@askrjs/askr 0.0.51 → 0.0.52
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/dist/bench/components/benchmark-row.d.ts +2 -2
- package/dist/bench/components/benchmark-row.js +0 -2
- package/dist/bench/components/benchmark-table.js +0 -2
- package/dist/benchmark.d.ts +1 -2
- package/dist/benchmark.js +2 -4
- package/dist/bin/askr-ssg.d.ts +1 -2
- package/dist/bin/askr-ssg.js +21 -6
- package/dist/boot/hydration.js +10 -11
- package/dist/boot/index.d.ts +1 -2
- package/dist/boot/index.js +20 -11
- package/dist/boot/root-lifecycle.d.ts +6 -3
- package/dist/boot/root-lifecycle.js +14 -10
- package/dist/boot/route-startup.js +13 -4
- package/dist/boot/types.d.ts +1 -2
- package/dist/common/attr-names.js +0 -2
- package/dist/common/component.d.ts +1 -2
- package/dist/common/control.d.ts +1 -2
- package/dist/common/control.js +0 -2
- package/dist/common/dom-range.d.ts +13 -0
- package/dist/common/env.js +1 -7
- package/dist/common/error-boundary.d.ts +1 -2
- package/dist/common/invariant.js +0 -2
- package/dist/common/jsx.d.ts +1 -2
- package/dist/common/jsx.js +0 -2
- package/dist/common/logger.js +0 -2
- package/dist/common/promise.js +0 -2
- package/dist/common/props.d.ts +1 -2
- package/dist/common/render-context.js +0 -2
- package/dist/common/route-activity.js +0 -2
- package/dist/common/router-internal.js +0 -2
- package/dist/common/router.d.ts +1 -2
- package/dist/common/ssr-errors.d.ts +1 -2
- package/dist/common/ssr-errors.js +0 -2
- package/dist/common/ssr.d.ts +1 -2
- package/dist/common/ssr.js +0 -2
- package/dist/common/vnode.d.ts +1 -2
- package/dist/common/vnode.js +0 -2
- package/dist/components/error-boundary.d.ts +1 -2
- package/dist/components/error-boundary.js +0 -2
- package/dist/components/link.d.ts +2 -2
- package/dist/components/link.js +0 -2
- package/dist/control/case.d.ts +1 -2
- package/dist/control/case.js +0 -2
- package/dist/control/for.d.ts +1 -2
- package/dist/control/for.js +0 -2
- package/dist/control/shared.d.ts +1 -2
- package/dist/control/shared.js +0 -2
- package/dist/control/show.d.ts +1 -2
- package/dist/control/show.js +0 -2
- package/dist/data/data-runtime.d.ts +1 -2
- package/dist/data/data-runtime.js +3 -5
- package/dist/data/invalidation-listeners.js +0 -2
- package/dist/data/invalidation.d.ts +1 -2
- package/dist/data/invalidation.js +0 -2
- package/dist/data/mutation-cell.d.ts +1 -2
- package/dist/data/mutation-cell.js +6 -5
- package/dist/data/query-cell.d.ts +3 -2
- package/dist/data/query-cell.js +43 -9
- package/dist/data/query-key.js +0 -2
- package/dist/data/shared.js +2 -3
- package/dist/data/types.d.ts +1 -2
- package/dist/foundations/icon/icon.d.ts +1 -2
- package/dist/foundations/icon/icon.js +0 -2
- package/dist/foundations/icon/icon.types.d.ts +1 -2
- package/dist/foundations/interactions/dismissable.d.ts +1 -2
- package/dist/foundations/interactions/dismissable.js +0 -2
- package/dist/foundations/interactions/focusable.d.ts +1 -2
- package/dist/foundations/interactions/focusable.js +0 -2
- package/dist/foundations/interactions/hoverable.d.ts +1 -2
- package/dist/foundations/interactions/hoverable.js +0 -2
- package/dist/foundations/interactions/interaction-policy.d.ts +1 -2
- package/dist/foundations/interactions/interaction-policy.js +0 -2
- package/dist/foundations/interactions/pressable.d.ts +1 -2
- package/dist/foundations/interactions/pressable.js +0 -2
- package/dist/foundations/interactions/roving-focus.d.ts +1 -2
- package/dist/foundations/interactions/roving-focus.js +0 -2
- package/dist/foundations/state/controllable.d.ts +1 -2
- package/dist/foundations/state/controllable.js +0 -2
- package/dist/foundations/structures/collection.d.ts +1 -2
- package/dist/foundations/structures/collection.js +0 -2
- package/dist/foundations/structures/layer.d.ts +1 -2
- package/dist/foundations/structures/layer.js +0 -2
- package/dist/foundations/structures/layout.d.ts +1 -2
- package/dist/foundations/structures/layout.js +0 -2
- package/dist/foundations/structures/presence.d.ts +1 -2
- package/dist/foundations/structures/presence.js +0 -2
- package/dist/foundations/structures/slot.d.ts +1 -2
- package/dist/foundations/structures/slot.js +0 -2
- package/dist/foundations/utilities/aria.d.ts +1 -2
- package/dist/foundations/utilities/aria.js +0 -2
- package/dist/foundations/utilities/compose-handlers.d.ts +1 -2
- package/dist/foundations/utilities/compose-handlers.js +0 -2
- package/dist/foundations/utilities/compose-ref.d.ts +1 -2
- package/dist/foundations/utilities/compose-ref.js +0 -2
- package/dist/foundations/utilities/event-types.d.ts +1 -2
- package/dist/foundations/utilities/merge-props.d.ts +1 -2
- package/dist/foundations/utilities/merge-props.js +0 -2
- package/dist/foundations/utilities/use-id.d.ts +1 -2
- package/dist/foundations/utilities/use-id.js +0 -2
- package/dist/fx/fx.d.ts +1 -2
- package/dist/fx/fx.js +0 -2
- package/dist/fx/noop.js +0 -2
- package/dist/fx/timing.d.ts +1 -2
- package/dist/fx/timing.js +0 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +0 -2
- package/dist/jsx/types.d.ts +1 -2
- package/dist/jsx/utils.d.ts +1 -2
- package/dist/jsx/utils.js +0 -2
- package/dist/jsx-dev-runtime.d.ts +16 -2
- package/dist/jsx-dev-runtime.js +3 -12
- package/dist/jsx-runtime.d.ts +16 -2
- package/dist/jsx-runtime.js +15 -24
- package/dist/jsx-runtime2.d.ts +1 -1
- package/dist/renderer/attributes.js +28 -6
- package/dist/renderer/boundaries.js +48 -172
- package/dist/renderer/boundary-materialization.js +72 -0
- package/dist/renderer/boundary-range-adoption.js +76 -0
- package/dist/renderer/boundary-range-sync.js +101 -0
- package/dist/renderer/boundary-state.js +50 -0
- package/dist/renderer/child-shape.js +0 -2
- package/dist/renderer/children-fastpath.js +3 -3
- package/dist/renderer/children.js +0 -2
- package/dist/renderer/cleanup.js +70 -13
- package/dist/renderer/component-host-cleanup.js +123 -48
- package/dist/renderer/component-host-instances.js +59 -8
- package/dist/renderer/component-host-replacement.js +105 -0
- package/dist/renderer/component-host-results.js +138 -0
- package/dist/renderer/component-host.js +94 -169
- package/dist/renderer/dom-host.js +0 -2
- package/dist/renderer/dom-internal.js +110 -53
- package/dist/renderer/dom-range.js +161 -0
- package/dist/renderer/dom.js +5 -4
- package/dist/renderer/element-children.js +112 -32
- package/dist/renderer/error-boundary-dom.js +19 -11
- package/dist/renderer/evaluate-dom-range.js +3 -4
- package/dist/renderer/evaluate-reconcile.js +12 -37
- package/dist/renderer/evaluate.js +14 -3
- package/dist/renderer/fastpath.js +4 -12
- package/dist/renderer/for-commit-dom-map.js +6 -18
- package/dist/renderer/for-commit-removal.js +7 -16
- package/dist/renderer/for-commit-reorder.js +0 -2
- package/dist/renderer/for-commit.js +172 -44
- package/dist/renderer/hydration-boundaries.js +60 -0
- package/dist/renderer/hydration-listener-transaction.js +49 -0
- package/dist/renderer/index.js +8 -7
- package/dist/renderer/intrinsic-blueprint-analysis.js +202 -0
- package/dist/renderer/intrinsic-blueprint-bindings.js +152 -0
- package/dist/renderer/intrinsic-blueprint-materialization.js +100 -0
- package/dist/renderer/intrinsic-blueprint.js +30 -0
- package/dist/renderer/intrinsic-hydration-adoption.js +66 -0
- package/dist/renderer/keyed-children.js +3 -9
- package/dist/renderer/keyed.js +10 -10
- package/dist/renderer/namespaces.js +0 -2
- package/dist/renderer/prop-bindings.js +56 -21
- package/dist/renderer/reactive-child-dom.js +10 -4
- package/dist/renderer/reactive-child-sources.js +0 -2
- package/dist/renderer/reactive-children.js +29 -20
- package/dist/renderer/reconcile-commit.js +0 -2
- package/dist/renderer/reconcile-fastpaths.js +4 -11
- package/dist/renderer/reconcile-resolution.js +31 -55
- package/dist/renderer/reconcile.js +0 -2
- package/dist/renderer/retained-element-rollback.js +159 -148
- package/dist/renderer/stable-patch.js +3 -4
- package/dist/renderer/static-reuse.js +0 -2
- package/dist/renderer/utils.js +18 -9
- package/dist/router/access.js +0 -2
- package/dist/router/activity.d.ts +1 -2
- package/dist/router/activity.js +0 -2
- package/dist/router/authoring.d.ts +1 -2
- package/dist/router/authoring.js +0 -2
- package/dist/router/internal-types.d.ts +1 -2
- package/dist/router/lazy.d.ts +1 -2
- package/dist/router/lazy.js +0 -2
- package/dist/router/manifest.d.ts +1 -2
- package/dist/router/manifest.js +0 -2
- package/dist/router/match.js +0 -2
- package/dist/router/navigate.d.ts +1 -2
- package/dist/router/navigate.js +4 -7
- package/dist/router/navigation-registry.d.ts +1 -2
- package/dist/router/navigation-registry.js +0 -2
- package/dist/router/navigation-scroll.d.ts +1 -2
- package/dist/router/navigation-scroll.js +0 -2
- package/dist/router/navigation-targets.d.ts +3 -4
- package/dist/router/navigation-targets.js +419 -40
- package/dist/router/policy.d.ts +1 -2
- package/dist/router/policy.js +0 -2
- package/dist/router/rendering.d.ts +1 -2
- package/dist/router/rendering.js +4 -3
- package/dist/router/resolution.d.ts +1 -2
- package/dist/router/resolution.js +0 -2
- package/dist/router/route-context.js +0 -2
- package/dist/router/route-matching.d.ts +1 -2
- package/dist/router/route-matching.js +0 -2
- package/dist/router/route-query.d.ts +1 -2
- package/dist/router/route-query.js +1 -3
- package/dist/router/store.d.ts +1 -2
- package/dist/router/store.js +0 -2
- package/dist/runtime/access.d.ts +1 -2
- package/dist/runtime/access.js +0 -2
- package/dist/runtime/child-scope.d.ts +21 -2
- package/dist/runtime/child-scope.js +101 -54
- package/dist/runtime/component-cleanup.d.ts +1 -2
- package/dist/runtime/component-cleanup.js +2 -4
- package/dist/runtime/component-commit.js +25 -23
- package/dist/runtime/component-facade.js +5 -3
- package/dist/runtime/component-internal.d.ts +11 -6
- package/dist/runtime/component-internal.js +63 -45
- package/dist/runtime/component-lifecycle.d.ts +2 -41
- package/dist/runtime/component-lifecycle.js +6 -149
- package/dist/runtime/component-scope.d.ts +3 -4
- package/dist/runtime/component-scope.js +27 -8
- package/dist/runtime/component.js +4 -3
- package/dist/runtime/context.d.ts +5 -2
- package/dist/runtime/context.js +29 -3
- package/dist/runtime/control.d.ts +22 -3
- package/dist/runtime/control.js +168 -55
- package/dist/runtime/derive.d.ts +1 -2
- package/dist/runtime/derive.js +0 -2
- package/dist/runtime/dev-namespace.d.ts +5 -6
- package/dist/runtime/dev-namespace.js +32 -25
- package/dist/runtime/effect.d.ts +8 -5
- package/dist/runtime/effect.js +158 -75
- package/dist/runtime/error-boundary.d.ts +1 -2
- package/dist/runtime/error-boundary.js +0 -2
- package/dist/runtime/events.d.ts +3 -3
- package/dist/runtime/events.js +66 -69
- package/dist/runtime/execution-model.d.ts +1 -2
- package/dist/runtime/execution-model.js +0 -2
- package/dist/runtime/fastlane.d.ts +1 -2
- package/dist/runtime/fastlane.js +0 -2
- package/dist/runtime/for-bench.d.ts +1 -2
- package/dist/runtime/for-bench.js +9 -167
- package/dist/runtime/for-internal.d.ts +68 -5
- package/dist/runtime/for-internal.js +201 -14
- package/dist/runtime/for-reconcile.d.ts +1 -2
- package/dist/runtime/for-reconcile.js +76 -23
- package/dist/runtime/for-scopes.d.ts +5 -5
- package/dist/runtime/for-scopes.js +168 -48
- package/dist/runtime/for-signals.d.ts +13 -4
- package/dist/runtime/for-signals.js +155 -81
- package/dist/runtime/for-types.d.ts +1 -2
- package/dist/runtime/for.d.ts +2 -2
- package/dist/runtime/for.js +3 -3
- package/dist/runtime/index.d.ts +5 -5
- package/dist/runtime/index.js +12 -10
- package/dist/runtime/lifecycle-batch.d.ts +59 -0
- package/dist/runtime/lifecycle-batch.js +178 -0
- package/dist/runtime/lifecycle-operation-settlement.d.ts +5 -0
- package/dist/runtime/lifecycle-operation-settlement.js +51 -0
- package/dist/runtime/lifecycle-operations.d.ts +1 -2
- package/dist/runtime/lifecycle-operations.js +5 -6
- package/dist/runtime/perf-metrics.d.ts +8 -7
- package/dist/runtime/perf-metrics.js +4 -68
- package/dist/runtime/portal.d.ts +1 -2
- package/dist/runtime/portal.js +103 -11
- package/dist/runtime/readable.d.ts +9 -4
- package/dist/runtime/readable.js +41 -17
- package/dist/runtime/resource-cell.js +2 -4
- package/dist/runtime/resource-operation.d.ts +1 -2
- package/dist/runtime/resource-operation.js +37 -34
- package/dist/runtime/runtime.d.ts +1 -2
- package/dist/runtime/runtime.js +0 -2
- package/dist/runtime/scheduler.d.ts +1 -2
- package/dist/runtime/scheduler.js +8 -11
- package/dist/runtime/selector-store.js +0 -2
- package/dist/runtime/selector.d.ts +1 -2
- package/dist/runtime/selector.js +3 -11
- package/dist/runtime/snapshot-source.d.ts +1 -2
- package/dist/runtime/snapshot-source.js +0 -2
- package/dist/runtime/state.d.ts +1 -2
- package/dist/runtime/state.js +1 -3
- package/dist/ssg/batch-render.js +0 -2
- package/dist/ssg/create-static-gen.d.ts +4 -2
- package/dist/ssg/create-static-gen.js +65 -14
- package/dist/ssg/generate-metadata.js +0 -2
- package/dist/ssg/generation-plan.js +0 -2
- package/dist/ssg/incremental-manifest.js +1 -3
- package/dist/ssg/resolve-ssg-data.js +0 -2
- package/dist/ssg/route-utils.js +0 -2
- package/dist/ssg/static-routes.js +0 -2
- package/dist/ssg/types.d.ts +2 -3
- package/dist/ssg/write-static-files.js +16 -12
- package/dist/ssr/attrs.js +0 -2
- package/dist/ssr/boundaries.js +16 -5
- package/dist/ssr/component-runtime.js +1 -27
- package/dist/ssr/context.d.ts +1 -2
- package/dist/ssr/context.js +0 -2
- package/dist/ssr/errors.d.ts +1 -2
- package/dist/ssr/errors.js +0 -2
- package/dist/ssr/escape.js +0 -2
- package/dist/ssr/hydration-data.js +0 -2
- package/dist/ssr/hydration-verify.d.ts +1 -2
- package/dist/ssr/hydration-verify.js +34 -7
- package/dist/ssr/index-internal.d.ts +1 -2
- package/dist/ssr/index-internal.js +0 -2
- package/dist/ssr/render-keys.js +0 -2
- package/dist/ssr/render-resolved.d.ts +1 -2
- package/dist/ssr/render-resolved.js +0 -2
- package/dist/ssr/render-sync.d.ts +1 -2
- package/dist/ssr/render-sync.js +27 -19
- package/dist/ssr/route-policy-resolution.js +0 -2
- package/dist/ssr/route-render.d.ts +1 -2
- package/dist/ssr/route-render.js +0 -2
- package/dist/ssr/sink.d.ts +1 -2
- package/dist/ssr/sink.js +0 -2
- package/dist/ssr/types.d.ts +1 -2
- package/dist/ssr/verify-hydration.js +0 -2
- package/dist/testing/index.d.ts +1 -2
- package/dist/testing/index.js +0 -2
- package/package.json +57 -44
- package/dist/bench/components/benchmark-row.d.ts.map +0 -1
- package/dist/bench/components/benchmark-row.js.map +0 -1
- package/dist/bench/components/benchmark-table.js.map +0 -1
- package/dist/benchmark.d.ts.map +0 -1
- package/dist/benchmark.js.map +0 -1
- package/dist/bin/askr-ssg.d.ts.map +0 -1
- package/dist/bin/askr-ssg.js.map +0 -1
- package/dist/boot/hydration.js.map +0 -1
- package/dist/boot/index.d.ts.map +0 -1
- package/dist/boot/index.js.map +0 -1
- package/dist/boot/root-lifecycle.d.ts.map +0 -1
- package/dist/boot/root-lifecycle.js.map +0 -1
- package/dist/boot/route-startup.js.map +0 -1
- package/dist/boot/types.d.ts.map +0 -1
- package/dist/common/attr-names.js.map +0 -1
- package/dist/common/component.d.ts.map +0 -1
- package/dist/common/control.d.ts.map +0 -1
- package/dist/common/control.js.map +0 -1
- package/dist/common/env.js.map +0 -1
- package/dist/common/error-boundary.d.ts.map +0 -1
- package/dist/common/invariant.js.map +0 -1
- package/dist/common/jsx.d.ts.map +0 -1
- package/dist/common/jsx.js.map +0 -1
- package/dist/common/logger.js.map +0 -1
- package/dist/common/promise.js.map +0 -1
- package/dist/common/props.d.ts.map +0 -1
- package/dist/common/render-context.js.map +0 -1
- package/dist/common/route-activity.js.map +0 -1
- package/dist/common/router-internal.js.map +0 -1
- package/dist/common/router.d.ts.map +0 -1
- package/dist/common/ssr-errors.d.ts.map +0 -1
- package/dist/common/ssr-errors.js.map +0 -1
- package/dist/common/ssr.d.ts.map +0 -1
- package/dist/common/ssr.js.map +0 -1
- package/dist/common/vnode.d.ts.map +0 -1
- package/dist/common/vnode.js.map +0 -1
- package/dist/components/error-boundary.d.ts.map +0 -1
- package/dist/components/error-boundary.js.map +0 -1
- package/dist/components/link.d.ts.map +0 -1
- package/dist/components/link.js.map +0 -1
- package/dist/control/case.d.ts.map +0 -1
- package/dist/control/case.js.map +0 -1
- package/dist/control/for.d.ts.map +0 -1
- package/dist/control/for.js.map +0 -1
- package/dist/control/shared.d.ts.map +0 -1
- package/dist/control/shared.js.map +0 -1
- package/dist/control/show.d.ts.map +0 -1
- package/dist/control/show.js.map +0 -1
- package/dist/data/data-runtime.d.ts.map +0 -1
- package/dist/data/data-runtime.js.map +0 -1
- package/dist/data/invalidation-listeners.js.map +0 -1
- package/dist/data/invalidation.d.ts.map +0 -1
- package/dist/data/invalidation.js.map +0 -1
- package/dist/data/mutation-cell.d.ts.map +0 -1
- package/dist/data/mutation-cell.js.map +0 -1
- package/dist/data/query-cell.d.ts.map +0 -1
- package/dist/data/query-cell.js.map +0 -1
- package/dist/data/query-key.js.map +0 -1
- package/dist/data/shared.js.map +0 -1
- package/dist/data/types.d.ts.map +0 -1
- package/dist/foundations/icon/icon.d.ts.map +0 -1
- package/dist/foundations/icon/icon.js.map +0 -1
- package/dist/foundations/icon/icon.types.d.ts.map +0 -1
- package/dist/foundations/interactions/dismissable.d.ts.map +0 -1
- package/dist/foundations/interactions/dismissable.js.map +0 -1
- package/dist/foundations/interactions/focusable.d.ts.map +0 -1
- package/dist/foundations/interactions/focusable.js.map +0 -1
- package/dist/foundations/interactions/hoverable.d.ts.map +0 -1
- package/dist/foundations/interactions/hoverable.js.map +0 -1
- package/dist/foundations/interactions/interaction-policy.d.ts.map +0 -1
- package/dist/foundations/interactions/interaction-policy.js.map +0 -1
- package/dist/foundations/interactions/pressable.d.ts.map +0 -1
- package/dist/foundations/interactions/pressable.js.map +0 -1
- package/dist/foundations/interactions/roving-focus.d.ts.map +0 -1
- package/dist/foundations/interactions/roving-focus.js.map +0 -1
- package/dist/foundations/state/controllable.d.ts.map +0 -1
- package/dist/foundations/state/controllable.js.map +0 -1
- package/dist/foundations/structures/collection.d.ts.map +0 -1
- package/dist/foundations/structures/collection.js.map +0 -1
- package/dist/foundations/structures/layer.d.ts.map +0 -1
- package/dist/foundations/structures/layer.js.map +0 -1
- package/dist/foundations/structures/layout.d.ts.map +0 -1
- package/dist/foundations/structures/layout.js.map +0 -1
- package/dist/foundations/structures/presence.d.ts.map +0 -1
- package/dist/foundations/structures/presence.js.map +0 -1
- package/dist/foundations/structures/slot.d.ts.map +0 -1
- package/dist/foundations/structures/slot.js.map +0 -1
- package/dist/foundations/utilities/aria.d.ts.map +0 -1
- package/dist/foundations/utilities/aria.js.map +0 -1
- package/dist/foundations/utilities/compose-handlers.d.ts.map +0 -1
- package/dist/foundations/utilities/compose-handlers.js.map +0 -1
- package/dist/foundations/utilities/compose-ref.d.ts.map +0 -1
- package/dist/foundations/utilities/compose-ref.js.map +0 -1
- package/dist/foundations/utilities/event-types.d.ts.map +0 -1
- package/dist/foundations/utilities/merge-props.d.ts.map +0 -1
- package/dist/foundations/utilities/merge-props.js.map +0 -1
- package/dist/foundations/utilities/use-id.d.ts.map +0 -1
- package/dist/foundations/utilities/use-id.js.map +0 -1
- package/dist/fx/fx.d.ts.map +0 -1
- package/dist/fx/fx.js.map +0 -1
- package/dist/fx/noop.js.map +0 -1
- package/dist/fx/timing.d.ts.map +0 -1
- package/dist/fx/timing.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/jsx/types.d.ts.map +0 -1
- package/dist/jsx/utils.d.ts.map +0 -1
- package/dist/jsx/utils.js.map +0 -1
- package/dist/jsx-dev-runtime.d.ts.map +0 -1
- package/dist/jsx-dev-runtime.js.map +0 -1
- package/dist/jsx-runtime.d.ts.map +0 -1
- package/dist/jsx-runtime.js.map +0 -1
- package/dist/renderer/attributes.js.map +0 -1
- package/dist/renderer/boundaries.js.map +0 -1
- package/dist/renderer/child-shape.js.map +0 -1
- package/dist/renderer/children-fastpath.js.map +0 -1
- package/dist/renderer/children.js.map +0 -1
- package/dist/renderer/cleanup.js.map +0 -1
- package/dist/renderer/component-host-cleanup.js.map +0 -1
- package/dist/renderer/component-host-instances.js.map +0 -1
- package/dist/renderer/component-host.js.map +0 -1
- package/dist/renderer/dom-host.js.map +0 -1
- package/dist/renderer/dom-internal.js.map +0 -1
- package/dist/renderer/element-children.js.map +0 -1
- package/dist/renderer/error-boundary-dom.js.map +0 -1
- package/dist/renderer/evaluate-dom-range.js.map +0 -1
- package/dist/renderer/evaluate-reconcile.js.map +0 -1
- package/dist/renderer/evaluate.js.map +0 -1
- package/dist/renderer/fastpath.js.map +0 -1
- package/dist/renderer/for-commit-dom-map.js.map +0 -1
- package/dist/renderer/for-commit-removal.js.map +0 -1
- package/dist/renderer/for-commit-reorder.js.map +0 -1
- package/dist/renderer/for-commit.js.map +0 -1
- package/dist/renderer/index.js.map +0 -1
- package/dist/renderer/keyed-children.js.map +0 -1
- package/dist/renderer/keyed.js.map +0 -1
- package/dist/renderer/namespaces.js.map +0 -1
- package/dist/renderer/prop-bindings.js.map +0 -1
- package/dist/renderer/reactive-child-dom.js.map +0 -1
- package/dist/renderer/reactive-child-sources.js.map +0 -1
- package/dist/renderer/reactive-children.js.map +0 -1
- package/dist/renderer/reconcile-commit.js.map +0 -1
- package/dist/renderer/reconcile-fastpaths.js.map +0 -1
- package/dist/renderer/reconcile-resolution.js.map +0 -1
- package/dist/renderer/reconcile.js.map +0 -1
- package/dist/renderer/retained-element-rollback.js.map +0 -1
- package/dist/renderer/stable-patch.js.map +0 -1
- package/dist/renderer/static-reuse.js.map +0 -1
- package/dist/renderer/utils.js.map +0 -1
- package/dist/router/access.js.map +0 -1
- package/dist/router/activity.d.ts.map +0 -1
- package/dist/router/activity.js.map +0 -1
- package/dist/router/authoring.d.ts.map +0 -1
- package/dist/router/authoring.js.map +0 -1
- package/dist/router/internal-types.d.ts.map +0 -1
- package/dist/router/lazy.d.ts.map +0 -1
- package/dist/router/lazy.js.map +0 -1
- package/dist/router/manifest.d.ts.map +0 -1
- package/dist/router/manifest.js.map +0 -1
- package/dist/router/match.js.map +0 -1
- package/dist/router/navigate.d.ts.map +0 -1
- package/dist/router/navigate.js.map +0 -1
- package/dist/router/navigation-registry.d.ts.map +0 -1
- package/dist/router/navigation-registry.js.map +0 -1
- package/dist/router/navigation-scroll.d.ts.map +0 -1
- package/dist/router/navigation-scroll.js.map +0 -1
- package/dist/router/navigation-targets.d.ts.map +0 -1
- package/dist/router/navigation-targets.js.map +0 -1
- package/dist/router/policy.d.ts.map +0 -1
- package/dist/router/policy.js.map +0 -1
- package/dist/router/rendering.d.ts.map +0 -1
- package/dist/router/rendering.js.map +0 -1
- package/dist/router/resolution.d.ts.map +0 -1
- package/dist/router/resolution.js.map +0 -1
- package/dist/router/route-context.js.map +0 -1
- package/dist/router/route-matching.d.ts.map +0 -1
- package/dist/router/route-matching.js.map +0 -1
- package/dist/router/route-query.d.ts.map +0 -1
- package/dist/router/route-query.js.map +0 -1
- package/dist/router/store.d.ts.map +0 -1
- package/dist/router/store.js.map +0 -1
- package/dist/runtime/access.d.ts.map +0 -1
- package/dist/runtime/access.js.map +0 -1
- package/dist/runtime/child-scope.d.ts.map +0 -1
- package/dist/runtime/child-scope.js.map +0 -1
- package/dist/runtime/component-cleanup.d.ts.map +0 -1
- package/dist/runtime/component-cleanup.js.map +0 -1
- package/dist/runtime/component-commit.js.map +0 -1
- package/dist/runtime/component-internal.d.ts.map +0 -1
- package/dist/runtime/component-internal.js.map +0 -1
- package/dist/runtime/component-lifecycle.d.ts.map +0 -1
- package/dist/runtime/component-lifecycle.js.map +0 -1
- package/dist/runtime/component-scope.d.ts.map +0 -1
- package/dist/runtime/component-scope.js.map +0 -1
- package/dist/runtime/context.d.ts.map +0 -1
- package/dist/runtime/context.js.map +0 -1
- package/dist/runtime/control.d.ts.map +0 -1
- package/dist/runtime/control.js.map +0 -1
- package/dist/runtime/derive.d.ts.map +0 -1
- package/dist/runtime/derive.js.map +0 -1
- package/dist/runtime/dev-namespace.d.ts.map +0 -1
- package/dist/runtime/dev-namespace.js.map +0 -1
- package/dist/runtime/effect.d.ts.map +0 -1
- package/dist/runtime/effect.js.map +0 -1
- package/dist/runtime/error-boundary.d.ts.map +0 -1
- package/dist/runtime/error-boundary.js.map +0 -1
- package/dist/runtime/events.d.ts.map +0 -1
- package/dist/runtime/events.js.map +0 -1
- package/dist/runtime/execution-model.d.ts.map +0 -1
- package/dist/runtime/execution-model.js.map +0 -1
- package/dist/runtime/fastlane.d.ts.map +0 -1
- package/dist/runtime/fastlane.js.map +0 -1
- package/dist/runtime/for-bench.d.ts.map +0 -1
- package/dist/runtime/for-bench.js.map +0 -1
- package/dist/runtime/for-internal.d.ts.map +0 -1
- package/dist/runtime/for-internal.js.map +0 -1
- package/dist/runtime/for-reconcile.d.ts.map +0 -1
- package/dist/runtime/for-reconcile.js.map +0 -1
- package/dist/runtime/for-scopes.d.ts.map +0 -1
- package/dist/runtime/for-scopes.js.map +0 -1
- package/dist/runtime/for-signals.d.ts.map +0 -1
- package/dist/runtime/for-signals.js.map +0 -1
- package/dist/runtime/for-types.d.ts.map +0 -1
- package/dist/runtime/lifecycle-operations.d.ts.map +0 -1
- package/dist/runtime/lifecycle-operations.js.map +0 -1
- package/dist/runtime/perf-metrics.d.ts.map +0 -1
- package/dist/runtime/perf-metrics.js.map +0 -1
- package/dist/runtime/portal.d.ts.map +0 -1
- package/dist/runtime/portal.js.map +0 -1
- package/dist/runtime/readable.d.ts.map +0 -1
- package/dist/runtime/readable.js.map +0 -1
- package/dist/runtime/resource-cell.js.map +0 -1
- package/dist/runtime/resource-operation.d.ts.map +0 -1
- package/dist/runtime/resource-operation.js.map +0 -1
- package/dist/runtime/runtime.d.ts.map +0 -1
- package/dist/runtime/runtime.js.map +0 -1
- package/dist/runtime/scheduler.d.ts.map +0 -1
- package/dist/runtime/scheduler.js.map +0 -1
- package/dist/runtime/selector-store.js.map +0 -1
- package/dist/runtime/selector.d.ts.map +0 -1
- package/dist/runtime/selector.js.map +0 -1
- package/dist/runtime/snapshot-source.d.ts.map +0 -1
- package/dist/runtime/snapshot-source.js.map +0 -1
- package/dist/runtime/state.d.ts.map +0 -1
- package/dist/runtime/state.js.map +0 -1
- package/dist/ssg/batch-render.js.map +0 -1
- package/dist/ssg/create-static-gen.d.ts.map +0 -1
- package/dist/ssg/create-static-gen.js.map +0 -1
- package/dist/ssg/generate-metadata.js.map +0 -1
- package/dist/ssg/generation-plan.js.map +0 -1
- package/dist/ssg/incremental-manifest.js.map +0 -1
- package/dist/ssg/resolve-ssg-data.js.map +0 -1
- package/dist/ssg/route-utils.js.map +0 -1
- package/dist/ssg/static-routes.js.map +0 -1
- package/dist/ssg/types.d.ts.map +0 -1
- package/dist/ssg/write-static-files.js.map +0 -1
- package/dist/ssr/attrs.js.map +0 -1
- package/dist/ssr/boundaries.js.map +0 -1
- package/dist/ssr/component-runtime.js.map +0 -1
- package/dist/ssr/context.d.ts.map +0 -1
- package/dist/ssr/context.js.map +0 -1
- package/dist/ssr/errors.d.ts.map +0 -1
- package/dist/ssr/errors.js.map +0 -1
- package/dist/ssr/escape.js.map +0 -1
- package/dist/ssr/hydration-data.js.map +0 -1
- package/dist/ssr/hydration-verify.d.ts.map +0 -1
- package/dist/ssr/hydration-verify.js.map +0 -1
- package/dist/ssr/index-internal.d.ts.map +0 -1
- package/dist/ssr/index-internal.js.map +0 -1
- package/dist/ssr/render-keys.js.map +0 -1
- package/dist/ssr/render-resolved.d.ts.map +0 -1
- package/dist/ssr/render-resolved.js.map +0 -1
- package/dist/ssr/render-sync.d.ts.map +0 -1
- package/dist/ssr/render-sync.js.map +0 -1
- package/dist/ssr/route-policy-resolution.js.map +0 -1
- package/dist/ssr/route-render.d.ts.map +0 -1
- package/dist/ssr/route-render.js.map +0 -1
- package/dist/ssr/sink.d.ts.map +0 -1
- package/dist/ssr/sink.js.map +0 -1
- package/dist/ssr/types.d.ts.map +0 -1
- package/dist/ssr/verify-hydration.js.map +0 -1
- package/dist/testing/index.d.ts.map +0 -1
- package/dist/testing/index.js.map +0 -1
|
@@ -1,171 +1,13 @@
|
|
|
1
|
-
import { isRuntimeEnvFlagEnabled } from "../common/env.js";
|
|
2
1
|
//#region src/runtime/for-bench.ts
|
|
3
|
-
const BENCH_BUILD_ENABLED =
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
keyHits: 0,
|
|
13
|
-
keyMisses: 0,
|
|
14
|
-
domInserts: 0,
|
|
15
|
-
domRemoves: 0,
|
|
16
|
-
domMoves: 0,
|
|
17
|
-
domAttrSets: 0,
|
|
18
|
-
domTextSets: 0,
|
|
19
|
-
domNodesCreated: 0,
|
|
20
|
-
listenerBindings: 0,
|
|
21
|
-
reactivePropsMounted: 0,
|
|
22
|
-
replaceChildrenCommits: 0,
|
|
23
|
-
bulkClearCommits: 0,
|
|
24
|
-
reconcilePhaseMs: 0,
|
|
25
|
-
domCommitPhaseMs: 0,
|
|
26
|
-
fastLaneName: null
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
let activeBenchMetricScope = null;
|
|
30
|
-
function isBenchRuntimeEnabled() {
|
|
31
|
-
if (!BENCH_BUILD_ENABLED) return false;
|
|
32
|
-
try {
|
|
33
|
-
return !!globalThis.__ASKR_BENCH__;
|
|
34
|
-
} catch {
|
|
35
|
-
return false;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
function publishBenchMetrics(metrics) {
|
|
39
|
-
if (!isBenchRuntimeEnabled()) return;
|
|
40
|
-
globalThis.__ASKR_FOR_BENCH__ = { ...metrics };
|
|
41
|
-
}
|
|
42
|
-
const flushBenchMetricsLive = () => {
|
|
43
|
-
if (!benchMetrics) return;
|
|
44
|
-
publishBenchMetrics(benchMetrics);
|
|
45
|
-
};
|
|
46
|
-
function resetBenchMetricsLive(metrics) {
|
|
47
|
-
metrics.itemsCreated = 0;
|
|
48
|
-
metrics.itemsReused = 0;
|
|
49
|
-
metrics.itemsRemoved = 0;
|
|
50
|
-
metrics.itemsMoved = 0;
|
|
51
|
-
metrics.rowFactoryInvocations = 0;
|
|
52
|
-
metrics.keyLookups = 0;
|
|
53
|
-
metrics.keyHits = 0;
|
|
54
|
-
metrics.keyMisses = 0;
|
|
55
|
-
metrics.domInserts = 0;
|
|
56
|
-
metrics.domRemoves = 0;
|
|
57
|
-
metrics.domMoves = 0;
|
|
58
|
-
metrics.domAttrSets = 0;
|
|
59
|
-
metrics.domTextSets = 0;
|
|
60
|
-
metrics.domNodesCreated = 0;
|
|
61
|
-
metrics.listenerBindings = 0;
|
|
62
|
-
metrics.reactivePropsMounted = 0;
|
|
63
|
-
metrics.replaceChildrenCommits = 0;
|
|
64
|
-
metrics.bulkClearCommits = 0;
|
|
65
|
-
metrics.reconcilePhaseMs = 0;
|
|
66
|
-
metrics.domCommitPhaseMs = 0;
|
|
67
|
-
metrics.fastLaneName = null;
|
|
68
|
-
publishBenchMetrics(metrics);
|
|
69
|
-
}
|
|
70
|
-
const benchMetrics = BENCH_BUILD_ENABLED ? createInitialBenchMetrics() : null;
|
|
71
|
-
const recordBenchEventLive = (event, delta = 1) => {
|
|
72
|
-
if (!isBenchRuntimeEnabled() || !benchMetrics) return;
|
|
73
|
-
if (delta === 0) return;
|
|
74
|
-
switch (event) {
|
|
75
|
-
case "itemCreated":
|
|
76
|
-
benchMetrics.itemsCreated += delta;
|
|
77
|
-
break;
|
|
78
|
-
case "itemReused":
|
|
79
|
-
benchMetrics.itemsReused += delta;
|
|
80
|
-
break;
|
|
81
|
-
case "itemRemoved":
|
|
82
|
-
benchMetrics.itemsRemoved += delta;
|
|
83
|
-
break;
|
|
84
|
-
case "itemMoved":
|
|
85
|
-
benchMetrics.itemsMoved += delta;
|
|
86
|
-
break;
|
|
87
|
-
case "rowFactory":
|
|
88
|
-
benchMetrics.rowFactoryInvocations += delta;
|
|
89
|
-
break;
|
|
90
|
-
case "keyLookup":
|
|
91
|
-
benchMetrics.keyLookups += delta;
|
|
92
|
-
break;
|
|
93
|
-
case "keyHit":
|
|
94
|
-
benchMetrics.keyHits += delta;
|
|
95
|
-
break;
|
|
96
|
-
case "keyMiss":
|
|
97
|
-
benchMetrics.keyMisses += delta;
|
|
98
|
-
break;
|
|
99
|
-
case "domInsert":
|
|
100
|
-
benchMetrics.domInserts += delta;
|
|
101
|
-
break;
|
|
102
|
-
case "domRemove":
|
|
103
|
-
benchMetrics.domRemoves += delta;
|
|
104
|
-
break;
|
|
105
|
-
case "domMove":
|
|
106
|
-
benchMetrics.domMoves += delta;
|
|
107
|
-
break;
|
|
108
|
-
case "domAttrSet":
|
|
109
|
-
benchMetrics.domAttrSets += delta;
|
|
110
|
-
break;
|
|
111
|
-
case "domTextSet":
|
|
112
|
-
benchMetrics.domTextSets += delta;
|
|
113
|
-
break;
|
|
114
|
-
}
|
|
115
|
-
};
|
|
116
|
-
const recordBenchFastLaneLive = (name) => {
|
|
117
|
-
if (!isBenchRuntimeEnabled() || !benchMetrics) return;
|
|
118
|
-
benchMetrics.fastLaneName = name;
|
|
119
|
-
};
|
|
120
|
-
const recordBenchCounterLive = (counter, delta = 1) => {
|
|
121
|
-
if (!isBenchRuntimeEnabled() || !benchMetrics || delta === 0) return;
|
|
122
|
-
switch (counter) {
|
|
123
|
-
case "domNodesCreated":
|
|
124
|
-
benchMetrics.domNodesCreated += delta;
|
|
125
|
-
break;
|
|
126
|
-
case "listenerBindings":
|
|
127
|
-
benchMetrics.listenerBindings += delta;
|
|
128
|
-
break;
|
|
129
|
-
case "reactivePropsMounted":
|
|
130
|
-
benchMetrics.reactivePropsMounted += delta;
|
|
131
|
-
break;
|
|
132
|
-
case "replaceChildrenCommits":
|
|
133
|
-
benchMetrics.replaceChildrenCommits += delta;
|
|
134
|
-
break;
|
|
135
|
-
case "bulkClearCommits":
|
|
136
|
-
benchMetrics.bulkClearCommits += delta;
|
|
137
|
-
break;
|
|
138
|
-
}
|
|
139
|
-
};
|
|
140
|
-
function withBenchMetricScopeLive(scope, run) {
|
|
141
|
-
if (!isBenchRuntimeEnabled()) return run();
|
|
142
|
-
const previousScope = activeBenchMetricScope;
|
|
143
|
-
activeBenchMetricScope = scope;
|
|
144
|
-
try {
|
|
145
|
-
return run();
|
|
146
|
-
} finally {
|
|
147
|
-
activeBenchMetricScope = previousScope;
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
const isBenchMetricScopeActiveLive = (scope) => isBenchRuntimeEnabled() && activeBenchMetricScope === scope;
|
|
151
|
-
const recordBenchTimingLive = (phase, ms) => {
|
|
152
|
-
if (!isBenchRuntimeEnabled() || !benchMetrics) return;
|
|
153
|
-
if (phase === "reconcile") benchMetrics.reconcilePhaseMs = ms;
|
|
154
|
-
else benchMetrics.domCommitPhaseMs = ms;
|
|
155
|
-
};
|
|
156
|
-
const resetBenchMetrics = BENCH_BUILD_ENABLED ? () => {
|
|
157
|
-
if (!isBenchRuntimeEnabled() || !benchMetrics) return;
|
|
158
|
-
resetBenchMetricsLive(benchMetrics);
|
|
159
|
-
} : () => {};
|
|
160
|
-
const recordBenchEvent = BENCH_BUILD_ENABLED ? recordBenchEventLive : (_event) => {};
|
|
161
|
-
const recordBenchFastLane = BENCH_BUILD_ENABLED ? recordBenchFastLaneLive : (_name) => {};
|
|
162
|
-
const recordBenchTiming = BENCH_BUILD_ENABLED ? recordBenchTimingLive : (_phase, _ms) => {};
|
|
163
|
-
const recordBenchCounter = BENCH_BUILD_ENABLED ? recordBenchCounterLive : (_counter, _delta = 1) => {};
|
|
164
|
-
const withBenchMetricScope = BENCH_BUILD_ENABLED ? withBenchMetricScopeLive : (_scope, run) => run();
|
|
165
|
-
const isBenchMetricScopeActive = BENCH_BUILD_ENABLED ? isBenchMetricScopeActiveLive : (_scope) => false;
|
|
166
|
-
const flushBenchMetrics = BENCH_BUILD_ENABLED ? flushBenchMetricsLive : () => {};
|
|
2
|
+
const BENCH_BUILD_ENABLED = false;
|
|
3
|
+
const resetBenchMetrics = () => {};
|
|
4
|
+
const recordBenchEvent = (_event) => {};
|
|
5
|
+
const recordBenchFastLane = (_name) => {};
|
|
6
|
+
const recordBenchTiming = (_phase, _ms) => {};
|
|
7
|
+
const recordBenchCounter = (_counter, _delta = 1) => {};
|
|
8
|
+
const withBenchMetricScope = (_scope, run) => run();
|
|
9
|
+
const isBenchMetricScopeActive = (_scope) => false;
|
|
10
|
+
const flushBenchMetrics = () => {};
|
|
167
11
|
const isBenchBuildEnabled = () => BENCH_BUILD_ENABLED;
|
|
168
12
|
//#endregion
|
|
169
13
|
export { flushBenchMetrics, isBenchBuildEnabled, isBenchMetricScopeActive, recordBenchCounter, recordBenchEvent, recordBenchFastLane, recordBenchTiming, resetBenchMetrics, withBenchMetricScope };
|
|
170
|
-
|
|
171
|
-
//# sourceMappingURL=for-bench.js.map
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { ComponentInstance } from "./component-internal.js";
|
|
2
|
-
import {
|
|
2
|
+
import { ReadableSource } from "./readable.js";
|
|
3
|
+
import { DOMRange } from "../common/dom-range.js";
|
|
4
|
+
import { ChildScope, ChildScopeTransactionSnapshot } from "./child-scope.js";
|
|
5
|
+
import { ForIndexSignal, ForItemPropertySignal } from "./for-signals.js";
|
|
3
6
|
import { ForItemInstance } from "./for-scopes.js";
|
|
4
7
|
import { FineGrainedEffectHandle } from "./effect.js";
|
|
5
8
|
import { ForEachSource, ForKeySelector, ForRenderItem } from "./for-types.js";
|
|
@@ -7,10 +10,11 @@ import { reconcileForItems } from "./for-reconcile.js";
|
|
|
7
10
|
import { VNode } from "../common/vnode.js";
|
|
8
11
|
|
|
9
12
|
//#region src/runtime/for-internal.d.ts
|
|
10
|
-
type ForCommitStrategy = 'APPEND' | 'TRUNCATE' | 'NO_REORDER' | 'SWAP' | 'FULL_KEYED';
|
|
13
|
+
type ForCommitStrategy = 'APPEND' | 'INSERT_ONE' | 'TRUNCATE' | 'NO_REORDER' | 'SWAP' | 'FULL_KEYED';
|
|
11
14
|
interface ForState<T> {
|
|
12
15
|
kind: 'for';
|
|
13
16
|
currentItems: T[];
|
|
17
|
+
_committedItems: T[];
|
|
14
18
|
eachSource: ForEachSource<T>;
|
|
15
19
|
fallback: VNode | null;
|
|
16
20
|
fallbackScope: ChildScope | null;
|
|
@@ -23,21 +27,80 @@ interface ForState<T> {
|
|
|
23
27
|
parentInstance: ComponentInstance | null;
|
|
24
28
|
lastCommitStrategy: ForCommitStrategy;
|
|
25
29
|
lastRemovedNodes: Node[];
|
|
30
|
+
lastRemovedRanges: DOMRange[];
|
|
26
31
|
pendingDirtyIndices: number[] | null;
|
|
27
32
|
pendingSwapIndices: [number, number] | null;
|
|
28
33
|
pendingMoveOnly: boolean;
|
|
34
|
+
pendingInsertedIndex: number | null;
|
|
35
|
+
pendingAppendStart: number | null;
|
|
29
36
|
_hasResolvedItemDom: boolean;
|
|
30
37
|
_needsSourceReconcile: boolean;
|
|
31
38
|
_sourceEffect: FineGrainedEffectHandle<T[]> | null;
|
|
32
39
|
_suspendSourceCommit: boolean;
|
|
33
40
|
_enqueueBoundaryCommit?: (() => void) | null;
|
|
34
41
|
_hasPendingBoundaryCommit?: boolean;
|
|
35
|
-
devKeyKinds?: Map<string, 'number' | 'string'>;
|
|
42
|
+
devKeyKinds?: Map<string | number, 'number' | 'string'>;
|
|
43
|
+
_transaction?: ForTransaction<T> | null;
|
|
44
|
+
}
|
|
45
|
+
interface ForItemTransactionSnapshot<T> {
|
|
46
|
+
item: T;
|
|
47
|
+
itemSignalExists: boolean;
|
|
48
|
+
itemSignalValue: T | undefined;
|
|
49
|
+
itemSignalHasBeenRead: boolean;
|
|
50
|
+
indexValue: number;
|
|
51
|
+
indexHasBeenRead: boolean;
|
|
52
|
+
propertySignalStore: Map<PropertyKey, ForItemPropertySignal> | null;
|
|
53
|
+
propertySignals: Map<PropertyKey, {
|
|
54
|
+
signal: ForItemPropertySignal;
|
|
55
|
+
value: unknown;
|
|
56
|
+
hasBeenRead: boolean;
|
|
57
|
+
}> | null;
|
|
58
|
+
scope: ChildScopeTransactionSnapshot;
|
|
59
|
+
}
|
|
60
|
+
interface ForTransaction<T> {
|
|
61
|
+
collectionSnapshotMode: 'copy' | 'reset-empty' | 'preserve-clear' | 'reuse';
|
|
62
|
+
currentItems: T[];
|
|
63
|
+
items: Map<string | number, ForItemInstance<T>>;
|
|
64
|
+
orderedKeys: Array<string | number>;
|
|
65
|
+
orderedItems: ForItemInstance<T>[];
|
|
66
|
+
orderedVNodes: VNode[];
|
|
67
|
+
fallbackScope: ChildScope | null;
|
|
68
|
+
lastCommitStrategy: ForCommitStrategy;
|
|
69
|
+
lastRemovedNodes: Node[];
|
|
70
|
+
lastRemovedRanges: DOMRange[];
|
|
71
|
+
pendingDirtyIndices: number[] | null;
|
|
72
|
+
pendingSwapIndices: [number, number] | null;
|
|
73
|
+
pendingMoveOnly: boolean;
|
|
74
|
+
pendingInsertedIndex: number | null;
|
|
75
|
+
pendingAppendStart: number | null;
|
|
76
|
+
hasResolvedItemDom: boolean;
|
|
77
|
+
needsSourceReconcile: boolean;
|
|
78
|
+
devKeyKinds?: Map<string | number, 'number' | 'string'>;
|
|
79
|
+
itemSnapshots: Map<ForItemInstance<T>, ForItemTransactionSnapshot<T>> | null;
|
|
80
|
+
unreadIndexSnapshots: Map<ForIndexSignal, number> | null;
|
|
81
|
+
fallbackScopeSnapshot: ChildScopeTransactionSnapshot | null;
|
|
82
|
+
removedScopes: ChildScope[] | null;
|
|
83
|
+
removeAllItems: boolean;
|
|
84
|
+
signalEffects: Map<ReadableSource<unknown>, {
|
|
85
|
+
parentInstance: ComponentInstance | null;
|
|
86
|
+
notify: boolean;
|
|
87
|
+
skipInstance: ComponentInstance | null;
|
|
88
|
+
skipOwnedBy: ComponentInstance | null;
|
|
89
|
+
}> | null;
|
|
90
|
+
shouldClearDomUpdateState: boolean;
|
|
36
91
|
}
|
|
37
92
|
declare function createForState<T>(eachSource: ForEachSource<T>, byFn: ForState<T>['byFn'], renderFn: ForRenderItem<T>, fallback: VNode | null): ForState<T>;
|
|
38
93
|
declare function useForState<T>(eachSource: ForEachSource<T>, byFn: ForState<T>['byFn'], renderFn: ForRenderItem<T>, fallback: VNode | null): ForState<T>;
|
|
39
94
|
declare function evaluateForState<T>(forState: ForState<T>): VNode[];
|
|
95
|
+
/**
|
|
96
|
+
* Reconciliation changes ownership before DOM work can fail. Keep a private
|
|
97
|
+
* structural snapshot until the boundary has committed so failed work cannot
|
|
98
|
+
* leave provisional child scopes in the parent owner graph.
|
|
99
|
+
*/
|
|
100
|
+
declare function beginForStateTransaction<T>(forState: ForState<T>, collectionMode?: 'auto' | 'reuse'): void;
|
|
101
|
+
declare function registerForStateTransaction<T>(forState: ForState<T>, transaction?: ForTransaction<T> | null | undefined): boolean;
|
|
102
|
+
declare function commitForStateTransaction<T>(forState: ForState<T>, transaction?: ForTransaction<T> | null | undefined): void;
|
|
103
|
+
declare function rollbackForStateTransaction<T>(forState: ForState<T>, transaction?: ForTransaction<T> | null | undefined): void;
|
|
40
104
|
declare function clearForDomUpdateState<T>(forState: ForState<T>): void;
|
|
41
105
|
//#endregion
|
|
42
|
-
export { ForCommitStrategy, ForState, reconcileForItems };
|
|
43
|
-
//# sourceMappingURL=for-internal.d.ts.map
|
|
106
|
+
export { ForCommitStrategy, ForItemTransactionSnapshot, ForState, ForTransaction, reconcileForItems };
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
+
import { logger } from "../common/logger.js";
|
|
2
|
+
import { getRuntimeRenderer } from "./access.js";
|
|
1
3
|
import { claimHookIndex, getCurrentInstance } from "./component-scope.js";
|
|
4
|
+
import { registerLifecycleTransaction } from "./lifecycle-batch.js";
|
|
5
|
+
import "./component-lifecycle.js";
|
|
2
6
|
import "./component.js";
|
|
7
|
+
import { disposeChildScope, restoreChildScopeTransactionSnapshot } from "./child-scope.js";
|
|
8
|
+
import { notifyForSignalReaders, removeForParentReaders } from "./for-signals.js";
|
|
3
9
|
import { isBenchMetricScopeActive, recordBenchCounter, recordBenchEvent, recordBenchTiming, withBenchMetricScope } from "./for-bench.js";
|
|
4
10
|
import { reconcileForItems } from "./for-reconcile.js";
|
|
5
11
|
//#region src/runtime/for-internal.ts
|
|
@@ -23,6 +29,7 @@ function createForState(eachSource, byFn, renderFn, fallback) {
|
|
|
23
29
|
return {
|
|
24
30
|
kind: "for",
|
|
25
31
|
currentItems: [],
|
|
32
|
+
_committedItems: [],
|
|
26
33
|
eachSource,
|
|
27
34
|
fallback,
|
|
28
35
|
fallbackScope: null,
|
|
@@ -35,15 +42,19 @@ function createForState(eachSource, byFn, renderFn, fallback) {
|
|
|
35
42
|
parentInstance,
|
|
36
43
|
lastCommitStrategy: "NO_REORDER",
|
|
37
44
|
lastRemovedNodes: [],
|
|
45
|
+
lastRemovedRanges: [],
|
|
38
46
|
pendingDirtyIndices: null,
|
|
39
47
|
pendingSwapIndices: null,
|
|
40
48
|
pendingMoveOnly: false,
|
|
49
|
+
pendingInsertedIndex: null,
|
|
50
|
+
pendingAppendStart: null,
|
|
41
51
|
_hasResolvedItemDom: false,
|
|
42
52
|
_needsSourceReconcile: false,
|
|
43
53
|
_sourceEffect: null,
|
|
44
54
|
_suspendSourceCommit: false,
|
|
45
55
|
_enqueueBoundaryCommit: null,
|
|
46
|
-
_hasPendingBoundaryCommit: false
|
|
56
|
+
_hasPendingBoundaryCommit: false,
|
|
57
|
+
_transaction: null
|
|
47
58
|
};
|
|
48
59
|
}
|
|
49
60
|
function useForState(eachSource, byFn, renderFn, fallback) {
|
|
@@ -70,29 +81,205 @@ function useForState(eachSource, byFn, renderFn, fallback) {
|
|
|
70
81
|
}
|
|
71
82
|
function evaluateForState(forState) {
|
|
72
83
|
if (!Array.isArray(forState.currentItems)) throw new Error("For source must evaluate to an array");
|
|
84
|
+
beginForStateTransaction(forState);
|
|
73
85
|
forState._needsSourceReconcile = false;
|
|
74
|
-
|
|
86
|
+
try {
|
|
87
|
+
return reconcileForItems(forState, forState.currentItems);
|
|
88
|
+
} catch (error) {
|
|
89
|
+
rollbackForStateTransaction(forState);
|
|
90
|
+
throw error;
|
|
91
|
+
}
|
|
75
92
|
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
93
|
+
/**
|
|
94
|
+
* Reconciliation changes ownership before DOM work can fail. Keep a private
|
|
95
|
+
* structural snapshot until the boundary has committed so failed work cannot
|
|
96
|
+
* leave provisional child scopes in the parent owner graph.
|
|
97
|
+
*/
|
|
98
|
+
function beginForStateTransaction(forState, collectionMode = "auto") {
|
|
99
|
+
if (forState._transaction) return;
|
|
100
|
+
const hasEmptyCollections = forState.items.size === 0 && forState.orderedKeys.length === 0 && forState.orderedItems.length === 0 && forState.orderedVNodes.length === 0;
|
|
101
|
+
const isFullClear = forState.currentItems.length === 0 && forState.orderedKeys.length > 0;
|
|
102
|
+
const collectionSnapshotMode = collectionMode === "reuse" ? "reuse" : hasEmptyCollections ? "reset-empty" : isFullClear ? "preserve-clear" : "copy";
|
|
103
|
+
const transaction = {
|
|
104
|
+
collectionSnapshotMode,
|
|
105
|
+
currentItems: forState._committedItems,
|
|
106
|
+
items: collectionSnapshotMode === "copy" ? new Map(forState.items) : forState.items,
|
|
107
|
+
orderedKeys: collectionSnapshotMode === "copy" ? forState.orderedKeys.slice() : forState.orderedKeys,
|
|
108
|
+
orderedItems: collectionSnapshotMode === "copy" ? forState.orderedItems.slice() : forState.orderedItems,
|
|
109
|
+
orderedVNodes: collectionSnapshotMode === "copy" ? forState.orderedVNodes.slice() : forState.orderedVNodes,
|
|
110
|
+
fallbackScope: forState.fallbackScope,
|
|
111
|
+
lastCommitStrategy: forState.lastCommitStrategy,
|
|
112
|
+
lastRemovedNodes: forState.lastRemovedNodes,
|
|
113
|
+
lastRemovedRanges: forState.lastRemovedRanges,
|
|
114
|
+
pendingDirtyIndices: forState.pendingDirtyIndices,
|
|
115
|
+
pendingSwapIndices: forState.pendingSwapIndices,
|
|
116
|
+
pendingMoveOnly: forState.pendingMoveOnly,
|
|
117
|
+
pendingInsertedIndex: forState.pendingInsertedIndex,
|
|
118
|
+
pendingAppendStart: forState.pendingAppendStart,
|
|
119
|
+
hasResolvedItemDom: forState._hasResolvedItemDom,
|
|
120
|
+
needsSourceReconcile: forState._needsSourceReconcile,
|
|
121
|
+
devKeyKinds: forState.devKeyKinds,
|
|
122
|
+
itemSnapshots: null,
|
|
123
|
+
unreadIndexSnapshots: null,
|
|
124
|
+
fallbackScopeSnapshot: null,
|
|
125
|
+
removedScopes: null,
|
|
126
|
+
removeAllItems: false,
|
|
127
|
+
signalEffects: null,
|
|
128
|
+
shouldClearDomUpdateState: false
|
|
129
|
+
};
|
|
130
|
+
forState._transaction = transaction;
|
|
131
|
+
registerForStateTransaction(forState, transaction);
|
|
132
|
+
}
|
|
133
|
+
function registerForStateTransaction(forState, transaction = forState._transaction) {
|
|
134
|
+
if (!transaction || forState._transaction !== transaction) return false;
|
|
135
|
+
return registerLifecycleTransaction(transaction, () => commitForStateTransaction(forState, transaction), () => rollbackForStateTransaction(forState, transaction));
|
|
136
|
+
}
|
|
137
|
+
function finalizeForStateRemovals(transaction) {
|
|
138
|
+
const removedScopes = transaction.removedScopes;
|
|
139
|
+
if (!transaction.removeAllItems && !removedScopes) return;
|
|
140
|
+
const cleanupErrors = [];
|
|
141
|
+
const finalizeScope = (scope) => {
|
|
142
|
+
const removedDom = scope.dom;
|
|
143
|
+
const removedRange = scope.range;
|
|
144
|
+
try {
|
|
145
|
+
disposeChildScope(scope);
|
|
146
|
+
} catch (error) {
|
|
147
|
+
cleanupErrors.push(error);
|
|
148
|
+
}
|
|
149
|
+
if (typeof Element !== "undefined" && removedDom instanceof Element) try {
|
|
150
|
+
getRuntimeRenderer().teardownNodeSubtree(removedDom);
|
|
151
|
+
} catch (error) {
|
|
152
|
+
cleanupErrors.push(error);
|
|
153
|
+
}
|
|
154
|
+
if (removedRange && !removedRange.single) for (let node = removedRange.start.nextSibling; node && node !== removedRange.end;) {
|
|
155
|
+
const next = node.nextSibling;
|
|
156
|
+
if (typeof Element !== "undefined" && node instanceof Element) try {
|
|
157
|
+
getRuntimeRenderer().teardownNodeSubtree(node);
|
|
158
|
+
} catch (error) {
|
|
159
|
+
cleanupErrors.push(error);
|
|
160
|
+
}
|
|
161
|
+
node = next;
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
if (transaction.removeAllItems) for (let index = 0; index < transaction.orderedItems.length; index++) {
|
|
165
|
+
const item = transaction.orderedItems[index];
|
|
166
|
+
if (item) finalizeScope(item.scope);
|
|
81
167
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
168
|
+
for (const scope of removedScopes ?? []) finalizeScope(scope);
|
|
169
|
+
if (removedScopes) removedScopes.length = 0;
|
|
170
|
+
transaction.removeAllItems = false;
|
|
171
|
+
if (cleanupErrors.length > 0) logger.error("[Askr] For removal cleanup failed:", new AggregateError(cleanupErrors, "For removal cleanup failed"));
|
|
172
|
+
}
|
|
173
|
+
function finalizeForSignalEffects(transaction) {
|
|
174
|
+
if (!transaction.signalEffects) return;
|
|
175
|
+
for (const [source, effect] of transaction.signalEffects) {
|
|
176
|
+
removeForParentReaders(effect.parentInstance, source);
|
|
177
|
+
if (effect.notify) notifyForSignalReaders(source, effect.skipInstance, effect.skipOwnedBy);
|
|
178
|
+
}
|
|
179
|
+
transaction.signalEffects.clear();
|
|
180
|
+
}
|
|
181
|
+
function finalizeForDomUpdateFlags(forState) {
|
|
182
|
+
for (let index = 0; index < forState.orderedItems.length; index++) {
|
|
183
|
+
const item = forState.orderedItems[index];
|
|
184
|
+
if (item) item.scope.needsDomUpdate = false;
|
|
86
185
|
}
|
|
87
186
|
if (forState.fallbackScope) forState.fallbackScope.needsDomUpdate = false;
|
|
187
|
+
}
|
|
188
|
+
function commitForStateTransaction(forState, transaction = forState._transaction) {
|
|
189
|
+
if (!transaction || forState._transaction !== transaction) return;
|
|
190
|
+
try {
|
|
191
|
+
finalizeForStateRemovals(transaction);
|
|
192
|
+
finalizeForSignalEffects(transaction);
|
|
193
|
+
if (transaction.shouldClearDomUpdateState) finalizeForDomUpdateFlags(forState);
|
|
194
|
+
} finally {
|
|
195
|
+
transaction.itemSnapshots?.clear();
|
|
196
|
+
transaction.unreadIndexSnapshots?.clear();
|
|
197
|
+
transaction.fallbackScopeSnapshot = null;
|
|
198
|
+
forState._committedItems = forState.currentItems;
|
|
199
|
+
forState._transaction = null;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
function rollbackForStateTransaction(forState, transaction = forState._transaction) {
|
|
203
|
+
if (!transaction || forState._transaction !== transaction) return;
|
|
204
|
+
const rollbackCleanupErrors = [];
|
|
205
|
+
const scopesToDispose = /* @__PURE__ */ new Set();
|
|
206
|
+
const committedScopes = transaction.collectionSnapshotMode === "reset-empty" ? null : new Set(transaction.orderedItems.map((item) => item.scope));
|
|
207
|
+
if (transaction.fallbackScope) committedScopes?.add(transaction.fallbackScope);
|
|
208
|
+
if (transaction.collectionSnapshotMode === "reset-empty") for (const item of forState.items.values()) scopesToDispose.add(item.scope);
|
|
209
|
+
else for (const [key, item] of forState.items) if (transaction.items.get(key) !== item) scopesToDispose.add(item.scope);
|
|
210
|
+
for (const scope of transaction.removedScopes ?? []) if (scope !== transaction.fallbackScope && !committedScopes?.has(scope)) scopesToDispose.add(scope);
|
|
211
|
+
if (forState.fallbackScope && forState.fallbackScope !== transaction.fallbackScope) scopesToDispose.add(forState.fallbackScope);
|
|
212
|
+
for (const scope of scopesToDispose) try {
|
|
213
|
+
disposeChildScope(scope);
|
|
214
|
+
} catch (error) {
|
|
215
|
+
rollbackCleanupErrors.push(error);
|
|
216
|
+
}
|
|
217
|
+
if (transaction.collectionSnapshotMode === "reset-empty") {
|
|
218
|
+
forState.items.clear();
|
|
219
|
+
forState.orderedKeys.length = 0;
|
|
220
|
+
forState.orderedItems.length = 0;
|
|
221
|
+
forState.orderedVNodes.length = 0;
|
|
222
|
+
}
|
|
223
|
+
for (const [itemInstance, snapshot] of transaction.itemSnapshots ?? []) {
|
|
224
|
+
itemInstance.item = snapshot.item;
|
|
225
|
+
const reactiveItemState = itemInstance.reactiveItemState;
|
|
226
|
+
if (reactiveItemState) reactiveItemState.currentItem = snapshot.item;
|
|
227
|
+
const itemSignal = reactiveItemState?.itemSignal;
|
|
228
|
+
if (itemSignal && snapshot.itemSignalExists) {
|
|
229
|
+
itemSignal.set(snapshot.itemSignalValue, false);
|
|
230
|
+
itemSignal._hasBeenRead = snapshot.itemSignalHasBeenRead;
|
|
231
|
+
}
|
|
232
|
+
itemInstance.indexSignal.set(snapshot.indexValue, false);
|
|
233
|
+
itemInstance.indexSignal._hasBeenRead = snapshot.indexHasBeenRead;
|
|
234
|
+
const propertySignals = snapshot.propertySignalStore;
|
|
235
|
+
if (reactiveItemState) reactiveItemState.propertySignals = propertySignals;
|
|
236
|
+
if (propertySignals) {
|
|
237
|
+
propertySignals.clear();
|
|
238
|
+
for (const [property, propertySnapshot] of snapshot.propertySignals ?? []) {
|
|
239
|
+
propertySnapshot.signal.set(propertySnapshot.value, false);
|
|
240
|
+
propertySnapshot.signal._hasBeenRead = propertySnapshot.hasBeenRead;
|
|
241
|
+
propertySignals.set(property, propertySnapshot.signal);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
restoreChildScopeTransactionSnapshot(itemInstance.scope, snapshot.scope);
|
|
245
|
+
}
|
|
246
|
+
for (const [indexSignal, index] of transaction.unreadIndexSnapshots ?? []) indexSignal.set(index, false);
|
|
247
|
+
if (transaction.fallbackScope && transaction.fallbackScopeSnapshot) restoreChildScopeTransactionSnapshot(transaction.fallbackScope, transaction.fallbackScopeSnapshot);
|
|
248
|
+
forState.currentItems = transaction.currentItems;
|
|
249
|
+
forState._committedItems = transaction.currentItems;
|
|
250
|
+
forState.items = transaction.items;
|
|
251
|
+
forState.orderedKeys = transaction.orderedKeys;
|
|
252
|
+
forState.orderedItems = transaction.orderedItems;
|
|
253
|
+
forState.orderedVNodes = transaction.orderedVNodes;
|
|
254
|
+
forState.fallbackScope = transaction.fallbackScope;
|
|
255
|
+
forState.lastCommitStrategy = transaction.lastCommitStrategy;
|
|
256
|
+
forState.lastRemovedNodes = transaction.lastRemovedNodes;
|
|
257
|
+
forState.lastRemovedRanges = transaction.lastRemovedRanges;
|
|
258
|
+
forState.pendingDirtyIndices = transaction.pendingDirtyIndices;
|
|
259
|
+
forState.pendingSwapIndices = transaction.pendingSwapIndices;
|
|
260
|
+
forState.pendingMoveOnly = transaction.pendingMoveOnly;
|
|
261
|
+
forState.pendingInsertedIndex = transaction.pendingInsertedIndex;
|
|
262
|
+
forState.pendingAppendStart = transaction.pendingAppendStart;
|
|
263
|
+
forState._hasResolvedItemDom = transaction.hasResolvedItemDom;
|
|
264
|
+
forState._needsSourceReconcile = transaction.needsSourceReconcile;
|
|
265
|
+
forState.devKeyKinds = transaction.devKeyKinds;
|
|
266
|
+
forState._transaction = null;
|
|
267
|
+
if (rollbackCleanupErrors.length > 0) logger.error("[Askr] transaction rollback cleanup failed:", new AggregateError(rollbackCleanupErrors, "Transaction rollback cleanup failed"));
|
|
268
|
+
}
|
|
269
|
+
function clearForDomUpdateState(forState) {
|
|
270
|
+
const transaction = forState._transaction;
|
|
271
|
+
if (transaction) transaction.shouldClearDomUpdateState = true;
|
|
272
|
+
if (transaction && !registerForStateTransaction(forState, transaction)) commitForStateTransaction(forState, transaction);
|
|
273
|
+
if (!transaction) finalizeForDomUpdateFlags(forState);
|
|
88
274
|
forState.lastRemovedNodes = [];
|
|
275
|
+
forState.lastRemovedRanges = [];
|
|
89
276
|
forState.pendingDirtyIndices = null;
|
|
90
277
|
forState.pendingSwapIndices = null;
|
|
91
278
|
forState.pendingMoveOnly = false;
|
|
279
|
+
forState.pendingInsertedIndex = null;
|
|
280
|
+
forState.pendingAppendStart = null;
|
|
92
281
|
forState._needsSourceReconcile = false;
|
|
93
282
|
forState._hasResolvedItemDom = forState.orderedKeys.length > 0;
|
|
94
283
|
}
|
|
95
284
|
//#endregion
|
|
96
|
-
export { clearForDomUpdateState, createForState, evaluateForState, isBenchMetricScopeActive, reconcileForItems, recordBenchCounter, recordBenchEvent, recordBenchTiming, useForState, withBenchMetricScope };
|
|
97
|
-
|
|
98
|
-
//# sourceMappingURL=for-internal.js.map
|
|
285
|
+
export { beginForStateTransaction, clearForDomUpdateState, commitForStateTransaction, createForState, evaluateForState, isBenchMetricScopeActive, reconcileForItems, recordBenchCounter, recordBenchEvent, recordBenchTiming, registerForStateTransaction, rollbackForStateTransaction, useForState, withBenchMetricScope };
|
|
@@ -4,5 +4,4 @@ import { VNode } from "../common/vnode.js";
|
|
|
4
4
|
//#region src/runtime/for-reconcile.d.ts
|
|
5
5
|
declare function reconcileForItems<T>(forState: ForState<T>, newArray: T[]): VNode[];
|
|
6
6
|
//#endregion
|
|
7
|
-
export { reconcileForItems };
|
|
8
|
-
//# sourceMappingURL=for-reconcile.d.ts.map
|
|
7
|
+
export { reconcileForItems };
|