@askrjs/askr 0.0.51 → 0.0.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bench/components/benchmark-row.d.ts +2 -2
- package/dist/bench/components/benchmark-row.js +0 -2
- package/dist/bench/components/benchmark-table.js +0 -2
- package/dist/benchmark.d.ts +1 -2
- package/dist/benchmark.js +2 -4
- package/dist/bin/askr-ssg.d.ts +1 -2
- package/dist/bin/askr-ssg.js +21 -6
- package/dist/boot/hydration.js +10 -11
- package/dist/boot/index.d.ts +1 -2
- package/dist/boot/index.js +20 -11
- package/dist/boot/root-lifecycle.d.ts +6 -3
- package/dist/boot/root-lifecycle.js +14 -10
- package/dist/boot/route-startup.js +13 -4
- package/dist/boot/types.d.ts +1 -2
- package/dist/common/attr-names.js +0 -2
- package/dist/common/component.d.ts +1 -2
- package/dist/common/control.d.ts +1 -2
- package/dist/common/control.js +0 -2
- package/dist/common/dom-range.d.ts +13 -0
- package/dist/common/env.js +1 -7
- package/dist/common/error-boundary.d.ts +1 -2
- package/dist/common/invariant.js +0 -2
- package/dist/common/jsx.d.ts +1 -2
- package/dist/common/jsx.js +0 -2
- package/dist/common/logger.js +0 -2
- package/dist/common/promise.js +0 -2
- package/dist/common/props.d.ts +1 -2
- package/dist/common/render-context.js +0 -2
- package/dist/common/route-activity.js +0 -2
- package/dist/common/router-internal.js +0 -2
- package/dist/common/router.d.ts +1 -2
- package/dist/common/ssr-errors.d.ts +1 -2
- package/dist/common/ssr-errors.js +0 -2
- package/dist/common/ssr.d.ts +1 -2
- package/dist/common/ssr.js +0 -2
- package/dist/common/vnode.d.ts +1 -2
- package/dist/common/vnode.js +0 -2
- package/dist/components/error-boundary.d.ts +1 -2
- package/dist/components/error-boundary.js +0 -2
- package/dist/components/link.d.ts +2 -2
- package/dist/components/link.js +0 -2
- package/dist/control/case.d.ts +1 -2
- package/dist/control/case.js +0 -2
- package/dist/control/for.d.ts +1 -2
- package/dist/control/for.js +0 -2
- package/dist/control/shared.d.ts +1 -2
- package/dist/control/shared.js +0 -2
- package/dist/control/show.d.ts +1 -2
- package/dist/control/show.js +0 -2
- package/dist/data/data-runtime.d.ts +1 -2
- package/dist/data/data-runtime.js +3 -5
- package/dist/data/invalidation-listeners.js +0 -2
- package/dist/data/invalidation.d.ts +1 -2
- package/dist/data/invalidation.js +0 -2
- package/dist/data/mutation-cell.d.ts +1 -2
- package/dist/data/mutation-cell.js +6 -5
- package/dist/data/query-cell.d.ts +3 -2
- package/dist/data/query-cell.js +43 -9
- package/dist/data/query-key.js +0 -2
- package/dist/data/shared.js +2 -3
- package/dist/data/types.d.ts +1 -2
- package/dist/foundations/icon/icon.d.ts +1 -2
- package/dist/foundations/icon/icon.js +0 -2
- package/dist/foundations/icon/icon.types.d.ts +1 -2
- package/dist/foundations/interactions/dismissable.d.ts +1 -2
- package/dist/foundations/interactions/dismissable.js +0 -2
- package/dist/foundations/interactions/focusable.d.ts +1 -2
- package/dist/foundations/interactions/focusable.js +0 -2
- package/dist/foundations/interactions/hoverable.d.ts +1 -2
- package/dist/foundations/interactions/hoverable.js +0 -2
- package/dist/foundations/interactions/interaction-policy.d.ts +1 -2
- package/dist/foundations/interactions/interaction-policy.js +0 -2
- package/dist/foundations/interactions/pressable.d.ts +1 -2
- package/dist/foundations/interactions/pressable.js +0 -2
- package/dist/foundations/interactions/roving-focus.d.ts +1 -2
- package/dist/foundations/interactions/roving-focus.js +0 -2
- package/dist/foundations/state/controllable.d.ts +1 -2
- package/dist/foundations/state/controllable.js +0 -2
- package/dist/foundations/structures/collection.d.ts +1 -2
- package/dist/foundations/structures/collection.js +0 -2
- package/dist/foundations/structures/layer.d.ts +1 -2
- package/dist/foundations/structures/layer.js +0 -2
- package/dist/foundations/structures/layout.d.ts +1 -2
- package/dist/foundations/structures/layout.js +0 -2
- package/dist/foundations/structures/presence.d.ts +1 -2
- package/dist/foundations/structures/presence.js +0 -2
- package/dist/foundations/structures/slot.d.ts +1 -2
- package/dist/foundations/structures/slot.js +0 -2
- package/dist/foundations/utilities/aria.d.ts +1 -2
- package/dist/foundations/utilities/aria.js +0 -2
- package/dist/foundations/utilities/compose-handlers.d.ts +1 -2
- package/dist/foundations/utilities/compose-handlers.js +0 -2
- package/dist/foundations/utilities/compose-ref.d.ts +1 -2
- package/dist/foundations/utilities/compose-ref.js +0 -2
- package/dist/foundations/utilities/event-types.d.ts +1 -2
- package/dist/foundations/utilities/merge-props.d.ts +1 -2
- package/dist/foundations/utilities/merge-props.js +0 -2
- package/dist/foundations/utilities/use-id.d.ts +1 -2
- package/dist/foundations/utilities/use-id.js +0 -2
- package/dist/fx/fx.d.ts +1 -2
- package/dist/fx/fx.js +0 -2
- package/dist/fx/noop.js +0 -2
- package/dist/fx/timing.d.ts +1 -2
- package/dist/fx/timing.js +0 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +0 -2
- package/dist/jsx/types.d.ts +1 -2
- package/dist/jsx/utils.d.ts +1 -2
- package/dist/jsx/utils.js +0 -2
- package/dist/jsx-dev-runtime.d.ts +16 -2
- package/dist/jsx-dev-runtime.js +3 -12
- package/dist/jsx-runtime.d.ts +16 -2
- package/dist/jsx-runtime.js +15 -24
- package/dist/jsx-runtime2.d.ts +1 -1
- package/dist/renderer/attributes.js +28 -6
- package/dist/renderer/boundaries.js +48 -172
- package/dist/renderer/boundary-materialization.js +72 -0
- package/dist/renderer/boundary-range-adoption.js +76 -0
- package/dist/renderer/boundary-range-sync.js +101 -0
- package/dist/renderer/boundary-state.js +50 -0
- package/dist/renderer/child-shape.js +0 -2
- package/dist/renderer/children-fastpath.js +3 -3
- package/dist/renderer/children.js +0 -2
- package/dist/renderer/cleanup.js +70 -13
- package/dist/renderer/component-host-cleanup.js +123 -48
- package/dist/renderer/component-host-instances.js +59 -8
- package/dist/renderer/component-host-replacement.js +105 -0
- package/dist/renderer/component-host-results.js +138 -0
- package/dist/renderer/component-host.js +94 -169
- package/dist/renderer/dom-host.js +0 -2
- package/dist/renderer/dom-internal.js +110 -53
- package/dist/renderer/dom-range.js +161 -0
- package/dist/renderer/dom.js +5 -4
- package/dist/renderer/element-children.js +112 -32
- package/dist/renderer/error-boundary-dom.js +19 -11
- package/dist/renderer/evaluate-dom-range.js +3 -4
- package/dist/renderer/evaluate-reconcile.js +12 -37
- package/dist/renderer/evaluate.js +14 -3
- package/dist/renderer/fastpath.js +4 -12
- package/dist/renderer/for-commit-dom-map.js +6 -18
- package/dist/renderer/for-commit-removal.js +7 -16
- package/dist/renderer/for-commit-reorder.js +0 -2
- package/dist/renderer/for-commit.js +172 -44
- package/dist/renderer/hydration-boundaries.js +60 -0
- package/dist/renderer/hydration-listener-transaction.js +49 -0
- package/dist/renderer/index.js +8 -7
- package/dist/renderer/intrinsic-blueprint-analysis.js +202 -0
- package/dist/renderer/intrinsic-blueprint-bindings.js +152 -0
- package/dist/renderer/intrinsic-blueprint-materialization.js +100 -0
- package/dist/renderer/intrinsic-blueprint.js +30 -0
- package/dist/renderer/intrinsic-hydration-adoption.js +66 -0
- package/dist/renderer/keyed-children.js +3 -9
- package/dist/renderer/keyed.js +10 -10
- package/dist/renderer/namespaces.js +0 -2
- package/dist/renderer/prop-bindings.js +56 -21
- package/dist/renderer/reactive-child-dom.js +10 -4
- package/dist/renderer/reactive-child-sources.js +0 -2
- package/dist/renderer/reactive-children.js +29 -20
- package/dist/renderer/reconcile-commit.js +0 -2
- package/dist/renderer/reconcile-fastpaths.js +4 -11
- package/dist/renderer/reconcile-resolution.js +31 -55
- package/dist/renderer/reconcile.js +0 -2
- package/dist/renderer/retained-element-rollback.js +159 -148
- package/dist/renderer/stable-patch.js +3 -4
- package/dist/renderer/static-reuse.js +0 -2
- package/dist/renderer/utils.js +18 -9
- package/dist/router/access.js +0 -2
- package/dist/router/activity.d.ts +1 -2
- package/dist/router/activity.js +0 -2
- package/dist/router/authoring.d.ts +1 -2
- package/dist/router/authoring.js +0 -2
- package/dist/router/internal-types.d.ts +1 -2
- package/dist/router/lazy.d.ts +1 -2
- package/dist/router/lazy.js +0 -2
- package/dist/router/manifest.d.ts +1 -2
- package/dist/router/manifest.js +0 -2
- package/dist/router/match.js +0 -2
- package/dist/router/navigate.d.ts +1 -2
- package/dist/router/navigate.js +4 -7
- package/dist/router/navigation-registry.d.ts +1 -2
- package/dist/router/navigation-registry.js +0 -2
- package/dist/router/navigation-scroll.d.ts +1 -2
- package/dist/router/navigation-scroll.js +0 -2
- package/dist/router/navigation-targets.d.ts +3 -4
- package/dist/router/navigation-targets.js +419 -40
- package/dist/router/policy.d.ts +1 -2
- package/dist/router/policy.js +0 -2
- package/dist/router/rendering.d.ts +1 -2
- package/dist/router/rendering.js +4 -3
- package/dist/router/resolution.d.ts +1 -2
- package/dist/router/resolution.js +0 -2
- package/dist/router/route-context.js +0 -2
- package/dist/router/route-matching.d.ts +1 -2
- package/dist/router/route-matching.js +0 -2
- package/dist/router/route-query.d.ts +1 -2
- package/dist/router/route-query.js +1 -3
- package/dist/router/store.d.ts +1 -2
- package/dist/router/store.js +0 -2
- package/dist/runtime/access.d.ts +1 -2
- package/dist/runtime/access.js +0 -2
- package/dist/runtime/child-scope.d.ts +21 -2
- package/dist/runtime/child-scope.js +101 -54
- package/dist/runtime/component-cleanup.d.ts +1 -2
- package/dist/runtime/component-cleanup.js +2 -4
- package/dist/runtime/component-commit.js +25 -23
- package/dist/runtime/component-facade.js +5 -3
- package/dist/runtime/component-internal.d.ts +11 -6
- package/dist/runtime/component-internal.js +63 -45
- package/dist/runtime/component-lifecycle.d.ts +2 -41
- package/dist/runtime/component-lifecycle.js +6 -149
- package/dist/runtime/component-scope.d.ts +3 -4
- package/dist/runtime/component-scope.js +27 -8
- package/dist/runtime/component.js +4 -3
- package/dist/runtime/context.d.ts +5 -2
- package/dist/runtime/context.js +29 -3
- package/dist/runtime/control.d.ts +22 -3
- package/dist/runtime/control.js +168 -55
- package/dist/runtime/derive.d.ts +1 -2
- package/dist/runtime/derive.js +0 -2
- package/dist/runtime/dev-namespace.d.ts +5 -6
- package/dist/runtime/dev-namespace.js +32 -25
- package/dist/runtime/effect.d.ts +8 -5
- package/dist/runtime/effect.js +158 -75
- package/dist/runtime/error-boundary.d.ts +1 -2
- package/dist/runtime/error-boundary.js +0 -2
- package/dist/runtime/events.d.ts +3 -3
- package/dist/runtime/events.js +66 -69
- package/dist/runtime/execution-model.d.ts +1 -2
- package/dist/runtime/execution-model.js +0 -2
- package/dist/runtime/fastlane.d.ts +1 -2
- package/dist/runtime/fastlane.js +0 -2
- package/dist/runtime/for-bench.d.ts +1 -2
- package/dist/runtime/for-bench.js +9 -167
- package/dist/runtime/for-internal.d.ts +68 -5
- package/dist/runtime/for-internal.js +201 -14
- package/dist/runtime/for-reconcile.d.ts +1 -2
- package/dist/runtime/for-reconcile.js +76 -23
- package/dist/runtime/for-scopes.d.ts +5 -5
- package/dist/runtime/for-scopes.js +168 -48
- package/dist/runtime/for-signals.d.ts +13 -4
- package/dist/runtime/for-signals.js +155 -81
- package/dist/runtime/for-types.d.ts +1 -2
- package/dist/runtime/for.d.ts +2 -2
- package/dist/runtime/for.js +3 -3
- package/dist/runtime/index.d.ts +5 -5
- package/dist/runtime/index.js +12 -10
- package/dist/runtime/lifecycle-batch.d.ts +59 -0
- package/dist/runtime/lifecycle-batch.js +178 -0
- package/dist/runtime/lifecycle-operation-settlement.d.ts +5 -0
- package/dist/runtime/lifecycle-operation-settlement.js +51 -0
- package/dist/runtime/lifecycle-operations.d.ts +1 -2
- package/dist/runtime/lifecycle-operations.js +5 -6
- package/dist/runtime/perf-metrics.d.ts +8 -7
- package/dist/runtime/perf-metrics.js +4 -68
- package/dist/runtime/portal.d.ts +1 -2
- package/dist/runtime/portal.js +103 -11
- package/dist/runtime/readable.d.ts +9 -4
- package/dist/runtime/readable.js +41 -17
- package/dist/runtime/resource-cell.js +2 -4
- package/dist/runtime/resource-operation.d.ts +1 -2
- package/dist/runtime/resource-operation.js +37 -34
- package/dist/runtime/runtime.d.ts +1 -2
- package/dist/runtime/runtime.js +0 -2
- package/dist/runtime/scheduler.d.ts +1 -2
- package/dist/runtime/scheduler.js +8 -11
- package/dist/runtime/selector-store.js +0 -2
- package/dist/runtime/selector.d.ts +1 -2
- package/dist/runtime/selector.js +3 -11
- package/dist/runtime/snapshot-source.d.ts +1 -2
- package/dist/runtime/snapshot-source.js +0 -2
- package/dist/runtime/state.d.ts +1 -2
- package/dist/runtime/state.js +1 -3
- package/dist/ssg/batch-render.js +0 -2
- package/dist/ssg/create-static-gen.d.ts +4 -2
- package/dist/ssg/create-static-gen.js +65 -14
- package/dist/ssg/generate-metadata.js +0 -2
- package/dist/ssg/generation-plan.js +0 -2
- package/dist/ssg/incremental-manifest.js +1 -3
- package/dist/ssg/resolve-ssg-data.js +0 -2
- package/dist/ssg/route-utils.js +0 -2
- package/dist/ssg/static-routes.js +0 -2
- package/dist/ssg/types.d.ts +2 -3
- package/dist/ssg/write-static-files.js +16 -12
- package/dist/ssr/attrs.js +0 -2
- package/dist/ssr/boundaries.js +16 -5
- package/dist/ssr/component-runtime.js +1 -27
- package/dist/ssr/context.d.ts +1 -2
- package/dist/ssr/context.js +0 -2
- package/dist/ssr/errors.d.ts +1 -2
- package/dist/ssr/errors.js +0 -2
- package/dist/ssr/escape.js +0 -2
- package/dist/ssr/hydration-data.js +0 -2
- package/dist/ssr/hydration-verify.d.ts +1 -2
- package/dist/ssr/hydration-verify.js +34 -7
- package/dist/ssr/index-internal.d.ts +1 -2
- package/dist/ssr/index-internal.js +0 -2
- package/dist/ssr/render-keys.js +0 -2
- package/dist/ssr/render-resolved.d.ts +1 -2
- package/dist/ssr/render-resolved.js +0 -2
- package/dist/ssr/render-sync.d.ts +1 -2
- package/dist/ssr/render-sync.js +27 -19
- package/dist/ssr/route-policy-resolution.js +0 -2
- package/dist/ssr/route-render.d.ts +1 -2
- package/dist/ssr/route-render.js +0 -2
- package/dist/ssr/sink.d.ts +1 -2
- package/dist/ssr/sink.js +0 -2
- package/dist/ssr/types.d.ts +1 -2
- package/dist/ssr/verify-hydration.js +0 -2
- package/dist/testing/index.d.ts +1 -2
- package/dist/testing/index.js +0 -2
- package/package.json +57 -44
- package/dist/bench/components/benchmark-row.d.ts.map +0 -1
- package/dist/bench/components/benchmark-row.js.map +0 -1
- package/dist/bench/components/benchmark-table.js.map +0 -1
- package/dist/benchmark.d.ts.map +0 -1
- package/dist/benchmark.js.map +0 -1
- package/dist/bin/askr-ssg.d.ts.map +0 -1
- package/dist/bin/askr-ssg.js.map +0 -1
- package/dist/boot/hydration.js.map +0 -1
- package/dist/boot/index.d.ts.map +0 -1
- package/dist/boot/index.js.map +0 -1
- package/dist/boot/root-lifecycle.d.ts.map +0 -1
- package/dist/boot/root-lifecycle.js.map +0 -1
- package/dist/boot/route-startup.js.map +0 -1
- package/dist/boot/types.d.ts.map +0 -1
- package/dist/common/attr-names.js.map +0 -1
- package/dist/common/component.d.ts.map +0 -1
- package/dist/common/control.d.ts.map +0 -1
- package/dist/common/control.js.map +0 -1
- package/dist/common/env.js.map +0 -1
- package/dist/common/error-boundary.d.ts.map +0 -1
- package/dist/common/invariant.js.map +0 -1
- package/dist/common/jsx.d.ts.map +0 -1
- package/dist/common/jsx.js.map +0 -1
- package/dist/common/logger.js.map +0 -1
- package/dist/common/promise.js.map +0 -1
- package/dist/common/props.d.ts.map +0 -1
- package/dist/common/render-context.js.map +0 -1
- package/dist/common/route-activity.js.map +0 -1
- package/dist/common/router-internal.js.map +0 -1
- package/dist/common/router.d.ts.map +0 -1
- package/dist/common/ssr-errors.d.ts.map +0 -1
- package/dist/common/ssr-errors.js.map +0 -1
- package/dist/common/ssr.d.ts.map +0 -1
- package/dist/common/ssr.js.map +0 -1
- package/dist/common/vnode.d.ts.map +0 -1
- package/dist/common/vnode.js.map +0 -1
- package/dist/components/error-boundary.d.ts.map +0 -1
- package/dist/components/error-boundary.js.map +0 -1
- package/dist/components/link.d.ts.map +0 -1
- package/dist/components/link.js.map +0 -1
- package/dist/control/case.d.ts.map +0 -1
- package/dist/control/case.js.map +0 -1
- package/dist/control/for.d.ts.map +0 -1
- package/dist/control/for.js.map +0 -1
- package/dist/control/shared.d.ts.map +0 -1
- package/dist/control/shared.js.map +0 -1
- package/dist/control/show.d.ts.map +0 -1
- package/dist/control/show.js.map +0 -1
- package/dist/data/data-runtime.d.ts.map +0 -1
- package/dist/data/data-runtime.js.map +0 -1
- package/dist/data/invalidation-listeners.js.map +0 -1
- package/dist/data/invalidation.d.ts.map +0 -1
- package/dist/data/invalidation.js.map +0 -1
- package/dist/data/mutation-cell.d.ts.map +0 -1
- package/dist/data/mutation-cell.js.map +0 -1
- package/dist/data/query-cell.d.ts.map +0 -1
- package/dist/data/query-cell.js.map +0 -1
- package/dist/data/query-key.js.map +0 -1
- package/dist/data/shared.js.map +0 -1
- package/dist/data/types.d.ts.map +0 -1
- package/dist/foundations/icon/icon.d.ts.map +0 -1
- package/dist/foundations/icon/icon.js.map +0 -1
- package/dist/foundations/icon/icon.types.d.ts.map +0 -1
- package/dist/foundations/interactions/dismissable.d.ts.map +0 -1
- package/dist/foundations/interactions/dismissable.js.map +0 -1
- package/dist/foundations/interactions/focusable.d.ts.map +0 -1
- package/dist/foundations/interactions/focusable.js.map +0 -1
- package/dist/foundations/interactions/hoverable.d.ts.map +0 -1
- package/dist/foundations/interactions/hoverable.js.map +0 -1
- package/dist/foundations/interactions/interaction-policy.d.ts.map +0 -1
- package/dist/foundations/interactions/interaction-policy.js.map +0 -1
- package/dist/foundations/interactions/pressable.d.ts.map +0 -1
- package/dist/foundations/interactions/pressable.js.map +0 -1
- package/dist/foundations/interactions/roving-focus.d.ts.map +0 -1
- package/dist/foundations/interactions/roving-focus.js.map +0 -1
- package/dist/foundations/state/controllable.d.ts.map +0 -1
- package/dist/foundations/state/controllable.js.map +0 -1
- package/dist/foundations/structures/collection.d.ts.map +0 -1
- package/dist/foundations/structures/collection.js.map +0 -1
- package/dist/foundations/structures/layer.d.ts.map +0 -1
- package/dist/foundations/structures/layer.js.map +0 -1
- package/dist/foundations/structures/layout.d.ts.map +0 -1
- package/dist/foundations/structures/layout.js.map +0 -1
- package/dist/foundations/structures/presence.d.ts.map +0 -1
- package/dist/foundations/structures/presence.js.map +0 -1
- package/dist/foundations/structures/slot.d.ts.map +0 -1
- package/dist/foundations/structures/slot.js.map +0 -1
- package/dist/foundations/utilities/aria.d.ts.map +0 -1
- package/dist/foundations/utilities/aria.js.map +0 -1
- package/dist/foundations/utilities/compose-handlers.d.ts.map +0 -1
- package/dist/foundations/utilities/compose-handlers.js.map +0 -1
- package/dist/foundations/utilities/compose-ref.d.ts.map +0 -1
- package/dist/foundations/utilities/compose-ref.js.map +0 -1
- package/dist/foundations/utilities/event-types.d.ts.map +0 -1
- package/dist/foundations/utilities/merge-props.d.ts.map +0 -1
- package/dist/foundations/utilities/merge-props.js.map +0 -1
- package/dist/foundations/utilities/use-id.d.ts.map +0 -1
- package/dist/foundations/utilities/use-id.js.map +0 -1
- package/dist/fx/fx.d.ts.map +0 -1
- package/dist/fx/fx.js.map +0 -1
- package/dist/fx/noop.js.map +0 -1
- package/dist/fx/timing.d.ts.map +0 -1
- package/dist/fx/timing.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/jsx/types.d.ts.map +0 -1
- package/dist/jsx/utils.d.ts.map +0 -1
- package/dist/jsx/utils.js.map +0 -1
- package/dist/jsx-dev-runtime.d.ts.map +0 -1
- package/dist/jsx-dev-runtime.js.map +0 -1
- package/dist/jsx-runtime.d.ts.map +0 -1
- package/dist/jsx-runtime.js.map +0 -1
- package/dist/renderer/attributes.js.map +0 -1
- package/dist/renderer/boundaries.js.map +0 -1
- package/dist/renderer/child-shape.js.map +0 -1
- package/dist/renderer/children-fastpath.js.map +0 -1
- package/dist/renderer/children.js.map +0 -1
- package/dist/renderer/cleanup.js.map +0 -1
- package/dist/renderer/component-host-cleanup.js.map +0 -1
- package/dist/renderer/component-host-instances.js.map +0 -1
- package/dist/renderer/component-host.js.map +0 -1
- package/dist/renderer/dom-host.js.map +0 -1
- package/dist/renderer/dom-internal.js.map +0 -1
- package/dist/renderer/element-children.js.map +0 -1
- package/dist/renderer/error-boundary-dom.js.map +0 -1
- package/dist/renderer/evaluate-dom-range.js.map +0 -1
- package/dist/renderer/evaluate-reconcile.js.map +0 -1
- package/dist/renderer/evaluate.js.map +0 -1
- package/dist/renderer/fastpath.js.map +0 -1
- package/dist/renderer/for-commit-dom-map.js.map +0 -1
- package/dist/renderer/for-commit-removal.js.map +0 -1
- package/dist/renderer/for-commit-reorder.js.map +0 -1
- package/dist/renderer/for-commit.js.map +0 -1
- package/dist/renderer/index.js.map +0 -1
- package/dist/renderer/keyed-children.js.map +0 -1
- package/dist/renderer/keyed.js.map +0 -1
- package/dist/renderer/namespaces.js.map +0 -1
- package/dist/renderer/prop-bindings.js.map +0 -1
- package/dist/renderer/reactive-child-dom.js.map +0 -1
- package/dist/renderer/reactive-child-sources.js.map +0 -1
- package/dist/renderer/reactive-children.js.map +0 -1
- package/dist/renderer/reconcile-commit.js.map +0 -1
- package/dist/renderer/reconcile-fastpaths.js.map +0 -1
- package/dist/renderer/reconcile-resolution.js.map +0 -1
- package/dist/renderer/reconcile.js.map +0 -1
- package/dist/renderer/retained-element-rollback.js.map +0 -1
- package/dist/renderer/stable-patch.js.map +0 -1
- package/dist/renderer/static-reuse.js.map +0 -1
- package/dist/renderer/utils.js.map +0 -1
- package/dist/router/access.js.map +0 -1
- package/dist/router/activity.d.ts.map +0 -1
- package/dist/router/activity.js.map +0 -1
- package/dist/router/authoring.d.ts.map +0 -1
- package/dist/router/authoring.js.map +0 -1
- package/dist/router/internal-types.d.ts.map +0 -1
- package/dist/router/lazy.d.ts.map +0 -1
- package/dist/router/lazy.js.map +0 -1
- package/dist/router/manifest.d.ts.map +0 -1
- package/dist/router/manifest.js.map +0 -1
- package/dist/router/match.js.map +0 -1
- package/dist/router/navigate.d.ts.map +0 -1
- package/dist/router/navigate.js.map +0 -1
- package/dist/router/navigation-registry.d.ts.map +0 -1
- package/dist/router/navigation-registry.js.map +0 -1
- package/dist/router/navigation-scroll.d.ts.map +0 -1
- package/dist/router/navigation-scroll.js.map +0 -1
- package/dist/router/navigation-targets.d.ts.map +0 -1
- package/dist/router/navigation-targets.js.map +0 -1
- package/dist/router/policy.d.ts.map +0 -1
- package/dist/router/policy.js.map +0 -1
- package/dist/router/rendering.d.ts.map +0 -1
- package/dist/router/rendering.js.map +0 -1
- package/dist/router/resolution.d.ts.map +0 -1
- package/dist/router/resolution.js.map +0 -1
- package/dist/router/route-context.js.map +0 -1
- package/dist/router/route-matching.d.ts.map +0 -1
- package/dist/router/route-matching.js.map +0 -1
- package/dist/router/route-query.d.ts.map +0 -1
- package/dist/router/route-query.js.map +0 -1
- package/dist/router/store.d.ts.map +0 -1
- package/dist/router/store.js.map +0 -1
- package/dist/runtime/access.d.ts.map +0 -1
- package/dist/runtime/access.js.map +0 -1
- package/dist/runtime/child-scope.d.ts.map +0 -1
- package/dist/runtime/child-scope.js.map +0 -1
- package/dist/runtime/component-cleanup.d.ts.map +0 -1
- package/dist/runtime/component-cleanup.js.map +0 -1
- package/dist/runtime/component-commit.js.map +0 -1
- package/dist/runtime/component-internal.d.ts.map +0 -1
- package/dist/runtime/component-internal.js.map +0 -1
- package/dist/runtime/component-lifecycle.d.ts.map +0 -1
- package/dist/runtime/component-lifecycle.js.map +0 -1
- package/dist/runtime/component-scope.d.ts.map +0 -1
- package/dist/runtime/component-scope.js.map +0 -1
- package/dist/runtime/context.d.ts.map +0 -1
- package/dist/runtime/context.js.map +0 -1
- package/dist/runtime/control.d.ts.map +0 -1
- package/dist/runtime/control.js.map +0 -1
- package/dist/runtime/derive.d.ts.map +0 -1
- package/dist/runtime/derive.js.map +0 -1
- package/dist/runtime/dev-namespace.d.ts.map +0 -1
- package/dist/runtime/dev-namespace.js.map +0 -1
- package/dist/runtime/effect.d.ts.map +0 -1
- package/dist/runtime/effect.js.map +0 -1
- package/dist/runtime/error-boundary.d.ts.map +0 -1
- package/dist/runtime/error-boundary.js.map +0 -1
- package/dist/runtime/events.d.ts.map +0 -1
- package/dist/runtime/events.js.map +0 -1
- package/dist/runtime/execution-model.d.ts.map +0 -1
- package/dist/runtime/execution-model.js.map +0 -1
- package/dist/runtime/fastlane.d.ts.map +0 -1
- package/dist/runtime/fastlane.js.map +0 -1
- package/dist/runtime/for-bench.d.ts.map +0 -1
- package/dist/runtime/for-bench.js.map +0 -1
- package/dist/runtime/for-internal.d.ts.map +0 -1
- package/dist/runtime/for-internal.js.map +0 -1
- package/dist/runtime/for-reconcile.d.ts.map +0 -1
- package/dist/runtime/for-reconcile.js.map +0 -1
- package/dist/runtime/for-scopes.d.ts.map +0 -1
- package/dist/runtime/for-scopes.js.map +0 -1
- package/dist/runtime/for-signals.d.ts.map +0 -1
- package/dist/runtime/for-signals.js.map +0 -1
- package/dist/runtime/for-types.d.ts.map +0 -1
- package/dist/runtime/lifecycle-operations.d.ts.map +0 -1
- package/dist/runtime/lifecycle-operations.js.map +0 -1
- package/dist/runtime/perf-metrics.d.ts.map +0 -1
- package/dist/runtime/perf-metrics.js.map +0 -1
- package/dist/runtime/portal.d.ts.map +0 -1
- package/dist/runtime/portal.js.map +0 -1
- package/dist/runtime/readable.d.ts.map +0 -1
- package/dist/runtime/readable.js.map +0 -1
- package/dist/runtime/resource-cell.js.map +0 -1
- package/dist/runtime/resource-operation.d.ts.map +0 -1
- package/dist/runtime/resource-operation.js.map +0 -1
- package/dist/runtime/runtime.d.ts.map +0 -1
- package/dist/runtime/runtime.js.map +0 -1
- package/dist/runtime/scheduler.d.ts.map +0 -1
- package/dist/runtime/scheduler.js.map +0 -1
- package/dist/runtime/selector-store.js.map +0 -1
- package/dist/runtime/selector.d.ts.map +0 -1
- package/dist/runtime/selector.js.map +0 -1
- package/dist/runtime/snapshot-source.d.ts.map +0 -1
- package/dist/runtime/snapshot-source.js.map +0 -1
- package/dist/runtime/state.d.ts.map +0 -1
- package/dist/runtime/state.js.map +0 -1
- package/dist/ssg/batch-render.js.map +0 -1
- package/dist/ssg/create-static-gen.d.ts.map +0 -1
- package/dist/ssg/create-static-gen.js.map +0 -1
- package/dist/ssg/generate-metadata.js.map +0 -1
- package/dist/ssg/generation-plan.js.map +0 -1
- package/dist/ssg/incremental-manifest.js.map +0 -1
- package/dist/ssg/resolve-ssg-data.js.map +0 -1
- package/dist/ssg/route-utils.js.map +0 -1
- package/dist/ssg/static-routes.js.map +0 -1
- package/dist/ssg/types.d.ts.map +0 -1
- package/dist/ssg/write-static-files.js.map +0 -1
- package/dist/ssr/attrs.js.map +0 -1
- package/dist/ssr/boundaries.js.map +0 -1
- package/dist/ssr/component-runtime.js.map +0 -1
- package/dist/ssr/context.d.ts.map +0 -1
- package/dist/ssr/context.js.map +0 -1
- package/dist/ssr/errors.d.ts.map +0 -1
- package/dist/ssr/errors.js.map +0 -1
- package/dist/ssr/escape.js.map +0 -1
- package/dist/ssr/hydration-data.js.map +0 -1
- package/dist/ssr/hydration-verify.d.ts.map +0 -1
- package/dist/ssr/hydration-verify.js.map +0 -1
- package/dist/ssr/index-internal.d.ts.map +0 -1
- package/dist/ssr/index-internal.js.map +0 -1
- package/dist/ssr/render-keys.js.map +0 -1
- package/dist/ssr/render-resolved.d.ts.map +0 -1
- package/dist/ssr/render-resolved.js.map +0 -1
- package/dist/ssr/render-sync.d.ts.map +0 -1
- package/dist/ssr/render-sync.js.map +0 -1
- package/dist/ssr/route-policy-resolution.js.map +0 -1
- package/dist/ssr/route-render.d.ts.map +0 -1
- package/dist/ssr/route-render.js.map +0 -1
- package/dist/ssr/sink.d.ts.map +0 -1
- package/dist/ssr/sink.js.map +0 -1
- package/dist/ssr/types.d.ts.map +0 -1
- package/dist/ssr/verify-hydration.js.map +0 -1
- package/dist/testing/index.d.ts.map +0 -1
- package/dist/testing/index.js.map +0 -1
|
@@ -1,34 +1,27 @@
|
|
|
1
1
|
import { logger } from "../common/logger.js";
|
|
2
|
+
import { getCurrentLifecycleCommitBatch, registerLifecycleTransaction } from "../runtime/lifecycle-batch.js";
|
|
2
3
|
import { addDelegatedListener, getDelegatedHandlersForElement, removeDelegatedListener, updateDelegatedListener } from "../runtime/events.js";
|
|
3
4
|
import "../runtime/index.js";
|
|
4
|
-
import { elementListeners, elementReactivePropsCleanup, elementRefs } from "./cleanup.js";
|
|
5
|
+
import { elementListeners, elementReactivePropsCleanup, elementRefs, getElementReactivePropsCleanupMap } from "./cleanup.js";
|
|
5
6
|
import { keyedElements } from "./keyed.js";
|
|
6
7
|
//#region src/renderer/retained-element-rollback.ts
|
|
7
|
-
function collectElementSubtree(root) {
|
|
8
|
-
const elements = [root];
|
|
9
|
-
const descendants = root.querySelectorAll("*");
|
|
10
|
-
for (let index = 0; index < descendants.length; index += 1) elements.push(descendants[index]);
|
|
11
|
-
return elements;
|
|
12
|
-
}
|
|
13
8
|
function collectTextSnapshots(root) {
|
|
14
9
|
const snapshots = [];
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const node = stack.pop();
|
|
10
|
+
for (let index = 0; index < root.childNodes.length; index += 1) {
|
|
11
|
+
const node = root.childNodes[index];
|
|
18
12
|
if (node.nodeType === 3) {
|
|
13
|
+
const text = node;
|
|
19
14
|
snapshots.push({
|
|
20
|
-
node,
|
|
21
|
-
data:
|
|
15
|
+
node: text,
|
|
16
|
+
data: text.data
|
|
22
17
|
});
|
|
23
|
-
continue;
|
|
24
18
|
}
|
|
25
|
-
for (let child = node.lastChild; child; child = child.previousSibling) stack.push(child);
|
|
26
19
|
}
|
|
27
20
|
return snapshots;
|
|
28
21
|
}
|
|
29
22
|
function getFormControlSnapshot(element) {
|
|
30
23
|
const control = element;
|
|
31
|
-
const snapshot = {
|
|
24
|
+
const snapshot = {};
|
|
32
25
|
if ("value" in control) snapshot.value = String(control.value ?? "");
|
|
33
26
|
if ("checked" in control) snapshot.checked = Boolean(control.checked);
|
|
34
27
|
return snapshot.value !== void 0 || snapshot.checked !== void 0 ? snapshot : null;
|
|
@@ -47,72 +40,38 @@ function cloneReactivePropEntry(entry) {
|
|
|
47
40
|
return {
|
|
48
41
|
cleanup: entry.cleanup,
|
|
49
42
|
fnRef: entry.fnRef,
|
|
43
|
+
groupedScalar: entry.groupedScalar,
|
|
50
44
|
restoreFn: entry.restoreFn,
|
|
51
45
|
updateFn: entry.updateFn
|
|
52
46
|
};
|
|
53
47
|
}
|
|
54
|
-
function snapshotRetainedElement(element) {
|
|
55
|
-
const
|
|
56
|
-
const
|
|
57
|
-
const
|
|
58
|
-
const delegatedListeners = [];
|
|
59
|
-
const formControls = [];
|
|
60
|
-
const listeners = [];
|
|
61
|
-
const reactiveProps = [];
|
|
62
|
-
const refs = [];
|
|
63
|
-
for (const currentElement of elements) {
|
|
64
|
-
attributes.push({
|
|
65
|
-
element: currentElement,
|
|
66
|
-
attributes: Array.from(currentElement.attributes, (attribute) => [attribute.name, attribute.value])
|
|
67
|
-
});
|
|
68
|
-
childNodes.push({
|
|
69
|
-
element: currentElement,
|
|
70
|
-
childNodes: Array.from(currentElement.childNodes)
|
|
71
|
-
});
|
|
72
|
-
const formControl = getFormControlSnapshot(currentElement);
|
|
73
|
-
if (formControl) formControls.push(formControl);
|
|
74
|
-
const listenerMap = elementListeners.get(currentElement);
|
|
75
|
-
listeners.push({
|
|
76
|
-
element: currentElement,
|
|
77
|
-
entries: listenerMap ? Array.from(listenerMap, ([listenerKey, entry]) => ({
|
|
78
|
-
listenerKey,
|
|
79
|
-
entry: cloneListenerEntry(entry)
|
|
80
|
-
})) : []
|
|
81
|
-
});
|
|
82
|
-
const delegatedHandlerMap = getDelegatedHandlersForElement(currentElement);
|
|
83
|
-
delegatedListeners.push({
|
|
84
|
-
element: currentElement,
|
|
85
|
-
entries: delegatedHandlerMap ? Array.from(delegatedHandlerMap, ([eventName, entry]) => ({
|
|
86
|
-
eventName,
|
|
87
|
-
handler: entry.handler,
|
|
88
|
-
original: entry.original,
|
|
89
|
-
options: entry.options
|
|
90
|
-
})) : []
|
|
91
|
-
});
|
|
92
|
-
const reactivePropMap = elementReactivePropsCleanup.get(currentElement);
|
|
93
|
-
reactiveProps.push({
|
|
94
|
-
element: currentElement,
|
|
95
|
-
entries: reactivePropMap ? Array.from(reactivePropMap, ([propName, entry]) => ({
|
|
96
|
-
propName,
|
|
97
|
-
entry: cloneReactivePropEntry(entry)
|
|
98
|
-
})) : []
|
|
99
|
-
});
|
|
100
|
-
refs.push({
|
|
101
|
-
element: currentElement,
|
|
102
|
-
ref: elementRefs.get(currentElement)
|
|
103
|
-
});
|
|
104
|
-
}
|
|
48
|
+
function snapshotRetainedElement(element, bindingsOnly = false) {
|
|
49
|
+
const listenerMap = elementListeners.get(element);
|
|
50
|
+
const delegatedHandlerMap = getDelegatedHandlersForElement(element);
|
|
51
|
+
const reactivePropMap = getElementReactivePropsCleanupMap(element);
|
|
105
52
|
const keyedMap = keyedElements.get(element);
|
|
106
53
|
return {
|
|
107
|
-
attributes,
|
|
108
|
-
childNodes,
|
|
109
|
-
delegatedListeners,
|
|
110
|
-
|
|
54
|
+
attributes: bindingsOnly ? [] : Array.from(element.attributes, (attribute) => [attribute.name, attribute.value]),
|
|
55
|
+
childNodes: bindingsOnly ? [] : Array.from(element.childNodes),
|
|
56
|
+
delegatedListeners: delegatedHandlerMap ? Array.from(delegatedHandlerMap, ([eventName, entry]) => ({
|
|
57
|
+
eventName,
|
|
58
|
+
handler: entry.handler,
|
|
59
|
+
original: entry.original,
|
|
60
|
+
options: entry.options
|
|
61
|
+
})) : [],
|
|
62
|
+
domCaptured: !bindingsOnly,
|
|
63
|
+
formControl: bindingsOnly ? null : getFormControlSnapshot(element),
|
|
111
64
|
keyedMap: keyedMap ? new Map(keyedMap) : void 0,
|
|
112
|
-
listeners,
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
65
|
+
listeners: listenerMap ? Array.from(listenerMap, ([listenerKey, entry]) => ({
|
|
66
|
+
listenerKey,
|
|
67
|
+
entry: cloneListenerEntry(entry)
|
|
68
|
+
})) : [],
|
|
69
|
+
reactiveProps: reactivePropMap ? Array.from(reactivePropMap, ([propName, entry]) => ({
|
|
70
|
+
propName,
|
|
71
|
+
entry: cloneReactivePropEntry(entry)
|
|
72
|
+
})) : [],
|
|
73
|
+
ref: elementRefs.get(element),
|
|
74
|
+
textNodes: bindingsOnly ? [] : collectTextSnapshots(element)
|
|
116
75
|
};
|
|
117
76
|
}
|
|
118
77
|
function sameChildOrder(element, childNodes) {
|
|
@@ -120,19 +79,17 @@ function sameChildOrder(element, childNodes) {
|
|
|
120
79
|
for (let index = 0; index < childNodes.length; index += 1) if (element.childNodes[index] !== childNodes[index]) return false;
|
|
121
80
|
return true;
|
|
122
81
|
}
|
|
123
|
-
function restoreAttributes(snapshot) {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
for (const [name, value] of attributes) if (element.getAttribute(name) !== value) element.setAttribute(name, value);
|
|
128
|
-
}
|
|
82
|
+
function restoreAttributes(element, snapshot) {
|
|
83
|
+
const expectedNames = new Set(snapshot.attributes.map(([name]) => name));
|
|
84
|
+
for (const attribute of Array.from(element.attributes)) if (!expectedNames.has(attribute.name)) element.removeAttribute(attribute.name);
|
|
85
|
+
for (const [name, value] of snapshot.attributes) if (element.getAttribute(name) !== value) element.setAttribute(name, value);
|
|
129
86
|
}
|
|
130
|
-
function
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
87
|
+
function restoreFormControl(element, snapshot) {
|
|
88
|
+
if (!snapshot.formControl) return;
|
|
89
|
+
const { value, checked } = snapshot.formControl;
|
|
90
|
+
const control = element;
|
|
91
|
+
if (value !== void 0 && "value" in control) control.value = value;
|
|
92
|
+
if (checked !== void 0 && "checked" in control) control.checked = checked;
|
|
136
93
|
}
|
|
137
94
|
function applyRefValue(ref, value) {
|
|
138
95
|
if (!ref) return;
|
|
@@ -144,15 +101,13 @@ function applyRefValue(ref, value) {
|
|
|
144
101
|
if (Object.isExtensible(ref)) ref.current = value;
|
|
145
102
|
} catch {}
|
|
146
103
|
}
|
|
147
|
-
function
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
} else elementRefs.delete(element);
|
|
155
|
-
}
|
|
104
|
+
function restoreRef(element, snapshot) {
|
|
105
|
+
const currentRef = elementRefs.get(element);
|
|
106
|
+
if (currentRef !== snapshot.ref) applyRefValue(currentRef, null);
|
|
107
|
+
if (snapshot.ref) {
|
|
108
|
+
applyRefValue(snapshot.ref, element);
|
|
109
|
+
elementRefs.set(element, snapshot.ref);
|
|
110
|
+
} else elementRefs.delete(element);
|
|
156
111
|
}
|
|
157
112
|
function removeDirectListener(element, entry) {
|
|
158
113
|
if (entry.isDelegated) return;
|
|
@@ -164,63 +119,86 @@ function addDirectListener(element, entry) {
|
|
|
164
119
|
if (entry.options !== void 0) element.addEventListener(entry.eventName, entry.handler, entry.options);
|
|
165
120
|
else element.addEventListener(entry.eventName, entry.handler);
|
|
166
121
|
}
|
|
167
|
-
function restoreListeners(snapshot) {
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
122
|
+
function restoreListeners(element, snapshot) {
|
|
123
|
+
const errors = [];
|
|
124
|
+
const expectedKeys = new Set(snapshot.listeners.map(({ listenerKey }) => listenerKey));
|
|
125
|
+
let currentMap = elementListeners.get(element);
|
|
126
|
+
if (currentMap) {
|
|
127
|
+
for (const [listenerKey, entry] of Array.from(currentMap)) if (!expectedKeys.has(listenerKey)) {
|
|
128
|
+
try {
|
|
173
129
|
removeDirectListener(element, entry);
|
|
174
|
-
|
|
130
|
+
} catch (error) {
|
|
131
|
+
errors.push(error);
|
|
175
132
|
}
|
|
133
|
+
currentMap.delete(listenerKey);
|
|
176
134
|
}
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
135
|
+
}
|
|
136
|
+
if (snapshot.listeners.length === 0) {
|
|
137
|
+
if (currentMap?.size === 0) elementListeners.delete(element);
|
|
138
|
+
} else {
|
|
181
139
|
if (!currentMap) {
|
|
182
140
|
currentMap = /* @__PURE__ */ new Map();
|
|
183
141
|
elementListeners.set(element, currentMap);
|
|
184
142
|
}
|
|
185
|
-
for (const { listenerKey, entry } of
|
|
143
|
+
for (const { listenerKey, entry } of snapshot.listeners) {
|
|
186
144
|
const currentEntry = currentMap.get(listenerKey);
|
|
187
145
|
entry.updateHandler?.(entry.original);
|
|
188
|
-
if (currentEntry && currentEntry.handler !== entry.handler)
|
|
189
|
-
|
|
146
|
+
if (currentEntry && currentEntry.handler !== entry.handler) try {
|
|
147
|
+
removeDirectListener(element, currentEntry);
|
|
148
|
+
} catch (error) {
|
|
149
|
+
errors.push(error);
|
|
150
|
+
}
|
|
151
|
+
if (!currentEntry || currentEntry.handler !== entry.handler) try {
|
|
152
|
+
addDirectListener(element, entry);
|
|
153
|
+
} catch (error) {
|
|
154
|
+
errors.push(error);
|
|
155
|
+
}
|
|
190
156
|
else currentEntry.updateHandler?.(entry.original);
|
|
191
157
|
currentMap.set(listenerKey, cloneListenerEntry(entry));
|
|
192
158
|
}
|
|
193
159
|
}
|
|
160
|
+
if (errors.length > 0) throw new AggregateError(errors, "Listener rollback failed");
|
|
194
161
|
}
|
|
195
|
-
function restoreDelegatedListeners(snapshot) {
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
162
|
+
function restoreDelegatedListeners(element, snapshot) {
|
|
163
|
+
const errors = [];
|
|
164
|
+
const expectedEventNames = new Set(snapshot.delegatedListeners.map(({ eventName }) => eventName));
|
|
165
|
+
const currentMap = getDelegatedHandlersForElement(element);
|
|
166
|
+
if (currentMap) {
|
|
167
|
+
for (const eventName of currentMap.keys()) if (!expectedEventNames.has(eventName)) try {
|
|
168
|
+
removeDelegatedListener(element, eventName);
|
|
169
|
+
} catch (error) {
|
|
170
|
+
errors.push(error);
|
|
201
171
|
}
|
|
202
|
-
for (const { eventName, handler, original, options } of entries) if (!updateDelegatedListener(element, eventName, handler, original, options)) addDelegatedListener(element, eventName, handler, original, options);
|
|
203
172
|
}
|
|
173
|
+
for (const { eventName, handler, original, options } of snapshot.delegatedListeners) try {
|
|
174
|
+
if (!updateDelegatedListener(element, eventName, handler, original, options)) addDelegatedListener(element, eventName, handler, original, options);
|
|
175
|
+
} catch (error) {
|
|
176
|
+
errors.push(error);
|
|
177
|
+
}
|
|
178
|
+
if (errors.length > 0) throw new AggregateError(errors, "Delegated listener rollback failed");
|
|
204
179
|
}
|
|
205
|
-
function restoreReactiveProps(snapshot) {
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
180
|
+
function restoreReactiveProps(element, snapshot) {
|
|
181
|
+
const errors = [];
|
|
182
|
+
const expectedPropNames = new Set(snapshot.reactiveProps.map(({ propName }) => propName));
|
|
183
|
+
let currentMap = getElementReactivePropsCleanupMap(element);
|
|
184
|
+
if (currentMap) {
|
|
185
|
+
for (const [propName, entry] of Array.from(currentMap)) if (!expectedPropNames.has(propName)) {
|
|
186
|
+
try {
|
|
211
187
|
entry.cleanup();
|
|
212
|
-
|
|
188
|
+
} catch (error) {
|
|
189
|
+
errors.push(error);
|
|
213
190
|
}
|
|
191
|
+
currentMap.delete(propName);
|
|
214
192
|
}
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
193
|
+
}
|
|
194
|
+
if (snapshot.reactiveProps.length === 0) {
|
|
195
|
+
if (currentMap?.size === 0) elementReactivePropsCleanup.delete(element);
|
|
196
|
+
} else {
|
|
219
197
|
if (!currentMap) {
|
|
220
198
|
currentMap = /* @__PURE__ */ new Map();
|
|
221
199
|
elementReactivePropsCleanup.set(element, currentMap);
|
|
222
200
|
}
|
|
223
|
-
for (const { propName, entry } of
|
|
201
|
+
for (const { propName, entry } of snapshot.reactiveProps) {
|
|
224
202
|
const currentEntry = currentMap.get(propName);
|
|
225
203
|
if (currentEntry) {
|
|
226
204
|
currentEntry.updateFn?.(entry.fnRef);
|
|
@@ -228,16 +206,28 @@ function restoreReactiveProps(snapshot) {
|
|
|
228
206
|
currentMap.set(propName, currentEntry);
|
|
229
207
|
continue;
|
|
230
208
|
}
|
|
231
|
-
currentMap.set(propName,
|
|
209
|
+
currentMap.set(propName, (() => {
|
|
210
|
+
try {
|
|
211
|
+
return entry.restoreFn?.(entry.fnRef) ?? cloneReactivePropEntry(entry);
|
|
212
|
+
} catch (error) {
|
|
213
|
+
errors.push(error);
|
|
214
|
+
return cloneReactivePropEntry(entry);
|
|
215
|
+
}
|
|
216
|
+
})());
|
|
232
217
|
}
|
|
233
218
|
}
|
|
219
|
+
if (errors.length > 0) throw new AggregateError(errors, "Reactive property rollback failed");
|
|
234
220
|
}
|
|
235
|
-
function restoreChildNodes(snapshot, cleanupRangeNode) {
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
221
|
+
function restoreChildNodes(element, snapshot, cleanupRangeNode) {
|
|
222
|
+
const errors = [];
|
|
223
|
+
const expectedChildren = new Set(snapshot.childNodes);
|
|
224
|
+
for (const child of Array.from(element.childNodes)) if (!expectedChildren.has(child)) try {
|
|
225
|
+
cleanupRangeNode(child);
|
|
226
|
+
} catch (error) {
|
|
227
|
+
errors.push(error);
|
|
239
228
|
}
|
|
240
|
-
|
|
229
|
+
if (!sameChildOrder(element, snapshot.childNodes)) element.replaceChildren(...snapshot.childNodes);
|
|
230
|
+
if (errors.length > 0) throw new AggregateError(errors, "DOM range rollback cleanup failed");
|
|
241
231
|
}
|
|
242
232
|
function restoreTextNodes(snapshot) {
|
|
243
233
|
for (const { node, data } of snapshot.textNodes) if (node.data !== data) node.data = data;
|
|
@@ -247,31 +237,52 @@ function restoreKeyedMap(element, snapshot) {
|
|
|
247
237
|
else keyedElements.delete(element);
|
|
248
238
|
}
|
|
249
239
|
function restoreRetainedElement(element, snapshot, cleanupRangeNode) {
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
240
|
+
const errors = [];
|
|
241
|
+
const phases = [
|
|
242
|
+
...snapshot.domCaptured ? [
|
|
243
|
+
() => restoreChildNodes(element, snapshot, cleanupRangeNode),
|
|
244
|
+
() => restoreTextNodes(snapshot),
|
|
245
|
+
() => restoreFormControl(element, snapshot),
|
|
246
|
+
() => restoreAttributes(element, snapshot)
|
|
247
|
+
] : [],
|
|
248
|
+
() => restoreReactiveProps(element, snapshot),
|
|
249
|
+
() => restoreRef(element, snapshot),
|
|
250
|
+
() => restoreListeners(element, snapshot),
|
|
251
|
+
() => restoreDelegatedListeners(element, snapshot),
|
|
252
|
+
...snapshot.domCaptured ? [() => restoreKeyedMap(element, snapshot)] : []
|
|
253
|
+
];
|
|
254
|
+
for (const phase of phases) try {
|
|
255
|
+
phase();
|
|
256
|
+
} catch (error) {
|
|
257
|
+
errors.push(error);
|
|
258
|
+
}
|
|
259
|
+
if (errors.length > 0) throw new AggregateError(errors, "Retained element rollback failed");
|
|
259
260
|
}
|
|
260
|
-
function runRetainedElementUpdate(element, cleanupRangeNode, update, onError) {
|
|
261
|
-
const
|
|
261
|
+
function runRetainedElementUpdate(element, cleanupRangeNode, update, onError, bindingsOnly = false) {
|
|
262
|
+
const batch = getCurrentLifecycleCommitBatch();
|
|
263
|
+
const existingSnapshot = batch?.retainedElementSnapshots.get(element);
|
|
264
|
+
const snapshot = existingSnapshot ?? snapshotRetainedElement(element, bindingsOnly);
|
|
265
|
+
let restored = false;
|
|
266
|
+
if (batch && !existingSnapshot) {
|
|
267
|
+
batch.retainedElementSnapshots.set(element, snapshot);
|
|
268
|
+
registerLifecycleTransaction(element, () => void 0, () => {
|
|
269
|
+
if (restored) return;
|
|
270
|
+
restored = true;
|
|
271
|
+
restoreRetainedElement(element, snapshot, cleanupRangeNode);
|
|
272
|
+
});
|
|
273
|
+
}
|
|
262
274
|
try {
|
|
263
275
|
update();
|
|
264
276
|
} catch (err) {
|
|
265
277
|
onError?.();
|
|
266
278
|
try {
|
|
279
|
+
restored = true;
|
|
267
280
|
restoreRetainedElement(element, snapshot, cleanupRangeNode);
|
|
268
281
|
} catch (rollbackError) {
|
|
269
|
-
logger.warn("[Askr] retained element rollback failed:", rollbackError);
|
|
282
|
+
logger.warn("[Askr] retained element rollback failed:", new AggregateError([err, rollbackError], "Render failed and retained rollback reported errors"));
|
|
270
283
|
}
|
|
271
284
|
throw err;
|
|
272
285
|
}
|
|
273
286
|
}
|
|
274
287
|
//#endregion
|
|
275
288
|
export { restoreRetainedElement, runRetainedElementUpdate, snapshotRetainedElement };
|
|
276
|
-
|
|
277
|
-
//# sourceMappingURL=retained-element-rollback.js.map
|
|
@@ -10,7 +10,8 @@ import "../runtime/index.js";
|
|
|
10
10
|
import { tagNamesEqualIgnoreCase } from "./utils.js";
|
|
11
11
|
import { getRendererDOMHost } from "./dom-host.js";
|
|
12
12
|
import { findHostInstanceByType, inheritComponentCleanupStrict, inheritComponentKey, isRouteRootComponentVNode } from "./component-host-instances.js";
|
|
13
|
-
import { resolveNestedComponentResult } from "./component-host.js";
|
|
13
|
+
import { resolveNestedComponentResult } from "./component-host-results.js";
|
|
14
|
+
import "./component-host.js";
|
|
14
15
|
//#region src/renderer/stable-patch.ts
|
|
15
16
|
function normalizeStableIntrinsicChildren(children) {
|
|
16
17
|
if (children === null || children === void 0 || children === false) return [];
|
|
@@ -49,7 +50,7 @@ function resolveStableIntrinsicPatchVNode(dom, vnode) {
|
|
|
49
50
|
if (typeof vnode.type === "string") return tagNamesEqualIgnoreCase(dom.tagName, vnode.type) ? vnode : null;
|
|
50
51
|
if (typeof vnode.type !== "function") return null;
|
|
51
52
|
const host = dom;
|
|
52
|
-
const existingInstance = findHostInstanceByType(host, vnode.type);
|
|
53
|
+
const existingInstance = findHostInstanceByType(host, vnode.type, vnode, getCurrentInstance());
|
|
53
54
|
if (!existingInstance || existingInstance.fn !== vnode.type || host.__ASKR_WRAPPER_HOST) return null;
|
|
54
55
|
const snapshot = getVNodeContextFrame(vnode) || getCurrentContextFrame() || existingInstance.ownerFrame || null;
|
|
55
56
|
captureInlineRenderSnapshot(existingInstance);
|
|
@@ -77,5 +78,3 @@ function tryPatchStableForDirtyItem(scope) {
|
|
|
77
78
|
}
|
|
78
79
|
//#endregion
|
|
79
80
|
export { tryPatchStableForDirtyItem };
|
|
80
|
-
|
|
81
|
-
//# sourceMappingURL=stable-patch.js.map
|
package/dist/renderer/utils.js
CHANGED
|
@@ -15,6 +15,14 @@ const DIRECT_REPLACE_CHILDREN_SPREAD_LIMIT = 4096;
|
|
|
15
15
|
function canUseDirectReplaceChildrenSpread(count) {
|
|
16
16
|
return count <= DIRECT_REPLACE_CHILDREN_SPREAD_LIMIT;
|
|
17
17
|
}
|
|
18
|
+
const CLICK_EVENT_PROP = {
|
|
19
|
+
eventName: "click",
|
|
20
|
+
capture: false
|
|
21
|
+
};
|
|
22
|
+
const CLICK_CAPTURE_EVENT_PROP = {
|
|
23
|
+
eventName: "click",
|
|
24
|
+
capture: true
|
|
25
|
+
};
|
|
18
26
|
const handlerCache = /* @__PURE__ */ new WeakMap();
|
|
19
27
|
let cacheSize = 0;
|
|
20
28
|
const MAX_CACHE_SIZE = 1e3;
|
|
@@ -25,6 +33,8 @@ function parseEventName(propName) {
|
|
|
25
33
|
return parseEventProp(propName)?.eventName ?? null;
|
|
26
34
|
}
|
|
27
35
|
function parseEventProp(propName) {
|
|
36
|
+
if (propName === "onClick") return CLICK_EVENT_PROP;
|
|
37
|
+
if (propName === "onClickCapture") return CLICK_CAPTURE_EVENT_PROP;
|
|
28
38
|
if (!propName.startsWith("on") || propName.length <= 2) return null;
|
|
29
39
|
const capture = propName.endsWith("Capture") && propName.length > 9;
|
|
30
40
|
const normalizedPropName = capture ? propName.slice(0, -7) : propName;
|
|
@@ -207,15 +217,16 @@ function extractKey(vnode) {
|
|
|
207
217
|
function buildKeyMapFromChildren(parent) {
|
|
208
218
|
const map = /* @__PURE__ */ new Map();
|
|
209
219
|
for (let ch = parent.firstElementChild; ch; ch = ch.nextElementSibling) {
|
|
210
|
-
const
|
|
211
|
-
if (
|
|
212
|
-
map.set(k, ch);
|
|
213
|
-
const n = Number(k);
|
|
214
|
-
if (!Number.isNaN(n)) map.set(n, ch);
|
|
215
|
-
}
|
|
220
|
+
const key = getMaterializedKey(ch);
|
|
221
|
+
if (key !== void 0) map.set(key, ch);
|
|
216
222
|
}
|
|
217
223
|
return map;
|
|
218
224
|
}
|
|
225
|
+
function getMaterializedKey(element) {
|
|
226
|
+
const value = element.getAttribute("data-key");
|
|
227
|
+
if (value === null) return void 0;
|
|
228
|
+
return element.getAttribute("data-askr-key-kind") === "number" ? Number(value) : value;
|
|
229
|
+
}
|
|
219
230
|
/**
|
|
220
231
|
* Record DOM replace operation for diagnostics
|
|
221
232
|
*/
|
|
@@ -251,6 +262,4 @@ function now() {
|
|
|
251
262
|
return typeof performance !== "undefined" && performance.now ? performance.now() : Date.now();
|
|
252
263
|
}
|
|
253
264
|
//#endregion
|
|
254
|
-
export { DIRECT_REPLACE_CHILDREN_SPREAD_LIMIT, buildKeyMapFromChildren, canUseDirectReplaceChildrenSpread, checkPropChanges, createMutableWrappedHandler, createWrappedHandler, extractKey, getEventListenerKey, getEventListenerOptions, getPassiveOptions, getRenderedAttributeName, hasNonTrivialProps, hasPropChanged, isIgnoredForPropChanges, isSVGDomElement, isSkippedProp, logFastPathDebug, now, parseEventName, parseEventProp, readElementClassName, recordDOMReplace, recordFastPathStats, removeRenderedAttribute, setRenderedAttribute, tagNamesEqualIgnoreCase, writeElementClassName };
|
|
255
|
-
|
|
256
|
-
//# sourceMappingURL=utils.js.map
|
|
265
|
+
export { DIRECT_REPLACE_CHILDREN_SPREAD_LIMIT, buildKeyMapFromChildren, canUseDirectReplaceChildrenSpread, checkPropChanges, createMutableWrappedHandler, createWrappedHandler, extractKey, getEventListenerKey, getEventListenerOptions, getMaterializedKey, getPassiveOptions, getRenderedAttributeName, hasNonTrivialProps, hasPropChanged, isIgnoredForPropChanges, isSVGDomElement, isSkippedProp, logFastPathDebug, now, parseEventName, parseEventProp, readElementClassName, recordDOMReplace, recordFastPathStats, removeRenderedAttribute, setRenderedAttribute, tagNamesEqualIgnoreCase, writeElementClassName };
|
package/dist/router/access.js
CHANGED
|
@@ -6,5 +6,4 @@ declare function isRoutePathActive(pathOrPaths: string | readonly string[]): boo
|
|
|
6
6
|
declare function currentRoute<TParams extends RouteParams = RouteParams>(): RouteSnapshot<TParams>;
|
|
7
7
|
declare function syncCurrentRouteSnapshot(pathname: string, search: string, hash: string, activityMatches?: readonly RouteMatch[]): void;
|
|
8
8
|
//#endregion
|
|
9
|
-
export { currentRoute };
|
|
10
|
-
//# sourceMappingURL=activity.d.ts.map
|
|
9
|
+
export { currentRoute };
|
package/dist/router/activity.js
CHANGED
|
@@ -18,5 +18,4 @@ declare function registerRoutes(definition: RouteDefinition, options?: RegisterR
|
|
|
18
18
|
declare function route<const TPath extends string>(path: TPath, Component: RouteComponent<RoutePathParams<TPath>>, options?: RouteOptions<RoutePathParams<TPath>>): void;
|
|
19
19
|
declare function route<const TPath extends string, TComponent extends AnyRouteComponent>(path: TPath, Component: CompatibleRouteComponent<TPath, TComponent>, options?: RouteOptionsForComponent<TPath, TComponent>): void;
|
|
20
20
|
//#endregion
|
|
21
|
-
export { fallback, group, index, page, registerRoutes, route };
|
|
22
|
-
//# sourceMappingURL=authoring.d.ts.map
|
|
21
|
+
export { fallback, group, index, page, registerRoutes, route };
|
package/dist/router/authoring.js
CHANGED
|
@@ -27,5 +27,4 @@ type RegistrationSession = {
|
|
|
27
27
|
authConfigured: boolean;
|
|
28
28
|
};
|
|
29
29
|
//#endregion
|
|
30
|
-
export { AccessScopeState, AnyRouteComponent, InternalRoute, InternalRouteRecord, RegistrationScope, RegistrationSession };
|
|
31
|
-
//# sourceMappingURL=internal-types.d.ts.map
|
|
30
|
+
export { AccessScopeState, AnyRouteComponent, InternalRoute, InternalRouteRecord, RegistrationScope, RegistrationSession };
|
package/dist/router/lazy.d.ts
CHANGED
|
@@ -15,5 +15,4 @@ declare function associateRouteSourceLazy(registry: RouteRegistry, manifest: Rou
|
|
|
15
15
|
declare function clearPendingLazy(): void;
|
|
16
16
|
declare function restorePendingLazy(lazyImports: readonly Promise<unknown>[]): void;
|
|
17
17
|
//#endregion
|
|
18
|
-
export { lazy };
|
|
19
|
-
//# sourceMappingURL=lazy.d.ts.map
|
|
18
|
+
export { lazy };
|
package/dist/router/lazy.js
CHANGED
|
@@ -6,5 +6,4 @@ declare function _applyManifest(manifest: RouteManifest): void;
|
|
|
6
6
|
declare function clearRoutes(): void;
|
|
7
7
|
declare function createRouteRegistry(definition: RouteDefinition, options?: RegisterRoutesOptions): RouteRegistry;
|
|
8
8
|
//#endregion
|
|
9
|
-
export { clearRoutes, createRouteRegistry, getManifest };
|
|
10
|
-
//# sourceMappingURL=manifest.d.ts.map
|
|
9
|
+
export { clearRoutes, createRouteRegistry, getManifest };
|
package/dist/router/manifest.js
CHANGED
package/dist/router/match.js
CHANGED
|
@@ -7,5 +7,4 @@ declare function navigate(path: string, options?: NavigateOptions): void;
|
|
|
7
7
|
declare function initializeNavigation(): void;
|
|
8
8
|
declare function cleanupNavigation(): void;
|
|
9
9
|
//#endregion
|
|
10
|
-
export { type HistoryScrollBehavior, type NavigateOptions, type NavigationScrollBehavior, type RouteQueryParamInput, type RouteQueryParamValue, type RouteQueryUpdater, type RouteQueryUpdates, type ScrollRestorationOptions, type UpdateRouteQueryOptions, navigate, updateRouteQuery };
|
|
11
|
-
//# sourceMappingURL=navigate.d.ts.map
|
|
10
|
+
export { type HistoryScrollBehavior, type NavigateOptions, type NavigationScrollBehavior, type RouteQueryParamInput, type RouteQueryParamValue, type RouteQueryUpdater, type RouteQueryUpdates, type ScrollRestorationOptions, type UpdateRouteQueryOptions, navigate, updateRouteQuery };
|
package/dist/router/navigate.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { logger } from "../common/logger.js";
|
|
2
2
|
import { isPromiseLike } from "../common/promise.js";
|
|
3
|
-
import { configureScrollRestoration, saveScrollPosition } from "./navigation-scroll.js";
|
|
4
3
|
import { configureNavigationRegistryHost, getCurrentHref, hasRegisteredApps, parseTargetUrl, registerAppInstance, unregisterAppInstance } from "./navigation-registry.js";
|
|
4
|
+
import { configureScrollRestoration } from "./navigation-scroll.js";
|
|
5
5
|
import { applyNavigationTargets, applyPopStateNavigationTargets, beginRouteRequest, cancelRouteRequests, isStaleRouteRequest, resolveNavigationTargetsForApps } from "./navigation-targets.js";
|
|
6
6
|
import { updateRouteQuery } from "./route-query.js";
|
|
7
7
|
//#region src/router/navigate.ts
|
|
@@ -29,7 +29,7 @@ function navigateWithRedirectState(path, options, redirectState) {
|
|
|
29
29
|
Promise.resolve(resolvedTargets).then((targets) => {
|
|
30
30
|
if (isStaleRouteRequest(request.id)) return;
|
|
31
31
|
try {
|
|
32
|
-
applyNavigationTargets(path, options, redirectState, pathname, href, targets, navigateWithRedirectState);
|
|
32
|
+
applyNavigationTargets(request.id, path, options, redirectState, pathname, href, targets, navigateWithRedirectState);
|
|
33
33
|
} catch (error) {
|
|
34
34
|
logger.error("[Askr] navigation failed:", error);
|
|
35
35
|
}
|
|
@@ -38,18 +38,17 @@ function navigateWithRedirectState(path, options, redirectState) {
|
|
|
38
38
|
});
|
|
39
39
|
return;
|
|
40
40
|
}
|
|
41
|
-
applyNavigationTargets(path, options, redirectState, pathname, href, resolvedTargets, navigateWithRedirectState);
|
|
41
|
+
applyNavigationTargets(request.id, path, options, redirectState, pathname, href, resolvedTargets, navigateWithRedirectState);
|
|
42
42
|
}
|
|
43
43
|
function handlePopState(event) {
|
|
44
44
|
const request = beginRouteRequest();
|
|
45
45
|
const previousHref = getCurrentHref();
|
|
46
46
|
const pathname = window.location.pathname;
|
|
47
47
|
const href = `${window.location.pathname}${window.location.search}${window.location.hash}`;
|
|
48
|
-
saveScrollPosition(previousHref);
|
|
49
48
|
if (!hasRegisteredApps()) return;
|
|
50
49
|
const applyResolved = (targets) => {
|
|
51
50
|
try {
|
|
52
|
-
applyPopStateNavigationTargets(request.id, pathname, href, event.state, targets, navigate);
|
|
51
|
+
applyPopStateNavigationTargets(request.id, previousHref, { path: previousHref }, pathname, href, event.state, targets, navigate);
|
|
53
52
|
} catch (error) {
|
|
54
53
|
logger.error("[Askr] popstate navigation failed:", error);
|
|
55
54
|
}
|
|
@@ -72,5 +71,3 @@ function initializeNavigation() {
|
|
|
72
71
|
}
|
|
73
72
|
//#endregion
|
|
74
73
|
export { configureScrollRestoration, initializeNavigation, navigate, registerAppInstance, unregisterAppInstance, updateRouteQuery };
|
|
75
|
-
|
|
76
|
-
//# sourceMappingURL=navigate.js.map
|
|
@@ -28,5 +28,4 @@ declare function syncRegisteredRouteSnapshot(): void;
|
|
|
28
28
|
declare function registerAppInstance(instance: ComponentInstance, path: string, source?: AppNavigationSource): void;
|
|
29
29
|
declare function unregisterAppInstance(instance: ComponentInstance): void;
|
|
30
30
|
//#endregion
|
|
31
|
-
export { AppNavigationSource, AppRegistration };
|
|
32
|
-
//# sourceMappingURL=navigation-registry.d.ts.map
|
|
31
|
+
export { AppNavigationSource, AppRegistration };
|