@sigil-dev/compiler 0.10.1 → 0.10.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -4
- package/package.json +1 -1
- package/src/babel/index.ts +801 -801
- package/src/babel/jsx/anchor-mount.ts +2 -2
- package/src/babel/jsx/conditional-return.ts +71 -71
- package/src/babel/jsx/text-node.ts +193 -192
- package/src/babel/jsx/textarea.ts +58 -58
- package/src/bun-plugin.ts +119 -119
- package/test/bun-plugin.test.ts +60 -60
- package/test/conditional-return.test.ts +82 -82
- package/test/hydration.test.ts +380 -380
- package/test/render-parity.test.ts +46 -35
package/README.md
CHANGED
|
@@ -45,7 +45,8 @@ const t = document.createTextNode("");
|
|
|
45
45
|
createEffect(() => { t.data = String(count()); });
|
|
46
46
|
el.appendChild(t);
|
|
47
47
|
```
|
|
48
|
-
|
|
48
|
+
|
|
49
|
+
There's no virtual DOM involved, and none of the nonsense that comes with one. Output is either a string or DOM manipulation, so you won't fight the runtime over what changed and what didn't.
|
|
49
50
|
|
|
50
51
|
## Modes
|
|
51
52
|
|
|
@@ -97,7 +98,7 @@ $effect(() => {
|
|
|
97
98
|
|
|
98
99
|
## Keyed lists
|
|
99
100
|
|
|
100
|
-
`.map()` with a `key` prop compiles to a reconciled list that
|
|
101
|
+
`.map()` with a `key` prop compiles to a reconciled list that updates only the items that changed:
|
|
101
102
|
|
|
102
103
|
```tsx
|
|
103
104
|
const items = $state([{ id: 1, name: "Rei" }, { id: 2, name: "Asuka" }]);
|
|
@@ -109,7 +110,7 @@ const items = $state([{ id: 1, name: "Rei" }, { id: 2, name: "Asuka" }]);
|
|
|
109
110
|
</ul>
|
|
110
111
|
```
|
|
111
112
|
|
|
112
|
-
Compiled to `reconcile()
|
|
113
|
+
Compiled to `reconcile()`, which moves, inserts, and removes DOM nodes by key without recreating unchanged elements.
|
|
113
114
|
|
|
114
115
|
## Scoped CSS
|
|
115
116
|
|
|
@@ -134,7 +135,7 @@ export default {
|
|
|
134
135
|
};
|
|
135
136
|
```
|
|
136
137
|
|
|
137
|
-
### Bun (
|
|
138
|
+
### Bun (recommended)
|
|
138
139
|
|
|
139
140
|
```typescript
|
|
140
141
|
// build script
|
package/package.json
CHANGED