@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,161 @@
|
|
|
1
|
+
//#region src/renderer/dom-range.ts
|
|
2
|
+
const RANGE_START_MARKER = "askr-range-start";
|
|
3
|
+
const RANGE_END_MARKER = "askr-range-end";
|
|
4
|
+
const rangesByOwner = /* @__PURE__ */ new WeakMap();
|
|
5
|
+
const ownersByAnchor = /* @__PURE__ */ new WeakMap();
|
|
6
|
+
function isRangeMarker(node) {
|
|
7
|
+
return node.nodeType === 8;
|
|
8
|
+
}
|
|
9
|
+
function normalizeNodes(node) {
|
|
10
|
+
if (!node) return [];
|
|
11
|
+
return node instanceof DocumentFragment ? Array.from(node.childNodes) : [node];
|
|
12
|
+
}
|
|
13
|
+
function getRangeNodes(range) {
|
|
14
|
+
if (range.single) return range.start.parentNode ? [range.start] : [];
|
|
15
|
+
const nodes = [];
|
|
16
|
+
let current = range.start.nextSibling;
|
|
17
|
+
while (current && current !== range.end) {
|
|
18
|
+
nodes.push(current);
|
|
19
|
+
current = current.nextSibling;
|
|
20
|
+
}
|
|
21
|
+
return nodes;
|
|
22
|
+
}
|
|
23
|
+
function createDetachedRange(nodes, owner) {
|
|
24
|
+
if (nodes && !(nodes instanceof DocumentFragment)) return {
|
|
25
|
+
range: createSingleNodeRange(nodes, owner),
|
|
26
|
+
fragment: null
|
|
27
|
+
};
|
|
28
|
+
const normalized = normalizeNodes(nodes);
|
|
29
|
+
const ownerDocument = normalized[0]?.ownerDocument ?? (typeof document !== "undefined" ? document : null);
|
|
30
|
+
if (!ownerDocument) throw new Error("[askr] Cannot create a DOM range without a document.");
|
|
31
|
+
if (normalized.length === 1) {
|
|
32
|
+
const single = normalized[0];
|
|
33
|
+
return {
|
|
34
|
+
range: createSingleNodeRange(single, owner),
|
|
35
|
+
fragment: null
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
const fragment = ownerDocument.createDocumentFragment();
|
|
39
|
+
const start = ownerDocument.createComment(RANGE_START_MARKER);
|
|
40
|
+
const end = ownerDocument.createComment(RANGE_END_MARKER);
|
|
41
|
+
fragment.appendChild(start);
|
|
42
|
+
for (const node of normalized) fragment.appendChild(node);
|
|
43
|
+
fragment.appendChild(end);
|
|
44
|
+
const range = {
|
|
45
|
+
start,
|
|
46
|
+
end,
|
|
47
|
+
single: false
|
|
48
|
+
};
|
|
49
|
+
registerRange(range, owner);
|
|
50
|
+
return {
|
|
51
|
+
range,
|
|
52
|
+
fragment
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
/** @internal Create the common singleton range without a result wrapper. */
|
|
56
|
+
function createSingleNodeRange(node, owner) {
|
|
57
|
+
const range = {
|
|
58
|
+
start: node,
|
|
59
|
+
end: node,
|
|
60
|
+
single: true
|
|
61
|
+
};
|
|
62
|
+
registerRange(range, owner);
|
|
63
|
+
return range;
|
|
64
|
+
}
|
|
65
|
+
function createEmptyRange(ownerDocument = document, owner) {
|
|
66
|
+
return createDetachedRange(ownerDocument.createDocumentFragment(), owner);
|
|
67
|
+
}
|
|
68
|
+
function registerRange(range, owner) {
|
|
69
|
+
if (!owner) return;
|
|
70
|
+
rangesByOwner.set(owner, range);
|
|
71
|
+
ownersByAnchor.set(range.start, owner);
|
|
72
|
+
if (range.end !== range.start) ownersByAnchor.set(range.end, owner);
|
|
73
|
+
}
|
|
74
|
+
function getOwnedRange(owner) {
|
|
75
|
+
return rangesByOwner.get(owner);
|
|
76
|
+
}
|
|
77
|
+
function getRangeOwner(node) {
|
|
78
|
+
return ownersByAnchor.get(node);
|
|
79
|
+
}
|
|
80
|
+
function clearRangeOwner(range, owner) {
|
|
81
|
+
const startOwner = ownersByAnchor.get(range.start);
|
|
82
|
+
const endOwner = ownersByAnchor.get(range.end);
|
|
83
|
+
if (!owner || startOwner === owner) ownersByAnchor.delete(range.start);
|
|
84
|
+
if (!owner || endOwner === owner) ownersByAnchor.delete(range.end);
|
|
85
|
+
if (!owner || rangesByOwner.get(owner) === range) rangesByOwner.delete(owner ?? startOwner);
|
|
86
|
+
}
|
|
87
|
+
function appendRange(parent, range, before = null) {
|
|
88
|
+
if (range.single) {
|
|
89
|
+
parent.insertBefore(range.start, before);
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
const nodes = [
|
|
93
|
+
range.start,
|
|
94
|
+
...getRangeNodes(range),
|
|
95
|
+
range.end
|
|
96
|
+
];
|
|
97
|
+
for (const node of nodes) parent.insertBefore(node, before);
|
|
98
|
+
}
|
|
99
|
+
function moveRange(parent, range, before = null) {
|
|
100
|
+
if (before && rangeContains(range, before)) return;
|
|
101
|
+
if (range.single) {
|
|
102
|
+
parent.insertBefore(range.start, before);
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
const fragment = parent.ownerDocument.createDocumentFragment();
|
|
106
|
+
const nodes = [
|
|
107
|
+
range.start,
|
|
108
|
+
...getRangeNodes(range),
|
|
109
|
+
range.end
|
|
110
|
+
];
|
|
111
|
+
for (const node of nodes) fragment.appendChild(node);
|
|
112
|
+
parent.insertBefore(fragment, before);
|
|
113
|
+
}
|
|
114
|
+
function insertRangeBefore(parent, range, before = null) {
|
|
115
|
+
moveRange(parent, range, before);
|
|
116
|
+
}
|
|
117
|
+
function removeRange(range, removeNode = (node) => node.parentNode?.removeChild(node)) {
|
|
118
|
+
if (range.single) {
|
|
119
|
+
removeNode(range.start);
|
|
120
|
+
clearRangeOwner(range);
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
const nodes = [
|
|
124
|
+
range.start,
|
|
125
|
+
...getRangeNodes(range),
|
|
126
|
+
range.end
|
|
127
|
+
];
|
|
128
|
+
for (const node of nodes) removeNode(node);
|
|
129
|
+
clearRangeOwner(range);
|
|
130
|
+
}
|
|
131
|
+
function rangeContains(range, node) {
|
|
132
|
+
if (range.single) return range.start === node;
|
|
133
|
+
if (range.start.parentNode !== node.parentNode) return false;
|
|
134
|
+
let current = range.start;
|
|
135
|
+
while (current) {
|
|
136
|
+
if (current === node) return true;
|
|
137
|
+
if (current === range.end) break;
|
|
138
|
+
current = current.nextSibling;
|
|
139
|
+
}
|
|
140
|
+
return false;
|
|
141
|
+
}
|
|
142
|
+
function isRangeStart(node) {
|
|
143
|
+
return isRangeMarker(node) && node.data === "askr-range-start";
|
|
144
|
+
}
|
|
145
|
+
function isRangeEnd(node) {
|
|
146
|
+
return isRangeMarker(node) && node.data === "askr-range-end";
|
|
147
|
+
}
|
|
148
|
+
function findRangeEnd(start) {
|
|
149
|
+
if (!isRangeStart(start)) return null;
|
|
150
|
+
let depth = 0;
|
|
151
|
+
for (let current = start; current; current = current.nextSibling) {
|
|
152
|
+
if (isRangeStart(current)) depth++;
|
|
153
|
+
if (isRangeEnd(current)) {
|
|
154
|
+
depth--;
|
|
155
|
+
if (depth === 0) return current;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
return null;
|
|
159
|
+
}
|
|
160
|
+
//#endregion
|
|
161
|
+
export { RANGE_END_MARKER, RANGE_START_MARKER, appendRange, clearRangeOwner, createDetachedRange, createEmptyRange, createSingleNodeRange, findRangeEnd, getOwnedRange, getRangeNodes, getRangeOwner, insertRangeBefore, isRangeEnd, isRangeStart, moveRange, rangeContains, registerRange, removeRange };
|
package/dist/renderer/dom.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import "./boundaries.js";
|
|
2
1
|
import { performBulkPositionalKeyedTextUpdate } from "./children-fastpath.js";
|
|
3
2
|
import { isBulkTextFastPathEligible, performBulkTextReplace } from "./children.js";
|
|
4
|
-
import { syncComponentElement } from "./component-host.js";
|
|
5
3
|
import { setStaticChildSlotsCacheEnabled } from "./static-reuse.js";
|
|
6
4
|
import { updateElementChildren, updateUnkeyedChildren } from "./element-children.js";
|
|
7
5
|
import { markReactivePropsDirtySource } from "./prop-bindings.js";
|
|
6
|
+
import "./boundary-materialization.js";
|
|
7
|
+
import "./boundaries.js";
|
|
8
|
+
import { syncComponentElement } from "./component-host.js";
|
|
8
9
|
import { tryPatchStableForDirtyItem } from "./stable-patch.js";
|
|
9
|
-
import { IS_DOM_AVAILABLE, createDOMNode, updateElementFromVnode } from "./dom-internal.js";
|
|
10
|
-
export { IS_DOM_AVAILABLE, createDOMNode, isBulkTextFastPathEligible, markReactivePropsDirtySource, performBulkPositionalKeyedTextUpdate, performBulkTextReplace, setStaticChildSlotsCacheEnabled, syncComponentElement, tryPatchStableForDirtyItem, updateElementChildren, updateElementFromVnode, updateUnkeyedChildren };
|
|
10
|
+
import { IS_DOM_AVAILABLE, activateHydrationBoundary, createDOMNode, updateElementFromVnode } from "./dom-internal.js";
|
|
11
|
+
export { IS_DOM_AVAILABLE, activateHydrationBoundary, createDOMNode, isBulkTextFastPathEligible, markReactivePropsDirtySource, performBulkPositionalKeyedTextUpdate, performBulkTextReplace, setStaticChildSlotsCacheEnabled, syncComponentElement, tryPatchStableForDirtyItem, updateElementChildren, updateElementFromVnode, updateUnkeyedChildren };
|
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
import { _isDOMElement } from "../common/vnode.js";
|
|
1
|
+
import { __FOR_BOUNDARY__, _isDOMElement } from "../common/vnode.js";
|
|
2
2
|
import "./types.js";
|
|
3
3
|
import { teardownNodeSubtree } from "./cleanup.js";
|
|
4
|
-
import { extractKey } from "./utils.js";
|
|
4
|
+
import { extractKey, getMaterializedKey } from "./utils.js";
|
|
5
5
|
import { keyedElements } from "./keyed.js";
|
|
6
|
+
import { createDetachedRange, findRangeEnd, isRangeStart, moveRange, removeRange } from "./dom-range.js";
|
|
6
7
|
import { getParentNamespace } from "./namespaces.js";
|
|
7
|
-
import { clearControlBoundaryCommitOwner, commitForBoundaryChildren, evaluateControlBoundaryState, getControlBoundaryState, getDirectControlBoundaryVNode, registerControlBoundaryCommitOwner, trySyncControlBoundaryChild } from "./boundaries.js";
|
|
8
8
|
import { isBulkTextFastPathEligible, performBulkTextReplace } from "./children.js";
|
|
9
|
-
import { isFragmentVNode, normalizeComponentChildren } from "./child-shape.js";
|
|
10
9
|
import { getRendererDOMHost } from "./dom-host.js";
|
|
11
|
-
import { trySyncScalarChildSequenceInPlace } from "./reactive-children.js";
|
|
12
10
|
import { reconcileKeyedChildren } from "./reconcile.js";
|
|
11
|
+
import { isFragmentVNode, normalizeComponentChildren } from "./child-shape.js";
|
|
12
|
+
import { trySyncScalarChildSequenceInPlace } from "./reactive-children.js";
|
|
13
13
|
import { tagsEqualIgnoreCase } from "./static-reuse.js";
|
|
14
|
+
import { syncControlBoundaryInMixedParent } from "./boundary-range-sync.js";
|
|
15
|
+
import { evaluateControlBoundaryState, getControlBoundaryState, getDirectControlBoundaryVNode } from "./boundary-state.js";
|
|
16
|
+
import { clearControlBoundaryCommitOwner, commitForBoundaryChildren, registerControlBoundaryCommitOwner, trySyncControlBoundaryChild } from "./boundaries.js";
|
|
14
17
|
//#region src/renderer/element-children.ts
|
|
15
18
|
const rendererReactiveChildDOMHost = {
|
|
16
19
|
createDOMNode: (node, parentNamespace) => getRendererDOMHost().createDOMNode(node, parentNamespace),
|
|
@@ -60,6 +63,14 @@ function updateElementChildren(el, children, forceUpdate = false) {
|
|
|
60
63
|
keyedElements.delete(el);
|
|
61
64
|
return;
|
|
62
65
|
}
|
|
66
|
+
if (normalizedChildren.some(isControlBoundaryVNode) && normalizedChildren.every((child) => {
|
|
67
|
+
if (!isControlBoundaryVNode(child)) return true;
|
|
68
|
+
return getControlBoundaryState(child)?.kind !== "for";
|
|
69
|
+
})) {
|
|
70
|
+
updateMixedControlChildren(el, normalizedChildren, forceUpdate);
|
|
71
|
+
keyedElements.delete(el);
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
63
74
|
if (hasKeyedVNodeChildren(normalizedChildren)) {
|
|
64
75
|
const newKeyMap = reconcileKeyedChildren(el, normalizedChildren, getOrBuildDomKeyMap(el));
|
|
65
76
|
keyedElements.set(el, newKeyMap);
|
|
@@ -90,6 +101,88 @@ function hasKeyedVNodeChildren(children) {
|
|
|
90
101
|
for (let i = 0; i < children.length; i++) if (extractKey(children[i]) !== void 0) return true;
|
|
91
102
|
return false;
|
|
92
103
|
}
|
|
104
|
+
function isControlBoundaryVNode(child) {
|
|
105
|
+
return _isDOMElement(child) && child.type === __FOR_BOUNDARY__;
|
|
106
|
+
}
|
|
107
|
+
function removeRangeAtCursor(parent, cursor) {
|
|
108
|
+
if (!isRangeStart(cursor)) return cursor;
|
|
109
|
+
const end = findRangeEnd(cursor);
|
|
110
|
+
if (!end) return cursor;
|
|
111
|
+
const range = {
|
|
112
|
+
start: cursor,
|
|
113
|
+
end,
|
|
114
|
+
single: false
|
|
115
|
+
};
|
|
116
|
+
const next = end.nextSibling;
|
|
117
|
+
removeRange(range, (node) => {
|
|
118
|
+
if (node === range.start || node === range.end) {
|
|
119
|
+
node.parentNode?.removeChild(node);
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
teardownNodeSubtree(node);
|
|
123
|
+
node.parentNode?.removeChild(node);
|
|
124
|
+
});
|
|
125
|
+
return next;
|
|
126
|
+
}
|
|
127
|
+
function updateMixedControlChildren(parent, children, forceUpdate) {
|
|
128
|
+
const parentNamespace = getParentNamespace(parent);
|
|
129
|
+
const domHost = getRendererDOMHost();
|
|
130
|
+
let cursor = parent.firstChild;
|
|
131
|
+
for (const child of children) {
|
|
132
|
+
if (isControlBoundaryVNode(child)) {
|
|
133
|
+
const controlState = getControlBoundaryState(child);
|
|
134
|
+
if (!controlState) throw new Error("[updateElementChildren] Control boundary missing internal state");
|
|
135
|
+
registerControlBoundaryCommitOwner(parent, controlState);
|
|
136
|
+
const ranges = syncControlBoundaryInMixedParent(parent, controlState, evaluateControlBoundaryState(controlState), cursor);
|
|
137
|
+
for (const range of ranges) if (range.start.parentNode !== parent) moveRange(parent, range, cursor?.parentNode === parent ? cursor : null);
|
|
138
|
+
else if (cursor?.parentNode === parent) moveRange(parent, range, cursor);
|
|
139
|
+
const last = ranges[ranges.length - 1];
|
|
140
|
+
if (last) {
|
|
141
|
+
const cursorWasReplaced = cursor && !ranges.some((range) => range.start === cursor);
|
|
142
|
+
if (!cursor?.parentNode) cursor = last.end.nextSibling;
|
|
143
|
+
else if (cursorWasReplaced && isRangeStart(cursor)) cursor = findRangeEnd(cursor)?.nextSibling ?? last.end.nextSibling;
|
|
144
|
+
else if (isRangeStart(cursor)) cursor = findRangeEnd(cursor)?.nextSibling ?? last.end.nextSibling;
|
|
145
|
+
else cursor = last.end.nextSibling;
|
|
146
|
+
}
|
|
147
|
+
continue;
|
|
148
|
+
}
|
|
149
|
+
if (cursor) cursor = removeRangeAtCursor(parent, cursor);
|
|
150
|
+
if (cursor && (typeof child === "string" || typeof child === "number") && cursor.nodeType === 3) {
|
|
151
|
+
cursor.data = String(child);
|
|
152
|
+
cursor = cursor.nextSibling;
|
|
153
|
+
continue;
|
|
154
|
+
}
|
|
155
|
+
if (cursor instanceof Element && _isDOMElement(child) && typeof child.type === "string" && tagsEqualIgnoreCase(cursor.tagName, child.type)) {
|
|
156
|
+
domHost.updateElementFromVnode(cursor, child, true, forceUpdate);
|
|
157
|
+
cursor = cursor.nextSibling;
|
|
158
|
+
continue;
|
|
159
|
+
}
|
|
160
|
+
if (cursor instanceof Element && _isDOMElement(child) && typeof child.type === "function") {
|
|
161
|
+
const synced = domHost.syncComponentElement(cursor, child, child.type, (child.props ?? {}) || {}, parentNamespace, forceUpdate);
|
|
162
|
+
if (synced) {
|
|
163
|
+
cursor = synced.nextSibling;
|
|
164
|
+
continue;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
const created = domHost.createDOMNode(child, parentNamespace);
|
|
168
|
+
if (!created) {
|
|
169
|
+
cursor = cursor?.nextSibling ?? null;
|
|
170
|
+
continue;
|
|
171
|
+
}
|
|
172
|
+
const materialized = createDetachedRange(created);
|
|
173
|
+
const old = cursor;
|
|
174
|
+
moveRange(parent, materialized.range, old);
|
|
175
|
+
if (old) {
|
|
176
|
+
teardownNodeSubtree(old);
|
|
177
|
+
old.parentNode?.removeChild(old);
|
|
178
|
+
}
|
|
179
|
+
cursor = materialized.range.end.nextSibling;
|
|
180
|
+
}
|
|
181
|
+
while (cursor) {
|
|
182
|
+
const next = removeRangeAtCursor(parent, cursor);
|
|
183
|
+
cursor = next === cursor ? cursor.nextSibling : next;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
93
186
|
function isEmptyChild(child) {
|
|
94
187
|
return child === null || child === void 0 || child === false;
|
|
95
188
|
}
|
|
@@ -98,12 +191,8 @@ function getOrBuildDomKeyMap(parent) {
|
|
|
98
191
|
if (!keyMap) {
|
|
99
192
|
keyMap = /* @__PURE__ */ new Map();
|
|
100
193
|
for (let child = parent.firstElementChild; child; child = child.nextElementSibling) {
|
|
101
|
-
const key = child
|
|
102
|
-
if (key !==
|
|
103
|
-
keyMap.set(key, child);
|
|
104
|
-
const numericKey = Number(key);
|
|
105
|
-
if (!Number.isNaN(numericKey)) keyMap.set(numericKey, child);
|
|
106
|
-
}
|
|
194
|
+
const key = getMaterializedKey(child);
|
|
195
|
+
if (key !== void 0) keyMap.set(key, child);
|
|
107
196
|
}
|
|
108
197
|
if (keyMap.size > 0) keyedElements.set(parent, keyMap);
|
|
109
198
|
}
|
|
@@ -137,9 +226,7 @@ function updateUnkeyedChildren(parent, newChildren, forceUpdate = false) {
|
|
|
137
226
|
}
|
|
138
227
|
else if (_isDOMElement(next)) {
|
|
139
228
|
if (trySyncControlBoundaryChild(parent, current, next)) continue;
|
|
140
|
-
|
|
141
|
-
if (synced && synced !== current) teardownNodeSubtree(current);
|
|
142
|
-
else if (!synced) {
|
|
229
|
+
if (!trySyncComponentChild(current, next)) {
|
|
143
230
|
const dom = domHost.createDOMNode(next, parentNamespace);
|
|
144
231
|
if (dom) {
|
|
145
232
|
teardownNodeSubtree(current);
|
|
@@ -192,9 +279,7 @@ function updateUnkeyedChildren(parent, newChildren, forceUpdate = false) {
|
|
|
192
279
|
}
|
|
193
280
|
else {
|
|
194
281
|
if (trySyncControlBoundaryChild(parent, currentNode, next)) continue;
|
|
195
|
-
|
|
196
|
-
if (synced && synced !== currentNode) teardownNodeSubtree(currentEl);
|
|
197
|
-
else if (!synced) {
|
|
282
|
+
if (!trySyncComponentChild(currentEl, next)) {
|
|
198
283
|
const dom = domHost.createDOMNode(next, parentNamespace);
|
|
199
284
|
if (dom) {
|
|
200
285
|
teardownNodeSubtree(currentEl);
|
|
@@ -245,26 +330,23 @@ function updateUnkeyedChildren(parent, newChildren, forceUpdate = false) {
|
|
|
245
330
|
const textNode = document.createTextNode(String(next));
|
|
246
331
|
teardownNodeSubtree(current);
|
|
247
332
|
parent.replaceChild(textNode, current);
|
|
248
|
-
} else if (_isDOMElement(next))
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
333
|
+
} else if (_isDOMElement(next)) {
|
|
334
|
+
if (typeof next.type === "string") if (tagsEqualIgnoreCase(current.tagName, next.type)) domHost.updateElementFromVnode(current, next, true, forceUpdate);
|
|
335
|
+
else {
|
|
336
|
+
const dom = domHost.createDOMNode(next, parentNamespace);
|
|
337
|
+
if (dom) {
|
|
338
|
+
teardownNodeSubtree(current);
|
|
339
|
+
parent.replaceChild(dom, current);
|
|
340
|
+
}
|
|
254
341
|
}
|
|
255
|
-
|
|
256
|
-
else {
|
|
257
|
-
const synced = trySyncComponentChild(current, next);
|
|
258
|
-
if (synced && synced !== current) teardownNodeSubtree(current);
|
|
259
|
-
else if (!synced) {
|
|
342
|
+
else if (!trySyncComponentChild(current, next)) {
|
|
260
343
|
const dom = domHost.createDOMNode(next, parentNamespace);
|
|
261
344
|
if (dom) {
|
|
262
345
|
teardownNodeSubtree(current);
|
|
263
346
|
parent.replaceChild(dom, current);
|
|
264
347
|
}
|
|
265
348
|
}
|
|
266
|
-
}
|
|
267
|
-
else {
|
|
349
|
+
} else {
|
|
268
350
|
const dom = domHost.createDOMNode(next);
|
|
269
351
|
if (dom) {
|
|
270
352
|
teardownNodeSubtree(current);
|
|
@@ -275,5 +357,3 @@ function updateUnkeyedChildren(parent, newChildren, forceUpdate = false) {
|
|
|
275
357
|
}
|
|
276
358
|
//#endregion
|
|
277
359
|
export { rendererReactiveChildDOMHost, updateElementChildren, updateUnkeyedChildren };
|
|
278
|
-
|
|
279
|
-
//# sourceMappingURL=element-children.js.map
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { isDevelopmentEnvironment } from "../common/env.js";
|
|
2
2
|
import { logger } from "../common/logger.js";
|
|
3
|
+
import { beginLifecycleCommitBatch, discardLifecycleCommitBatch, flushLifecycleCommitBatch } from "../runtime/lifecycle-batch.js";
|
|
3
4
|
import { createBoundaryReset, reportBoundaryError } from "../runtime/error-boundary.js";
|
|
4
5
|
import "../runtime/index.js";
|
|
5
6
|
import { getRendererDOMHost } from "./dom-host.js";
|
|
@@ -51,28 +52,35 @@ function resolveErrorBoundaryFallback(fallback, error, reset) {
|
|
|
51
52
|
if (typeof fallback === "function") return fallback(error, reset);
|
|
52
53
|
return fallback ?? createDefaultFallbackNode(error, reset);
|
|
53
54
|
}
|
|
55
|
+
function runErrorBoundaryDOMAttempt(attempt) {
|
|
56
|
+
const lifecycleBatch = beginLifecycleCommitBatch();
|
|
57
|
+
try {
|
|
58
|
+
const result = attempt();
|
|
59
|
+
flushLifecycleCommitBatch(lifecycleBatch);
|
|
60
|
+
return result;
|
|
61
|
+
} catch (error) {
|
|
62
|
+
discardLifecycleCommitBatch(lifecycleBatch);
|
|
63
|
+
throw error;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
function materializeErrorBoundaryValue(value, parentNamespace) {
|
|
67
|
+
if (value instanceof Node) return value;
|
|
68
|
+
return getRendererDOMHost().createDOMNode(value, parentNamespace) ?? document.createComment("");
|
|
69
|
+
}
|
|
54
70
|
function createErrorBoundaryElement(node, props, parentNamespace) {
|
|
55
71
|
const boundaryState = node.__instance?.errorBoundaryState ?? null;
|
|
56
72
|
const reset = node.__instance ? createBoundaryReset(node.__instance) : () => {};
|
|
57
73
|
const fallback = props.fallback;
|
|
58
74
|
const children = props.children;
|
|
59
75
|
const domHost = getRendererDOMHost();
|
|
60
|
-
if (boundaryState?.error != null)
|
|
61
|
-
const fallbackValue = resolveErrorBoundaryFallback(fallback, boundaryState.error, reset);
|
|
62
|
-
if (fallbackValue instanceof Node) return fallbackValue;
|
|
63
|
-
return domHost.createDOMNode(fallbackValue, parentNamespace) ?? document.createComment("");
|
|
64
|
-
}
|
|
76
|
+
if (boundaryState?.error != null) return runErrorBoundaryDOMAttempt(() => materializeErrorBoundaryValue(resolveErrorBoundaryFallback(fallback, boundaryState.error, reset), parentNamespace));
|
|
65
77
|
try {
|
|
66
|
-
return domHost.createDOMNode(children, parentNamespace) ?? document.createComment("");
|
|
78
|
+
return runErrorBoundaryDOMAttempt(() => domHost.createDOMNode(children, parentNamespace) ?? document.createComment(""));
|
|
67
79
|
} catch (error) {
|
|
68
80
|
if (node.__instance) reportBoundaryError(node.__instance, error, props.onError);
|
|
69
81
|
else logger.error("[Askr] ErrorBoundary caught render error:", error);
|
|
70
|
-
|
|
71
|
-
if (fallbackValue instanceof Node) return fallbackValue;
|
|
72
|
-
return domHost.createDOMNode(fallbackValue, parentNamespace) ?? document.createComment("");
|
|
82
|
+
return runErrorBoundaryDOMAttempt(() => materializeErrorBoundaryValue(resolveErrorBoundaryFallback(fallback, error, reset), parentNamespace));
|
|
73
83
|
}
|
|
74
84
|
}
|
|
75
85
|
//#endregion
|
|
76
86
|
export { createErrorBoundaryElement };
|
|
77
|
-
|
|
78
|
-
//# sourceMappingURL=error-boundary-dom.js.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { _isDOMElement } from "../common/vnode.js";
|
|
2
2
|
import "./types.js";
|
|
3
3
|
import { teardownNodeSubtree } from "./cleanup.js";
|
|
4
|
+
import { RANGE_END_MARKER, RANGE_START_MARKER } from "./dom-range.js";
|
|
4
5
|
import { getRendererDOMHost } from "./dom-host.js";
|
|
5
6
|
import { smartUpdateElement, tagNamesEqualIgnoreCase } from "./evaluate-reconcile.js";
|
|
6
7
|
//#region src/renderer/evaluate-dom-range.ts
|
|
@@ -9,8 +10,8 @@ function hasDOMRange(context) {
|
|
|
9
10
|
return domRanges.has(context);
|
|
10
11
|
}
|
|
11
12
|
function createDOMRange(target, context, node) {
|
|
12
|
-
const start = document.createComment(
|
|
13
|
-
const end = document.createComment(
|
|
13
|
+
const start = document.createComment(RANGE_START_MARKER);
|
|
14
|
+
const end = document.createComment(RANGE_END_MARKER);
|
|
14
15
|
target.appendChild(start);
|
|
15
16
|
target.appendChild(end);
|
|
16
17
|
domRanges.set(context, {
|
|
@@ -81,5 +82,3 @@ function updateDOMRangeForContext(target, context, children) {
|
|
|
81
82
|
}
|
|
82
83
|
//#endregion
|
|
83
84
|
export { cleanupRangeNode, createDOMRange, hasDOMRange, updateDOMRangeForContext };
|
|
84
|
-
|
|
85
|
-
//# sourceMappingURL=evaluate-dom-range.js.map
|
|
@@ -7,18 +7,19 @@ import { incDevCounter, setDevValue } from "../runtime/dev-namespace.js";
|
|
|
7
7
|
import { evaluateCaseState, evaluateShowState } from "../runtime/control.js";
|
|
8
8
|
import { evaluateForState } from "../runtime/for-internal.js";
|
|
9
9
|
import "../runtime/index.js";
|
|
10
|
-
import { elementListeners } from "./cleanup.js";
|
|
10
|
+
import { elementListeners, updateElementRef } from "./cleanup.js";
|
|
11
11
|
import "./env.js";
|
|
12
|
-
import { createWrappedHandler, extractKey, getEventListenerKey, getEventListenerOptions, parseEventProp, setRenderedAttribute, tagNamesEqualIgnoreCase as tagNamesEqualIgnoreCase$1, writeElementClassName } from "./utils.js";
|
|
12
|
+
import { createWrappedHandler, extractKey, getEventListenerKey, getEventListenerOptions, getMaterializedKey, parseEventProp, setRenderedAttribute, tagNamesEqualIgnoreCase as tagNamesEqualIgnoreCase$1, writeElementClassName } from "./utils.js";
|
|
13
13
|
import { keyedElements } from "./keyed.js";
|
|
14
14
|
import { createElementForNamespace, getParentNamespace } from "./namespaces.js";
|
|
15
|
-
import { commitForBoundaryChildren } from "./boundaries.js";
|
|
16
15
|
import { performBulkPositionalKeyedTextUpdate } from "./children-fastpath.js";
|
|
17
16
|
import { isBulkTextFastPathEligible, performBulkTextReplace } from "./children.js";
|
|
18
17
|
import { getRendererDOMHost } from "./dom-host.js";
|
|
19
18
|
import { reconcileKeyedChildren } from "./reconcile.js";
|
|
20
19
|
import { updateUnkeyedChildren } from "./element-children.js";
|
|
21
20
|
import { runRetainedElementUpdate } from "./retained-element-rollback.js";
|
|
21
|
+
import { tryAdoptMatchingIntrinsicSubtree } from "./intrinsic-hydration-adoption.js";
|
|
22
|
+
import { commitForBoundaryChildren } from "./boundaries.js";
|
|
22
23
|
//#region src/renderer/evaluate-reconcile.ts
|
|
23
24
|
function getRetainedHostOwnerChain(host, owner) {
|
|
24
25
|
const instances = host.__ASKR_INSTANCES ?? [];
|
|
@@ -60,12 +61,8 @@ function tryUpdateTextInPlace(element, text) {
|
|
|
60
61
|
function buildKeyMapFromDOM(parent) {
|
|
61
62
|
const keyMap = /* @__PURE__ */ new Map();
|
|
62
63
|
for (let child = parent.firstElementChild; child; child = child.nextElementSibling) {
|
|
63
|
-
const
|
|
64
|
-
if (
|
|
65
|
-
keyMap.set(k, child);
|
|
66
|
-
const n = Number(k);
|
|
67
|
-
if (!Number.isNaN(n)) keyMap.set(n, child);
|
|
68
|
-
}
|
|
64
|
+
const key = getMaterializedKey(child);
|
|
65
|
+
if (key !== void 0) keyMap.set(key, child);
|
|
69
66
|
}
|
|
70
67
|
return keyMap;
|
|
71
68
|
}
|
|
@@ -177,17 +174,11 @@ function updateElementChildren(element, vnodeChildren, cleanupRangeNode) {
|
|
|
177
174
|
updateForBoundaryChildren(element, vnodeChildren[0]);
|
|
178
175
|
return;
|
|
179
176
|
}
|
|
180
|
-
if (hasKeyedChildren(vnodeChildren))
|
|
181
|
-
|
|
182
|
-
try {
|
|
183
|
-
reconcileKeyed(element, vnodeChildren, oldKeyMap);
|
|
184
|
-
} catch {
|
|
185
|
-
const newKeyMap = reconcileKeyedChildren(element, vnodeChildren, oldKeyMap);
|
|
186
|
-
keyedElements.set(element, newKeyMap);
|
|
187
|
-
}
|
|
188
|
-
} else reconcileUnkeyed(element, vnodeChildren);
|
|
177
|
+
if (hasKeyedChildren(vnodeChildren)) reconcileKeyed(element, vnodeChildren, getOrBuildKeyMap(element));
|
|
178
|
+
else reconcileUnkeyed(element, vnodeChildren);
|
|
189
179
|
}
|
|
190
180
|
function smartUpdateElement(element, vnode, cleanupRangeNode) {
|
|
181
|
+
if (tryAdoptMatchingIntrinsicSubtree(element, vnode)) return;
|
|
191
182
|
const hadVNodeKey = Object.prototype.hasOwnProperty.call(vnode, "key");
|
|
192
183
|
const previousVNodeKey = vnode.key;
|
|
193
184
|
runRetainedElementUpdate(element, cleanupRangeNode, () => applySmartUpdateElement(element, vnode, cleanupRangeNode), () => {
|
|
@@ -198,11 +189,8 @@ function smartUpdateElement(element, vnode, cleanupRangeNode) {
|
|
|
198
189
|
function applySmartUpdateElement(element, vnode, cleanupRangeNode) {
|
|
199
190
|
const domHost = getRendererDOMHost();
|
|
200
191
|
if (vnode.key == null && element.hasAttribute("data-key")) {
|
|
201
|
-
const existingKey = element
|
|
202
|
-
if (existingKey !==
|
|
203
|
-
const numericKey = Number(existingKey);
|
|
204
|
-
vnode.key = Number.isNaN(numericKey) ? existingKey : numericKey;
|
|
205
|
-
}
|
|
192
|
+
const existingKey = getMaterializedKey(element);
|
|
193
|
+
if (existingKey !== void 0) vnode.key = existingKey;
|
|
206
194
|
}
|
|
207
195
|
let vnodeChildren = vnode.props?.children ?? vnode.children;
|
|
208
196
|
if (vnodeChildren && _isDOMElement(vnodeChildren) && vnodeChildren.type === __FOR_BOUNDARY__) {
|
|
@@ -223,7 +211,7 @@ function applyPropsToElement(el, props) {
|
|
|
223
211
|
if (key === "children" || key === "key") continue;
|
|
224
212
|
if (value === void 0 || value === null || value === false) continue;
|
|
225
213
|
if (key === "ref") {
|
|
226
|
-
|
|
214
|
+
updateElementRef(el, value);
|
|
227
215
|
continue;
|
|
228
216
|
}
|
|
229
217
|
const eventProp = parseEventProp(key);
|
|
@@ -248,17 +236,6 @@ function applyPropsToElement(el, props) {
|
|
|
248
236
|
else setRenderedAttribute(el, key, String(value));
|
|
249
237
|
}
|
|
250
238
|
}
|
|
251
|
-
function applyRef(el, ref) {
|
|
252
|
-
const r = ref;
|
|
253
|
-
if (!r) return;
|
|
254
|
-
if (typeof r === "function") {
|
|
255
|
-
r(el);
|
|
256
|
-
return;
|
|
257
|
-
}
|
|
258
|
-
try {
|
|
259
|
-
r.current = el;
|
|
260
|
-
} catch {}
|
|
261
|
-
}
|
|
262
239
|
function tryFirstRenderKeyedChildren(target, vnode) {
|
|
263
240
|
const children = vnode.children;
|
|
264
241
|
if (!Array.isArray(children) || !hasKeyedChildren(children)) return false;
|
|
@@ -278,5 +255,3 @@ function getFragmentChildren(vnode) {
|
|
|
278
255
|
}
|
|
279
256
|
//#endregion
|
|
280
257
|
export { getFragmentChildren, getRetainedHostOwnerChain, isFragment, processFragmentChildren, retainHostOwnerChain, smartUpdateElement, tagNamesEqualIgnoreCase, tryFirstRenderKeyedChildren, updateElementChildren, updateForBoundaryChildren };
|
|
281
|
-
|
|
282
|
-
//# sourceMappingURL=evaluate-reconcile.js.map
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { __FOR_BOUNDARY__, _isDOMElement } from "../common/vnode.js";
|
|
2
2
|
import "./types.js";
|
|
3
3
|
import { getRuntimeEnv } from "../common/env.js";
|
|
4
|
+
import { beginLifecycleCommitBatch, discardLifecycleCommitBatch, flushLifecycleCommitBatch, getCurrentLifecycleCommitBatch } from "../runtime/lifecycle-batch.js";
|
|
5
|
+
import "../runtime/index.js";
|
|
4
6
|
import { removeAllListeners } from "./cleanup.js";
|
|
5
7
|
import "./env.js";
|
|
8
|
+
import { getFragmentChildren, getRetainedHostOwnerChain, isFragment, processFragmentChildren, retainHostOwnerChain, smartUpdateElement, tagNamesEqualIgnoreCase, tryFirstRenderKeyedChildren, updateElementChildren, updateForBoundaryChildren } from "./evaluate-reconcile.js";
|
|
6
9
|
import { syncComponentElement } from "./component-host.js";
|
|
7
10
|
import { createDOMNode } from "./dom-internal.js";
|
|
8
11
|
import "./dom.js";
|
|
9
|
-
import { getFragmentChildren, getRetainedHostOwnerChain, isFragment, processFragmentChildren, retainHostOwnerChain, smartUpdateElement, tagNamesEqualIgnoreCase, tryFirstRenderKeyedChildren, updateElementChildren, updateForBoundaryChildren } from "./evaluate-reconcile.js";
|
|
10
12
|
import { cleanupRangeNode, createDOMRange, hasDOMRange, updateDOMRangeForContext } from "./evaluate-dom-range.js";
|
|
11
13
|
function evaluate(node, target, context, retainedOwner) {
|
|
12
14
|
if (!target) return;
|
|
@@ -16,6 +18,17 @@ function evaluate(node, target, context, retainedOwner) {
|
|
|
16
18
|
} catch (e) {}
|
|
17
19
|
return;
|
|
18
20
|
}
|
|
21
|
+
const batch = !getCurrentLifecycleCommitBatch() ? beginLifecycleCommitBatch() : null;
|
|
22
|
+
try {
|
|
23
|
+
evaluateInLifecycleBatch(node, target, context, retainedOwner);
|
|
24
|
+
if (batch) flushLifecycleCommitBatch(batch);
|
|
25
|
+
} catch (error) {
|
|
26
|
+
if (batch) discardLifecycleCommitBatch(batch);
|
|
27
|
+
throw error;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function evaluateInLifecycleBatch(node, target, context, retainedOwner) {
|
|
31
|
+
if (!target) return;
|
|
19
32
|
if (context && hasDOMRange(context)) updateDOMRangeForContext(target, context, node === null || node === void 0 || node === false ? [] : isFragment(node) ? getFragmentChildren(node) : Array.isArray(node) ? node : [node]);
|
|
20
33
|
else if (context) createDOMRange(target, context, node);
|
|
21
34
|
else {
|
|
@@ -80,5 +93,3 @@ function evaluate(node, target, context, retainedOwner) {
|
|
|
80
93
|
}
|
|
81
94
|
//#endregion
|
|
82
95
|
export { evaluate };
|
|
83
|
-
|
|
84
|
-
//# sourceMappingURL=evaluate.js.map
|
|
@@ -7,7 +7,7 @@ import { recordBenchCounter, recordBenchEvent } from "../runtime/for-bench.js";
|
|
|
7
7
|
import "../runtime/index.js";
|
|
8
8
|
import { cleanupInstanceIfPresent, removeAllListeners } from "./cleanup.js";
|
|
9
9
|
import "./env.js";
|
|
10
|
-
import { canUseDirectReplaceChildrenSpread } from "./utils.js";
|
|
10
|
+
import { canUseDirectReplaceChildrenSpread, getMaterializedKey } from "./utils.js";
|
|
11
11
|
import { _reconcilerRecordedParents } from "./keyed.js";
|
|
12
12
|
import { createDOMNode, updateElementFromVnode } from "./dom-internal.js";
|
|
13
13
|
import "./dom.js";
|
|
@@ -27,12 +27,8 @@ function applyRendererFastPath(parent, keyedVnodes, oldKeyMap) {
|
|
|
27
27
|
localOldKeyMap = /* @__PURE__ */ new Map();
|
|
28
28
|
try {
|
|
29
29
|
for (let ch = parent.firstElementChild; ch; ch = ch.nextElementSibling) {
|
|
30
|
-
const
|
|
31
|
-
if (
|
|
32
|
-
localOldKeyMap.set(k, ch);
|
|
33
|
-
const n = Number(k);
|
|
34
|
-
if (!Number.isNaN(n)) localOldKeyMap.set(n, ch);
|
|
35
|
-
}
|
|
30
|
+
const key = getMaterializedKey(ch);
|
|
31
|
+
if (key !== void 0) localOldKeyMap.set(key, ch);
|
|
36
32
|
}
|
|
37
33
|
} catch (e) {
|
|
38
34
|
localOldKeyMap = void 0;
|
|
@@ -47,11 +43,9 @@ function applyRendererFastPath(parent, keyedVnodes, oldKeyMap) {
|
|
|
47
43
|
mapLookups++;
|
|
48
44
|
let el;
|
|
49
45
|
if (totalKeyed <= 20 && parentChildrenArr) {
|
|
50
|
-
const ks = String(key);
|
|
51
46
|
for (let j = 0; j < parentChildrenArr.length; j++) {
|
|
52
47
|
const ch = parentChildrenArr[j];
|
|
53
|
-
|
|
54
|
-
if (k !== null && (k === ks || Number(k) === key)) {
|
|
48
|
+
if (getMaterializedKey(ch) === key) {
|
|
55
49
|
el = ch;
|
|
56
50
|
break;
|
|
57
51
|
}
|
|
@@ -146,5 +140,3 @@ function applyRendererFastPath(parent, keyedVnodes, oldKeyMap) {
|
|
|
146
140
|
}
|
|
147
141
|
//#endregion
|
|
148
142
|
export { applyRendererFastPath };
|
|
149
|
-
|
|
150
|
-
//# sourceMappingURL=fastpath.js.map
|