@askrjs/askr 0.0.35 → 0.0.37
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 +17 -9
- package/dist/bench/components/benchmark-row.js.map +1 -1
- package/dist/bench/components/benchmark-table.js +1 -1
- package/dist/bench/components/benchmark-table.js.map +1 -1
- package/dist/benchmark.js +3 -3
- package/dist/benchmark.js.map +1 -1
- package/dist/bin/askr-ssg.js.map +1 -1
- package/dist/boot/index.d.ts +1 -7
- package/dist/boot/index.d.ts.map +1 -1
- package/dist/boot/index.js +31 -42
- package/dist/boot/index.js.map +1 -1
- package/dist/common/control.js.map +1 -1
- package/dist/common/env.js.map +1 -1
- package/dist/common/ssr-errors.js.map +1 -1
- package/dist/common/vnode.js.map +1 -1
- package/dist/components/error-boundary.js.map +1 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +2 -0
- package/dist/components/link.d.ts +4 -5
- package/dist/components/link.d.ts.map +1 -1
- package/dist/components/link.js +2 -1
- package/dist/components/link.js.map +1 -1
- package/dist/control/case.js.map +1 -1
- package/dist/control/for.js.map +1 -1
- package/dist/control/shared.js.map +1 -1
- package/dist/control/show.js.map +1 -1
- package/dist/data/index.d.ts.map +1 -1
- package/dist/data/index.js +165 -23
- package/dist/data/index.js.map +1 -1
- package/dist/dev/invariant.js.map +1 -1
- package/dist/dev/logger.js.map +1 -1
- package/dist/foundations/icon/icon.d.ts.map +1 -1
- package/dist/foundations/icon/icon.js.map +1 -1
- package/dist/foundations/icon/icon.types.d.ts +2 -1
- package/dist/foundations/icon/icon.types.d.ts.map +1 -1
- package/dist/foundations/icon/index.d.ts +3 -0
- package/dist/foundations/icon/index.js +2 -0
- package/dist/foundations/index.d.ts +1 -18
- package/dist/foundations/index.js +2 -18
- package/dist/foundations/interactions/dismissable.js.map +1 -1
- package/dist/foundations/interactions/focusable.js.map +1 -1
- package/dist/foundations/interactions/hoverable.js.map +1 -1
- package/dist/foundations/interactions/index.d.ts +7 -0
- package/dist/foundations/interactions/index.js +7 -0
- package/dist/foundations/interactions/interaction-policy.js +2 -2
- package/dist/foundations/interactions/interaction-policy.js.map +1 -1
- package/dist/foundations/interactions/pressable.js.map +1 -1
- package/dist/foundations/interactions/roving-focus.js.map +1 -1
- package/dist/foundations/state/controllable.js.map +1 -1
- package/dist/foundations/state/index.d.ts +2 -0
- package/dist/foundations/state/index.js +2 -0
- package/dist/foundations/structures/collection.js.map +1 -1
- package/dist/foundations/structures/index.d.ts +8 -0
- package/dist/foundations/structures/index.js +7 -0
- package/dist/foundations/structures/layer.js.map +1 -1
- package/dist/foundations/structures/layout.js.map +1 -1
- package/dist/foundations/structures/portal.js.map +1 -1
- package/dist/foundations/structures/presence.js.map +1 -1
- package/dist/foundations/structures/slot.js.map +1 -1
- package/dist/foundations/utilities/aria.js.map +1 -1
- package/dist/foundations/utilities/compose-handlers.js.map +1 -1
- package/dist/foundations/utilities/compose-ref.js.map +1 -1
- package/dist/foundations/utilities/index.d.ts +7 -0
- package/dist/foundations/utilities/index.js +6 -0
- package/dist/foundations/utilities/merge-props.js.map +1 -1
- package/dist/foundations/utilities/use-id.js.map +1 -1
- package/dist/fx/fx.js.map +1 -1
- package/dist/fx/timing.js.map +1 -1
- package/dist/index.d.ts +2 -16
- package/dist/index.js +1 -17
- package/dist/index.js.map +1 -1
- package/dist/jsx/utils.js.map +1 -1
- package/dist/jsx-dev-runtime.d.ts +1 -1
- package/dist/jsx-dev-runtime.js.map +1 -1
- package/dist/jsx-runtime.d.ts +1 -1
- package/dist/jsx-runtime.js.map +1 -1
- package/dist/renderer/children.js.map +1 -1
- package/dist/renderer/cleanup.js.map +1 -1
- package/dist/renderer/dom.js +92 -357
- package/dist/renderer/dom.js.map +1 -1
- package/dist/renderer/evaluate.js +7 -0
- package/dist/renderer/evaluate.js.map +1 -1
- package/dist/renderer/fastpath.js +20 -18
- package/dist/renderer/fastpath.js.map +1 -1
- package/dist/renderer/for-commit.js +486 -0
- package/dist/renderer/for-commit.js.map +1 -0
- package/dist/renderer/index.js.map +1 -1
- package/dist/renderer/keyed.js +84 -23
- package/dist/renderer/keyed.js.map +1 -1
- package/dist/renderer/reconcile.js +11 -18
- package/dist/renderer/reconcile.js.map +1 -1
- package/dist/renderer/utils.js +5 -1
- package/dist/renderer/utils.js.map +1 -1
- package/dist/resources/index.d.ts +1 -2
- package/dist/resources/index.js +1 -2
- package/dist/router/index.d.ts +2 -2
- package/dist/router/index.js +2 -2
- package/dist/router/match.js.map +1 -1
- package/dist/router/navigate.d.ts.map +1 -1
- package/dist/router/navigate.js +4 -2
- package/dist/router/navigate.js.map +1 -1
- package/dist/router/policy.js.map +1 -1
- package/dist/router/route-context.js.map +1 -1
- package/dist/router/route.d.ts +1 -1
- package/dist/router/route.d.ts.map +1 -1
- package/dist/router/route.js +2 -33
- package/dist/router/route.js.map +1 -1
- package/dist/runtime/child-scope.d.ts +1 -0
- package/dist/runtime/child-scope.d.ts.map +1 -1
- package/dist/runtime/child-scope.js +2 -0
- package/dist/runtime/child-scope.js.map +1 -1
- package/dist/runtime/component.js +1 -1
- package/dist/runtime/component.js.map +1 -1
- package/dist/runtime/context.js.map +1 -1
- package/dist/runtime/control.js.map +1 -1
- package/dist/runtime/derive.d.ts +2 -1
- package/dist/runtime/derive.d.ts.map +1 -1
- package/dist/runtime/derive.js +15 -10
- package/dist/runtime/derive.js.map +1 -1
- package/dist/runtime/dev-namespace.js.map +1 -1
- package/dist/runtime/effect.d.ts.map +1 -1
- package/dist/runtime/effect.js +34 -9
- package/dist/runtime/effect.js.map +1 -1
- package/dist/runtime/events.js.map +1 -1
- package/dist/runtime/execution-model.js.map +1 -1
- package/dist/runtime/fastlane.js.map +1 -1
- package/dist/runtime/for-bench.d.ts +1 -1
- package/dist/runtime/for-bench.d.ts.map +1 -1
- package/dist/runtime/for-bench.js +15 -14
- package/dist/runtime/for-bench.js.map +1 -1
- package/dist/runtime/for.d.ts +1 -0
- package/dist/runtime/for.d.ts.map +1 -1
- package/dist/runtime/for.js +90 -31
- package/dist/runtime/for.js.map +1 -1
- package/dist/runtime/operations.d.ts.map +1 -1
- package/dist/runtime/operations.js +10 -8
- package/dist/runtime/operations.js.map +1 -1
- package/dist/runtime/perf-metrics.js +8 -2
- package/dist/runtime/perf-metrics.js.map +1 -1
- package/dist/runtime/readable.js.map +1 -1
- package/dist/runtime/resource-cell.js +3 -2
- package/dist/runtime/resource-cell.js.map +1 -1
- package/dist/runtime/scheduler.d.ts +0 -1
- package/dist/runtime/scheduler.d.ts.map +1 -1
- package/dist/runtime/scheduler.js +6 -19
- package/dist/runtime/scheduler.js.map +1 -1
- package/dist/runtime/selector.d.ts.map +1 -1
- package/dist/runtime/selector.js +182 -103
- package/dist/runtime/selector.js.map +1 -1
- package/dist/runtime/snapshot-source.d.ts +10 -0
- package/dist/runtime/snapshot-source.d.ts.map +1 -0
- package/dist/runtime/snapshot-source.js +17 -0
- package/dist/runtime/snapshot-source.js.map +1 -0
- package/dist/runtime/ssr-bridge.js.map +1 -1
- package/dist/runtime/state.d.ts.map +1 -1
- package/dist/runtime/state.js +1 -5
- package/dist/runtime/state.js.map +1 -1
- package/dist/ssg/batch-render.js.map +1 -1
- package/dist/ssg/create-static-gen.js.map +1 -1
- package/dist/ssg/generate-metadata.js.map +1 -1
- package/dist/ssg/incremental-manifest.js.map +1 -1
- package/dist/ssg/index.d.ts +1 -6
- package/dist/ssg/index.js +1 -6
- package/dist/ssg/resolve-ssg-data.js.map +1 -1
- package/dist/ssg/route-utils.js.map +1 -1
- package/dist/ssg/write-static-files.js.map +1 -1
- package/dist/ssr/attrs.js.map +1 -1
- package/dist/ssr/context.d.ts +3 -1
- package/dist/ssr/context.d.ts.map +1 -1
- package/dist/ssr/context.js +31 -11
- package/dist/ssr/context.js.map +1 -1
- package/dist/ssr/escape.js +56 -16
- package/dist/ssr/escape.js.map +1 -1
- package/dist/ssr/index.d.ts +2 -31
- package/dist/ssr/index.d.ts.map +1 -1
- package/dist/ssr/index.js +19 -49
- package/dist/ssr/index.js.map +1 -1
- package/dist/ssr/render-keys.js +1 -12
- package/dist/ssr/render-keys.js.map +1 -1
- package/dist/ssr/sink.js.map +1 -1
- package/dist/ssr/verify-hydration.js +25 -0
- package/dist/ssr/verify-hydration.js.map +1 -0
- package/package.json +44 -19
- package/dist/_virtual/_rolldown/runtime.js +0 -7
- package/dist/foundations/core.d.ts +0 -15
- package/dist/foundations/core.js +0 -13
- package/dist/foundations/structures.d.ts +0 -7
- package/dist/foundations/structures.js +0 -6
- package/dist/ssg/batch-render.d.ts +0 -16
- package/dist/ssg/batch-render.d.ts.map +0 -1
- package/dist/ssg/generate-metadata.d.ts +0 -24
- package/dist/ssg/generate-metadata.d.ts.map +0 -1
- package/dist/ssg/resolve-ssg-data.d.ts +0 -23
- package/dist/ssg/resolve-ssg-data.d.ts.map +0 -1
- package/dist/ssg/route-utils.d.ts +0 -16
- package/dist/ssg/route-utils.d.ts.map +0 -1
- package/dist/ssg/write-static-files.d.ts +0 -15
- package/dist/ssg/write-static-files.d.ts.map +0 -1
- package/dist/ssr/render-keys.d.ts +0 -37
- package/dist/ssr/render-keys.d.ts.map +0 -1
- package/dist/ssr/stream-render.js +0 -76
- package/dist/ssr/stream-render.js.map +0 -1
package/dist/runtime/for.js
CHANGED
|
@@ -31,6 +31,7 @@ function createForState(eachSource, byFn, renderFn, fallback) {
|
|
|
31
31
|
fallbackScope: null,
|
|
32
32
|
items: /* @__PURE__ */ new Map(),
|
|
33
33
|
orderedKeys: [],
|
|
34
|
+
orderedItems: [],
|
|
34
35
|
orderedVNodes: [],
|
|
35
36
|
byFn,
|
|
36
37
|
renderFn,
|
|
@@ -105,9 +106,11 @@ function createForItemSignal(initialItem) {
|
|
|
105
106
|
itemSignal.set = (newValue, notifyReaders = true) => {
|
|
106
107
|
if (Object.is(itemValue, newValue)) return;
|
|
107
108
|
itemValue = newValue;
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
109
|
+
if (notifyReaders) {
|
|
110
|
+
markReadableDerivedSubscribersDirty(itemSignal);
|
|
111
|
+
markReactivePropsDirtySource(itemSignal);
|
|
112
|
+
notifyReadableReaders(itemSignal);
|
|
113
|
+
}
|
|
111
114
|
};
|
|
112
115
|
itemSignal._hasBeenRead = false;
|
|
113
116
|
return itemSignal;
|
|
@@ -125,9 +128,11 @@ function createForItemPropertySignal(initialValue) {
|
|
|
125
128
|
propertySignal.set = (newValue, notifyReaders = true) => {
|
|
126
129
|
if (Object.is(propertyValue, newValue)) return;
|
|
127
130
|
propertyValue = newValue;
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
+
if (notifyReaders) {
|
|
132
|
+
markReadableDerivedSubscribersDirty(propertySignal);
|
|
133
|
+
markReactivePropsDirtySource(propertySignal);
|
|
134
|
+
notifyReadableReaders(propertySignal);
|
|
135
|
+
}
|
|
131
136
|
};
|
|
132
137
|
propertySignal._hasBeenRead = false;
|
|
133
138
|
return propertySignal;
|
|
@@ -135,6 +140,16 @@ function createForItemPropertySignal(initialValue) {
|
|
|
135
140
|
function readForItemProperty(item, prop) {
|
|
136
141
|
return Reflect.get(Object(item), prop);
|
|
137
142
|
}
|
|
143
|
+
function haveSameOwnKeys(previousItem, nextItem) {
|
|
144
|
+
const previousKeys = Reflect.ownKeys(Object(previousItem));
|
|
145
|
+
const nextKeys = Reflect.ownKeys(Object(nextItem));
|
|
146
|
+
if (previousKeys.length !== nextKeys.length) return false;
|
|
147
|
+
for (let i = 0; i < previousKeys.length; i += 1) if (previousKeys[i] !== nextKeys[i]) return false;
|
|
148
|
+
return true;
|
|
149
|
+
}
|
|
150
|
+
function scopeReadsSource(scope, source) {
|
|
151
|
+
return source._readers?.has(scope.componentInstance) ?? false;
|
|
152
|
+
}
|
|
138
153
|
function getOrCreateForItemPropertySignal(item, propertySignals, prop) {
|
|
139
154
|
const existingSignal = propertySignals.get(prop);
|
|
140
155
|
if (existingSignal) return existingSignal;
|
|
@@ -232,6 +247,7 @@ function createItemInstance(key, item, index, forState) {
|
|
|
232
247
|
const itemSignal = canProxyForItem(item) ? createForItemSignal(item) : null;
|
|
233
248
|
const itemPropertySignals = itemSignal ? /* @__PURE__ */ new Map() : null;
|
|
234
249
|
const reactiveItem = itemSignal && itemPropertySignals ? createReactiveForItem(itemSignal, itemPropertySignals) : item;
|
|
250
|
+
let itemInstance = null;
|
|
235
251
|
const scope = createChildScope(forState.parentInstance, key, () => {
|
|
236
252
|
if (forState._enqueueBoundaryCommit) {
|
|
237
253
|
forState._enqueueBoundaryCommit();
|
|
@@ -241,7 +257,7 @@ function createItemInstance(key, item, index, forState) {
|
|
|
241
257
|
if (parent) parent._enqueueRun?.();
|
|
242
258
|
});
|
|
243
259
|
renderItemScope(forState, scope, reactiveItem, indexSignal, key);
|
|
244
|
-
|
|
260
|
+
itemInstance = {
|
|
245
261
|
key,
|
|
246
262
|
item,
|
|
247
263
|
reactiveItem,
|
|
@@ -250,6 +266,7 @@ function createItemInstance(key, item, index, forState) {
|
|
|
250
266
|
indexSignal,
|
|
251
267
|
scope
|
|
252
268
|
};
|
|
269
|
+
return itemInstance;
|
|
253
270
|
}
|
|
254
271
|
function rerenderItemInstance(forState, itemInstance, item) {
|
|
255
272
|
renderItemScope(forState, itemInstance.scope, item, itemInstance.indexSignal, itemInstance.key);
|
|
@@ -258,26 +275,30 @@ function updateItemInstance(forState, itemInstance, item) {
|
|
|
258
275
|
if (itemInstance.item === item) return false;
|
|
259
276
|
const previousItem = itemInstance.item;
|
|
260
277
|
itemInstance.item = item;
|
|
261
|
-
|
|
278
|
+
const scope = itemInstance.scope;
|
|
279
|
+
let scopeReadsChangedSignal = false;
|
|
262
280
|
const itemSignal = itemInstance.itemSignal;
|
|
263
281
|
if (!itemSignal) {
|
|
264
282
|
rerenderItemInstance(forState, itemInstance, item);
|
|
265
283
|
return true;
|
|
266
284
|
}
|
|
267
285
|
const propertySignals = itemInstance.itemPropertySignals;
|
|
286
|
+
const changedPropertySignals = [];
|
|
268
287
|
if (propertySignals && propertySignals.size > 0) for (const [prop, propertySignal] of propertySignals) {
|
|
269
288
|
const previousValue = readForItemProperty(previousItem, prop);
|
|
270
289
|
const nextValue = readForItemProperty(item, prop);
|
|
271
290
|
if (Object.is(previousValue, nextValue)) continue;
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
propertySignal.set(nextValue, !propertyHasRenderReaders);
|
|
291
|
+
if (scopeReadsSource(scope, propertySignal)) scopeReadsChangedSignal = true;
|
|
292
|
+
changedPropertySignals.push([propertySignal, nextValue]);
|
|
275
293
|
}
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
294
|
+
if (scopeReadsSource(scope, itemSignal)) scopeReadsChangedSignal = true;
|
|
295
|
+
const itemShapeChanged = changedPropertySignals.length === 0 && !haveSameOwnKeys(previousItem, item);
|
|
296
|
+
const notifyReaders = !scopeReadsChangedSignal && (changedPropertySignals.length > 0 || itemShapeChanged);
|
|
297
|
+
const visibleChange = scopeReadsChangedSignal || changedPropertySignals.length > 0 || itemShapeChanged;
|
|
298
|
+
for (const [propertySignal, nextValue] of changedPropertySignals) propertySignal.set(nextValue, notifyReaders);
|
|
299
|
+
itemSignal.set(item, notifyReaders);
|
|
300
|
+
if (scopeReadsChangedSignal) rerenderItemInstance(forState, itemInstance, itemInstance.reactiveItem);
|
|
301
|
+
return visibleChange;
|
|
281
302
|
}
|
|
282
303
|
const FOR_FALLBACK_SCOPE_KEY = "__for-fallback__";
|
|
283
304
|
function disposeFallbackScope(forState, domCleanup) {
|
|
@@ -296,6 +317,7 @@ function renderFallbackScope(forState) {
|
|
|
296
317
|
if (forState.fallback == null || forState.fallback === false) {
|
|
297
318
|
if (forState.fallbackScope) disposeFallbackScope(forState, "none");
|
|
298
319
|
forState.orderedVNodes = [];
|
|
320
|
+
forState.orderedItems = [];
|
|
299
321
|
return [];
|
|
300
322
|
}
|
|
301
323
|
const fallbackScope = forState.fallbackScope ?? createChildScope(forState.parentInstance, FOR_FALLBACK_SCOPE_KEY, () => {
|
|
@@ -308,6 +330,7 @@ function renderFallbackScope(forState) {
|
|
|
308
330
|
forState.fallbackScope = fallbackScope;
|
|
309
331
|
const vnode = fallbackScope.render(() => forState.fallback);
|
|
310
332
|
forState.orderedVNodes = vnode == null || vnode === false ? [] : [vnode];
|
|
333
|
+
forState.orderedItems = [];
|
|
311
334
|
return forState.orderedVNodes;
|
|
312
335
|
}
|
|
313
336
|
function disposeAllItems(forState, domCleanup) {
|
|
@@ -355,20 +378,24 @@ function reconcileForItems(forState, newArray) {
|
|
|
355
378
|
recordBenchFastLane("APPEND");
|
|
356
379
|
forState.lastCommitStrategy = "APPEND";
|
|
357
380
|
const resultVNodes = forState.orderedVNodes;
|
|
381
|
+
const resultItems = forState.orderedItems;
|
|
358
382
|
resultVNodes.length = newLen;
|
|
383
|
+
resultItems.length = newLen;
|
|
359
384
|
for (let i = 0; i < oldLen; i++) {
|
|
360
385
|
const item = newArray[i];
|
|
361
386
|
const key = orderedKeys[i];
|
|
362
|
-
const existing = items.get(key);
|
|
363
|
-
recordBenchEvent("itemReused");
|
|
387
|
+
const existing = resultItems[i] ?? items.get(key);
|
|
364
388
|
updateItemInstance(forState, existing, item);
|
|
389
|
+
resultItems[i] = existing;
|
|
365
390
|
resultVNodes[i] = existing.scope.vnode;
|
|
366
391
|
}
|
|
392
|
+
recordBenchEvent("itemReused", oldLen);
|
|
367
393
|
for (let i = oldLen; i < newLen; i++) {
|
|
368
394
|
const item = newArray[i];
|
|
369
395
|
const key = byFn(item, i);
|
|
370
396
|
const itemInstance = createItemInstance(key, item, i, forState);
|
|
371
397
|
items.set(key, itemInstance);
|
|
398
|
+
resultItems[i] = itemInstance;
|
|
372
399
|
resultVNodes[i] = itemInstance.scope.vnode;
|
|
373
400
|
orderedKeys[i] = key;
|
|
374
401
|
}
|
|
@@ -399,22 +426,27 @@ function reconcileForItems(forState, newArray) {
|
|
|
399
426
|
if (canUseRemoveOnePath) {
|
|
400
427
|
recordBenchFastLane("REMOVE_ONE");
|
|
401
428
|
forState.lastCommitStrategy = "NO_REORDER";
|
|
429
|
+
const previousOrderedItems = forState.orderedItems.slice();
|
|
402
430
|
const resultVNodes = forState.orderedVNodes;
|
|
431
|
+
const resultItems = forState.orderedItems;
|
|
403
432
|
resultVNodes.length = newLen;
|
|
433
|
+
resultItems.length = newLen;
|
|
404
434
|
const dirtyIndices = [];
|
|
405
435
|
for (let i = 0; i < newLen; i++) {
|
|
406
436
|
const item = newArray[i];
|
|
407
437
|
const key = i < removedIndex ? orderedKeys[i] : orderedKeys[i + 1];
|
|
408
438
|
const existing = items.get(key);
|
|
409
|
-
|
|
439
|
+
const scopeNeedsDomUpdate = existing.scope.needsDomUpdate;
|
|
410
440
|
const itemChanged = existing.item !== item;
|
|
411
|
-
const
|
|
412
|
-
const indexChanged =
|
|
441
|
+
const indexSignal = existing.indexSignal;
|
|
442
|
+
const indexChanged = indexSignal._hasBeenRead && indexSignal.peek() !== i;
|
|
413
443
|
if (itemChanged) updateItemInstance(forState, existing, item);
|
|
414
|
-
if (indexChanged
|
|
415
|
-
if (itemChanged || indexChanged ||
|
|
444
|
+
if (indexChanged) indexSignal.set(i);
|
|
445
|
+
if (itemChanged || indexChanged || scopeNeedsDomUpdate) dirtyIndices.push(i);
|
|
446
|
+
resultItems[i] = existing;
|
|
416
447
|
resultVNodes[i] = existing.scope.vnode;
|
|
417
448
|
}
|
|
449
|
+
recordBenchEvent("itemReused", newLen);
|
|
418
450
|
const removedKey = orderedKeys[removedIndex];
|
|
419
451
|
const removedItem = items.get(removedKey);
|
|
420
452
|
if (removedItem) {
|
|
@@ -422,8 +454,13 @@ function reconcileForItems(forState, newArray) {
|
|
|
422
454
|
items.delete(removedKey);
|
|
423
455
|
}
|
|
424
456
|
const nextOrderedKeys = orderedKeys.slice(0, newLen);
|
|
425
|
-
|
|
457
|
+
const nextOrderedItems = previousOrderedItems.slice(0, newLen);
|
|
458
|
+
for (let i = removedIndex; i < newLen; i++) {
|
|
459
|
+
nextOrderedKeys[i] = orderedKeys[i + 1];
|
|
460
|
+
nextOrderedItems[i] = previousOrderedItems[i + 1];
|
|
461
|
+
}
|
|
426
462
|
forState.orderedKeys = nextOrderedKeys;
|
|
463
|
+
forState.orderedItems = nextOrderedItems;
|
|
427
464
|
if (BENCH_BUILD_ENABLED) {
|
|
428
465
|
recordBenchTiming("reconcile", performance.now() - reconcileStartMs);
|
|
429
466
|
flushBenchMetrics();
|
|
@@ -444,16 +481,19 @@ function reconcileForItems(forState, newArray) {
|
|
|
444
481
|
recordBenchFastLane("TRUNCATE");
|
|
445
482
|
forState.lastCommitStrategy = "TRUNCATE";
|
|
446
483
|
const resultVNodes = forState.orderedVNodes;
|
|
484
|
+
const resultItems = forState.orderedItems;
|
|
447
485
|
resultVNodes.length = newLen;
|
|
486
|
+
resultItems.length = newLen;
|
|
448
487
|
const isFullClear = newLen === 0;
|
|
449
488
|
for (let i = 0; i < newLen; i++) {
|
|
450
489
|
const item = newArray[i];
|
|
451
490
|
const key = orderedKeys[i];
|
|
452
491
|
const existing = items.get(key);
|
|
453
|
-
recordBenchEvent("itemReused");
|
|
454
492
|
updateItemInstance(forState, existing, item);
|
|
493
|
+
resultItems[i] = existing;
|
|
455
494
|
resultVNodes[i] = existing.scope.vnode;
|
|
456
495
|
}
|
|
496
|
+
recordBenchEvent("itemReused", newLen);
|
|
457
497
|
for (let i = newLen; i < oldLen; i++) {
|
|
458
498
|
const key = orderedKeys[i];
|
|
459
499
|
const itemInstance = items.get(key);
|
|
@@ -464,6 +504,7 @@ function reconcileForItems(forState, newArray) {
|
|
|
464
504
|
}
|
|
465
505
|
orderedKeys.length = newLen;
|
|
466
506
|
forState.orderedKeys = orderedKeys;
|
|
507
|
+
forState.orderedItems.length = newLen;
|
|
467
508
|
if (BENCH_BUILD_ENABLED) {
|
|
468
509
|
recordBenchTiming("reconcile", performance.now() - reconcileStartMs);
|
|
469
510
|
flushBenchMetrics();
|
|
@@ -485,20 +526,21 @@ function reconcileForItems(forState, newArray) {
|
|
|
485
526
|
recordBenchFastLane("NO_REORDER");
|
|
486
527
|
forState.lastCommitStrategy = "NO_REORDER";
|
|
487
528
|
const resultVNodes = forState.orderedVNodes;
|
|
529
|
+
const resultItems = forState.orderedItems;
|
|
488
530
|
resultVNodes.length = oldLen;
|
|
531
|
+
resultItems.length = oldLen;
|
|
489
532
|
const dirtyIndices = [];
|
|
490
533
|
for (let i = 0; i < oldLen; i++) {
|
|
491
534
|
const item = newArray[i];
|
|
492
535
|
const key = orderedKeys[i];
|
|
493
536
|
const existing = items.get(key);
|
|
494
|
-
recordBenchEvent("itemReused");
|
|
495
537
|
const itemChanged = existing.item !== item;
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
if (rerendered || needsDomUpdate || existing.scope.needsDomUpdate) dirtyIndices.push(i);
|
|
538
|
+
if (itemChanged) updateItemInstance(forState, existing, item);
|
|
539
|
+
if (!itemChanged && existing.scope.needsDomUpdate) dirtyIndices.push(i);
|
|
540
|
+
resultItems[i] = existing;
|
|
500
541
|
resultVNodes[i] = existing.scope.vnode;
|
|
501
542
|
}
|
|
543
|
+
recordBenchEvent("itemReused", oldLen);
|
|
502
544
|
if (BENCH_BUILD_ENABLED) {
|
|
503
545
|
recordBenchTiming("reconcile", performance.now() - reconcileStartMs);
|
|
504
546
|
flushBenchMetrics();
|
|
@@ -552,6 +594,9 @@ function reconcileForItems(forState, newArray) {
|
|
|
552
594
|
const secondExisting = items.get(secondMismatchKey);
|
|
553
595
|
const firstItem = newArray[firstMismatch];
|
|
554
596
|
const secondItem = newArray[secondMismatch];
|
|
597
|
+
const nextOrderedItems = forState.orderedItems.slice();
|
|
598
|
+
nextOrderedItems[firstMismatch] = secondExisting;
|
|
599
|
+
nextOrderedItems[secondMismatch] = firstExisting;
|
|
555
600
|
recordBenchEvent("itemReused");
|
|
556
601
|
recordBenchEvent("itemReused");
|
|
557
602
|
if (firstExisting.item !== firstItem) updateItemInstance(forState, firstExisting, firstItem);
|
|
@@ -561,6 +606,7 @@ function reconcileForItems(forState, newArray) {
|
|
|
561
606
|
resultVNodes[firstMismatch] = firstExisting.scope.vnode;
|
|
562
607
|
resultVNodes[secondMismatch] = secondExisting.scope.vnode;
|
|
563
608
|
forState.orderedKeys = nextOrderedKeys;
|
|
609
|
+
forState.orderedItems = nextOrderedItems;
|
|
564
610
|
if (BENCH_BUILD_ENABLED) {
|
|
565
611
|
recordBenchTiming("reconcile", performance.now() - reconcileStartMs);
|
|
566
612
|
flushBenchMetrics();
|
|
@@ -572,6 +618,7 @@ function reconcileForItems(forState, newArray) {
|
|
|
572
618
|
}
|
|
573
619
|
let canUseMoveOnlyPath = true;
|
|
574
620
|
const moveOnlyKeys = [];
|
|
621
|
+
const moveOnlyItems = [];
|
|
575
622
|
const moveOnlyVNodes = [];
|
|
576
623
|
for (let i = 0; i < oldLen; i++) {
|
|
577
624
|
const item = newArray[i];
|
|
@@ -582,6 +629,7 @@ function reconcileForItems(forState, newArray) {
|
|
|
582
629
|
break;
|
|
583
630
|
}
|
|
584
631
|
moveOnlyKeys[i] = key;
|
|
632
|
+
moveOnlyItems[i] = existing;
|
|
585
633
|
moveOnlyVNodes[i] = existing.scope.vnode;
|
|
586
634
|
recordBenchEvent("itemReused");
|
|
587
635
|
}
|
|
@@ -589,6 +637,7 @@ function reconcileForItems(forState, newArray) {
|
|
|
589
637
|
recordBenchFastLane("FULL_KEYED");
|
|
590
638
|
forState.lastCommitStrategy = "FULL_KEYED";
|
|
591
639
|
forState.orderedKeys = moveOnlyKeys;
|
|
640
|
+
forState.orderedItems = moveOnlyItems;
|
|
592
641
|
forState.orderedVNodes = moveOnlyVNodes;
|
|
593
642
|
if (BENCH_BUILD_ENABLED) {
|
|
594
643
|
recordBenchTiming("reconcile", performance.now() - reconcileStartMs);
|
|
@@ -604,6 +653,7 @@ function reconcileForItems(forState, newArray) {
|
|
|
604
653
|
forState.lastCommitStrategy = "FULL_KEYED";
|
|
605
654
|
const toRemove = new Set(orderedKeys);
|
|
606
655
|
const newOrderedKeys = [];
|
|
656
|
+
const newOrderedItems = [];
|
|
607
657
|
const resultVNodes = [];
|
|
608
658
|
let moveOnly = toRemove.size === newArray.length;
|
|
609
659
|
for (let i = 0; i < newArray.length; i++) {
|
|
@@ -617,6 +667,7 @@ function reconcileForItems(forState, newArray) {
|
|
|
617
667
|
if (!existing) {
|
|
618
668
|
const itemInstance = createItemInstance(key, item, i, forState);
|
|
619
669
|
items.set(key, itemInstance);
|
|
670
|
+
newOrderedItems.push(itemInstance);
|
|
620
671
|
resultVNodes.push(itemInstance.scope.vnode);
|
|
621
672
|
} else {
|
|
622
673
|
recordBenchEvent("itemReused");
|
|
@@ -627,6 +678,7 @@ function reconcileForItems(forState, newArray) {
|
|
|
627
678
|
updateItemInstance(forState, existing, item);
|
|
628
679
|
}
|
|
629
680
|
if (indexChanged) existing.indexSignal.set(i);
|
|
681
|
+
newOrderedItems.push(existing);
|
|
630
682
|
resultVNodes.push(existing.scope.vnode);
|
|
631
683
|
}
|
|
632
684
|
}
|
|
@@ -639,6 +691,7 @@ function reconcileForItems(forState, newArray) {
|
|
|
639
691
|
}
|
|
640
692
|
}
|
|
641
693
|
forState.orderedKeys = newOrderedKeys;
|
|
694
|
+
forState.orderedItems = newOrderedItems;
|
|
642
695
|
if (BENCH_BUILD_ENABLED) {
|
|
643
696
|
recordBenchTiming("reconcile", performance.now() - reconcileStartMs);
|
|
644
697
|
flushBenchMetrics();
|
|
@@ -655,7 +708,12 @@ function evaluateForState(forState) {
|
|
|
655
708
|
return reconcileForItems(forState, forState.currentItems);
|
|
656
709
|
}
|
|
657
710
|
function clearForDomUpdateState(forState) {
|
|
658
|
-
|
|
711
|
+
const dirtyIndices = forState.pendingDirtyIndices;
|
|
712
|
+
if (dirtyIndices && dirtyIndices.length > 0) for (let i = 0; i < dirtyIndices.length; i++) {
|
|
713
|
+
const itemInstance = forState.orderedItems[dirtyIndices[i]];
|
|
714
|
+
if (itemInstance) itemInstance.scope.needsDomUpdate = false;
|
|
715
|
+
}
|
|
716
|
+
else for (let i = 0; i < forState.orderedKeys.length; i++) {
|
|
659
717
|
const key = forState.orderedKeys[i];
|
|
660
718
|
const itemInstance = forState.items.get(key);
|
|
661
719
|
if (itemInstance) itemInstance.scope.needsDomUpdate = false;
|
|
@@ -666,6 +724,7 @@ function clearForDomUpdateState(forState) {
|
|
|
666
724
|
forState.pendingSwapIndices = null;
|
|
667
725
|
forState.pendingMoveOnly = false;
|
|
668
726
|
forState._needsSourceReconcile = false;
|
|
727
|
+
forState._hasResolvedItemDom = forState.orderedKeys.length > 0;
|
|
669
728
|
}
|
|
670
729
|
//#endregion
|
|
671
730
|
export { clearForDomUpdateState, evaluateForState, useForState };
|
package/dist/runtime/for.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"for.js","names":[],"sources":["../../src/runtime/for.ts"],"sourcesContent":["/**\n * For primitive runtime\n *\n * Manages per-item component instances and array reconciliation\n * to eliminate over-invalidation in list rendering.\n */\n\nimport { type ComponentInstance, getCurrentInstance } from './component';\nimport { claimHookIndex } from './component';\nimport { type DOMElement, type VNode } from '../common/vnode';\nimport { isDevelopmentEnvironment } from '../common/env';\nimport { teardownNodeSubtree } from '../renderer/cleanup';\nimport {\n createChildScope,\n disposeChildScope,\n type ChildScope,\n} from './child-scope';\nimport type { ForProps } from '../control/for';\nimport type { ForEachSource } from '../control/for';\nimport {\n markReactivePropsDirtySource,\n markReadableDerivedSubscribersDirty,\n notifyReadableReaders,\n recordReadableRead,\n type ReadableSource,\n} from './readable';\nimport type { FineGrainedEffectHandle } from './effect';\nimport {\n flushBenchMetrics,\n getBenchMetrics,\n isBenchBuildEnabled,\n isBenchMetricScopeActive,\n recordBenchEvent,\n recordBenchCounter,\n recordBenchFastLane,\n recordBenchTiming,\n resetBenchMetrics,\n withBenchMetricScope,\n} from './for-bench';\n\nconst BENCH_BUILD_ENABLED = isBenchBuildEnabled();\n\nexport {\n getBenchMetrics,\n isBenchMetricScopeActive,\n recordBenchEvent,\n recordBenchCounter,\n recordBenchTiming,\n resetBenchMetrics,\n withBenchMetricScope,\n};\n\nexport interface ForItemInstance<T> {\n key: string | number;\n item: T;\n reactiveItem: T;\n itemSignal: ForItemSignal<T> | null;\n itemPropertySignals: Map<PropertyKey, ForItemPropertySignal> | null;\n indexSignal: ForIndexSignal;\n scope: ChildScope;\n}\n\ntype ForItemSignal<T> = ReadableSource<T> &\n (() => T) & {\n peek(): T;\n set(newValue: T, notifyReaders?: boolean): void;\n };\n\ntype ForItemPropertySignal = ReadableSource<unknown> &\n (() => unknown) & {\n peek(): unknown;\n set(newValue: unknown, notifyReaders?: boolean): void;\n };\n\ntype ForIndexSignal = ReadableSource<number> &\n (() => number) & {\n peek(): number;\n set(newValue: number | ((prev: number) => number)): void;\n };\n\nexport type ForCommitStrategy =\n | 'APPEND'\n | 'TRUNCATE'\n | 'NO_REORDER'\n | 'SWAP'\n | 'FULL_KEYED';\n\nexport interface ForState<T> {\n kind: 'for';\n currentItems: T[];\n eachSource: ForEachSource<T>;\n fallback: VNode | null;\n fallbackScope: ChildScope | null;\n items: Map<string | number, ForItemInstance<T>>;\n orderedKeys: Array<string | number>;\n orderedVNodes: VNode[];\n byFn: NonNullable<ForProps<T>['by']> | ((item: T, index: number) => number);\n renderFn: (item: T, index: () => number) => VNode;\n parentInstance: ComponentInstance | null;\n lastCommitStrategy: ForCommitStrategy;\n lastRemovedNodes: Node[];\n pendingDirtyIndices: number[] | null;\n pendingSwapIndices: [number, number] | null;\n pendingMoveOnly: boolean;\n _hasResolvedItemDom: boolean;\n _needsSourceReconcile: boolean;\n _sourceEffect: FineGrainedEffectHandle<T[]> | null;\n _suspendSourceCommit: boolean;\n _enqueueBoundaryCommit?: (() => void) | null;\n _hasPendingBoundaryCommit?: boolean;\n devKeyKinds?: Map<string, 'number' | 'string'>;\n}\n\nconst forStates = new WeakMap<\n ComponentInstance,\n Map<number, ForState<unknown>>\n>();\n\nfunction getForStore(\n instance: ComponentInstance\n): Map<number, ForState<unknown>> {\n let store = forStates.get(instance);\n if (!store) {\n store = new Map();\n forStates.set(instance, store);\n }\n return store;\n}\n\nexport function createForState<T>(\n eachSource: ForEachSource<T>,\n byFn: ForState<T>['byFn'],\n renderFn: (item: T, index: () => number) => VNode,\n fallback: VNode | null\n): ForState<T> {\n const parentInstance = getCurrentInstance();\n\n return {\n kind: 'for',\n currentItems: [],\n eachSource,\n fallback,\n fallbackScope: null,\n items: new Map(),\n orderedKeys: [],\n orderedVNodes: [],\n byFn,\n renderFn,\n parentInstance,\n lastCommitStrategy: 'NO_REORDER',\n lastRemovedNodes: [],\n pendingDirtyIndices: null,\n pendingSwapIndices: null,\n pendingMoveOnly: false,\n _hasResolvedItemDom: false,\n _needsSourceReconcile: false,\n _sourceEffect: null,\n _suspendSourceCommit: false,\n _enqueueBoundaryCommit: null,\n _hasPendingBoundaryCommit: false,\n };\n}\n\nexport function useForState<T>(\n eachSource: ForEachSource<T>,\n byFn: ForState<T>['byFn'],\n renderFn: (item: T, index: () => number) => VNode,\n fallback: VNode | null\n): ForState<T> {\n const instance = getCurrentInstance();\n if (!instance) {\n throw new Error(\n 'For can only be created during component render execution.'\n );\n }\n\n const hookIndex = claimHookIndex(instance, 'For');\n const store = getForStore(instance);\n const existing = store.get(hookIndex) as ForState<T> | undefined;\n\n if (existing) {\n existing.eachSource = eachSource;\n existing.byFn = byFn;\n existing.renderFn = renderFn;\n existing.fallback = fallback;\n return existing;\n }\n\n const created = createForState(eachSource, byFn, renderFn, fallback);\n store.set(hookIndex, created as ForState<unknown>);\n\n (instance.cleanupFns ??= []).push(() => {\n created._sourceEffect?.cleanup();\n created._sourceEffect = null;\n store.delete(hookIndex);\n });\n\n return created;\n}\n\nfunction createForIndexSignal(initialIndex: number): ForIndexSignal {\n let indexValue = initialIndex;\n const readers = new Map<ComponentInstance, number>();\n\n const indexSignal = (() => {\n indexSignal._hasBeenRead = true;\n recordReadableRead(indexSignal);\n return indexValue;\n }) as ForIndexSignal;\n indexSignal._readers = readers;\n indexSignal.peek = () => indexValue;\n indexSignal.set = (newValue: number | ((prev: number) => number)) => {\n const nextValue =\n typeof newValue === 'function' ? newValue(indexValue) : newValue;\n if (nextValue !== indexValue) {\n indexValue = nextValue;\n markReadableDerivedSubscribersDirty(indexSignal);\n markReactivePropsDirtySource(indexSignal);\n notifyReadableReaders(indexSignal);\n }\n };\n indexSignal._hasBeenRead = false;\n\n return indexSignal;\n}\n\nfunction createForItemSignal<T>(initialItem: T): ForItemSignal<T> {\n let itemValue = initialItem;\n const readers = new Map<ComponentInstance, number>();\n\n const itemSignal = (() => {\n itemSignal._hasBeenRead = true;\n recordReadableRead(itemSignal);\n return itemValue;\n }) as ForItemSignal<T>;\n\n itemSignal._readers = readers;\n itemSignal.peek = () => itemValue;\n itemSignal.set = (newValue: T, notifyReaders = true) => {\n if (Object.is(itemValue, newValue)) {\n return;\n }\n\n itemValue = newValue;\n markReadableDerivedSubscribersDirty(itemSignal);\n markReactivePropsDirtySource(itemSignal);\n\n if (notifyReaders) {\n notifyReadableReaders(itemSignal);\n }\n };\n itemSignal._hasBeenRead = false;\n\n return itemSignal;\n}\n\nfunction createForItemPropertySignal(\n initialValue: unknown\n): ForItemPropertySignal {\n let propertyValue = initialValue;\n const readers = new Map<ComponentInstance, number>();\n\n const propertySignal = (() => {\n propertySignal._hasBeenRead = true;\n recordReadableRead(propertySignal);\n return propertyValue;\n }) as ForItemPropertySignal;\n\n propertySignal._readers = readers;\n propertySignal.peek = () => propertyValue;\n propertySignal.set = (newValue: unknown, notifyReaders = true) => {\n if (Object.is(propertyValue, newValue)) {\n return;\n }\n\n propertyValue = newValue;\n markReadableDerivedSubscribersDirty(propertySignal);\n markReactivePropsDirtySource(propertySignal);\n\n if (notifyReaders) {\n notifyReadableReaders(propertySignal);\n }\n };\n propertySignal._hasBeenRead = false;\n\n return propertySignal;\n}\n\nfunction readForItemProperty(item: unknown, prop: PropertyKey): unknown {\n return Reflect.get(Object(item), prop);\n}\n\nfunction getOrCreateForItemPropertySignal<T>(\n item: T,\n propertySignals: Map<PropertyKey, ForItemPropertySignal>,\n prop: PropertyKey\n): ForItemPropertySignal {\n const existingSignal = propertySignals.get(prop);\n if (existingSignal) {\n return existingSignal;\n }\n\n const propertySignal = createForItemPropertySignal(\n readForItemProperty(item, prop)\n );\n propertySignals.set(prop, propertySignal);\n return propertySignal;\n}\n\nfunction canProxyForItem(item: unknown): item is object {\n return (\n (typeof item === 'object' && item !== null) || typeof item === 'function'\n );\n}\n\nfunction createReactiveForItem<T>(\n itemSignal: ForItemSignal<T>,\n propertySignals: Map<PropertyKey, ForItemPropertySignal>\n): T {\n const target = Object.create(null) as Record<string | symbol, unknown>;\n\n return new Proxy(target, {\n get(target, prop, receiver) {\n const ownDescriptor = Reflect.getOwnPropertyDescriptor(target, prop);\n if (ownDescriptor) {\n return Reflect.get(target, prop, receiver);\n }\n\n const currentItem = itemSignal.peek();\n\n if (typeof prop !== 'symbol') {\n return getOrCreateForItemPropertySignal(\n currentItem,\n propertySignals,\n prop\n )();\n }\n\n recordReadableRead(itemSignal);\n return Reflect.get(Object(currentItem), prop, receiver);\n },\n has(target, prop) {\n recordReadableRead(itemSignal);\n return prop in target || prop in Object(itemSignal.peek());\n },\n ownKeys(target) {\n recordReadableRead(itemSignal);\n const keys = new Set<string | symbol>(Reflect.ownKeys(target));\n for (const key of Reflect.ownKeys(Object(itemSignal.peek()))) {\n keys.add(key);\n }\n\n return Array.from(keys);\n },\n getOwnPropertyDescriptor(target, prop) {\n recordReadableRead(itemSignal);\n const ownDescriptor = Reflect.getOwnPropertyDescriptor(target, prop);\n if (ownDescriptor) {\n return ownDescriptor;\n }\n\n return Object.getOwnPropertyDescriptor(Object(itemSignal.peek()), prop);\n },\n getPrototypeOf() {\n recordReadableRead(itemSignal);\n return Object.getPrototypeOf(Object(itemSignal.peek()));\n },\n }) as T;\n}\n\nfunction materializeItemVnode(\n key: string | number,\n vnode: VNode | undefined\n): void {\n if (vnode && typeof vnode === 'object' && 'type' in vnode) {\n const vn = vnode as DOMElement;\n vn.key = key;\n\n if (typeof vn.type === 'string') {\n if (!vn.props) vn.props = {};\n if (vn.props['data-key'] === undefined) {\n vn.props['data-key'] = String(key);\n }\n }\n }\n}\n\nfunction renderItemScope<T>(\n forState: ForState<T>,\n scope: ChildScope,\n item: T,\n indexSignal: ForIndexSignal,\n key: string | number\n): VNode {\n recordBenchEvent('rowFactory');\n const vnode = scope.render(() => forState.renderFn(item, indexSignal));\n materializeItemVnode(key, vnode);\n return vnode;\n}\n\nfunction failForValidation(message: string): never {\n throw new Error(message);\n}\n\nfunction validateForKeys<T>(forState: ForState<T>, newArray: T[]): void {\n if (!isDevelopmentEnvironment()) {\n return;\n }\n\n const seen = new Set<string | number>();\n const keyKinds = new Map<string, 'number' | 'string'>();\n for (let i = 0; i < newArray.length; i++) {\n const key = forState.byFn(newArray[i], i);\n\n if (key === null || key === undefined) {\n failForValidation(\n '[askr] Invalid For key detected. Keys should be stable, non-null, and unique within a For list.'\n );\n }\n\n if (seen.has(key)) {\n failForValidation(\n `[askr] Duplicate For key detected: ${String(key)}. Keys should be stable, non-null, and unique within a For list.`\n );\n }\n\n seen.add(key);\n\n const keyString = String(key);\n const keyKind = typeof key;\n const previousKeyKind = forState.devKeyKinds?.get(keyString);\n if (previousKeyKind && previousKeyKind !== keyKind) {\n failForValidation(\n `[askr] For key type changed for ${keyString}. Keys must remain consistently typed across renders.`\n );\n }\n keyKinds.set(keyString, keyKind as 'number' | 'string');\n }\n\n forState.devKeyKinds = keyKinds;\n}\n\ntype RemovedDomCleanupMode = 'none' | 'teardown' | 'full-clear';\n\nfunction disposeItemInstance<T>(\n forState: ForState<T>,\n itemInstance: ForItemInstance<T>,\n domCleanup: RemovedDomCleanupMode\n): void {\n recordBenchEvent('itemRemoved');\n const removedDom = itemInstance.scope.dom;\n\n try {\n disposeChildScope(itemInstance.scope);\n } catch (err) {\n if (isDevelopmentEnvironment()) {\n console.error('[For] Cleanup error:', err);\n }\n }\n\n if (!removedDom) {\n return;\n }\n\n if (removedDom instanceof Element) {\n if (domCleanup === 'teardown') {\n teardownNodeSubtree(removedDom);\n }\n }\n\n forState.lastRemovedNodes.push(removedDom);\n}\n\nexport function createItemInstance<T>(\n key: string | number,\n item: T,\n index: number,\n forState: ForState<T>\n): ForItemInstance<T> {\n recordBenchEvent('itemCreated');\n\n // Create index signal manually without going through state() hook\n // to avoid hook order violations (each For item creates its signal dynamically)\n const indexSignal = createForIndexSignal(index);\n const itemSignal = canProxyForItem(item) ? createForItemSignal(item) : null;\n const itemPropertySignals = itemSignal\n ? new Map<PropertyKey, ForItemPropertySignal>()\n : null;\n const reactiveItem =\n itemSignal && itemPropertySignals\n ? createReactiveForItem(itemSignal, itemPropertySignals)\n : item;\n const scope = createChildScope(forState.parentInstance, key, () => {\n if (forState._enqueueBoundaryCommit) {\n forState._enqueueBoundaryCommit();\n return;\n }\n\n const parent = forState.parentInstance;\n if (parent) {\n parent._enqueueRun?.();\n }\n });\n\n renderItemScope(forState, scope, reactiveItem, indexSignal, key);\n\n const itemInstance: ForItemInstance<T> = {\n key,\n item,\n reactiveItem,\n itemSignal,\n itemPropertySignals,\n indexSignal,\n scope,\n };\n\n return itemInstance;\n}\n\nfunction rerenderItemInstance<T>(\n forState: ForState<T>,\n itemInstance: ForItemInstance<T>,\n item: T\n): void {\n renderItemScope(\n forState,\n itemInstance.scope,\n item,\n itemInstance.indexSignal,\n itemInstance.key\n );\n}\n\nfunction updateItemInstance<T>(\n forState: ForState<T>,\n itemInstance: ForItemInstance<T>,\n item: T\n): boolean {\n if (itemInstance.item === item) {\n return false;\n }\n\n const previousItem = itemInstance.item;\n itemInstance.item = item;\n\n let needsRerender = false;\n const itemSignal = itemInstance.itemSignal;\n if (!itemSignal) {\n rerenderItemInstance(forState, itemInstance, item);\n return true;\n }\n\n const propertySignals = itemInstance.itemPropertySignals;\n if (propertySignals && propertySignals.size > 0) {\n for (const [prop, propertySignal] of propertySignals) {\n const previousValue = readForItemProperty(previousItem, prop);\n const nextValue = readForItemProperty(item, prop);\n if (Object.is(previousValue, nextValue)) {\n continue;\n }\n\n const propertyHasRenderReaders = (propertySignal._readers?.size ?? 0) > 0;\n if (propertyHasRenderReaders) {\n needsRerender = true;\n }\n\n propertySignal.set(nextValue, !propertyHasRenderReaders);\n }\n }\n\n const hasRenderReaders = (itemSignal._readers?.size ?? 0) > 0;\n if (hasRenderReaders) {\n needsRerender = true;\n }\n itemSignal.set(item, hasRenderReaders);\n\n if (needsRerender) {\n rerenderItemInstance(forState, itemInstance, itemInstance.reactiveItem);\n }\n return true;\n}\n\nconst FOR_FALLBACK_SCOPE_KEY = '__for-fallback__';\n\nfunction disposeFallbackScope<T>(\n forState: ForState<T>,\n domCleanup: RemovedDomCleanupMode\n): void {\n const fallbackScope = forState.fallbackScope;\n if (!fallbackScope) {\n return;\n }\n\n const removedDom = fallbackScope.dom;\n disposeChildScope(fallbackScope);\n forState.fallbackScope = null;\n\n if (!removedDom) {\n return;\n }\n\n if (removedDom instanceof Element) {\n if (domCleanup === 'teardown') {\n teardownNodeSubtree(removedDom);\n }\n }\n\n forState.lastRemovedNodes.push(removedDom);\n}\n\nfunction renderFallbackScope<T>(forState: ForState<T>): VNode[] {\n if (forState.fallback == null || forState.fallback === false) {\n if (forState.fallbackScope) {\n disposeFallbackScope(forState, 'none');\n }\n forState.orderedVNodes = [];\n return [];\n }\n\n const fallbackScope =\n forState.fallbackScope ??\n createChildScope(forState.parentInstance, FOR_FALLBACK_SCOPE_KEY, () => {\n if (forState._enqueueBoundaryCommit) {\n forState._enqueueBoundaryCommit();\n return;\n }\n\n forState.parentInstance?._enqueueRun?.();\n });\n forState.fallbackScope = fallbackScope;\n\n const vnode = fallbackScope.render(() => forState.fallback as VNode);\n forState.orderedVNodes = vnode == null || vnode === false ? [] : [vnode];\n return forState.orderedVNodes;\n}\n\nfunction disposeAllItems<T>(\n forState: ForState<T>,\n domCleanup: RemovedDomCleanupMode\n): void {\n const { items, orderedKeys } = forState;\n for (let index = 0; index < orderedKeys.length; index += 1) {\n const key = orderedKeys[index];\n const itemInstance = items.get(key);\n if (!itemInstance) {\n continue;\n }\n disposeItemInstance(forState, itemInstance, domCleanup);\n items.delete(key);\n }\n orderedKeys.length = 0;\n forState.orderedKeys = orderedKeys;\n}\n\nexport function reconcileForItems<T>(\n forState: ForState<T>,\n newArray: T[]\n): VNode[] {\n forState.currentItems = newArray;\n validateForKeys(forState, newArray);\n\n if (BENCH_BUILD_ENABLED) {\n resetBenchMetrics();\n }\n\n const reconcileStartMs = BENCH_BUILD_ENABLED ? performance.now() : 0;\n\n const { items, orderedKeys, byFn } = forState;\n const oldLen = orderedKeys.length;\n const newLen = newArray.length;\n forState.lastRemovedNodes = [];\n\n if (newLen === 0) {\n if (oldLen > 0) {\n disposeAllItems(forState, forState.fallback ? 'teardown' : 'none');\n }\n recordBenchFastLane('TRUNCATE');\n forState.lastCommitStrategy = 'TRUNCATE';\n forState.pendingDirtyIndices = null;\n forState.pendingSwapIndices = null;\n forState.pendingMoveOnly = false;\n\n if (BENCH_BUILD_ENABLED) {\n recordBenchTiming('reconcile', performance.now() - reconcileStartMs);\n flushBenchMetrics();\n }\n\n return renderFallbackScope(forState);\n }\n\n if (forState.fallbackScope) {\n disposeFallbackScope(forState, 'none');\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // FAST PATH A: APPEND\n // Guard: oldLen <= newLen && all old keys match new keys at same indices\n // ─────────────────────────────────────────────────────────────────────────\n if (oldLen < newLen) {\n let canUseAppendPath = true;\n for (let i = 0; i < oldLen; i++) {\n const key = byFn(newArray[i], i);\n if (key !== orderedKeys[i]) {\n canUseAppendPath = false;\n break;\n }\n }\n\n if (canUseAppendPath) {\n recordBenchFastLane('APPEND');\n forState.lastCommitStrategy = 'APPEND';\n const resultVNodes = forState.orderedVNodes;\n resultVNodes.length = newLen;\n\n // Update existing rows in-place\n for (let i = 0; i < oldLen; i++) {\n const item = newArray[i];\n const key = orderedKeys[i];\n const existing = items.get(key)!;\n recordBenchEvent('itemReused');\n\n updateItemInstance(forState, existing, item);\n\n resultVNodes[i] = existing.scope.vnode as VNode;\n }\n\n // Create and append new rows\n for (let i = oldLen; i < newLen; i++) {\n const item = newArray[i];\n const key = byFn(item, i);\n const itemInstance = createItemInstance(key, item, i, forState);\n items.set(key, itemInstance);\n resultVNodes[i] = itemInstance.scope.vnode as VNode;\n orderedKeys[i] = key;\n }\n\n if (BENCH_BUILD_ENABLED) {\n recordBenchTiming('reconcile', performance.now() - reconcileStartMs);\n flushBenchMetrics();\n }\n\n forState.orderedVNodes = resultVNodes;\n forState.pendingDirtyIndices = null;\n forState.pendingSwapIndices = null;\n forState.pendingMoveOnly = false;\n\n return resultVNodes;\n }\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // FAST PATH B: TRUNCATE\n // Guard: newLen <= oldLen && all new keys match old keys at same indices\n // ─────────────────────────────────────────────────────────────────────────\n if (newLen < oldLen) {\n if (oldLen === newLen + 1) {\n let removedIndex = -1;\n\n for (let i = 0; i < newLen; i++) {\n const nextKey = byFn(newArray[i], i);\n if (nextKey !== orderedKeys[i]) {\n removedIndex = i;\n break;\n }\n }\n\n if (removedIndex !== -1) {\n let canUseRemoveOnePath = true;\n for (let i = removedIndex; i < newLen; i++) {\n const nextKey = byFn(newArray[i], i);\n if (nextKey !== orderedKeys[i + 1]) {\n canUseRemoveOnePath = false;\n break;\n }\n }\n\n if (canUseRemoveOnePath) {\n recordBenchFastLane('REMOVE_ONE');\n forState.lastCommitStrategy = 'NO_REORDER';\n\n const resultVNodes = forState.orderedVNodes;\n resultVNodes.length = newLen;\n const dirtyIndices: number[] = [];\n\n for (let i = 0; i < newLen; i++) {\n const item = newArray[i];\n const key = i < removedIndex ? orderedKeys[i] : orderedKeys[i + 1];\n const existing = items.get(key)!;\n recordBenchEvent('itemReused');\n\n const itemChanged = existing.item !== item;\n const needsDomUpdate = existing.scope.needsDomUpdate;\n const indexChanged = existing.indexSignal.peek() !== i;\n\n if (itemChanged) {\n updateItemInstance(forState, existing, item);\n }\n\n if (indexChanged && existing.indexSignal._hasBeenRead) {\n existing.indexSignal.set(i);\n }\n\n if (\n itemChanged ||\n indexChanged ||\n needsDomUpdate ||\n existing.scope.needsDomUpdate\n ) {\n dirtyIndices.push(i);\n }\n\n resultVNodes[i] = existing.scope.vnode as VNode;\n }\n\n const removedKey = orderedKeys[removedIndex];\n const removedItem = items.get(removedKey);\n if (removedItem) {\n disposeItemInstance(forState, removedItem, 'teardown');\n items.delete(removedKey);\n }\n\n const nextOrderedKeys = orderedKeys.slice(0, newLen);\n for (let i = removedIndex; i < newLen; i++) {\n nextOrderedKeys[i] = orderedKeys[i + 1];\n }\n forState.orderedKeys = nextOrderedKeys;\n\n if (BENCH_BUILD_ENABLED) {\n recordBenchTiming(\n 'reconcile',\n performance.now() - reconcileStartMs\n );\n flushBenchMetrics();\n }\n\n forState.pendingDirtyIndices = dirtyIndices;\n forState.pendingSwapIndices = null;\n forState.pendingMoveOnly = false;\n\n return resultVNodes;\n }\n }\n }\n\n let canUseTruncatePath = true;\n for (let i = 0; i < newLen; i++) {\n const key = byFn(newArray[i], i);\n if (key !== orderedKeys[i]) {\n canUseTruncatePath = false;\n break;\n }\n }\n\n if (canUseTruncatePath) {\n recordBenchFastLane('TRUNCATE');\n forState.lastCommitStrategy = 'TRUNCATE';\n const resultVNodes = forState.orderedVNodes;\n resultVNodes.length = newLen;\n const isFullClear = newLen === 0;\n\n // Update existing rows in-place\n for (let i = 0; i < newLen; i++) {\n const item = newArray[i];\n const key = orderedKeys[i];\n const existing = items.get(key)!;\n recordBenchEvent('itemReused');\n\n updateItemInstance(forState, existing, item);\n\n resultVNodes[i] = existing.scope.vnode as VNode;\n }\n\n // Remove tail rows\n for (let i = newLen; i < oldLen; i++) {\n const key = orderedKeys[i];\n const itemInstance = items.get(key);\n if (itemInstance) {\n disposeItemInstance(\n forState,\n itemInstance,\n isFullClear ? 'full-clear' : 'teardown'\n );\n items.delete(key);\n }\n }\n\n orderedKeys.length = newLen;\n forState.orderedKeys = orderedKeys;\n\n if (BENCH_BUILD_ENABLED) {\n recordBenchTiming('reconcile', performance.now() - reconcileStartMs);\n flushBenchMetrics();\n }\n\n forState.orderedVNodes = resultVNodes;\n forState.pendingDirtyIndices = null;\n forState.pendingSwapIndices = null;\n forState.pendingMoveOnly = false;\n\n return resultVNodes;\n }\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // FAST PATH C: NO-REORDER (in-place update only)\n // Guard: oldLen === newLen && keys match at all indices\n // ─────────────────────────────────────────────────────────────────────────\n if (oldLen === newLen) {\n let canUseNoReorderPath = true;\n for (let i = 0; i < oldLen; i++) {\n const key = byFn(newArray[i], i);\n if (key !== orderedKeys[i]) {\n canUseNoReorderPath = false;\n break;\n }\n }\n\n if (canUseNoReorderPath) {\n recordBenchFastLane('NO_REORDER');\n forState.lastCommitStrategy = 'NO_REORDER';\n const resultVNodes = forState.orderedVNodes;\n resultVNodes.length = oldLen;\n const dirtyIndices: number[] = [];\n\n // Update in-place only, no DOM moves needed\n for (let i = 0; i < oldLen; i++) {\n const item = newArray[i];\n const key = orderedKeys[i];\n const existing = items.get(key)!;\n recordBenchEvent('itemReused');\n\n const itemChanged = existing.item !== item;\n const needsDomUpdate = existing.scope.needsDomUpdate;\n let rerendered = false;\n\n if (itemChanged) {\n rerendered = updateItemInstance(forState, existing, item);\n }\n\n if (rerendered || needsDomUpdate || existing.scope.needsDomUpdate) {\n dirtyIndices.push(i);\n }\n\n resultVNodes[i] = existing.scope.vnode as VNode;\n }\n\n if (BENCH_BUILD_ENABLED) {\n recordBenchTiming('reconcile', performance.now() - reconcileStartMs);\n flushBenchMetrics();\n }\n\n forState.pendingDirtyIndices = dirtyIndices;\n forState.pendingSwapIndices = null;\n forState.pendingMoveOnly = false;\n\n return resultVNodes;\n }\n\n let firstMismatch = -1;\n let secondMismatch = -1;\n let firstMismatchKey: string | number | null = null;\n let secondMismatchKey: string | number | null = null;\n let mismatchCount = 0;\n let canUseSwapPath = true;\n\n for (let i = 0; i < oldLen; i++) {\n const item = newArray[i];\n const key = byFn(newArray[i], i);\n if (key === orderedKeys[i]) {\n const existing = items.get(key);\n if (existing && existing.item !== item) {\n canUseSwapPath = false;\n break;\n }\n continue;\n }\n\n mismatchCount++;\n if (firstMismatch === -1) {\n firstMismatch = i;\n firstMismatchKey = key;\n continue;\n }\n\n if (secondMismatch === -1) {\n secondMismatch = i;\n secondMismatchKey = key;\n continue;\n }\n\n mismatchCount = 3;\n break;\n }\n\n if (\n canUseSwapPath &&\n mismatchCount === 2 &&\n firstMismatch !== -1 &&\n secondMismatch !== -1 &&\n firstMismatchKey === orderedKeys[secondMismatch] &&\n secondMismatchKey === orderedKeys[firstMismatch]\n ) {\n recordBenchFastLane('SWAP');\n recordBenchEvent('itemMoved');\n recordBenchEvent('itemMoved');\n\n forState.lastCommitStrategy = 'SWAP';\n\n const nextOrderedKeys = orderedKeys.slice();\n nextOrderedKeys[firstMismatch] = firstMismatchKey;\n nextOrderedKeys[secondMismatch] = secondMismatchKey;\n\n const resultVNodes = forState.orderedVNodes;\n const firstExisting = items.get(firstMismatchKey)!;\n const secondExisting = items.get(secondMismatchKey)!;\n const firstItem = newArray[firstMismatch];\n const secondItem = newArray[secondMismatch];\n\n recordBenchEvent('itemReused');\n recordBenchEvent('itemReused');\n\n if (firstExisting.item !== firstItem) {\n updateItemInstance(forState, firstExisting, firstItem);\n }\n\n if (secondExisting.item !== secondItem) {\n updateItemInstance(forState, secondExisting, secondItem);\n }\n\n if (\n firstExisting.indexSignal._hasBeenRead &&\n firstExisting.indexSignal.peek() !== firstMismatch\n ) {\n firstExisting.indexSignal.set(firstMismatch);\n }\n\n if (\n secondExisting.indexSignal._hasBeenRead &&\n secondExisting.indexSignal.peek() !== secondMismatch\n ) {\n secondExisting.indexSignal.set(secondMismatch);\n }\n\n resultVNodes[firstMismatch] = firstExisting.scope.vnode as VNode;\n resultVNodes[secondMismatch] = secondExisting.scope.vnode as VNode;\n\n forState.orderedKeys = nextOrderedKeys;\n\n if (BENCH_BUILD_ENABLED) {\n recordBenchTiming('reconcile', performance.now() - reconcileStartMs);\n flushBenchMetrics();\n }\n\n forState.pendingDirtyIndices = null;\n forState.pendingSwapIndices = [firstMismatch, secondMismatch];\n forState.pendingMoveOnly = true;\n\n return resultVNodes;\n }\n\n let canUseMoveOnlyPath = true;\n const moveOnlyKeys: Array<string | number> = [];\n const moveOnlyVNodes: VNode[] = [];\n\n for (let i = 0; i < oldLen; i++) {\n const item = newArray[i];\n const key = byFn(item, i);\n const existing = items.get(key);\n\n if (\n !existing ||\n existing.item !== item ||\n (existing.indexSignal._hasBeenRead && existing.indexSignal.peek() !== i)\n ) {\n canUseMoveOnlyPath = false;\n break;\n }\n\n moveOnlyKeys[i] = key;\n moveOnlyVNodes[i] = existing.scope.vnode as VNode;\n recordBenchEvent('itemReused');\n }\n\n if (canUseMoveOnlyPath) {\n recordBenchFastLane('FULL_KEYED');\n forState.lastCommitStrategy = 'FULL_KEYED';\n forState.orderedKeys = moveOnlyKeys;\n forState.orderedVNodes = moveOnlyVNodes;\n\n if (BENCH_BUILD_ENABLED) {\n recordBenchTiming('reconcile', performance.now() - reconcileStartMs);\n flushBenchMetrics();\n }\n\n forState.pendingDirtyIndices = null;\n forState.pendingSwapIndices = null;\n forState.pendingMoveOnly = true;\n\n return moveOnlyVNodes;\n }\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // FULL KEYED RECONCILIATION (slow path for complex reorders)\n // Avoid allocating newKeyMap: iterate directly and track removals\n // ─────────────────────────────────────────────────────────────────────────\n recordBenchFastLane('FULL_KEYED');\n forState.lastCommitStrategy = 'FULL_KEYED';\n\n const toRemove = new Set(orderedKeys);\n const newOrderedKeys: Array<string | number> = [];\n const resultVNodes: VNode[] = [];\n let moveOnly = toRemove.size === newArray.length;\n\n // Single pass: iterate new array directly, no intermediate map\n for (let i = 0; i < newArray.length; i++) {\n const item = newArray[i];\n const key = byFn(item, i);\n recordBenchEvent('keyLookup');\n\n toRemove.delete(key);\n newOrderedKeys.push(key);\n\n const existing = items.get(key);\n recordBenchEvent(existing ? 'keyHit' : 'keyMiss');\n\n if (!existing) {\n // Added: create new item instance\n const itemInstance = createItemInstance(key, item, i, forState);\n items.set(key, itemInstance);\n resultVNodes.push(itemInstance.scope.vnode as VNode);\n } else {\n // Exists: check if item changed (by identity)\n recordBenchEvent('itemReused');\n const itemChanged = existing.item !== item;\n const indexChanged =\n existing.indexSignal._hasBeenRead && existing.indexSignal.peek() !== i;\n\n if (itemChanged) {\n moveOnly = false;\n updateItemInstance(forState, existing, item);\n }\n\n if (indexChanged) {\n // Index changed: update index signal (triggers re-render if index is used)\n existing.indexSignal.set(i);\n }\n\n resultVNodes.push(existing.scope.vnode as VNode);\n }\n }\n\n // Remove deleted items\n for (const key of toRemove) {\n moveOnly = false;\n const itemInstance = items.get(key);\n if (itemInstance) {\n disposeItemInstance(forState, itemInstance, 'none');\n items.delete(key);\n }\n }\n\n forState.orderedKeys = newOrderedKeys;\n\n // Record reconcile timing\n if (BENCH_BUILD_ENABLED) {\n recordBenchTiming('reconcile', performance.now() - reconcileStartMs);\n flushBenchMetrics();\n }\n\n forState.orderedVNodes = resultVNodes;\n forState.pendingDirtyIndices = null;\n forState.pendingSwapIndices = null;\n forState.pendingMoveOnly = moveOnly;\n\n return resultVNodes;\n}\n\nexport function evaluateForState<T>(forState: ForState<T>): VNode[] {\n if (!Array.isArray(forState.currentItems)) {\n throw new Error('For source must evaluate to an array');\n }\n\n forState._needsSourceReconcile = false;\n return reconcileForItems(forState, forState.currentItems);\n}\n\nexport function clearForDomUpdateState<T>(forState: ForState<T>): void {\n for (let i = 0; i < forState.orderedKeys.length; i++) {\n const key = forState.orderedKeys[i];\n const itemInstance = forState.items.get(key);\n if (itemInstance) {\n itemInstance.scope.needsDomUpdate = false;\n }\n }\n if (forState.fallbackScope) {\n forState.fallbackScope.needsDomUpdate = false;\n }\n forState.lastRemovedNodes = [];\n forState.pendingDirtyIndices = null;\n forState.pendingSwapIndices = null;\n forState.pendingMoveOnly = false;\n forState._needsSourceReconcile = false;\n}\n"],"mappings":";;;;;;;;;;;;;AAwCA,MAAM,sBAAsB,qBAAqB;AAyEjD,MAAM,4BAAY,IAAI,SAGnB;AAEH,SAAS,YACP,UACgC;CAChC,IAAI,QAAQ,UAAU,IAAI,SAAS;AACnC,KAAI,CAAC,OAAO;AACV,0BAAQ,IAAI,KAAK;AACjB,YAAU,IAAI,UAAU,MAAM;;AAEhC,QAAO;;AAGT,SAAgB,eACd,YACA,MACA,UACA,UACa;CACb,MAAM,iBAAiB,oBAAoB;AAE3C,QAAO;EACL,MAAM;EACN,cAAc,EAAE;EAChB;EACA;EACA,eAAe;EACf,uBAAO,IAAI,KAAK;EAChB,aAAa,EAAE;EACf,eAAe,EAAE;EACjB;EACA;EACA;EACA,oBAAoB;EACpB,kBAAkB,EAAE;EACpB,qBAAqB;EACrB,oBAAoB;EACpB,iBAAiB;EACjB,qBAAqB;EACrB,uBAAuB;EACvB,eAAe;EACf,sBAAsB;EACtB,wBAAwB;EACxB,2BAA2B;EAC5B;;AAGH,SAAgB,YACd,YACA,MACA,UACA,UACa;CACb,MAAM,WAAW,oBAAoB;AACrC,KAAI,CAAC,SACH,OAAM,IAAI,MACR,6DACD;CAGH,MAAM,YAAY,eAAe,UAAU,MAAM;CACjD,MAAM,QAAQ,YAAY,SAAS;CACnC,MAAM,WAAW,MAAM,IAAI,UAAU;AAErC,KAAI,UAAU;AACZ,WAAS,aAAa;AACtB,WAAS,OAAO;AAChB,WAAS,WAAW;AACpB,WAAS,WAAW;AACpB,SAAO;;CAGT,MAAM,UAAU,eAAe,YAAY,MAAM,UAAU,SAAS;AACpE,OAAM,IAAI,WAAW,QAA6B;AAElD,EAAC,SAAS,eAAe,EAAE,EAAE,WAAW;AACtC,UAAQ,eAAe,SAAS;AAChC,UAAQ,gBAAgB;AACxB,QAAM,OAAO,UAAU;GACvB;AAEF,QAAO;;AAGT,SAA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AI,GAAG,IAAI,SAAS,YAAY,QAAQ,KAAK;EACpD,MAAM,MAAM,SAAS,YAAY;EACjC,MAAM,eAAe,SAAS,MAAM,IAAI,IAAI;AAC5C,MAAI,aACF,cAAa,MAAM,iBAAiB;;AAGxC,KAAI,SAAS,cACX,UAAS,cAAc,iBAAiB;AAE1C,UAAS,mBAAmB,EAAE;AAC9B,UAAS,sBAAsB;AAC/B,UAAS,qBAAqB;AAC9B,UAAS,kBAAkB;AAC3B,UAAS,wBAAwB"}
|
|
1
|
+
{"version":3,"file":"for.js","names":[],"sources":["../../src/runtime/for.ts"],"sourcesContent":["/**\n * For primitive runtime\n *\n * Manages per-item component instances and array reconciliation\n * to eliminate over-invalidation in list rendering.\n */\n\nimport { type ComponentInstance, getCurrentInstance } from './component';\nimport { claimHookIndex } from './component';\nimport { type DOMElement, type VNode } from '../common/vnode';\nimport { isDevelopmentEnvironment } from '../common/env';\nimport { teardownNodeSubtree } from '../renderer/cleanup';\nimport {\n createChildScope,\n disposeChildScope,\n type ChildScope,\n} from './child-scope';\nimport type { ForProps } from '../control/for';\nimport type { ForEachSource } from '../control/for';\nimport {\n markReactivePropsDirtySource,\n markReadableDerivedSubscribersDirty,\n notifyReadableReaders,\n recordReadableRead,\n type ReadableSource,\n} from './readable';\nimport type { FineGrainedEffectHandle } from './effect';\nimport {\n flushBenchMetrics,\n getBenchMetrics,\n isBenchBuildEnabled,\n isBenchMetricScopeActive,\n recordBenchEvent,\n recordBenchCounter,\n recordBenchFastLane,\n recordBenchTiming,\n resetBenchMetrics,\n withBenchMetricScope,\n} from './for-bench';\n\nconst BENCH_BUILD_ENABLED = isBenchBuildEnabled();\n\nexport {\n getBenchMetrics,\n isBenchMetricScopeActive,\n recordBenchEvent,\n recordBenchCounter,\n recordBenchTiming,\n resetBenchMetrics,\n withBenchMetricScope,\n};\n\nexport interface ForItemInstance<T> {\n key: string | number;\n item: T;\n reactiveItem: T;\n itemSignal: ForItemSignal<T> | null;\n itemPropertySignals: Map<PropertyKey, ForItemPropertySignal> | null;\n indexSignal: ForIndexSignal;\n scope: ChildScope;\n}\n\ntype ForItemSignal<T> = ReadableSource<T> &\n (() => T) & {\n peek(): T;\n set(newValue: T, notifyReaders?: boolean): void;\n };\n\ntype ForItemPropertySignal = ReadableSource<unknown> &\n (() => unknown) & {\n peek(): unknown;\n set(newValue: unknown, notifyReaders?: boolean): void;\n };\n\ntype ForIndexSignal = ReadableSource<number> &\n (() => number) & {\n peek(): number;\n set(newValue: number | ((prev: number) => number)): void;\n };\n\nexport type ForCommitStrategy =\n | 'APPEND'\n | 'TRUNCATE'\n | 'NO_REORDER'\n | 'SWAP'\n | 'FULL_KEYED';\n\nexport interface ForState<T> {\n kind: 'for';\n currentItems: T[];\n eachSource: ForEachSource<T>;\n fallback: VNode | null;\n fallbackScope: ChildScope | null;\n items: Map<string | number, ForItemInstance<T>>;\n orderedKeys: Array<string | number>;\n orderedItems: ForItemInstance<T>[];\n orderedVNodes: VNode[];\n byFn: NonNullable<ForProps<T>['by']> | ((item: T, index: number) => number);\n renderFn: (item: T, index: () => number) => VNode;\n parentInstance: ComponentInstance | null;\n lastCommitStrategy: ForCommitStrategy;\n lastRemovedNodes: Node[];\n pendingDirtyIndices: number[] | null;\n pendingSwapIndices: [number, number] | null;\n pendingMoveOnly: boolean;\n _hasResolvedItemDom: boolean;\n _needsSourceReconcile: boolean;\n _sourceEffect: FineGrainedEffectHandle<T[]> | null;\n _suspendSourceCommit: boolean;\n _enqueueBoundaryCommit?: (() => void) | null;\n _hasPendingBoundaryCommit?: boolean;\n devKeyKinds?: Map<string, 'number' | 'string'>;\n}\n\nconst forStates = new WeakMap<\n ComponentInstance,\n Map<number, ForState<unknown>>\n>();\n\nfunction getForStore(\n instance: ComponentInstance\n): Map<number, ForState<unknown>> {\n let store = forStates.get(instance);\n if (!store) {\n store = new Map();\n forStates.set(instance, store);\n }\n return store;\n}\n\nexport function createForState<T>(\n eachSource: ForEachSource<T>,\n byFn: ForState<T>['byFn'],\n renderFn: (item: T, index: () => number) => VNode,\n fallback: VNode | null\n): ForState<T> {\n const parentInstance = getCurrentInstance();\n\n return {\n kind: 'for',\n currentItems: [],\n eachSource,\n fallback,\n fallbackScope: null,\n items: new Map(),\n orderedKeys: [],\n orderedItems: [],\n orderedVNodes: [],\n byFn,\n renderFn,\n parentInstance,\n lastCommitStrategy: 'NO_REORDER',\n lastRemovedNodes: [],\n pendingDirtyIndices: null,\n pendingSwapIndices: null,\n pendingMoveOnly: false,\n _hasResolvedItemDom: false,\n _needsSourceReconcile: false,\n _sourceEffect: null,\n _suspendSourceCommit: false,\n _enqueueBoundaryCommit: null,\n _hasPendingBoundaryCommit: false,\n };\n}\n\nexport function useForState<T>(\n eachSource: ForEachSource<T>,\n byFn: ForState<T>['byFn'],\n renderFn: (item: T, index: () => number) => VNode,\n fallback: VNode | null\n): ForState<T> {\n const instance = getCurrentInstance();\n if (!instance) {\n throw new Error(\n 'For can only be created during component render execution.'\n );\n }\n\n const hookIndex = claimHookIndex(instance, 'For');\n const store = getForStore(instance);\n const existing = store.get(hookIndex) as ForState<T> | undefined;\n\n if (existing) {\n existing.eachSource = eachSource;\n existing.byFn = byFn;\n existing.renderFn = renderFn;\n existing.fallback = fallback;\n return existing;\n }\n\n const created = createForState(eachSource, byFn, renderFn, fallback);\n store.set(hookIndex, created as ForState<unknown>);\n\n (instance.cleanupFns ??= []).push(() => {\n created._sourceEffect?.cleanup();\n created._sourceEffect = null;\n store.delete(hookIndex);\n });\n\n return created;\n}\n\nfunction createForIndexSignal(initialIndex: number): ForIndexSignal {\n let indexValue = initialIndex;\n const readers = new Map<ComponentInstance, number>();\n\n const indexSignal = (() => {\n indexSignal._hasBeenRead = true;\n recordReadableRead(indexSignal);\n return indexValue;\n }) as ForIndexSignal;\n indexSignal._readers = readers;\n indexSignal.peek = () => indexValue;\n indexSignal.set = (newValue: number | ((prev: number) => number)) => {\n const nextValue =\n typeof newValue === 'function' ? newValue(indexValue) : newValue;\n if (nextValue !== indexValue) {\n indexValue = nextValue;\n markReadableDerivedSubscribersDirty(indexSignal);\n markReactivePropsDirtySource(indexSignal);\n notifyReadableReaders(indexSignal);\n }\n };\n indexSignal._hasBeenRead = false;\n\n return indexSignal;\n}\n\nfunction createForItemSignal<T>(initialItem: T): ForItemSignal<T> {\n let itemValue = initialItem;\n const readers = new Map<ComponentInstance, number>();\n\n const itemSignal = (() => {\n itemSignal._hasBeenRead = true;\n recordReadableRead(itemSignal);\n return itemValue;\n }) as ForItemSignal<T>;\n\n itemSignal._readers = readers;\n itemSignal.peek = () => itemValue;\n itemSignal.set = (newValue: T, notifyReaders = true) => {\n if (Object.is(itemValue, newValue)) {\n return;\n }\n\n itemValue = newValue;\n if (notifyReaders) {\n markReadableDerivedSubscribersDirty(itemSignal);\n markReactivePropsDirtySource(itemSignal);\n notifyReadableReaders(itemSignal);\n }\n };\n itemSignal._hasBeenRead = false;\n\n return itemSignal;\n}\n\nfunction createForItemPropertySignal(\n initialValue: unknown\n): ForItemPropertySignal {\n let propertyValue = initialValue;\n const readers = new Map<ComponentInstance, number>();\n\n const propertySignal = (() => {\n propertySignal._hasBeenRead = true;\n recordReadableRead(propertySignal);\n return propertyValue;\n }) as ForItemPropertySignal;\n\n propertySignal._readers = readers;\n propertySignal.peek = () => propertyValue;\n propertySignal.set = (newValue: unknown, notifyReaders = true) => {\n if (Object.is(propertyValue, newValue)) {\n return;\n }\n\n propertyValue = newValue;\n if (notifyReaders) {\n markReadableDerivedSubscribersDirty(propertySignal);\n markReactivePropsDirtySource(propertySignal);\n notifyReadableReaders(propertySignal);\n }\n };\n propertySignal._hasBeenRead = false;\n\n return propertySignal;\n}\n\nfunction readForItemProperty(item: unknown, prop: PropertyKey): unknown {\n return Reflect.get(Object(item), prop);\n}\n\nfunction haveSameOwnKeys(previousItem: unknown, nextItem: unknown): boolean {\n const previousKeys = Reflect.ownKeys(Object(previousItem));\n const nextKeys = Reflect.ownKeys(Object(nextItem));\n\n if (previousKeys.length !== nextKeys.length) {\n return false;\n }\n\n for (let i = 0; i < previousKeys.length; i += 1) {\n if (previousKeys[i] !== nextKeys[i]) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction scopeReadsSource(\n scope: ChildScope,\n source: ReadableSource<unknown>\n): boolean {\n return source._readers?.has(scope.componentInstance) ?? false;\n}\n\nfunction getOrCreateForItemPropertySignal<T>(\n item: T,\n propertySignals: Map<PropertyKey, ForItemPropertySignal>,\n prop: PropertyKey\n): ForItemPropertySignal {\n const existingSignal = propertySignals.get(prop);\n if (existingSignal) {\n return existingSignal;\n }\n\n const propertySignal = createForItemPropertySignal(\n readForItemProperty(item, prop)\n );\n propertySignals.set(prop, propertySignal);\n return propertySignal;\n}\n\nfunction canProxyForItem(item: unknown): item is object {\n return (\n (typeof item === 'object' && item !== null) || typeof item === 'function'\n );\n}\n\nfunction createReactiveForItem<T>(\n itemSignal: ForItemSignal<T>,\n propertySignals: Map<PropertyKey, ForItemPropertySignal>\n): T {\n const target = Object.create(null) as Record<string | symbol, unknown>;\n\n return new Proxy(target, {\n get(target, prop, receiver) {\n const ownDescriptor = Reflect.getOwnPropertyDescriptor(target, prop);\n if (ownDescriptor) {\n return Reflect.get(target, prop, receiver);\n }\n\n const currentItem = itemSignal.peek();\n\n if (typeof prop !== 'symbol') {\n return getOrCreateForItemPropertySignal(\n currentItem,\n propertySignals,\n prop\n )();\n }\n\n recordReadableRead(itemSignal);\n return Reflect.get(Object(currentItem), prop, receiver);\n },\n has(target, prop) {\n recordReadableRead(itemSignal);\n return prop in target || prop in Object(itemSignal.peek());\n },\n ownKeys(target) {\n recordReadableRead(itemSignal);\n const keys = new Set<string | symbol>(Reflect.ownKeys(target));\n for (const key of Reflect.ownKeys(Object(itemSignal.peek()))) {\n keys.add(key);\n }\n\n return Array.from(keys);\n },\n getOwnPropertyDescriptor(target, prop) {\n recordReadableRead(itemSignal);\n const ownDescriptor = Reflect.getOwnPropertyDescriptor(target, prop);\n if (ownDescriptor) {\n return ownDescriptor;\n }\n\n return Object.getOwnPropertyDescriptor(Object(itemSignal.peek()), prop);\n },\n getPrototypeOf() {\n recordReadableRead(itemSignal);\n return Object.getPrototypeOf(Object(itemSignal.peek()));\n },\n }) as T;\n}\n\nfunction materializeItemVnode(\n key: string | number,\n vnode: VNode | undefined\n): void {\n if (vnode && typeof vnode === 'object' && 'type' in vnode) {\n const vn = vnode as DOMElement;\n vn.key = key;\n\n if (typeof vn.type === 'string') {\n if (!vn.props) vn.props = {};\n if (vn.props['data-key'] === undefined) {\n vn.props['data-key'] = String(key);\n }\n }\n }\n}\n\nfunction renderItemScope<T>(\n forState: ForState<T>,\n scope: ChildScope,\n item: T,\n indexSignal: ForIndexSignal,\n key: string | number\n): VNode {\n recordBenchEvent('rowFactory');\n const vnode = scope.render(() => forState.renderFn(item, indexSignal));\n materializeItemVnode(key, vnode);\n return vnode;\n}\n\nfunction failForValidation(message: string): never {\n throw new Error(message);\n}\n\nfunction validateForKeys<T>(forState: ForState<T>, newArray: T[]): void {\n if (!isDevelopmentEnvironment()) {\n return;\n }\n\n const seen = new Set<string | number>();\n const keyKinds = new Map<string, 'number' | 'string'>();\n for (let i = 0; i < newArray.length; i++) {\n const key = forState.byFn(newArray[i], i);\n\n if (key === null || key === undefined) {\n failForValidation(\n '[askr] Invalid For key detected. Keys should be stable, non-null, and unique within a For list.'\n );\n }\n\n if (seen.has(key)) {\n failForValidation(\n `[askr] Duplicate For key detected: ${String(key)}. Keys should be stable, non-null, and unique within a For list.`\n );\n }\n\n seen.add(key);\n\n const keyString = String(key);\n const keyKind = typeof key;\n const previousKeyKind = forState.devKeyKinds?.get(keyString);\n if (previousKeyKind && previousKeyKind !== keyKind) {\n failForValidation(\n `[askr] For key type changed for ${keyString}. Keys must remain consistently typed across renders.`\n );\n }\n keyKinds.set(keyString, keyKind as 'number' | 'string');\n }\n\n forState.devKeyKinds = keyKinds;\n}\n\ntype RemovedDomCleanupMode = 'none' | 'teardown' | 'full-clear';\n\nfunction disposeItemInstance<T>(\n forState: ForState<T>,\n itemInstance: ForItemInstance<T>,\n domCleanup: RemovedDomCleanupMode\n): void {\n recordBenchEvent('itemRemoved');\n const removedDom = itemInstance.scope.dom;\n\n try {\n disposeChildScope(itemInstance.scope);\n } catch (err) {\n if (isDevelopmentEnvironment()) {\n console.error('[For] Cleanup error:', err);\n }\n }\n\n if (!removedDom) {\n return;\n }\n\n if (removedDom instanceof Element) {\n if (domCleanup === 'teardown') {\n teardownNodeSubtree(removedDom);\n }\n }\n\n forState.lastRemovedNodes.push(removedDom);\n}\n\nexport function createItemInstance<T>(\n key: string | number,\n item: T,\n index: number,\n forState: ForState<T>\n): ForItemInstance<T> {\n recordBenchEvent('itemCreated');\n\n // Create index signal manually without going through state() hook\n // to avoid hook order violations (each For item creates its signal dynamically)\n const indexSignal = createForIndexSignal(index);\n const itemSignal = canProxyForItem(item) ? createForItemSignal(item) : null;\n const itemPropertySignals = itemSignal\n ? new Map<PropertyKey, ForItemPropertySignal>()\n : null;\n const reactiveItem =\n itemSignal && itemPropertySignals\n ? createReactiveForItem(itemSignal, itemPropertySignals)\n : item;\n let itemInstance: ForItemInstance<T> | null = null;\n const scope = createChildScope(forState.parentInstance, key, () => {\n if (forState._enqueueBoundaryCommit) {\n forState._enqueueBoundaryCommit();\n return;\n }\n\n const parent = forState.parentInstance;\n if (parent) {\n parent._enqueueRun?.();\n }\n });\n\n renderItemScope(forState, scope, reactiveItem, indexSignal, key);\n\n itemInstance = {\n key,\n item,\n reactiveItem,\n itemSignal,\n itemPropertySignals,\n indexSignal,\n scope,\n };\n\n return itemInstance;\n}\n\nfunction rerenderItemInstance<T>(\n forState: ForState<T>,\n itemInstance: ForItemInstance<T>,\n item: T\n): void {\n renderItemScope(\n forState,\n itemInstance.scope,\n item,\n itemInstance.indexSignal,\n itemInstance.key\n );\n}\n\nfunction updateItemInstance<T>(\n forState: ForState<T>,\n itemInstance: ForItemInstance<T>,\n item: T\n): boolean {\n if (itemInstance.item === item) {\n return false;\n }\n\n const previousItem = itemInstance.item;\n itemInstance.item = item;\n\n const scope = itemInstance.scope;\n let scopeReadsChangedSignal = false;\n const itemSignal = itemInstance.itemSignal;\n if (!itemSignal) {\n rerenderItemInstance(forState, itemInstance, item);\n return true;\n }\n\n const propertySignals = itemInstance.itemPropertySignals;\n const changedPropertySignals: Array<[ForItemPropertySignal, unknown]> = [];\n if (propertySignals && propertySignals.size > 0) {\n for (const [prop, propertySignal] of propertySignals) {\n const previousValue = readForItemProperty(previousItem, prop);\n const nextValue = readForItemProperty(item, prop);\n if (Object.is(previousValue, nextValue)) {\n continue;\n }\n\n if (scopeReadsSource(scope, propertySignal)) {\n scopeReadsChangedSignal = true;\n }\n\n changedPropertySignals.push([propertySignal, nextValue]);\n }\n }\n\n if (scopeReadsSource(scope, itemSignal)) {\n scopeReadsChangedSignal = true;\n }\n\n const itemShapeChanged =\n changedPropertySignals.length === 0 && !haveSameOwnKeys(previousItem, item);\n const notifyReaders =\n !scopeReadsChangedSignal &&\n (changedPropertySignals.length > 0 || itemShapeChanged);\n const visibleChange =\n scopeReadsChangedSignal ||\n changedPropertySignals.length > 0 ||\n itemShapeChanged;\n for (const [propertySignal, nextValue] of changedPropertySignals) {\n propertySignal.set(nextValue, notifyReaders);\n }\n itemSignal.set(item, notifyReaders);\n\n if (scopeReadsChangedSignal) {\n rerenderItemInstance(forState, itemInstance, itemInstance.reactiveItem);\n }\n\n return visibleChange;\n}\n\nconst FOR_FALLBACK_SCOPE_KEY = '__for-fallback__';\n\nfunction disposeFallbackScope<T>(\n forState: ForState<T>,\n domCleanup: RemovedDomCleanupMode\n): void {\n const fallbackScope = forState.fallbackScope;\n if (!fallbackScope) {\n return;\n }\n\n const removedDom = fallbackScope.dom;\n disposeChildScope(fallbackScope);\n forState.fallbackScope = null;\n\n if (!removedDom) {\n return;\n }\n\n if (removedDom instanceof Element) {\n if (domCleanup === 'teardown') {\n teardownNodeSubtree(removedDom);\n }\n }\n\n forState.lastRemovedNodes.push(removedDom);\n}\n\nfunction renderFallbackScope<T>(forState: ForState<T>): VNode[] {\n if (forState.fallback == null || forState.fallback === false) {\n if (forState.fallbackScope) {\n disposeFallbackScope(forState, 'none');\n }\n forState.orderedVNodes = [];\n forState.orderedItems = [];\n return [];\n }\n\n const fallbackScope =\n forState.fallbackScope ??\n createChildScope(forState.parentInstance, FOR_FALLBACK_SCOPE_KEY, () => {\n if (forState._enqueueBoundaryCommit) {\n forState._enqueueBoundaryCommit();\n return;\n }\n\n forState.parentInstance?._enqueueRun?.();\n });\n forState.fallbackScope = fallbackScope;\n\n const vnode = fallbackScope.render(() => forState.fallback as VNode);\n forState.orderedVNodes = vnode == null || vnode === false ? [] : [vnode];\n forState.orderedItems = [];\n return forState.orderedVNodes;\n}\n\nfunction disposeAllItems<T>(\n forState: ForState<T>,\n domCleanup: RemovedDomCleanupMode\n): void {\n const { items, orderedKeys } = forState;\n for (let index = 0; index < orderedKeys.length; index += 1) {\n const key = orderedKeys[index];\n const itemInstance = items.get(key);\n if (!itemInstance) {\n continue;\n }\n disposeItemInstance(forState, itemInstance, domCleanup);\n items.delete(key);\n }\n orderedKeys.length = 0;\n forState.orderedKeys = orderedKeys;\n}\n\nexport function reconcileForItems<T>(\n forState: ForState<T>,\n newArray: T[]\n): VNode[] {\n forState.currentItems = newArray;\n validateForKeys(forState, newArray);\n\n if (BENCH_BUILD_ENABLED) {\n resetBenchMetrics();\n }\n\n const reconcileStartMs = BENCH_BUILD_ENABLED ? performance.now() : 0;\n\n const { items, orderedKeys, byFn } = forState;\n const oldLen = orderedKeys.length;\n const newLen = newArray.length;\n forState.lastRemovedNodes = [];\n\n if (newLen === 0) {\n if (oldLen > 0) {\n disposeAllItems(forState, forState.fallback ? 'teardown' : 'none');\n }\n recordBenchFastLane('TRUNCATE');\n forState.lastCommitStrategy = 'TRUNCATE';\n forState.pendingDirtyIndices = null;\n forState.pendingSwapIndices = null;\n forState.pendingMoveOnly = false;\n\n if (BENCH_BUILD_ENABLED) {\n recordBenchTiming('reconcile', performance.now() - reconcileStartMs);\n flushBenchMetrics();\n }\n\n return renderFallbackScope(forState);\n }\n\n if (forState.fallbackScope) {\n disposeFallbackScope(forState, 'none');\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // FAST PATH A: APPEND\n // Guard: oldLen <= newLen && all old keys match new keys at same indices\n // ─────────────────────────────────────────────────────────────────────────\n if (oldLen < newLen) {\n let canUseAppendPath = true;\n for (let i = 0; i < oldLen; i++) {\n const key = byFn(newArray[i], i);\n if (key !== orderedKeys[i]) {\n canUseAppendPath = false;\n break;\n }\n }\n\n if (canUseAppendPath) {\n recordBenchFastLane('APPEND');\n forState.lastCommitStrategy = 'APPEND';\n const resultVNodes = forState.orderedVNodes;\n const resultItems = forState.orderedItems;\n resultVNodes.length = newLen;\n resultItems.length = newLen;\n\n // Update existing rows in-place\n for (let i = 0; i < oldLen; i++) {\n const item = newArray[i];\n const key = orderedKeys[i];\n const existing = resultItems[i] ?? items.get(key)!;\n\n updateItemInstance(forState, existing, item);\n\n resultItems[i] = existing;\n resultVNodes[i] = existing.scope.vnode as VNode;\n }\n\n recordBenchEvent('itemReused', oldLen);\n\n // Create and append new rows\n for (let i = oldLen; i < newLen; i++) {\n const item = newArray[i];\n const key = byFn(item, i);\n const itemInstance = createItemInstance(key, item, i, forState);\n items.set(key, itemInstance);\n resultItems[i] = itemInstance;\n resultVNodes[i] = itemInstance.scope.vnode as VNode;\n orderedKeys[i] = key;\n }\n\n if (BENCH_BUILD_ENABLED) {\n recordBenchTiming('reconcile', performance.now() - reconcileStartMs);\n flushBenchMetrics();\n }\n\n forState.orderedVNodes = resultVNodes;\n forState.pendingDirtyIndices = null;\n forState.pendingSwapIndices = null;\n forState.pendingMoveOnly = false;\n\n return resultVNodes;\n }\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // FAST PATH B: TRUNCATE\n // Guard: newLen <= oldLen && all new keys match old keys at same indices\n // ─────────────────────────────────────────────────────────────────────────\n if (newLen < oldLen) {\n if (oldLen === newLen + 1) {\n let removedIndex = -1;\n\n for (let i = 0; i < newLen; i++) {\n const nextKey = byFn(newArray[i], i);\n if (nextKey !== orderedKeys[i]) {\n removedIndex = i;\n break;\n }\n }\n\n if (removedIndex !== -1) {\n let canUseRemoveOnePath = true;\n for (let i = removedIndex; i < newLen; i++) {\n const nextKey = byFn(newArray[i], i);\n if (nextKey !== orderedKeys[i + 1]) {\n canUseRemoveOnePath = false;\n break;\n }\n }\n\n if (canUseRemoveOnePath) {\n recordBenchFastLane('REMOVE_ONE');\n forState.lastCommitStrategy = 'NO_REORDER';\n\n const previousOrderedItems = forState.orderedItems.slice();\n const resultVNodes = forState.orderedVNodes;\n const resultItems = forState.orderedItems;\n resultVNodes.length = newLen;\n resultItems.length = newLen;\n const dirtyIndices: number[] = [];\n\n for (let i = 0; i < newLen; i++) {\n const item = newArray[i];\n const key = i < removedIndex ? orderedKeys[i] : orderedKeys[i + 1];\n const existing = items.get(key)!;\n const scopeNeedsDomUpdate = existing.scope.needsDomUpdate;\n\n const itemChanged = existing.item !== item;\n const indexSignal = existing.indexSignal;\n const indexChanged =\n indexSignal._hasBeenRead && indexSignal.peek() !== i;\n\n if (itemChanged) {\n updateItemInstance(forState, existing, item);\n }\n\n if (indexChanged) {\n indexSignal.set(i);\n }\n\n if (itemChanged || indexChanged || scopeNeedsDomUpdate) {\n dirtyIndices.push(i);\n }\n\n resultItems[i] = existing;\n resultVNodes[i] = existing.scope.vnode as VNode;\n }\n\n recordBenchEvent('itemReused', newLen);\n\n const removedKey = orderedKeys[removedIndex];\n const removedItem = items.get(removedKey);\n if (removedItem) {\n disposeItemInstance(forState, removedItem, 'teardown');\n items.delete(removedKey);\n }\n\n const nextOrderedKeys = orderedKeys.slice(0, newLen);\n const nextOrderedItems = previousOrderedItems.slice(0, newLen);\n for (let i = removedIndex; i < newLen; i++) {\n nextOrderedKeys[i] = orderedKeys[i + 1];\n nextOrderedItems[i] = previousOrderedItems[i + 1];\n }\n forState.orderedKeys = nextOrderedKeys;\n forState.orderedItems = nextOrderedItems;\n\n if (BENCH_BUILD_ENABLED) {\n recordBenchTiming(\n 'reconcile',\n performance.now() - reconcileStartMs\n );\n flushBenchMetrics();\n }\n\n forState.pendingDirtyIndices = dirtyIndices;\n forState.pendingSwapIndices = null;\n forState.pendingMoveOnly = false;\n\n return resultVNodes;\n }\n }\n }\n\n let canUseTruncatePath = true;\n for (let i = 0; i < newLen; i++) {\n const key = byFn(newArray[i], i);\n if (key !== orderedKeys[i]) {\n canUseTruncatePath = false;\n break;\n }\n }\n\n if (canUseTruncatePath) {\n recordBenchFastLane('TRUNCATE');\n forState.lastCommitStrategy = 'TRUNCATE';\n const resultVNodes = forState.orderedVNodes;\n const resultItems = forState.orderedItems;\n resultVNodes.length = newLen;\n resultItems.length = newLen;\n const isFullClear = newLen === 0;\n\n // Update existing rows in-place\n for (let i = 0; i < newLen; i++) {\n const item = newArray[i];\n const key = orderedKeys[i];\n const existing = items.get(key)!;\n\n updateItemInstance(forState, existing, item);\n\n resultItems[i] = existing;\n resultVNodes[i] = existing.scope.vnode as VNode;\n }\n\n recordBenchEvent('itemReused', newLen);\n\n // Remove tail rows\n for (let i = newLen; i < oldLen; i++) {\n const key = orderedKeys[i];\n const itemInstance = items.get(key);\n if (itemInstance) {\n disposeItemInstance(\n forState,\n itemInstance,\n isFullClear ? 'full-clear' : 'teardown'\n );\n items.delete(key);\n }\n }\n\n orderedKeys.length = newLen;\n forState.orderedKeys = orderedKeys;\n forState.orderedItems.length = newLen;\n\n if (BENCH_BUILD_ENABLED) {\n recordBenchTiming('reconcile', performance.now() - reconcileStartMs);\n flushBenchMetrics();\n }\n\n forState.orderedVNodes = resultVNodes;\n forState.pendingDirtyIndices = null;\n forState.pendingSwapIndices = null;\n forState.pendingMoveOnly = false;\n\n return resultVNodes;\n }\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // FAST PATH C: NO-REORDER (in-place update only)\n // Guard: oldLen === newLen && keys match at all indices\n // ─────────────────────────────────────────────────────────────────────────\n if (oldLen === newLen) {\n let canUseNoReorderPath = true;\n for (let i = 0; i < oldLen; i++) {\n const key = byFn(newArray[i], i);\n if (key !== orderedKeys[i]) {\n canUseNoReorderPath = false;\n break;\n }\n }\n\n if (canUseNoReorderPath) {\n recordBenchFastLane('NO_REORDER');\n forState.lastCommitStrategy = 'NO_REORDER';\n const resultVNodes = forState.orderedVNodes;\n const resultItems = forState.orderedItems;\n resultVNodes.length = oldLen;\n resultItems.length = oldLen;\n const dirtyIndices: number[] = [];\n // Update in-place only, no DOM moves needed\n for (let i = 0; i < oldLen; i++) {\n const item = newArray[i];\n const key = orderedKeys[i];\n const existing = items.get(key)!;\n const itemChanged = existing.item !== item;\n\n if (itemChanged) {\n updateItemInstance(forState, existing, item);\n }\n\n if (!itemChanged && existing.scope.needsDomUpdate) {\n dirtyIndices.push(i);\n }\n\n resultItems[i] = existing;\n resultVNodes[i] = existing.scope.vnode as VNode;\n }\n\n recordBenchEvent('itemReused', oldLen);\n\n if (BENCH_BUILD_ENABLED) {\n recordBenchTiming('reconcile', performance.now() - reconcileStartMs);\n flushBenchMetrics();\n }\n\n forState.pendingDirtyIndices = dirtyIndices;\n forState.pendingSwapIndices = null;\n forState.pendingMoveOnly = false;\n\n return resultVNodes;\n }\n\n let firstMismatch = -1;\n let secondMismatch = -1;\n let firstMismatchKey: string | number | null = null;\n let secondMismatchKey: string | number | null = null;\n let mismatchCount = 0;\n let canUseSwapPath = true;\n\n for (let i = 0; i < oldLen; i++) {\n const item = newArray[i];\n const key = byFn(newArray[i], i);\n if (key === orderedKeys[i]) {\n const existing = items.get(key);\n if (existing && existing.item !== item) {\n canUseSwapPath = false;\n break;\n }\n continue;\n }\n\n mismatchCount++;\n if (firstMismatch === -1) {\n firstMismatch = i;\n firstMismatchKey = key;\n continue;\n }\n\n if (secondMismatch === -1) {\n secondMismatch = i;\n secondMismatchKey = key;\n continue;\n }\n\n mismatchCount = 3;\n break;\n }\n\n if (\n canUseSwapPath &&\n mismatchCount === 2 &&\n firstMismatch !== -1 &&\n secondMismatch !== -1 &&\n firstMismatchKey === orderedKeys[secondMismatch] &&\n secondMismatchKey === orderedKeys[firstMismatch]\n ) {\n recordBenchFastLane('SWAP');\n recordBenchEvent('itemMoved');\n recordBenchEvent('itemMoved');\n\n forState.lastCommitStrategy = 'SWAP';\n\n const nextOrderedKeys = orderedKeys.slice();\n nextOrderedKeys[firstMismatch] = firstMismatchKey;\n nextOrderedKeys[secondMismatch] = secondMismatchKey;\n\n const resultVNodes = forState.orderedVNodes;\n const firstExisting = items.get(firstMismatchKey)!;\n const secondExisting = items.get(secondMismatchKey)!;\n const firstItem = newArray[firstMismatch];\n const secondItem = newArray[secondMismatch];\n const nextOrderedItems = forState.orderedItems.slice();\n nextOrderedItems[firstMismatch] = secondExisting;\n nextOrderedItems[secondMismatch] = firstExisting;\n\n recordBenchEvent('itemReused');\n recordBenchEvent('itemReused');\n\n if (firstExisting.item !== firstItem) {\n updateItemInstance(forState, firstExisting, firstItem);\n }\n\n if (secondExisting.item !== secondItem) {\n updateItemInstance(forState, secondExisting, secondItem);\n }\n\n if (\n firstExisting.indexSignal._hasBeenRead &&\n firstExisting.indexSignal.peek() !== firstMismatch\n ) {\n firstExisting.indexSignal.set(firstMismatch);\n }\n\n if (\n secondExisting.indexSignal._hasBeenRead &&\n secondExisting.indexSignal.peek() !== secondMismatch\n ) {\n secondExisting.indexSignal.set(secondMismatch);\n }\n\n resultVNodes[firstMismatch] = firstExisting.scope.vnode as VNode;\n resultVNodes[secondMismatch] = secondExisting.scope.vnode as VNode;\n\n forState.orderedKeys = nextOrderedKeys;\n forState.orderedItems = nextOrderedItems;\n\n if (BENCH_BUILD_ENABLED) {\n recordBenchTiming('reconcile', performance.now() - reconcileStartMs);\n flushBenchMetrics();\n }\n\n forState.pendingDirtyIndices = null;\n forState.pendingSwapIndices = [firstMismatch, secondMismatch];\n forState.pendingMoveOnly = true;\n\n return resultVNodes;\n }\n\n let canUseMoveOnlyPath = true;\n const moveOnlyKeys: Array<string | number> = [];\n const moveOnlyItems: ForItemInstance<T>[] = [];\n const moveOnlyVNodes: VNode[] = [];\n\n for (let i = 0; i < oldLen; i++) {\n const item = newArray[i];\n const key = byFn(item, i);\n const existing = items.get(key);\n\n if (\n !existing ||\n existing.item !== item ||\n (existing.indexSignal._hasBeenRead && existing.indexSignal.peek() !== i)\n ) {\n canUseMoveOnlyPath = false;\n break;\n }\n\n moveOnlyKeys[i] = key;\n moveOnlyItems[i] = existing;\n moveOnlyVNodes[i] = existing.scope.vnode as VNode;\n recordBenchEvent('itemReused');\n }\n\n if (canUseMoveOnlyPath) {\n recordBenchFastLane('FULL_KEYED');\n forState.lastCommitStrategy = 'FULL_KEYED';\n forState.orderedKeys = moveOnlyKeys;\n forState.orderedItems = moveOnlyItems;\n forState.orderedVNodes = moveOnlyVNodes;\n\n if (BENCH_BUILD_ENABLED) {\n recordBenchTiming('reconcile', performance.now() - reconcileStartMs);\n flushBenchMetrics();\n }\n\n forState.pendingDirtyIndices = null;\n forState.pendingSwapIndices = null;\n forState.pendingMoveOnly = true;\n\n return moveOnlyVNodes;\n }\n }\n\n // ─────────────────────────────────────────────────────────────────────────\n // FULL KEYED RECONCILIATION (slow path for complex reorders)\n // Avoid allocating newKeyMap: iterate directly and track removals\n // ─────────────────────────────────────────────────────────────────────────\n recordBenchFastLane('FULL_KEYED');\n forState.lastCommitStrategy = 'FULL_KEYED';\n\n const toRemove = new Set(orderedKeys);\n const newOrderedKeys: Array<string | number> = [];\n const newOrderedItems: ForItemInstance<T>[] = [];\n const resultVNodes: VNode[] = [];\n let moveOnly = toRemove.size === newArray.length;\n\n // Single pass: iterate new array directly, no intermediate map\n for (let i = 0; i < newArray.length; i++) {\n const item = newArray[i];\n const key = byFn(item, i);\n recordBenchEvent('keyLookup');\n\n toRemove.delete(key);\n newOrderedKeys.push(key);\n\n const existing = items.get(key);\n recordBenchEvent(existing ? 'keyHit' : 'keyMiss');\n\n if (!existing) {\n // Added: create new item instance\n const itemInstance = createItemInstance(key, item, i, forState);\n items.set(key, itemInstance);\n newOrderedItems.push(itemInstance);\n resultVNodes.push(itemInstance.scope.vnode as VNode);\n } else {\n // Exists: check if item changed (by identity)\n recordBenchEvent('itemReused');\n const itemChanged = existing.item !== item;\n const indexChanged =\n existing.indexSignal._hasBeenRead && existing.indexSignal.peek() !== i;\n\n if (itemChanged) {\n moveOnly = false;\n updateItemInstance(forState, existing, item);\n }\n\n if (indexChanged) {\n // Index changed: update index signal (triggers re-render if index is used)\n existing.indexSignal.set(i);\n }\n\n newOrderedItems.push(existing);\n resultVNodes.push(existing.scope.vnode as VNode);\n }\n }\n\n // Remove deleted items\n for (const key of toRemove) {\n moveOnly = false;\n const itemInstance = items.get(key);\n if (itemInstance) {\n disposeItemInstance(forState, itemInstance, 'none');\n items.delete(key);\n }\n }\n\n forState.orderedKeys = newOrderedKeys;\n forState.orderedItems = newOrderedItems;\n\n // Record reconcile timing\n if (BENCH_BUILD_ENABLED) {\n recordBenchTiming('reconcile', performance.now() - reconcileStartMs);\n flushBenchMetrics();\n }\n\n forState.orderedVNodes = resultVNodes;\n forState.pendingDirtyIndices = null;\n forState.pendingSwapIndices = null;\n forState.pendingMoveOnly = moveOnly;\n\n return resultVNodes;\n}\n\nexport function evaluateForState<T>(forState: ForState<T>): VNode[] {\n if (!Array.isArray(forState.currentItems)) {\n throw new Error('For source must evaluate to an array');\n }\n\n forState._needsSourceReconcile = false;\n return reconcileForItems(forState, forState.currentItems);\n}\n\nexport function clearForDomUpdateState<T>(forState: ForState<T>): void {\n const dirtyIndices = forState.pendingDirtyIndices;\n if (dirtyIndices && dirtyIndices.length > 0) {\n for (let i = 0; i < dirtyIndices.length; i++) {\n const itemInstance = forState.orderedItems[dirtyIndices[i]];\n if (itemInstance) {\n itemInstance.scope.needsDomUpdate = false;\n }\n }\n } else {\n for (let i = 0; i < forState.orderedKeys.length; i++) {\n const key = forState.orderedKeys[i];\n const itemInstance = forState.items.get(key);\n if (itemInstance) {\n itemInstance.scope.needsDomUpdate = false;\n }\n }\n }\n\n if (forState.fallbackScope) {\n forState.fallbackScope.needsDomUpdate = false;\n }\n forState.lastRemovedNodes = [];\n forState.pendingDirtyIndices = null;\n forState.pendingSwapIndices = null;\n forState.pendingMoveOnly = false;\n forState._needsSourceReconcile = false;\n forState._hasResolvedItemDom = forState.orderedKeys.length > 0;\n}\n"],"mappings":";;;;;;;;;;;;;AAwCA,MAAM,sBAAsB,qBAAqB;AA0EjD,MAAM,4BAAY,IAAI,SAGnB;AAEH,SAAS,YACP,UACgC;CAChC,IAAI,QAAQ,UAAU,IAAI,SAAS;CACnC,IAAI,CAAC,OAAO;EACV,wBAAQ,IAAI,KAAK;EACjB,UAAU,IAAI,UAAU,MAAM;;CAEhC,OAAO;;AAGT,SAAgB,eACd,YACA,MACA,UACA,UACa;CACb,MAAM,iBAAiB,oBAAoB;CAE3C,OAAO;EACL,MAAM;EACN,cAAc,EAAE;EAChB;EACA;EACA,eAAe;EACf,uBAAO,IAAI,KAAK;EAChB,aAAa,EAAE;EACf,cAAc,EAAE;EAChB,eAAe,EAAE;EACjB;EACA;EACA;EACA,oBAAoB;EACpB,kBAAkB,EAAE;EACpB,qBAAqB;EACrB,oBAAoB;EACpB,iBAAiB;EACjB,qBAAqB;EACrB,uBAAuB;EACvB,eAAe;EACf,sBAAsB;EACtB,wBAAwB;EACxB,2BAA2B;EAC5B;;AAGH,SAAgB,YACd,YACA,MACA,UACA,UACa;CACb,MAAM,WAAW,oBAAoB;CACrC,IAAI,CAAC,UACH,MAAM,IAAI,MACR,6DACD;CAGH,MAAM,YAAY,eAAe,UAAU,MAAM;CACjD,MAAM,QAAQ,YAAY,SAAS;CACnC,MAAM,WAAW,MAAM,IAAI,UAAU;CAErC,IAAI,UAAU;EACZ,SAAS,aAAa;EACtB,SAAS,OAAO;EAChB,SAAS,WAAW;EACpB,SAAS,WAAW;EACpB,OAAO;;CAGT,MAAM,UAAU,eAAe,YAAY,MAAM,UAAU,SAAS;CACpE,MAAM,IAAI,WA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S,sBAAsB;CAC/B,SAAS,qBAAqB;CAC9B,SAAS,kBAAkB;CAE3B,OAAO;;AAGT,SAAgB,iBAAoB,UAAgC;CAClE,IAAI,CAAC,MAAM,QAAQ,SAAS,aAAa,EACvC,MAAM,IAAI,MAAM,uCAAuC;CAGzD,SAAS,wBAAwB;CACjC,OAAO,kBAAkB,UAAU,SAAS,aAAa;;AAG3D,SAAgB,uBAA0B,UAA6B;CACrE,MAAM,eAAe,SAAS;CAC9B,IAAI,gBAAgB,aAAa,SAAS,GACxC,KAAK,IAAI,IAAI,GAAG,IAAI,aAAa,QAAQ,KAAK;EAC5C,MAAM,eAAe,SAAS,aAAa,aAAa;EACxD,IAAI,cACF,aAAa,MAAM,iBAAiB;;MAIxC,KAAK,IAAI,IAAI,GAAG,IAAI,SAAS,YAAY,QAAQ,KAAK;EACpD,MAAM,MAAM,SAAS,YAAY;EACjC,MAAM,eAAe,SAAS,MAAM,IAAI,IAAI;EAC5C,IAAI,cACF,aAAa,MAAM,iBAAiB;;CAK1C,IAAI,SAAS,eACX,SAAS,cAAc,iBAAiB;CAE1C,SAAS,mBAAmB,EAAE;CAC9B,SAAS,sBAAsB;CAC/B,SAAS,qBAAqB;CAC9B,SAAS,kBAAkB;CAC3B,SAAS,wBAAwB;CACjC,SAAS,sBAAsB,SAAS,YAAY,SAAS"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operations.d.ts","names":[],"sources":["../../src/runtime/operations.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"operations.d.ts","names":[],"sources":["../../src/runtime/operations.ts"],"mappings":";UAaiB,cAAA;EACf,KAAA,EAAO,CAAA;EACP,OAAA;EACA,KAAA,EAAO,KAAA;EACP,OAAA;AAAA;;;;;;;;;AAaF;;iBAAgB,QAAA,GAAA,CACd,EAAA,GAAK,IAAA;EAAQ,MAAA,EAAQ,WAAA;AAAA,MAAkB,OAAA,CAAQ,CAAA,IAAK,CAAA,EACpD,IAAA,eACC,cAAA,CAAe,CAAA;AAAA,iBAsNF,EAAA,CACd,MAAA,EAAQ,WAAA,EACR,KAAA,UACA,OAAA,EAAS,aAAA;AAAA,iBAiBK,KAAA,CAAM,UAAA,UAAoB,EAAA;AAAA,iBAgB1B,MAAA,GAAA,CACd,OAAA,WACA,QAAA,GAAW,MAAA;EACR,KAAA,EAAO,CAAA;EAAU,OAAA;EAAkB,KAAA,EAAO,KAAA;AAAA;AAAA,iBAK/B,IAAA,CACd,EAAA,8BAAgC,OAAA;;;;;;;;;;;iBAwBlB,OAAA,GAAA,CAAW,EAAA,QAAU,CAAA,SAAU,CAAA"}
|