@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
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import { _isDOMElement } from "../common/vnode.js";
|
|
2
|
+
import "./types.js";
|
|
3
|
+
import { extractKey, tagNamesEqualIgnoreCase } from "./utils.js";
|
|
4
|
+
import { applyScalarPropValue } from "./attributes.js";
|
|
5
|
+
import { isFragmentVNode } from "./child-shape.js";
|
|
6
|
+
//#region src/renderer/intrinsic-blueprint-analysis.ts
|
|
7
|
+
function getVNodeChildren(vnode) {
|
|
8
|
+
return vnode.props?.children ?? vnode.children;
|
|
9
|
+
}
|
|
10
|
+
function getDirectReactiveCompute(value) {
|
|
11
|
+
if (typeof value === "function") return value;
|
|
12
|
+
if (Array.isArray(value)) return value.length === 1 ? getDirectReactiveCompute(value[0]) : null;
|
|
13
|
+
if (typeof value === "object" && value !== null && isFragmentVNode(value)) return getDirectReactiveCompute(getVNodeChildren(value));
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
const ownerBlueprints = /* @__PURE__ */ new WeakMap();
|
|
17
|
+
function getBlueprintKey(parentNamespace) {
|
|
18
|
+
return parentNamespace ?? "";
|
|
19
|
+
}
|
|
20
|
+
function getBlueprint(owner, ownerDocument, parentNamespace) {
|
|
21
|
+
return ownerBlueprints.get(owner)?.get(ownerDocument)?.get(getBlueprintKey(parentNamespace));
|
|
22
|
+
}
|
|
23
|
+
function cacheBlueprint(owner, ownerDocument, parentNamespace, blueprint) {
|
|
24
|
+
let byDocument = ownerBlueprints.get(owner);
|
|
25
|
+
if (!byDocument) {
|
|
26
|
+
byDocument = /* @__PURE__ */ new WeakMap();
|
|
27
|
+
ownerBlueprints.set(owner, byDocument);
|
|
28
|
+
}
|
|
29
|
+
let byNamespace = byDocument.get(ownerDocument);
|
|
30
|
+
if (!byNamespace) {
|
|
31
|
+
byNamespace = /* @__PURE__ */ new Map();
|
|
32
|
+
byDocument.set(ownerDocument, byNamespace);
|
|
33
|
+
}
|
|
34
|
+
const key = getBlueprintKey(parentNamespace);
|
|
35
|
+
if (!byNamespace.has(key)) byNamespace.set(key, blueprint);
|
|
36
|
+
}
|
|
37
|
+
function isBlueprintKeyProp(key) {
|
|
38
|
+
return key === "key" || key === "data-key" || key === "data-askr-key-kind";
|
|
39
|
+
}
|
|
40
|
+
function classifyProp(value, key) {
|
|
41
|
+
if (key === "ref") return { kind: "ref" };
|
|
42
|
+
if (key.startsWith("on") && key.length > 2) return typeof value === "function" ? { kind: "event" } : null;
|
|
43
|
+
if (typeof value === "function") return { kind: "reactive" };
|
|
44
|
+
if (value === void 0 || value === null || value === false) return { kind: "empty" };
|
|
45
|
+
if (typeof value === "object") return null;
|
|
46
|
+
return {
|
|
47
|
+
kind: "static",
|
|
48
|
+
value
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
function collectReactiveSlotShapes(value, slots) {
|
|
52
|
+
if (Array.isArray(value)) {
|
|
53
|
+
for (const child of value) if (!collectReactiveSlotShapes(child, slots)) return false;
|
|
54
|
+
return true;
|
|
55
|
+
}
|
|
56
|
+
if (value === null || value === void 0 || value === false) return true;
|
|
57
|
+
if (typeof value === "function") {
|
|
58
|
+
slots.push({ kind: "dynamic" });
|
|
59
|
+
return true;
|
|
60
|
+
}
|
|
61
|
+
if (typeof value === "string" || typeof value === "number") {
|
|
62
|
+
slots.push({
|
|
63
|
+
kind: "static",
|
|
64
|
+
value: String(value)
|
|
65
|
+
});
|
|
66
|
+
return true;
|
|
67
|
+
}
|
|
68
|
+
if (typeof value === "object" && value !== null && isFragmentVNode(value)) return collectReactiveSlotShapes(getVNodeChildren(value), slots);
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
function collectStaticVNodeChildren(value, children) {
|
|
72
|
+
if (Array.isArray(value)) {
|
|
73
|
+
for (const child of value) if (!collectStaticVNodeChildren(child, children)) return false;
|
|
74
|
+
return true;
|
|
75
|
+
}
|
|
76
|
+
if (value === null || value === void 0 || typeof value === "boolean") return true;
|
|
77
|
+
if (typeof value === "string" || typeof value === "number") {
|
|
78
|
+
children.push(String(value));
|
|
79
|
+
return true;
|
|
80
|
+
}
|
|
81
|
+
if (_isDOMElement(value)) {
|
|
82
|
+
if (typeof value.type === "string") {
|
|
83
|
+
children.push(value);
|
|
84
|
+
return true;
|
|
85
|
+
}
|
|
86
|
+
if (typeof value.type === "symbol" && isFragmentVNode(value)) return collectStaticVNodeChildren(getVNodeChildren(value), children);
|
|
87
|
+
}
|
|
88
|
+
return false;
|
|
89
|
+
}
|
|
90
|
+
function buildElementShape(template, vnode) {
|
|
91
|
+
if (typeof vnode.type !== "string" || !tagNamesEqualIgnoreCase(template.tagName, vnode.type)) return null;
|
|
92
|
+
const props = vnode.props ?? {};
|
|
93
|
+
const propShapes = Object.create(null);
|
|
94
|
+
let propCount = 0;
|
|
95
|
+
for (const key in props) {
|
|
96
|
+
if (key === "children" || isBlueprintKeyProp(key)) continue;
|
|
97
|
+
const propShape = classifyProp(props[key], key);
|
|
98
|
+
if (!propShape) return null;
|
|
99
|
+
propShapes[key] = propShape;
|
|
100
|
+
propCount += 1;
|
|
101
|
+
if (propShape.kind === "reactive") applyScalarPropValue(template, key, null, vnode.type);
|
|
102
|
+
}
|
|
103
|
+
if (extractKey(vnode) !== void 0) template.removeAttribute("data-key");
|
|
104
|
+
const children = vnode.props?.children ?? vnode.children;
|
|
105
|
+
const reactiveSlots = [];
|
|
106
|
+
if (collectReactiveSlotShapes(children, reactiveSlots)) {
|
|
107
|
+
if (reactiveSlots.some((slot) => slot.kind === "dynamic")) {
|
|
108
|
+
if (template.childNodes.length !== reactiveSlots.length) return null;
|
|
109
|
+
for (let index = 0; index < reactiveSlots.length; index += 1) {
|
|
110
|
+
const child = template.childNodes[index];
|
|
111
|
+
const slot = reactiveSlots[index];
|
|
112
|
+
if (!child || child.nodeType !== Node.TEXT_NODE) return null;
|
|
113
|
+
if (slot.kind === "static" && child.data !== slot.value) return null;
|
|
114
|
+
if (slot.kind === "dynamic") child.data = "";
|
|
115
|
+
}
|
|
116
|
+
return {
|
|
117
|
+
tagName: vnode.type,
|
|
118
|
+
namespaceURI: template.namespaceURI,
|
|
119
|
+
propCount,
|
|
120
|
+
props: propShapes,
|
|
121
|
+
children: {
|
|
122
|
+
kind: "reactive",
|
|
123
|
+
slots: reactiveSlots
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
const staticChildren = [];
|
|
129
|
+
if (!collectStaticVNodeChildren(children, staticChildren)) return null;
|
|
130
|
+
if (template.childNodes.length !== staticChildren.length) return null;
|
|
131
|
+
const childShapes = [];
|
|
132
|
+
for (let index = 0; index < staticChildren.length; index += 1) {
|
|
133
|
+
const child = staticChildren[index];
|
|
134
|
+
const templateChild = template.childNodes[index];
|
|
135
|
+
if (typeof child === "string") {
|
|
136
|
+
if (templateChild.nodeType !== Node.TEXT_NODE || templateChild.data !== child) return null;
|
|
137
|
+
childShapes.push({
|
|
138
|
+
kind: "text",
|
|
139
|
+
value: child
|
|
140
|
+
});
|
|
141
|
+
continue;
|
|
142
|
+
}
|
|
143
|
+
if (!(templateChild instanceof Element)) return null;
|
|
144
|
+
const shape = buildElementShape(templateChild, child);
|
|
145
|
+
if (!shape) return null;
|
|
146
|
+
childShapes.push({
|
|
147
|
+
kind: "element",
|
|
148
|
+
shape
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
return {
|
|
152
|
+
tagName: vnode.type,
|
|
153
|
+
namespaceURI: template.namespaceURI,
|
|
154
|
+
propCount,
|
|
155
|
+
props: propShapes,
|
|
156
|
+
children: {
|
|
157
|
+
kind: "static",
|
|
158
|
+
slots: childShapes
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
function buildBlueprint(element, vnode) {
|
|
163
|
+
const template = element.cloneNode(true);
|
|
164
|
+
const shape = buildElementShape(template, vnode);
|
|
165
|
+
return shape ? {
|
|
166
|
+
template,
|
|
167
|
+
shape,
|
|
168
|
+
elementCount: countBlueprintElements(shape)
|
|
169
|
+
} : null;
|
|
170
|
+
}
|
|
171
|
+
function countBlueprintElements(shape) {
|
|
172
|
+
if (shape.children.kind === "reactive") return 1;
|
|
173
|
+
return 1 + shape.children.slots.reduce((count, slot) => count + (slot.kind === "element" ? countBlueprintElements(slot.shape) : 0), 0);
|
|
174
|
+
}
|
|
175
|
+
function matchPropShape(expected, value, key) {
|
|
176
|
+
switch (expected.kind) {
|
|
177
|
+
case "ref": return key === "ref";
|
|
178
|
+
case "event": return key.startsWith("on") && key.length > 2 && typeof value === "function";
|
|
179
|
+
case "reactive": return !(key.startsWith("on") && key.length > 2) && typeof value === "function";
|
|
180
|
+
case "empty": return value === void 0 || value === null || value === false;
|
|
181
|
+
case "static": return typeof value !== "object" && Object.is(value, expected.value);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
function matchReactiveSlots(value, slots, startIndex) {
|
|
185
|
+
if (Array.isArray(value)) {
|
|
186
|
+
let index = startIndex;
|
|
187
|
+
for (const child of value) {
|
|
188
|
+
index = matchReactiveSlots(child, slots, index);
|
|
189
|
+
if (index < 0) return -1;
|
|
190
|
+
}
|
|
191
|
+
return index;
|
|
192
|
+
}
|
|
193
|
+
if (value === null || value === void 0 || value === false) return startIndex;
|
|
194
|
+
const slot = slots[startIndex];
|
|
195
|
+
if (!slot) return -1;
|
|
196
|
+
if (typeof value === "function") return slot.kind === "dynamic" ? startIndex + 1 : -1;
|
|
197
|
+
if (typeof value === "string" || typeof value === "number") return slot.kind === "static" && slot.value === String(value) ? startIndex + 1 : -1;
|
|
198
|
+
if (typeof value === "object" && value !== null && isFragmentVNode(value)) return matchReactiveSlots(getVNodeChildren(value), slots, startIndex);
|
|
199
|
+
return -1;
|
|
200
|
+
}
|
|
201
|
+
//#endregion
|
|
202
|
+
export { buildBlueprint, cacheBlueprint, getBlueprint, getDirectReactiveCompute, getVNodeChildren, isBlueprintKeyProp, matchPropShape, matchReactiveSlots };
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { getRuntimeEnv } from "../common/env.js";
|
|
2
|
+
import { logger } from "../common/logger.js";
|
|
3
|
+
import { incrementPerfMetric } from "../runtime/perf-metrics.js";
|
|
4
|
+
import "../runtime/dev-namespace.js";
|
|
5
|
+
import { createOwnedFineGrainedEffect } from "../runtime/effect.js";
|
|
6
|
+
import "../runtime/index.js";
|
|
7
|
+
import { REACTIVE_CHILDREN_KEY, setDirectElementReactivePropCleanup, setFreshElementReactivePropCleanup, teardownNodeSubtree } from "./cleanup.js";
|
|
8
|
+
import "./env.js";
|
|
9
|
+
import { applyScalarPropValue } from "./attributes.js";
|
|
10
|
+
import { normalizeOwnedReactiveTextValue } from "./reactive-child-sources.js";
|
|
11
|
+
import { createReactiveScalarChildCleanupEntry, syncReactiveScalarChild } from "./reactive-children.js";
|
|
12
|
+
import { applyFreshElementBindings, createReactivePropCleanupEntry } from "./prop-bindings.js";
|
|
13
|
+
const EMPTY_CLASS_TOKENS = [];
|
|
14
|
+
var BlueprintBinding = class {
|
|
15
|
+
constructor(kind, element, compute, propName, tagName, textNode) {
|
|
16
|
+
this.kind = kind;
|
|
17
|
+
this.element = element;
|
|
18
|
+
this.propName = propName;
|
|
19
|
+
this.tagName = tagName;
|
|
20
|
+
this.textNode = textNode;
|
|
21
|
+
this.active = true;
|
|
22
|
+
this.group = null;
|
|
23
|
+
this.lastClassTokens = null;
|
|
24
|
+
this.hasValue = false;
|
|
25
|
+
this.lastValue = void 0;
|
|
26
|
+
this.nextValue = void 0;
|
|
27
|
+
this.compute = compute;
|
|
28
|
+
}
|
|
29
|
+
get fnRef() {
|
|
30
|
+
return this.compute;
|
|
31
|
+
}
|
|
32
|
+
set fnRef(nextValue) {
|
|
33
|
+
this.compute = nextValue;
|
|
34
|
+
}
|
|
35
|
+
get groupedScalar() {
|
|
36
|
+
return this.kind === "text";
|
|
37
|
+
}
|
|
38
|
+
cleanup() {
|
|
39
|
+
if (this.group) cleanupGroupedBinding(this.group, this);
|
|
40
|
+
}
|
|
41
|
+
updateFn(nextValue) {
|
|
42
|
+
if (this.group) updateGroupedBinding(this.group, this, nextValue);
|
|
43
|
+
}
|
|
44
|
+
restoreFn(nextValue) {
|
|
45
|
+
const group = this.group;
|
|
46
|
+
if (this.kind === "text") return createReactiveScalarChildCleanupEntry(this.element, [{
|
|
47
|
+
kind: "dynamic",
|
|
48
|
+
compute: nextValue
|
|
49
|
+
}], group.host);
|
|
50
|
+
return createReactivePropCleanupEntry(this.element, this.propName, nextValue, this.tagName);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
function commitBlueprintBinding(binding, value, host) {
|
|
54
|
+
const previousValue = binding.lastValue;
|
|
55
|
+
if (binding.hasValue && Object.is(previousValue, value)) return;
|
|
56
|
+
if (!binding.hasValue && binding.kind === "text" && binding.textNode) {
|
|
57
|
+
const normalized = normalizeOwnedReactiveTextValue(value);
|
|
58
|
+
if (normalized !== null) {
|
|
59
|
+
if (binding.textNode.data !== normalized) binding.textNode.data = normalized;
|
|
60
|
+
binding.lastValue = value;
|
|
61
|
+
binding.hasValue = true;
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
if (binding.kind === "prop") {
|
|
66
|
+
incrementPerfMetric("reactivePropReevaluations");
|
|
67
|
+
if (!binding.hasValue && (binding.propName === "class" || binding.propName === "className") && (value === "" || value === void 0 || value === null || value === false)) binding.lastClassTokens = EMPTY_CLASS_TOKENS;
|
|
68
|
+
else applyScalarPropValue(binding.element, binding.propName, value, binding.tagName, binding.hasValue ? previousValue : void 0, binding);
|
|
69
|
+
} else {
|
|
70
|
+
const normalized = normalizeOwnedReactiveTextValue(value);
|
|
71
|
+
if (normalized === null) {
|
|
72
|
+
binding.textNode = null;
|
|
73
|
+
host.updateElementChildren(binding.element, value);
|
|
74
|
+
} else {
|
|
75
|
+
let textNode = binding.textNode;
|
|
76
|
+
if (!textNode || binding.element.firstChild !== textNode || binding.element.lastChild !== textNode) {
|
|
77
|
+
host.updateElementChildren(binding.element, normalized);
|
|
78
|
+
textNode = binding.element.childNodes.length === 1 && binding.element.firstChild?.nodeType === Node.TEXT_NODE ? binding.element.firstChild : null;
|
|
79
|
+
binding.textNode = textNode;
|
|
80
|
+
}
|
|
81
|
+
if (textNode && textNode.data !== normalized) textNode.data = normalized;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
binding.lastValue = value;
|
|
85
|
+
binding.hasValue = true;
|
|
86
|
+
}
|
|
87
|
+
function updateGroupedBinding(group, binding, nextValue) {
|
|
88
|
+
if (!binding.active || !group.effect) return;
|
|
89
|
+
if (binding.kind === "text") {
|
|
90
|
+
const nextSlot = nextValue[0];
|
|
91
|
+
const nextCompute = typeof nextValue === "function" ? nextValue : nextSlot?.kind === "dynamic" ? nextSlot.compute : null;
|
|
92
|
+
if (!nextCompute) return;
|
|
93
|
+
binding.compute = nextCompute;
|
|
94
|
+
} else binding.compute = nextValue;
|
|
95
|
+
group.effect.flush();
|
|
96
|
+
}
|
|
97
|
+
function cleanupGroupedBinding(group, binding) {
|
|
98
|
+
if (!binding.active) return;
|
|
99
|
+
binding.active = false;
|
|
100
|
+
group.activeCount -= 1;
|
|
101
|
+
if (group.activeCount === 0) {
|
|
102
|
+
group.effect?.cleanup();
|
|
103
|
+
group.effect = null;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
function computeBlueprintBindings() {
|
|
107
|
+
const group = this._owner;
|
|
108
|
+
for (const binding of group.bindings) if (binding.active) binding.nextValue = binding.compute();
|
|
109
|
+
return group.bindings;
|
|
110
|
+
}
|
|
111
|
+
function commitBlueprintBindings(_bindings, _previousBindings) {
|
|
112
|
+
const group = this._owner;
|
|
113
|
+
for (const binding of group.bindings) if (binding.active) commitBlueprintBinding(binding, binding.nextValue, group.host);
|
|
114
|
+
}
|
|
115
|
+
function blueprintBindingsChanged(_previousBindings, _nextBindings) {
|
|
116
|
+
return false;
|
|
117
|
+
}
|
|
118
|
+
function reportBlueprintBindingError(error) {
|
|
119
|
+
if (getRuntimeEnv().NODE_ENV !== "production") logger.warn("[Askr] Blueprint reactive update failed:", error);
|
|
120
|
+
}
|
|
121
|
+
function mountBlueprintBindingGroup(bindings, host) {
|
|
122
|
+
if (bindings.length === 0) return;
|
|
123
|
+
const group = {
|
|
124
|
+
_coalesceForItemReads: true,
|
|
125
|
+
bindings,
|
|
126
|
+
activeCount: bindings.length,
|
|
127
|
+
effect: null,
|
|
128
|
+
host
|
|
129
|
+
};
|
|
130
|
+
group.effect = createOwnedFineGrainedEffect("reactive", computeBlueprintBindings, commitBlueprintBindings, blueprintBindingsChanged, reportBlueprintBindingError, group);
|
|
131
|
+
let previousElement = null;
|
|
132
|
+
for (const binding of bindings) {
|
|
133
|
+
binding.group = group;
|
|
134
|
+
const bindingKey = binding.kind === "text" ? REACTIVE_CHILDREN_KEY : binding.propName;
|
|
135
|
+
if (binding.element === previousElement) setDirectElementReactivePropCleanup(binding.element, bindingKey, binding);
|
|
136
|
+
else {
|
|
137
|
+
setFreshElementReactivePropCleanup(binding.element, bindingKey, binding);
|
|
138
|
+
previousElement = binding.element;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
function publishPreparedBlueprintBindings(element, props) {
|
|
143
|
+
applyFreshElementBindings(element, props);
|
|
144
|
+
}
|
|
145
|
+
function cleanupBlueprintElement(element) {
|
|
146
|
+
teardownNodeSubtree(element);
|
|
147
|
+
}
|
|
148
|
+
function syncPreparedBlueprintChild(element, value, host) {
|
|
149
|
+
return syncReactiveScalarChild(element, value, host);
|
|
150
|
+
}
|
|
151
|
+
//#endregion
|
|
152
|
+
export { BlueprintBinding, cleanupBlueprintElement, mountBlueprintBindingGroup, publishPreparedBlueprintBindings, syncPreparedBlueprintChild };
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { _isDOMElement } from "../common/vnode.js";
|
|
2
|
+
import "./types.js";
|
|
3
|
+
import { isBenchMetricScopeActive, recordBenchCounter } from "../runtime/for-bench.js";
|
|
4
|
+
import "../runtime/index.js";
|
|
5
|
+
import { materializeFreshKey } from "./attributes.js";
|
|
6
|
+
import { isFragmentVNode } from "./child-shape.js";
|
|
7
|
+
import { getDirectReactiveCompute, getVNodeChildren, isBlueprintKeyProp, matchPropShape, matchReactiveSlots } from "./intrinsic-blueprint-analysis.js";
|
|
8
|
+
import { BlueprintBinding, cleanupBlueprintElement, mountBlueprintBindingGroup, publishPreparedBlueprintBindings, syncPreparedBlueprintChild } from "./intrinsic-blueprint-bindings.js";
|
|
9
|
+
//#region src/renderer/intrinsic-blueprint-materialization.ts
|
|
10
|
+
const BLUEPRINT_PUBLISH_BINDINGS = 0;
|
|
11
|
+
const BLUEPRINT_SYNC_REACTIVE_CHILD = 1;
|
|
12
|
+
function prepareElementBlueprint(element, vnode, shape, bindings, deferred) {
|
|
13
|
+
const vnodeType = vnode.type;
|
|
14
|
+
if (typeof vnodeType !== "string" || shape.tagName !== vnodeType && shape.tagName.toLowerCase() !== vnodeType.toLowerCase()) return false;
|
|
15
|
+
const props = vnode.props ?? {};
|
|
16
|
+
let propCount = 0;
|
|
17
|
+
let shouldPublishBindings = false;
|
|
18
|
+
for (const key in props) {
|
|
19
|
+
if (key === "children" || isBlueprintKeyProp(key)) continue;
|
|
20
|
+
const expected = shape.props[key];
|
|
21
|
+
if (!expected || !matchPropShape(expected, props[key], key)) return false;
|
|
22
|
+
propCount += 1;
|
|
23
|
+
if (expected.kind === "reactive") bindings.push(new BlueprintBinding("prop", element, props[key], key, vnodeType, null));
|
|
24
|
+
else if (expected.kind === "event" || expected.kind === "ref") shouldPublishBindings = true;
|
|
25
|
+
}
|
|
26
|
+
if (propCount !== shape.propCount) return false;
|
|
27
|
+
materializeFreshKey(element, vnode, props);
|
|
28
|
+
if (shouldPublishBindings) deferred.push(BLUEPRINT_PUBLISH_BINDINGS, element, props);
|
|
29
|
+
const children = vnode.props?.children ?? vnode.children;
|
|
30
|
+
if (shape.children.kind === "reactive") {
|
|
31
|
+
if (shape.children.slots.length === 1 && shape.children.slots[0]?.kind === "dynamic") {
|
|
32
|
+
const compute = getDirectReactiveCompute(children);
|
|
33
|
+
const textNode = element.firstChild;
|
|
34
|
+
if (compute) {
|
|
35
|
+
bindings.push(new BlueprintBinding("text", element, compute, null, null, textNode));
|
|
36
|
+
return true;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
if (matchReactiveSlots(children, shape.children.slots, 0) !== shape.children.slots.length) return false;
|
|
40
|
+
deferred.push(BLUEPRINT_SYNC_REACTIVE_CHILD, element, children);
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
if (shape.children.slots.length === 0 && (children === null || children === void 0 || typeof children === "boolean")) return true;
|
|
44
|
+
const staticSlot = shape.children.slots.length === 1 ? shape.children.slots[0] : void 0;
|
|
45
|
+
if (staticSlot?.kind === "element" && _isDOMElement(children) && typeof children.type === "string") {
|
|
46
|
+
const childNode = element.firstChild;
|
|
47
|
+
if (!(childNode instanceof Element)) return false;
|
|
48
|
+
return prepareElementBlueprint(childNode, children, staticSlot.shape, bindings, deferred);
|
|
49
|
+
}
|
|
50
|
+
return prepareStaticSlots(element, children, shape.children.slots, 0, bindings, deferred) === shape.children.slots.length;
|
|
51
|
+
}
|
|
52
|
+
function prepareStaticSlots(element, value, slots, startIndex, bindings, deferred) {
|
|
53
|
+
if (Array.isArray(value)) {
|
|
54
|
+
let index = startIndex;
|
|
55
|
+
for (const child of value) {
|
|
56
|
+
index = prepareStaticSlots(element, child, slots, index, bindings, deferred);
|
|
57
|
+
if (index < 0) return -1;
|
|
58
|
+
}
|
|
59
|
+
return index;
|
|
60
|
+
}
|
|
61
|
+
if (value === null || value === void 0 || typeof value === "boolean") return startIndex;
|
|
62
|
+
const slot = slots[startIndex];
|
|
63
|
+
const childNode = element.childNodes[startIndex];
|
|
64
|
+
if (typeof value === "string" || typeof value === "number") return slot?.kind === "text" && slot.value === String(value) ? startIndex + 1 : -1;
|
|
65
|
+
if (!_isDOMElement(value)) return -1;
|
|
66
|
+
if (typeof value.type === "symbol") return isFragmentVNode(value) ? prepareStaticSlots(element, getVNodeChildren(value), slots, startIndex, bindings, deferred) : -1;
|
|
67
|
+
if (slot?.kind === "element" && childNode !== void 0) return prepareElementBlueprint(childNode, value, slot.shape, bindings, deferred) ? startIndex + 1 : -1;
|
|
68
|
+
return -1;
|
|
69
|
+
}
|
|
70
|
+
function publishPreparedBlueprint(deferred, host) {
|
|
71
|
+
for (let index = 0; index < deferred.length; index += 3) {
|
|
72
|
+
const operation = deferred[index];
|
|
73
|
+
const element = deferred[index + 1];
|
|
74
|
+
const value = deferred[index + 2];
|
|
75
|
+
if (operation === BLUEPRINT_PUBLISH_BINDINGS) publishPreparedBlueprintBindings(element, value);
|
|
76
|
+
else if (!syncPreparedBlueprintChild(element, value, host)) throw new Error("[askr] Component blueprint reactive shape changed.");
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
function instantiateBlueprint(blueprint, vnode, host) {
|
|
80
|
+
const element = blueprint.template.cloneNode(true);
|
|
81
|
+
const bindings = [];
|
|
82
|
+
const deferred = [];
|
|
83
|
+
if (!prepareElementBlueprint(element, vnode, blueprint.shape, bindings, deferred)) return null;
|
|
84
|
+
try {
|
|
85
|
+
publishPreparedBlueprint(deferred, host);
|
|
86
|
+
mountBlueprintBindingGroup(bindings, host);
|
|
87
|
+
if (isBenchMetricScopeActive("coldCreate")) {
|
|
88
|
+
recordBenchCounter("domNodesCreated", blueprint.elementCount);
|
|
89
|
+
recordBenchCounter("reactivePropsMounted", bindings.reduce((count, binding) => count + (binding.kind === "prop" ? 1 : 0), 0));
|
|
90
|
+
}
|
|
91
|
+
return element;
|
|
92
|
+
} catch (error) {
|
|
93
|
+
try {
|
|
94
|
+
cleanupBlueprintElement(element);
|
|
95
|
+
} catch {}
|
|
96
|
+
throw error;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
//#endregion
|
|
100
|
+
export { instantiateBlueprint, prepareElementBlueprint };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { _isDOMElement } from "../common/vnode.js";
|
|
2
|
+
import "./types.js";
|
|
3
|
+
import { buildBlueprint, cacheBlueprint, getBlueprint } from "./intrinsic-blueprint-analysis.js";
|
|
4
|
+
import { instantiateBlueprint } from "./intrinsic-blueprint-materialization.js";
|
|
5
|
+
//#region src/renderer/intrinsic-blueprint.ts
|
|
6
|
+
/**
|
|
7
|
+
* Stable renderer facade for the intrinsic blueprint fast path.
|
|
8
|
+
*
|
|
9
|
+
* Analysis, materialization, and grouped binding publication intentionally
|
|
10
|
+
* live behind this small adapter so callers do not depend on their internal
|
|
11
|
+
* representations.
|
|
12
|
+
*/
|
|
13
|
+
function createResultNodeWithBlueprint(owner, result, parentNamespace, createNormally, host) {
|
|
14
|
+
if (!_isDOMElement(result) || typeof result.type !== "string") return createNormally();
|
|
15
|
+
const cached = getBlueprint(owner, document, parentNamespace);
|
|
16
|
+
if (cached) {
|
|
17
|
+
const instantiated = instantiateBlueprint(cached, result, host);
|
|
18
|
+
if (instantiated) return instantiated;
|
|
19
|
+
}
|
|
20
|
+
const node = createNormally();
|
|
21
|
+
if (!(node instanceof Element) || cached) return node;
|
|
22
|
+
const blueprint = buildBlueprint(node, result);
|
|
23
|
+
if (blueprint) cacheBlueprint(owner, node.ownerDocument, parentNamespace, blueprint);
|
|
24
|
+
return node;
|
|
25
|
+
}
|
|
26
|
+
function createComponentResultNodeWithBlueprint(component, result, parentNamespace, createNormally, host) {
|
|
27
|
+
return createResultNodeWithBlueprint(component, result, parentNamespace, createNormally, host);
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
30
|
+
export { createComponentResultNodeWithBlueprint, createResultNodeWithBlueprint };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { _isDOMElement } from "../common/vnode.js";
|
|
2
|
+
import "./types.js";
|
|
3
|
+
import { extractKey, parseEventProp, tagNamesEqualIgnoreCase } from "./utils.js";
|
|
4
|
+
import { hasMatchingStaticPropsIgnoringEvents } from "./attributes.js";
|
|
5
|
+
import { runRetainedElementUpdate } from "./retained-element-rollback.js";
|
|
6
|
+
import { applyMatchingElementBindings, hasAnyElementBindingState } from "./prop-bindings.js";
|
|
7
|
+
//#region src/renderer/intrinsic-hydration-adoption.ts
|
|
8
|
+
let hydrationAdoptionDepth = 0;
|
|
9
|
+
function withIntrinsicHydrationAdoption(work) {
|
|
10
|
+
hydrationAdoptionDepth += 1;
|
|
11
|
+
try {
|
|
12
|
+
return work();
|
|
13
|
+
} finally {
|
|
14
|
+
hydrationAdoptionDepth -= 1;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
function getDirectVNodeChildren(vnode) {
|
|
18
|
+
const children = vnode.props?.children ?? vnode.children;
|
|
19
|
+
if (children === null || children === void 0 || children === false) return [];
|
|
20
|
+
return Array.isArray(children) ? children : [children];
|
|
21
|
+
}
|
|
22
|
+
function canAdoptMatchingIntrinsicSubtree(element, vnode) {
|
|
23
|
+
if (typeof vnode.type !== "string" || !tagNamesEqualIgnoreCase(element.tagName, vnode.type) || hasAnyElementBindingState(element) || extractKey(vnode) !== void 0) return false;
|
|
24
|
+
const props = vnode.props || {};
|
|
25
|
+
if (!hasMatchingStaticPropsIgnoringEvents(element, props, vnode.type)) return false;
|
|
26
|
+
for (const key in props) {
|
|
27
|
+
const value = props[key];
|
|
28
|
+
const eventProp = parseEventProp(key);
|
|
29
|
+
if (eventProp && typeof value !== "function") return false;
|
|
30
|
+
if (!eventProp && key !== "ref" && typeof value === "function") return false;
|
|
31
|
+
}
|
|
32
|
+
const children = getDirectVNodeChildren(vnode);
|
|
33
|
+
if (element.childNodes.length !== children.length) return false;
|
|
34
|
+
for (let index = 0; index < children.length; index += 1) {
|
|
35
|
+
const child = children[index];
|
|
36
|
+
const current = element.childNodes[index];
|
|
37
|
+
if (typeof child === "string" || typeof child === "number") {
|
|
38
|
+
if (current.nodeType !== 3 || current.data !== String(child)) return false;
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
if (!_isDOMElement(child) || typeof child.type !== "string" || !(current instanceof Element) || extractKey(child) !== void 0 || !canAdoptMatchingIntrinsicSubtree(current, child)) return false;
|
|
42
|
+
}
|
|
43
|
+
return true;
|
|
44
|
+
}
|
|
45
|
+
function adoptMatchingIntrinsicSubtree(element, vnode) {
|
|
46
|
+
const props = vnode.props || {};
|
|
47
|
+
let hasBindings = Object.prototype.hasOwnProperty.call(props, "ref");
|
|
48
|
+
for (const key in props) if (parseEventProp(key)) {
|
|
49
|
+
hasBindings = true;
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
if (hasBindings) runRetainedElementUpdate(element, () => void 0, () => applyMatchingElementBindings(element, props), void 0, true);
|
|
53
|
+
const children = getDirectVNodeChildren(vnode);
|
|
54
|
+
for (let index = 0; index < children.length; index += 1) {
|
|
55
|
+
const child = children[index];
|
|
56
|
+
if (_isDOMElement(child)) adoptMatchingIntrinsicSubtree(element.childNodes[index], child);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
function tryAdoptMatchingIntrinsicSubtree(element, vnode) {
|
|
60
|
+
if (hydrationAdoptionDepth === 0) return false;
|
|
61
|
+
if (!canAdoptMatchingIntrinsicSubtree(element, vnode)) return false;
|
|
62
|
+
adoptMatchingIntrinsicSubtree(element, vnode);
|
|
63
|
+
return true;
|
|
64
|
+
}
|
|
65
|
+
//#endregion
|
|
66
|
+
export { tryAdoptMatchingIntrinsicSubtree, withIntrinsicHydrationAdoption };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { extractKey } from "./utils.js";
|
|
1
|
+
import { extractKey, getMaterializedKey } from "./utils.js";
|
|
2
2
|
//#region src/renderer/keyed-children.ts
|
|
3
3
|
function extractKeyedVnodes(newChildren) {
|
|
4
4
|
const keyedVnodes = [];
|
|
@@ -16,17 +16,11 @@ function buildDOMKeyMap(parent) {
|
|
|
16
16
|
const keyMap = /* @__PURE__ */ new Map();
|
|
17
17
|
try {
|
|
18
18
|
for (let el = parent.firstElementChild; el; el = el.nextElementSibling) {
|
|
19
|
-
const
|
|
20
|
-
if (
|
|
21
|
-
keyMap.set(k, el);
|
|
22
|
-
const n = Number(k);
|
|
23
|
-
if (!Number.isNaN(n)) keyMap.set(n, el);
|
|
24
|
-
}
|
|
19
|
+
const key = getMaterializedKey(el);
|
|
20
|
+
if (key !== void 0) keyMap.set(key, el);
|
|
25
21
|
}
|
|
26
22
|
} catch {}
|
|
27
23
|
return keyMap;
|
|
28
24
|
}
|
|
29
25
|
//#endregion
|
|
30
26
|
export { buildDOMKeyMap, extractKeyedVnodes };
|
|
31
|
-
|
|
32
|
-
//# sourceMappingURL=keyed-children.js.map
|
package/dist/renderer/keyed.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { buildKeyMapFromChildren, hasPropChanged, isIgnoredForPropChanges } from "./utils.js";
|
|
1
|
+
import { buildKeyMapFromChildren, getMaterializedKey, hasPropChanged, isIgnoredForPropChanges } from "./utils.js";
|
|
2
2
|
import { extractKeyedVnodes } from "./keyed-children.js";
|
|
3
3
|
//#region src/renderer/keyed.ts
|
|
4
4
|
const keyedElements = /* @__PURE__ */ new WeakMap();
|
|
@@ -52,6 +52,9 @@ function computeLISLength(positions) {
|
|
|
52
52
|
}
|
|
53
53
|
return tails.length;
|
|
54
54
|
}
|
|
55
|
+
function keyToken(key) {
|
|
56
|
+
return `${typeof key}:${String(key)}`;
|
|
57
|
+
}
|
|
55
58
|
function collectCurrentKeyOrder(parent, oldKeyMap) {
|
|
56
59
|
const currentKeys = [];
|
|
57
60
|
if (oldKeyMap && oldKeyMap.size > 0) {
|
|
@@ -60,8 +63,7 @@ function collectCurrentKeyOrder(parent, oldKeyMap) {
|
|
|
60
63
|
for (const [key, el] of oldKeyMap) {
|
|
61
64
|
if (el === lastElement) continue;
|
|
62
65
|
lastElement = el;
|
|
63
|
-
|
|
64
|
-
currentKeys.push(normalizedKey);
|
|
66
|
+
currentKeys.push(keyToken(key));
|
|
65
67
|
keyCount++;
|
|
66
68
|
}
|
|
67
69
|
if (keyCount > 0) return {
|
|
@@ -72,9 +74,9 @@ function collectCurrentKeyOrder(parent, oldKeyMap) {
|
|
|
72
74
|
let keyCount = 0;
|
|
73
75
|
try {
|
|
74
76
|
for (let el = parent.firstElementChild; el; el = el.nextElementSibling) {
|
|
75
|
-
const
|
|
76
|
-
if (
|
|
77
|
-
currentKeys.push(
|
|
77
|
+
const key = getMaterializedKey(el);
|
|
78
|
+
if (key === void 0) continue;
|
|
79
|
+
currentKeys.push(keyToken(key));
|
|
78
80
|
keyCount++;
|
|
79
81
|
}
|
|
80
82
|
} catch {}
|
|
@@ -125,7 +127,7 @@ function planKeyedReorderFastPath(parent, keyedVnodes, totalChildren, oldKeyMap)
|
|
|
125
127
|
};
|
|
126
128
|
const { keyCount: currentKeyCount, currentKeys } = collectCurrentKeyOrder(parent, oldKeyMap);
|
|
127
129
|
let moveCount = 0;
|
|
128
|
-
for (let i = 0; i < totalKeyed; i++) if (currentKeys[i] !==
|
|
130
|
+
for (let i = 0; i < totalKeyed; i++) if (currentKeys[i] !== keyToken(keyedVnodes[i].key)) moveCount++;
|
|
129
131
|
const cheapMoveTrigger = shouldEvaluateShape && currentKeyCount > 0 && moveCount > Math.max(64, Math.floor(totalKeyed * .1));
|
|
130
132
|
let lisTrigger = false;
|
|
131
133
|
let lisLen = 0;
|
|
@@ -133,7 +135,7 @@ function planKeyedReorderFastPath(parent, keyedVnodes, totalChildren, oldKeyMap)
|
|
|
133
135
|
const indexByKey = /* @__PURE__ */ new Map();
|
|
134
136
|
for (let i = 0; i < currentKeys.length; i++) indexByKey.set(currentKeys[i], i);
|
|
135
137
|
const positions = Array(totalKeyed).fill(-1);
|
|
136
|
-
for (let i = 0; i < totalKeyed; i++) positions[i] = indexByKey.get(
|
|
138
|
+
for (let i = 0; i < totalKeyed; i++) positions[i] = indexByKey.get(keyToken(keyedVnodes[i].key)) ?? -1;
|
|
137
139
|
lisLen = computeLISLength(positions);
|
|
138
140
|
lisTrigger = lisLen < Math.floor(totalKeyed * .5);
|
|
139
141
|
}
|
|
@@ -163,5 +165,3 @@ function isKeyedReorderFastPathEligible(parent, newChildren, oldKeyMap) {
|
|
|
163
165
|
}
|
|
164
166
|
//#endregion
|
|
165
167
|
export { _reconcilerRecordedParents, getKeyMapForElement, isKeyedReorderFastPathEligible, keyedElements, planKeyedReorderFastPath, populateKeyMapForElement };
|
|
166
|
-
|
|
167
|
-
//# sourceMappingURL=keyed.js.map
|
|
@@ -19,5 +19,3 @@ function canReuseIntrinsicElementInNamespace(existing, type, parentNamespace) {
|
|
|
19
19
|
}
|
|
20
20
|
//#endregion
|
|
21
21
|
export { SVG_NAMESPACE, canReuseIntrinsicElementInNamespace, createElementForNamespace, getParentNamespace, resolveChildNamespace };
|
|
22
|
-
|
|
23
|
-
//# sourceMappingURL=namespaces.js.map
|