@askrjs/askr 0.0.50 → 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 +5 -6
- 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 +21 -11
- package/dist/boot/root-lifecycle.d.ts +6 -3
- package/dist/boot/root-lifecycle.js +18 -14
- 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 +15 -0
- package/dist/common/invariant.js +15 -0
- package/dist/common/jsx.d.ts +1 -2
- package/dist/common/jsx.js +0 -2
- package/dist/{dev → common}/logger.js +5 -8
- 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 +2 -16
- package/dist/components/error-boundary.js +2 -76
- package/dist/components/index.d.ts +2 -1
- package/dist/components/link.d.ts +2 -2
- package/dist/components/link.js +2 -2
- package/dist/control/case.d.ts +1 -2
- package/dist/control/case.js +1 -2
- package/dist/control/for.d.ts +3 -4
- package/dist/control/for.js +2 -4
- 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 +1 -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 +2 -4
- package/dist/data/mutation-cell.d.ts +1 -2
- package/dist/data/mutation-cell.js +7 -6
- package/dist/data/query-cell.d.ts +3 -2
- package/dist/data/query-cell.js +45 -11
- package/dist/data/query-key.js +0 -2
- package/dist/data/shared.js +3 -3
- package/dist/data/testing.js +2 -0
- 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/index.d.ts +1 -1
- package/dist/foundations/index.js +1 -1
- 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 -3
- package/dist/foundations/state/controllable.js +1 -2
- package/dist/foundations/structures/collection.d.ts +1 -2
- package/dist/foundations/structures/collection.js +0 -2
- package/dist/foundations/structures/index.d.ts +1 -1
- package/dist/foundations/structures/index.js +2 -1
- 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/portal.d.ts +2 -24
- package/dist/foundations/structures/portal.js +3 -187
- 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 +2 -4
- package/dist/fx/index.js +1 -0
- 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 +4 -4
- package/dist/index.js +4 -6
- 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 +4 -12
- package/dist/jsx-runtime.d.ts +16 -2
- package/dist/jsx-runtime.js +16 -24
- package/dist/jsx-runtime2.d.ts +1 -1
- package/dist/renderer/attributes.js +29 -6
- package/dist/renderer/boundaries.js +50 -174
- 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 +2 -4
- package/dist/renderer/children-fastpath.js +149 -0
- package/dist/renderer/children.js +3 -140
- package/dist/renderer/cleanup.js +72 -15
- package/dist/renderer/component-host-cleanup.js +124 -49
- package/dist/renderer/component-host-instances.js +60 -9
- package/dist/renderer/component-host-replacement.js +105 -0
- package/dist/renderer/component-host-results.js +138 -0
- package/dist/renderer/component-host.js +95 -170
- package/dist/renderer/dom-host.js +0 -2
- package/dist/renderer/dom-internal.js +115 -57
- package/dist/renderer/dom-range.js +161 -0
- package/dist/renderer/dom.js +7 -5
- package/dist/renderer/element-children.js +112 -32
- package/dist/renderer/error-boundary-dom.js +70 -13
- package/dist/renderer/evaluate-dom-range.js +3 -4
- package/dist/renderer/evaluate-reconcile.js +18 -42
- package/dist/renderer/evaluate.js +14 -3
- package/dist/renderer/fastpath.js +7 -14
- package/dist/renderer/for-commit-dom-map.js +6 -18
- package/dist/renderer/for-commit-removal.js +8 -17
- package/dist/renderer/for-commit-reorder.js +2 -4
- package/dist/renderer/for-commit.js +173 -45
- package/dist/renderer/hydration-boundaries.js +60 -0
- package/dist/renderer/hydration-listener-transaction.js +49 -0
- package/dist/renderer/index.js +11 -8
- 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 +59 -24
- package/dist/renderer/reactive-child-dom.js +10 -4
- package/dist/renderer/reactive-child-sources.js +0 -2
- package/dist/renderer/reactive-children.js +33 -24
- package/dist/renderer/reconcile-commit.js +0 -2
- package/dist/renderer/reconcile-fastpaths.js +6 -12
- package/dist/renderer/reconcile-resolution.js +32 -56
- package/dist/renderer/reconcile.js +0 -2
- package/dist/renderer/retained-element-rollback.js +161 -149
- package/dist/renderer/stable-patch.js +5 -7
- package/dist/renderer/static-reuse.js +0 -2
- package/dist/renderer/utils.js +20 -10
- package/dist/resources/index.js +1 -2
- package/dist/router/access.js +0 -2
- package/dist/router/activity.d.ts +1 -2
- package/dist/router/activity.js +20 -24
- package/dist/router/authoring.d.ts +1 -2
- package/dist/router/authoring.js +1 -3
- package/dist/router/index.d.ts +1 -1
- 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 +5 -8
- package/dist/router/navigation-registry.d.ts +1 -2
- package/dist/router/navigation-registry.js +1 -3
- 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 +425 -44
- 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 +5 -3
- package/dist/router/resolution.d.ts +2 -16
- package/dist/router/resolution.js +6 -175
- package/dist/router/route-context.js +0 -2
- package/dist/router/route-matching.d.ts +19 -0
- package/dist/router/route-matching.js +173 -0
- package/dist/router/route-query.d.ts +1 -2
- package/dist/router/route-query.js +1 -3
- package/dist/router/route.js +4 -2
- package/dist/router/store.d.ts +1 -2
- package/dist/router/store.js +0 -2
- package/dist/router/testing.js +4 -0
- package/dist/runtime/access.d.ts +19 -0
- 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 +3 -5
- package/dist/runtime/component-commit.js +26 -24
- package/dist/runtime/component-facade.js +5 -3
- package/dist/runtime/component-internal.d.ts +12 -7
- package/dist/runtime/component-internal.js +64 -46
- package/dist/runtime/component-lifecycle.d.ts +2 -41
- package/dist/runtime/component-lifecycle.js +6 -149
- package/dist/runtime/component-scope.d.ts +4 -5
- 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 +30 -0
- 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 +4 -0
- package/dist/runtime/error-boundary.js +29 -0
- package/dist/runtime/events.d.ts +58 -0
- package/dist/runtime/events.js +67 -70
- package/dist/runtime/execution-model.d.ts +6 -0
- package/dist/runtime/execution-model.js +0 -2
- package/dist/runtime/fastlane.d.ts +33 -0
- 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 +73 -10
- 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 +14 -5
- package/dist/runtime/for-signals.js +157 -83
- package/dist/runtime/for-types.d.ts +8 -0
- package/dist/runtime/for.d.ts +2 -2
- package/dist/runtime/for.js +3 -3
- package/dist/runtime/index.d.ts +24 -0
- package/dist/runtime/index.js +33 -0
- 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 +27 -0
- package/dist/runtime/perf-metrics.js +4 -68
- package/dist/runtime/portal.d.ts +21 -0
- package/dist/runtime/portal.js +305 -0
- package/dist/runtime/readable.d.ts +9 -4
- package/dist/runtime/readable.js +41 -17
- package/dist/runtime/resource-cell.js +3 -5
- package/dist/runtime/resource-operation.d.ts +1 -2
- package/dist/runtime/resource-operation.js +38 -35
- package/dist/runtime/runtime.d.ts +2 -3
- package/dist/runtime/runtime.js +0 -2
- package/dist/runtime/scheduler.d.ts +1 -2
- package/dist/runtime/scheduler.js +10 -13
- package/dist/runtime/selector-store.js +22 -0
- package/dist/runtime/selector.d.ts +1 -2
- package/dist/runtime/selector.js +6 -29
- 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 +66 -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 +1 -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 +17 -6
- package/dist/ssr/component-runtime.js +4 -30
- 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 +1 -3
- package/dist/ssr/render-sync.d.ts +1 -2
- package/dist/ssr/render-sync.js +28 -20
- package/dist/ssr/route-policy-resolution.js +2 -3
- package/dist/ssr/route-render.d.ts +1 -2
- package/dist/ssr/route-render.js +2 -3
- 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 +3 -4
- package/package.json +60 -47
- 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/jsx.d.ts.map +0 -1
- package/dist/common/jsx.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/dev/invariant.js +0 -29
- package/dist/dev/invariant.js.map +0 -1
- package/dist/dev/logger.js.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/portal.d.ts.map +0 -1
- package/dist/foundations/structures/portal.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.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-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.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-contracts.js +0 -5
- 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.js.map +0 -1
- package/dist/runtime/effect.d.ts.map +0 -1
- package/dist/runtime/effect.js.map +0 -1
- package/dist/runtime/events.js.map +0 -1
- package/dist/runtime/execution-model.js.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/lifecycle-operations.d.ts.map +0 -1
- package/dist/runtime/lifecycle-operations.js.map +0 -1
- package/dist/runtime/perf-metrics.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.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
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
|
|
@@ -1,23 +1,29 @@
|
|
|
1
1
|
import { getRuntimeEnv } from "../common/env.js";
|
|
2
|
-
import { logger } from "../
|
|
2
|
+
import { logger } from "../common/logger.js";
|
|
3
3
|
import { incrementPerfMetric } from "../runtime/perf-metrics.js";
|
|
4
4
|
import { incDevCounter } from "../runtime/dev-namespace.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { createFineGrainedEffect, markFineGrainedEffectsDirtySource } from "../runtime/effect.js";
|
|
6
|
+
import { addDelegatedListener, addFreshDelegatedListener, getDelegatedHandlerForElement, getDelegatedHandlersForElement, isDelegatedEvent, isEventDelegationEnabled, removeDelegatedListener, updateDelegatedListener } from "../runtime/events.js";
|
|
7
|
+
import "../runtime/for-bench.js";
|
|
8
|
+
import "../runtime/index.js";
|
|
9
|
+
import { REACTIVE_CHILDREN_KEY, elementListeners, elementReactivePropsCleanup, elementRefs, getElementReactivePropCleanupSize, getElementReactivePropsCleanupMap, updateElementRef } from "./cleanup.js";
|
|
7
10
|
import "./env.js";
|
|
8
11
|
import { createMutableWrappedHandler, getEventListenerKey, getEventListenerOptions, isSkippedProp, parseEventProp } from "./utils.js";
|
|
9
|
-
import { isBenchMetricScopeActive, recordBenchCounter } from "../runtime/for-bench.js";
|
|
10
|
-
import "../runtime/for.js";
|
|
11
12
|
import { applyScalarPropValue, removeStaleAttributes } from "./attributes.js";
|
|
12
|
-
import {
|
|
13
|
-
//#region src/renderer/prop-bindings.ts
|
|
13
|
+
import { stageHydrationListener } from "./hydration-listener-transaction.js";
|
|
14
14
|
const reactivePropRegistry = /* @__PURE__ */ new Set();
|
|
15
|
-
function addTrackedListener(el, eventName, handler, capture = false) {
|
|
15
|
+
function addTrackedListener(el, eventName, handler, capture = false, fresh = false) {
|
|
16
16
|
const useDelegation = !capture && isEventDelegationEnabled() && isDelegatedEvent(eventName);
|
|
17
17
|
const listenerKey = getEventListenerKey(eventName, capture);
|
|
18
|
+
if (stageHydrationListener({
|
|
19
|
+
kind: useDelegation ? "delegated" : "direct",
|
|
20
|
+
eventName,
|
|
21
|
+
publish: () => addTrackedListener(el, eventName, handler, capture, fresh),
|
|
22
|
+
rollback: () => removeTrackedListener(el, eventName, capture)
|
|
23
|
+
})) return;
|
|
18
24
|
if (useDelegation) {
|
|
19
|
-
|
|
20
|
-
|
|
25
|
+
if (fresh) addFreshDelegatedListener(el, eventName, handler, handler, void 0);
|
|
26
|
+
else addDelegatedListener(el, eventName, handler, handler, void 0);
|
|
21
27
|
return;
|
|
22
28
|
}
|
|
23
29
|
const options = getEventListenerOptions(eventName, capture);
|
|
@@ -35,7 +41,21 @@ function addTrackedListener(el, eventName, handler, capture = false) {
|
|
|
35
41
|
isDelegated: false,
|
|
36
42
|
updateHandler: mutableHandler?.updateHandler
|
|
37
43
|
});
|
|
38
|
-
|
|
44
|
+
}
|
|
45
|
+
function removeTrackedListener(el, eventName, capture) {
|
|
46
|
+
if (!capture && getDelegatedHandlerForElement(el, eventName)) {
|
|
47
|
+
removeDelegatedListener(el, eventName);
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
const listenerKey = getEventListenerKey(eventName, capture);
|
|
51
|
+
const entry = elementListeners.get(el)?.get(listenerKey);
|
|
52
|
+
if (!entry) return;
|
|
53
|
+
if (entry.options !== void 0) el.removeEventListener(entry.eventName, entry.handler, entry.options);
|
|
54
|
+
else el.removeEventListener(entry.eventName, entry.handler);
|
|
55
|
+
incDevCounter("listenerRemoves");
|
|
56
|
+
const listeners = elementListeners.get(el);
|
|
57
|
+
listeners?.delete(listenerKey);
|
|
58
|
+
if (listeners?.size === 0) elementListeners.delete(el);
|
|
39
59
|
}
|
|
40
60
|
function markReactivePropsDirtySource(source) {
|
|
41
61
|
markFineGrainedEffectsDirtySource(source);
|
|
@@ -68,7 +88,6 @@ function setupReactiveProp(el, propName, propFn, tagName) {
|
|
|
68
88
|
if (getRuntimeEnv().NODE_ENV !== "production") logger.warn("[Askr] Reactive prop update failed:", err);
|
|
69
89
|
}
|
|
70
90
|
});
|
|
71
|
-
if (isBenchMetricScopeActive("coldCreate")) recordBenchCounter("reactivePropsMounted");
|
|
72
91
|
const cleanup = () => {
|
|
73
92
|
reactivePropRegistry.delete(descriptor);
|
|
74
93
|
effectHandle?.cleanup();
|
|
@@ -89,13 +108,9 @@ function setupReactiveProp(el, propName, propFn, tagName) {
|
|
|
89
108
|
};
|
|
90
109
|
}
|
|
91
110
|
function getOrCreateReactivePropsCleanupMap(el) {
|
|
92
|
-
|
|
93
|
-
if (!cleanupMap) {
|
|
94
|
-
cleanupMap = /* @__PURE__ */ new Map();
|
|
95
|
-
elementReactivePropsCleanup.set(el, cleanupMap);
|
|
96
|
-
}
|
|
97
|
-
return cleanupMap;
|
|
111
|
+
return getElementReactivePropsCleanupMap(el, true);
|
|
98
112
|
}
|
|
113
|
+
/** @internal Create a standalone reactive prop entry for rollback restoration. */
|
|
99
114
|
function createReactivePropCleanupEntry(el, propName, propFn, tagName) {
|
|
100
115
|
const reactive = setupReactiveProp(el, propName, propFn, tagName);
|
|
101
116
|
return {
|
|
@@ -109,8 +124,30 @@ function createReactivePropCleanupEntry(el, propName, propFn, tagName) {
|
|
|
109
124
|
}
|
|
110
125
|
function hasTrackedElementPropBindings(el) {
|
|
111
126
|
const existingListeners = elementListeners.get(el);
|
|
112
|
-
|
|
113
|
-
|
|
127
|
+
return existingListeners !== void 0 && existingListeners.size > 0 || getElementReactivePropCleanupSize(el) > 0;
|
|
128
|
+
}
|
|
129
|
+
function hasAnyElementBindingState(el) {
|
|
130
|
+
return hasTrackedElementPropBindings(el) || getDelegatedHandlersForElement(el) !== void 0 || elementRefs.has(el);
|
|
131
|
+
}
|
|
132
|
+
function applyMatchingElementBindings(el, props) {
|
|
133
|
+
if (Object.prototype.hasOwnProperty.call(props, "ref")) updateElementRef(el, props.ref);
|
|
134
|
+
for (const key in props) {
|
|
135
|
+
const eventProp = parseEventProp(key);
|
|
136
|
+
if (!eventProp) continue;
|
|
137
|
+
const value = props[key];
|
|
138
|
+
if (typeof value === "function") addTrackedListener(el, eventProp.eventName, value, eventProp.capture);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
/** @internal Attach stateful bindings to a newly cloned blueprint element. */
|
|
142
|
+
function applyFreshElementBindings(el, props) {
|
|
143
|
+
if (Object.prototype.hasOwnProperty.call(props, "ref")) updateElementRef(el, props.ref);
|
|
144
|
+
for (const key in props) {
|
|
145
|
+
const eventProp = parseEventProp(key);
|
|
146
|
+
if (eventProp) {
|
|
147
|
+
const value = props[key];
|
|
148
|
+
if (typeof value === "function") addTrackedListener(el, eventProp.eventName, value, eventProp.capture, true);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
114
151
|
}
|
|
115
152
|
function applyPropsToElement(el, props, tagName, isHydrationSkipped) {
|
|
116
153
|
if (isHydrationSkipped(el)) return;
|
|
@@ -136,7 +173,7 @@ function applyPropsToElement(el, props, tagName, isHydrationSkipped) {
|
|
|
136
173
|
}
|
|
137
174
|
function syncElementPropBindings(el, domVNode, props, usesReactiveChildren) {
|
|
138
175
|
const existingListeners = elementListeners.get(el);
|
|
139
|
-
const existingReactiveProps =
|
|
176
|
+
const existingReactiveProps = getElementReactivePropsCleanupMap(el);
|
|
140
177
|
let desiredListenerKeys = null;
|
|
141
178
|
let desiredDelegatedEventNames = null;
|
|
142
179
|
let desiredReactivePropNames = null;
|
|
@@ -275,6 +312,4 @@ function syncElementPropBindings(el, domVNode, props, usesReactiveChildren) {
|
|
|
275
312
|
}
|
|
276
313
|
}
|
|
277
314
|
//#endregion
|
|
278
|
-
export { applyPropsToElement, hasTrackedElementPropBindings, markReactivePropsDirtySource, syncElementPropBindings };
|
|
279
|
-
|
|
280
|
-
//# sourceMappingURL=prop-bindings.js.map
|
|
315
|
+
export { applyFreshElementBindings, applyMatchingElementBindings, applyPropsToElement, createReactivePropCleanupEntry, hasAnyElementBindingState, hasTrackedElementPropBindings, markReactivePropsDirtySource, syncElementPropBindings };
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { teardownNodeSubtree } from "./cleanup.js";
|
|
2
|
+
import { getRangeNodes } from "./dom-range.js";
|
|
2
3
|
import { createElementForNamespace, getParentNamespace } from "./namespaces.js";
|
|
3
|
-
import { syncControlBoundaryScopeDom } from "./boundaries.js";
|
|
4
4
|
import { collectReactiveChildBoundaryVNodes, isSingleRootReactiveChildBoundaryValue } from "./reactive-child-sources.js";
|
|
5
|
+
import { syncControlBoundaryScopeDom } from "./boundary-range-sync.js";
|
|
6
|
+
import "./boundaries.js";
|
|
5
7
|
//#region src/renderer/reactive-child-dom.ts
|
|
6
8
|
function materializeReactiveChildBoundaryNodes(value, parentNamespace, host) {
|
|
7
9
|
const nodes = [];
|
|
@@ -72,6 +74,7 @@ function commitReactiveChildBoundaryEntryNodes(el, entry, host) {
|
|
|
72
74
|
host.updateElementChildren(boundaryHost, nextChildren);
|
|
73
75
|
const nextNodes = Array.from(boundaryHost.childNodes);
|
|
74
76
|
entry.scope.dom = void 0;
|
|
77
|
+
entry.scope.range = void 0;
|
|
75
78
|
entry.scope.needsDomUpdate = false;
|
|
76
79
|
entry.nodes = nextNodes;
|
|
77
80
|
return nextNodes;
|
|
@@ -80,6 +83,7 @@ function commitReactiveChildBoundaryEntryNodes(el, entry, host) {
|
|
|
80
83
|
disposeReactiveChildBoundaryNodes(entry.nodes);
|
|
81
84
|
entry.nodes = [];
|
|
82
85
|
entry.scope.dom = void 0;
|
|
86
|
+
entry.scope.range = void 0;
|
|
83
87
|
}
|
|
84
88
|
const nextDom = syncControlBoundaryScopeDom(el, entry.scope, entry.scope.vnode ?? null);
|
|
85
89
|
if (!nextDom) {
|
|
@@ -87,7 +91,11 @@ function commitReactiveChildBoundaryEntryNodes(el, entry, host) {
|
|
|
87
91
|
entry.scope.needsDomUpdate = false;
|
|
88
92
|
return entry.nodes;
|
|
89
93
|
}
|
|
90
|
-
entry.nodes = [nextDom]
|
|
94
|
+
entry.nodes = nextDom.single ? [nextDom.start] : [
|
|
95
|
+
nextDom.start,
|
|
96
|
+
...getRangeNodes(nextDom),
|
|
97
|
+
nextDom.end
|
|
98
|
+
];
|
|
91
99
|
entry.scope.needsDomUpdate = false;
|
|
92
100
|
return entry.nodes;
|
|
93
101
|
}
|
|
@@ -129,5 +137,3 @@ function syncReactiveScalarTextNodes(el, slotValues, values, host) {
|
|
|
129
137
|
}
|
|
130
138
|
//#endregion
|
|
131
139
|
export { commitReactiveChildBoundaryEntryNodes, createReactiveChildBoundaryHost, disposeReactiveChildBoundaryNodes, materializeReactiveChildBoundaryNodes, syncReactiveChildExpectedNodes, syncReactiveChildSequenceNodes, syncReactiveScalarTextNodes };
|
|
132
|
-
|
|
133
|
-
//# sourceMappingURL=reactive-child-dom.js.map
|
|
@@ -180,5 +180,3 @@ function collectReactiveChildBoundaryVNodes(value, children) {
|
|
|
180
180
|
}
|
|
181
181
|
//#endregion
|
|
182
182
|
export { areReactiveChildBoundarySequenceSourcesEqual, areReactiveScalarChildSourcesEqual, canUpdateReactiveChildBoundarySequenceSource, collectReactiveChildBoundaryVNodes, collectReactiveChildValuesAsVNodes, getReactiveChildBoundarySequenceSource, getReactiveScalarChildSource, getSingleReactiveChildBoundarySource, isSingleRootReactiveChildBoundaryValue, normalizeOwnedReactiveTextValue, normalizeReactiveChildBoundaryVNode, normalizeReactiveScalarSequenceValues };
|
|
183
|
-
|
|
184
|
-
//# sourceMappingURL=reactive-child-sources.js.map
|
|
@@ -1,24 +1,19 @@
|
|
|
1
1
|
import { getRuntimeEnv } from "../common/env.js";
|
|
2
|
-
import { logger } from "../
|
|
2
|
+
import { logger } from "../common/logger.js";
|
|
3
3
|
import { incDevCounter } from "../runtime/dev-namespace.js";
|
|
4
4
|
import { getCurrentInstance } from "../runtime/component-scope.js";
|
|
5
|
-
import "../runtime/component-contracts.js";
|
|
6
|
-
import { REACTIVE_CHILDREN_KEY, elementReactivePropsCleanup, teardownNodeSubtree } from "./cleanup.js";
|
|
7
|
-
import "./env.js";
|
|
8
5
|
import { createChildScope, disposeChildScope, rerenderChildScope } from "../runtime/child-scope.js";
|
|
9
|
-
import { getParentNamespace } from "./namespaces.js";
|
|
10
6
|
import { createFineGrainedEffect } from "../runtime/effect.js";
|
|
7
|
+
import "../runtime/index.js";
|
|
8
|
+
import { REACTIVE_CHILDREN_KEY, elementReactivePropsCleanup, getElementReactivePropsCleanupMap, teardownNodeSubtree } from "./cleanup.js";
|
|
9
|
+
import "./env.js";
|
|
10
|
+
import { getParentNamespace } from "./namespaces.js";
|
|
11
11
|
import { areReactiveChildBoundarySequenceSourcesEqual, areReactiveScalarChildSourcesEqual, canUpdateReactiveChildBoundarySequenceSource, collectReactiveChildValuesAsVNodes, getReactiveChildBoundarySequenceSource, getReactiveScalarChildSource, getSingleReactiveChildBoundarySource, normalizeOwnedReactiveTextValue, normalizeReactiveChildBoundaryVNode, normalizeReactiveScalarSequenceValues } from "./reactive-child-sources.js";
|
|
12
12
|
import { commitReactiveChildBoundaryEntryNodes, createReactiveChildBoundaryHost, disposeReactiveChildBoundaryNodes, materializeReactiveChildBoundaryNodes, syncReactiveChildExpectedNodes, syncReactiveChildSequenceNodes, syncReactiveScalarTextNodes } from "./reactive-child-dom.js";
|
|
13
13
|
//#region src/renderer/reactive-children.ts
|
|
14
14
|
let reactiveChildScopeId = 0;
|
|
15
15
|
function getOrCreateElementReactiveCleanupMap(el) {
|
|
16
|
-
|
|
17
|
-
if (!cleanupMap) {
|
|
18
|
-
cleanupMap = /* @__PURE__ */ new Map();
|
|
19
|
-
elementReactivePropsCleanup.set(el, cleanupMap);
|
|
20
|
-
}
|
|
21
|
-
return cleanupMap;
|
|
16
|
+
return getElementReactivePropsCleanupMap(el, true);
|
|
22
17
|
}
|
|
23
18
|
function trySyncScalarChildSequenceInPlace(el, children, host) {
|
|
24
19
|
const normalized = normalizeReactiveScalarSequenceValues(children);
|
|
@@ -47,6 +42,11 @@ function setupReactiveScalarChild(el, source, host) {
|
|
|
47
42
|
host.updateElementChildren(el, value);
|
|
48
43
|
return;
|
|
49
44
|
}
|
|
45
|
+
if (!ownedTextNode && el.childNodes.length === 0) {
|
|
46
|
+
ownedTextNode = el.ownerDocument.createTextNode(normalized);
|
|
47
|
+
el.appendChild(ownedTextNode);
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
50
|
if (!ownedTextNode || el.childNodes.length !== 1 || el.firstChild !== ownedTextNode) {
|
|
51
51
|
host.updateElementChildren(el, normalized);
|
|
52
52
|
ownedTextNode = el.childNodes.length === 1 && el.firstChild?.nodeType === Node.TEXT_NODE ? el.firstChild : null;
|
|
@@ -124,6 +124,18 @@ function setupReactiveScalarChild(el, source, host) {
|
|
|
124
124
|
}
|
|
125
125
|
};
|
|
126
126
|
}
|
|
127
|
+
/** @internal Create a standalone scalar-child binding for rollback restoration. */
|
|
128
|
+
function createReactiveScalarChildCleanupEntry(el, source, host) {
|
|
129
|
+
const reactive = setupReactiveScalarChild(el, source, host);
|
|
130
|
+
return {
|
|
131
|
+
cleanup: reactive.cleanup,
|
|
132
|
+
updateFn: (nextValue) => {
|
|
133
|
+
reactive.updateFn(nextValue);
|
|
134
|
+
},
|
|
135
|
+
restoreFn: (nextValue) => createReactiveScalarChildCleanupEntry(el, nextValue, host),
|
|
136
|
+
fnRef: source
|
|
137
|
+
};
|
|
138
|
+
}
|
|
127
139
|
function setupReactiveChildBoundary(el, childFn, host) {
|
|
128
140
|
let currentChildFn = childFn;
|
|
129
141
|
const entry = {
|
|
@@ -224,17 +236,23 @@ function syncReactiveScalarChild(el, children, host) {
|
|
|
224
236
|
const reactiveChildSource = getReactiveScalarChildSource(children);
|
|
225
237
|
const reactiveChildBoundary = getSingleReactiveChildBoundarySource(children);
|
|
226
238
|
const reactiveChildBoundarySequence = getReactiveChildBoundarySequenceSource(children);
|
|
227
|
-
const
|
|
239
|
+
const cleanupMap = getElementReactivePropsCleanupMap(el);
|
|
240
|
+
const existingReactiveEntry = cleanupMap?.get(REACTIVE_CHILDREN_KEY);
|
|
228
241
|
if (!reactiveChildSource && !reactiveChildBoundary && !reactiveChildBoundarySequence) {
|
|
229
242
|
if (existingReactiveEntry) {
|
|
230
243
|
existingReactiveEntry.cleanup();
|
|
231
|
-
const cleanupMap = elementReactivePropsCleanup.get(el);
|
|
232
244
|
cleanupMap?.delete(REACTIVE_CHILDREN_KEY);
|
|
233
245
|
if (cleanupMap && cleanupMap.size === 0) elementReactivePropsCleanup.delete(el);
|
|
234
246
|
}
|
|
235
247
|
return false;
|
|
236
248
|
}
|
|
237
249
|
if (reactiveChildSource && !reactiveChildBoundarySequence) {
|
|
250
|
+
if (existingReactiveEntry?.groupedScalar && existingReactiveEntry.updateFn && reactiveChildSource.length === 1 && reactiveChildSource[0]?.kind === "dynamic") {
|
|
251
|
+
const nextCompute = reactiveChildSource[0].compute;
|
|
252
|
+
existingReactiveEntry.updateFn(nextCompute);
|
|
253
|
+
existingReactiveEntry.fnRef = nextCompute;
|
|
254
|
+
return true;
|
|
255
|
+
}
|
|
238
256
|
if (existingReactiveEntry && Array.isArray(existingReactiveEntry.fnRef) && areReactiveScalarChildSourcesEqual(existingReactiveEntry.fnRef, reactiveChildSource)) return true;
|
|
239
257
|
if (existingReactiveEntry?.updateFn && Array.isArray(existingReactiveEntry.fnRef)) {
|
|
240
258
|
existingReactiveEntry.updateFn(reactiveChildSource);
|
|
@@ -243,14 +261,7 @@ function syncReactiveScalarChild(el, children, host) {
|
|
|
243
261
|
}
|
|
244
262
|
existingReactiveEntry?.cleanup();
|
|
245
263
|
try {
|
|
246
|
-
|
|
247
|
-
getOrCreateElementReactiveCleanupMap(el).set(REACTIVE_CHILDREN_KEY, {
|
|
248
|
-
cleanup: reactive.cleanup,
|
|
249
|
-
updateFn: (nextValue) => {
|
|
250
|
-
reactive.updateFn(nextValue);
|
|
251
|
-
},
|
|
252
|
-
fnRef: reactiveChildSource
|
|
253
|
-
});
|
|
264
|
+
getOrCreateElementReactiveCleanupMap(el).set(REACTIVE_CHILDREN_KEY, createReactiveScalarChildCleanupEntry(el, reactiveChildSource, host));
|
|
254
265
|
return true;
|
|
255
266
|
} catch (error) {
|
|
256
267
|
if (!reactiveChildBoundary && !reactiveChildBoundarySequence) throw error;
|
|
@@ -289,6 +300,4 @@ function syncReactiveScalarChild(el, children, host) {
|
|
|
289
300
|
return true;
|
|
290
301
|
}
|
|
291
302
|
//#endregion
|
|
292
|
-
export { syncReactiveScalarChild, trySyncScalarChildSequenceInPlace };
|
|
293
|
-
|
|
294
|
-
//# sourceMappingURL=reactive-children.js.map
|
|
303
|
+
export { createReactiveScalarChildCleanupEntry, syncReactiveScalarChild, trySyncScalarChildSequenceInPlace };
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { getRuntimeEnv } from "../common/env.js";
|
|
2
2
|
import "./env.js";
|
|
3
|
-
import { checkPropChanges, recordFastPathStats } from "./utils.js";
|
|
3
|
+
import { checkPropChanges, getMaterializedKey, recordFastPathStats } from "./utils.js";
|
|
4
4
|
import { keyedElements, planKeyedReorderFastPath } from "./keyed.js";
|
|
5
5
|
import { canReuseIntrinsicElementInNamespace, getParentNamespace } from "./namespaces.js";
|
|
6
|
-
import { performBulkPositionalKeyedTextUpdate } from "./children.js";
|
|
6
|
+
import { performBulkPositionalKeyedTextUpdate } from "./children-fastpath.js";
|
|
7
|
+
import "./children.js";
|
|
7
8
|
import { applyRendererFastPath } from "./fastpath.js";
|
|
8
9
|
//#region src/renderer/reconcile-fastpaths.ts
|
|
9
10
|
function tryFastPaths(parent, newChildren, keyedVnodes, oldKeyMap) {
|
|
@@ -66,8 +67,7 @@ function countPositionalMatches(parent, keyedVnodes, parentNamespace) {
|
|
|
66
67
|
const el = parent.children[i];
|
|
67
68
|
if (!el) continue;
|
|
68
69
|
if (canReuseIntrinsicElementInNamespace(el, vnode.type, parentNamespace)) {
|
|
69
|
-
|
|
70
|
-
if (actualKey === String(expectedKey) || actualKey !== null && !Number.isNaN(Number(actualKey)) && Number(actualKey) === expectedKey) matchCount++;
|
|
70
|
+
if (getMaterializedKey(el) === expectedKey) matchCount++;
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
} catch {}
|
|
@@ -90,17 +90,11 @@ function rebuildKeyedMap(parent) {
|
|
|
90
90
|
try {
|
|
91
91
|
const map = /* @__PURE__ */ new Map();
|
|
92
92
|
for (let el = parent.firstElementChild; el; el = el.nextElementSibling) {
|
|
93
|
-
const
|
|
94
|
-
if (
|
|
95
|
-
map.set(k, el);
|
|
96
|
-
const n = Number(k);
|
|
97
|
-
if (!Number.isNaN(n)) map.set(n, el);
|
|
98
|
-
}
|
|
93
|
+
const key = getMaterializedKey(el);
|
|
94
|
+
if (key !== void 0) map.set(key, el);
|
|
99
95
|
}
|
|
100
96
|
keyedElements.set(parent, map);
|
|
101
97
|
} catch {}
|
|
102
98
|
}
|
|
103
99
|
//#endregion
|
|
104
100
|
export { tryFastPaths };
|
|
105
|
-
|
|
106
|
-
//# sourceMappingURL=reconcile-fastpaths.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { __FOR_BOUNDARY__ } from "../common/vnode.js";
|
|
2
|
-
import { extractKey } from "./utils.js";
|
|
3
|
-
import { evaluateForState } from "../runtime/for-internal.js";
|
|
4
|
-
import "../runtime/for.js";
|
|
5
2
|
import { evaluateCaseState, evaluateShowState } from "../runtime/control.js";
|
|
3
|
+
import { clearForDomUpdateState, evaluateForState } from "../runtime/for-internal.js";
|
|
4
|
+
import "../runtime/index.js";
|
|
5
|
+
import { extractKey, getMaterializedKey } from "./utils.js";
|
|
6
6
|
import { canReuseIntrinsicElementInNamespace, getParentNamespace } from "./namespaces.js";
|
|
7
7
|
import { getRendererDOMHost } from "./dom-host.js";
|
|
8
8
|
//#region src/renderer/reconcile-resolution.ts
|
|
@@ -14,39 +14,17 @@ function createOldElResolver(parent, oldKeyMap, usedOldEls) {
|
|
|
14
14
|
usedOldEls.add(direct);
|
|
15
15
|
return direct;
|
|
16
16
|
}
|
|
17
|
-
|
|
18
|
-
const byString = oldKeyMap.get(s);
|
|
19
|
-
if (byString && !usedOldEls.has(byString)) {
|
|
20
|
-
usedOldEls.add(byString);
|
|
21
|
-
return byString;
|
|
22
|
-
}
|
|
23
|
-
const n = Number(s);
|
|
24
|
-
if (!Number.isNaN(n)) {
|
|
25
|
-
const byNum = oldKeyMap.get(n);
|
|
26
|
-
if (byNum && !usedOldEls.has(byNum)) {
|
|
27
|
-
usedOldEls.add(byNum);
|
|
28
|
-
return byNum;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
return scanForElementByKey(parent, k, s, usedOldEls);
|
|
17
|
+
return scanForElementByKey(parent, k, usedOldEls);
|
|
32
18
|
};
|
|
33
19
|
}
|
|
34
|
-
function scanForElementByKey(parent, k,
|
|
20
|
+
function scanForElementByKey(parent, k, usedOldEls) {
|
|
35
21
|
try {
|
|
36
22
|
for (let ch = parent.firstElementChild; ch; ch = ch.nextElementSibling) {
|
|
37
23
|
if (usedOldEls.has(ch)) continue;
|
|
38
|
-
|
|
39
|
-
if (attr === keyStr) {
|
|
24
|
+
if (getMaterializedKey(ch) === k) {
|
|
40
25
|
usedOldEls.add(ch);
|
|
41
26
|
return ch;
|
|
42
27
|
}
|
|
43
|
-
if (attr !== null) {
|
|
44
|
-
const numAttr = Number(attr);
|
|
45
|
-
if (!Number.isNaN(numAttr) && numAttr === k) {
|
|
46
|
-
usedOldEls.add(ch);
|
|
47
|
-
return ch;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
28
|
}
|
|
51
29
|
} catch {}
|
|
52
30
|
}
|
|
@@ -64,7 +42,7 @@ function reconcileKeyedChild(child, key, parent, resolveOldElOnce, newKeyMap) {
|
|
|
64
42
|
const el = resolveOldElOnce(key);
|
|
65
43
|
const parentNamespace = getParentNamespace(parent);
|
|
66
44
|
const domHost = getRendererDOMHost();
|
|
67
|
-
if (el && el.parentElement === parent)
|
|
45
|
+
if (el && el.parentElement === parent) {
|
|
68
46
|
const childObj = child;
|
|
69
47
|
if (childObj && typeof childObj === "object" && typeof childObj.type === "string") {
|
|
70
48
|
if (canReuseIntrinsicElementInNamespace(el, childObj.type, parentNamespace)) {
|
|
@@ -80,7 +58,7 @@ function reconcileKeyedChild(child, key, parent, resolveOldElOnce, newKeyMap) {
|
|
|
80
58
|
return synced;
|
|
81
59
|
}
|
|
82
60
|
}
|
|
83
|
-
}
|
|
61
|
+
}
|
|
84
62
|
const dom = domHost.createDOMNode(child, parentNamespace);
|
|
85
63
|
if (dom) {
|
|
86
64
|
if (dom instanceof Element) newKeyMap.set(key, dom);
|
|
@@ -91,31 +69,29 @@ function reconcileKeyedChild(child, key, parent, resolveOldElOnce, newKeyMap) {
|
|
|
91
69
|
function reconcileUnkeyedChild(child, index, parent, resolveUnkeyedOnce, usedOldEls) {
|
|
92
70
|
const parentNamespace = getParentNamespace(parent);
|
|
93
71
|
const domHost = getRendererDOMHost();
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
if (
|
|
97
|
-
|
|
98
|
-
existing.data = String(child);
|
|
99
|
-
usedOldEls.add(existing);
|
|
100
|
-
return existing;
|
|
101
|
-
}
|
|
102
|
-
return domHost.createDOMNode(child, parentNamespace);
|
|
103
|
-
}
|
|
104
|
-
if (existing instanceof Element) {
|
|
105
|
-
const synced = trySyncComponentChild(existing, child, usedOldEls, parentNamespace);
|
|
106
|
-
if (synced) return synced;
|
|
107
|
-
}
|
|
108
|
-
if (existing instanceof Element && canReuseElement(existing, child, parentNamespace)) {
|
|
109
|
-
domHost.updateElementFromVnode(existing, child);
|
|
72
|
+
const existing = parent.childNodes[index];
|
|
73
|
+
if (typeof child === "string" || typeof child === "number") {
|
|
74
|
+
if (existing && existing.nodeType === 3) {
|
|
75
|
+
existing.data = String(child);
|
|
110
76
|
usedOldEls.add(existing);
|
|
111
77
|
return existing;
|
|
112
78
|
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
}
|
|
79
|
+
return domHost.createDOMNode(child, parentNamespace);
|
|
80
|
+
}
|
|
81
|
+
if (existing instanceof Element) {
|
|
82
|
+
const synced = trySyncComponentChild(existing, child, usedOldEls, parentNamespace);
|
|
83
|
+
if (synced) return synced;
|
|
84
|
+
}
|
|
85
|
+
if (existing instanceof Element && canReuseElement(existing, child, parentNamespace)) {
|
|
86
|
+
domHost.updateElementFromVnode(existing, child);
|
|
87
|
+
usedOldEls.add(existing);
|
|
88
|
+
return existing;
|
|
89
|
+
}
|
|
90
|
+
const avail = resolveUnkeyedOnce();
|
|
91
|
+
if (avail) {
|
|
92
|
+
const reuseResult = tryReuseElement(avail, child, usedOldEls, parentNamespace);
|
|
93
|
+
if (reuseResult) return reuseResult;
|
|
94
|
+
}
|
|
119
95
|
return domHost.createDOMNode(child, parentNamespace);
|
|
120
96
|
}
|
|
121
97
|
function isComponentVNode(child) {
|
|
@@ -130,10 +106,12 @@ function prepareControlBoundaryResolution(child) {
|
|
|
130
106
|
if (!controlState) return null;
|
|
131
107
|
if (controlState.kind === "for") {
|
|
132
108
|
const childrenVNodes = evaluateControlBoundaryChildren(controlState);
|
|
133
|
-
|
|
109
|
+
if (childrenVNodes.length !== 1) return null;
|
|
110
|
+
clearForDomUpdateState(controlState);
|
|
111
|
+
return {
|
|
134
112
|
remount: false,
|
|
135
113
|
vnode: childrenVNodes[0] ?? null
|
|
136
|
-
}
|
|
114
|
+
};
|
|
137
115
|
}
|
|
138
116
|
const previousActiveKey = controlState.activeKey;
|
|
139
117
|
const childrenVNodes = evaluateControlBoundaryChildren(controlState);
|
|
@@ -183,5 +161,3 @@ function tryReuseElement(avail, child, usedOldEls, parentNamespace) {
|
|
|
183
161
|
}
|
|
184
162
|
//#endregion
|
|
185
163
|
export { collectUnkeyedElements, createOldElResolver, reconcileSingleChild };
|
|
186
|
-
|
|
187
|
-
//# sourceMappingURL=reconcile-resolution.js.map
|