@sigil-dev/runtime 0.9.32 → 0.10.0

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.
Files changed (2) hide show
  1. package/index.ts +17 -0
  2. package/package.json +1 -1
package/index.ts CHANGED
@@ -1329,6 +1329,23 @@ export function hydrateKeyedList<T>(
1329
1329
  createNode: (item: T, index: number) => Node,
1330
1330
  parent?: Element,
1331
1331
  usesIndex = false,
1332
+ ): { anchor: Comment; keyMap: Map<unknown, Node> } {
1333
+ // The first pass reads the items (a $state array is a reactive proxy) and
1334
+ // builds rows; none of that may subscribe the enclosing effect, or a
1335
+ // branch around the list is rebuilt on every change. The reconcile effect
1336
+ // the compiler emits next to this call owns the dependency.
1337
+ return untrack(() =>
1338
+ hydrateKeyedListNow(nodesVar, signalItems, getKey, createNode, parent, usesIndex),
1339
+ );
1340
+ }
1341
+
1342
+ function hydrateKeyedListNow<T>(
1343
+ nodesVar: ChildNode[],
1344
+ signalItems: T[],
1345
+ getKey: (item: T, index: number) => unknown,
1346
+ createNode: (item: T, index: number) => Node,
1347
+ parent: Element | undefined,
1348
+ usesIndex: boolean,
1332
1349
  ): { anchor: Comment; keyMap: Map<unknown, Node> } {
1333
1350
  const keyMap = new Map<unknown, Node>();
1334
1351
  const isMarker = (n: ChildNode, data: string) =>
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@sigil-dev/runtime",
3
3
  "module": "index.ts",
4
4
  "type": "module",
5
- "version": "0.9.32",
5
+ "version": "0.10.0",
6
6
  "description": "Signals and fine-grained DOM updates for compiled Sigil components",
7
7
  "license": "MIT",
8
8
  "homepage": "https://sigil.cane1712.dev/docs/reference/runtime",