You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Supports default cases and complex conditional logic
36
-
37
-
### Changed
38
-
-**Attribute Binding Default**: Expressions in JSX attributes now bind as HTML attributes by default instead of properties
39
-
-`<input value={value} />` now compiles to `value=${value}` (attribute binding)
40
-
- Use `as.prop` to force property binding: `<input value={as.prop(value)} />`
41
-
- Use `as.bool` to force boolean attribute binding: `<button disabled={as.bool(flag)} />`
42
-
- Alternative syntax: `<input value={prop => value} />` or `<button disabled={bool => flag} />`
43
-
44
-
-**Enhanced Binding Control**: Improved binding control functions for more precise control
45
-
- Better TypeScript integration and error messages
46
-
- More consistent compilation output
47
-
48
-
-**Custom Element Integration**: Improved `toJSX()` function for better type safety
49
-
- Enhanced TypeScript intellisense and type checking
50
-
- Better integration with dynamic tag name features
51
-
52
-
### Enhanced
53
-
-**Dynamic Tag Names**: Enhanced support for conditional and polymorphic element types with **required `.tag` property pattern**
54
-
-**Error Handling**: Better error messages and validation during compilation
55
-
-**Type Safety**: Improved TypeScript definitions and JSX type support
56
-
-**New `toTag()` Utility**: Function to create dynamic tag objects with proper `.tag` property structure
57
-
58
-
### Critical Breaking Change: Dynamic Tag Names
59
-
60
-
**IMPORTANT**: Dynamic tag names now require the `.tag` property pattern for proper compilation to static templates.
61
-
62
-
```tsx
63
-
// ❌ OLD WAY - No longer works correctly
64
-
const Tag =condition?'div':'span';
65
-
return <Tag>Content</Tag>; // Won't compile to static templates
66
-
67
-
// ✅ NEW WAY - Required .tag property pattern
68
-
import { toTag } from'jsx-lit';
69
-
70
-
const Tag =toTag(condition?'div':'span');
71
-
return <Tag.tag>Content</Tag.tag>; // Compiles to efficient static templates
72
-
```
73
-
74
-
**Why This Change**: jsx-lit's compiler specifically looks for the `.tag` property pattern to detect and transform dynamic tags into efficient lit-html static templates. This pattern ensures optimal performance and proper compilation.
75
-
76
-
### Migration Guide for Dynamic Tags
77
-
78
-
If you were using dynamic tag names in previous versions, you need to update your code:
79
-
80
-
```tsx
81
-
// ❌ Before v1.1.0
82
-
const ElementType =condition?'div':'span';
83
-
return <ElementType>Content</ElementType>;
84
-
85
-
// ✅ After v1.1.0 - Required pattern for proper compilation
0 commit comments