@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,49 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ContextFrame } from "./context.js";
|
|
1
|
+
import { LifecycleCommitBatch, LifecycleOperation, LifecycleTransaction } from "./lifecycle-batch.js";
|
|
3
2
|
import { ComponentInstance } from "./component-internal.js";
|
|
4
|
-
import { ReadableSource } from "./readable.js";
|
|
5
3
|
|
|
6
4
|
//#region src/runtime/component-lifecycle.d.ts
|
|
7
|
-
type LifecycleOperation = () => void | (() => void) | PromiseLike<void | (() => void)>;
|
|
8
|
-
type LifecycleCommitBatchEntry = {
|
|
9
|
-
instance: ComponentInstance;
|
|
10
|
-
wasFirstMount: boolean;
|
|
11
|
-
};
|
|
12
|
-
type ReadSubscriptionCommit = {
|
|
13
|
-
instance: ComponentInstance;
|
|
14
|
-
token: number;
|
|
15
|
-
pendingReadSources: Set<ReadableSource<unknown>> | undefined;
|
|
16
|
-
pendingReadSourceVersions: Map<ReadableSource<unknown>, number> | undefined;
|
|
17
|
-
};
|
|
18
|
-
type InlineRenderSnapshot = {
|
|
19
|
-
instance: ComponentInstance;
|
|
20
|
-
props: Props;
|
|
21
|
-
ownerFrame: ContextFrame | null;
|
|
22
|
-
portalScope: object | null;
|
|
23
|
-
parentInstance: ComponentInstance | null;
|
|
24
|
-
isRoot: boolean | undefined;
|
|
25
|
-
};
|
|
26
|
-
type LifecycleCommitBatch = {
|
|
27
|
-
parent: LifecycleCommitBatch | null;
|
|
28
|
-
entries: LifecycleCommitBatchEntry[];
|
|
29
|
-
entriesByInstance: Map<ComponentInstance, LifecycleCommitBatchEntry>;
|
|
30
|
-
readCommits: ReadSubscriptionCommit[];
|
|
31
|
-
readCommitsByInstance: Map<ComponentInstance, ReadSubscriptionCommit>;
|
|
32
|
-
renderSnapshots: InlineRenderSnapshot[];
|
|
33
|
-
renderSnapshotsByInstance: Map<ComponentInstance, InlineRenderSnapshot>;
|
|
34
|
-
active: boolean;
|
|
35
|
-
};
|
|
36
|
-
declare function beginLifecycleCommitBatch(): LifecycleCommitBatch;
|
|
37
|
-
declare function captureInlineRenderSnapshot(instance: ComponentInstance): void;
|
|
38
|
-
declare function finalizeInlineReadSubscriptions(instance: ComponentInstance, token: number, pendingReadSources: Set<ReadableSource<unknown>> | undefined, pendingReadSourceVersions: Map<ReadableSource<unknown>, number> | undefined): void;
|
|
39
|
-
declare function flushLifecycleCommitBatch(batch: LifecycleCommitBatch): void;
|
|
40
|
-
declare function discardLifecycleCommitBatch(batch: LifecycleCommitBatch): void;
|
|
41
5
|
declare function registerMountOperationForInstance(instance: ComponentInstance | null, operation: LifecycleOperation): void;
|
|
42
6
|
declare function registerCommitOperationForInstance(instance: ComponentInstance | null, operation: LifecycleOperation): void;
|
|
43
|
-
declare function discardCommitOperations(instance: ComponentInstance): void;
|
|
44
|
-
declare function executeCommittedLifecycleOperations(instance: ComponentInstance, wasFirstMount: boolean): void;
|
|
45
7
|
declare function commitLifecycleForInstance(instance: ComponentInstance, wasFirstMount: boolean): void;
|
|
46
8
|
declare function commitRenderedComponent(instance: ComponentInstance): void;
|
|
47
9
|
//#endregion
|
|
48
|
-
export {
|
|
49
|
-
//# sourceMappingURL=component-lifecycle.d.ts.map
|
|
10
|
+
export type { LifecycleOperation };
|
|
@@ -1,108 +1,8 @@
|
|
|
1
1
|
import { isDevelopmentEnvironment } from "../common/env.js";
|
|
2
|
-
import { logger } from "../common/logger.js";
|
|
3
|
-
import { finalizeReadableSubscriptionsFromSnapshot } from "./readable.js";
|
|
4
|
-
import { isPromiseLike } from "../common/promise.js";
|
|
5
2
|
import { isBulkCommitActive } from "./fastlane.js";
|
|
3
|
+
import { discardCommitOperations, executeCommittedLifecycleOperations } from "./lifecycle-operation-settlement.js";
|
|
4
|
+
import { beginLifecycleCommitBatch, captureInlineRenderSnapshot, discardLifecycleCommitBatch, drainLifecycleCommitErrors, enqueueLifecycleCommitForInstance, finalizeInlineReadSubscriptions, flushLifecycleCommitBatch, getCurrentLifecycleCommitBatch, registerLifecycleRollback, registerLifecycleTransaction } from "./lifecycle-batch.js";
|
|
6
5
|
//#region src/runtime/component-lifecycle.ts
|
|
7
|
-
let currentLifecycleCommitBatch = null;
|
|
8
|
-
function beginLifecycleCommitBatch() {
|
|
9
|
-
const batch = {
|
|
10
|
-
parent: currentLifecycleCommitBatch,
|
|
11
|
-
entries: [],
|
|
12
|
-
entriesByInstance: /* @__PURE__ */ new Map(),
|
|
13
|
-
readCommits: [],
|
|
14
|
-
readCommitsByInstance: /* @__PURE__ */ new Map(),
|
|
15
|
-
renderSnapshots: [],
|
|
16
|
-
renderSnapshotsByInstance: /* @__PURE__ */ new Map(),
|
|
17
|
-
active: true
|
|
18
|
-
};
|
|
19
|
-
currentLifecycleCommitBatch = batch;
|
|
20
|
-
return batch;
|
|
21
|
-
}
|
|
22
|
-
function closeLifecycleCommitBatch(batch) {
|
|
23
|
-
if (!batch.active) return false;
|
|
24
|
-
batch.active = false;
|
|
25
|
-
currentLifecycleCommitBatch = batch.parent;
|
|
26
|
-
return true;
|
|
27
|
-
}
|
|
28
|
-
function enqueueLifecycleCommit(batch, instance, wasFirstMount) {
|
|
29
|
-
const existing = batch.entriesByInstance.get(instance);
|
|
30
|
-
if (existing) {
|
|
31
|
-
existing.wasFirstMount = existing.wasFirstMount || wasFirstMount;
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
const entry = {
|
|
35
|
-
instance,
|
|
36
|
-
wasFirstMount
|
|
37
|
-
};
|
|
38
|
-
batch.entriesByInstance.set(instance, entry);
|
|
39
|
-
batch.entries.push(entry);
|
|
40
|
-
}
|
|
41
|
-
function enqueueReadSubscriptionCommit(batch, instance, token, pendingReadSources, pendingReadSourceVersions) {
|
|
42
|
-
const existing = batch.readCommitsByInstance.get(instance);
|
|
43
|
-
const commit = existing ?? {
|
|
44
|
-
instance,
|
|
45
|
-
token,
|
|
46
|
-
pendingReadSources,
|
|
47
|
-
pendingReadSourceVersions
|
|
48
|
-
};
|
|
49
|
-
commit.token = token;
|
|
50
|
-
commit.pendingReadSources = pendingReadSources ? new Set(pendingReadSources) : void 0;
|
|
51
|
-
commit.pendingReadSourceVersions = pendingReadSourceVersions ? new Map(pendingReadSourceVersions) : void 0;
|
|
52
|
-
if (!existing) {
|
|
53
|
-
batch.readCommitsByInstance.set(instance, commit);
|
|
54
|
-
batch.readCommits.push(commit);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
function enqueueInlineRenderSnapshot(batch, snapshot) {
|
|
58
|
-
if (batch.renderSnapshotsByInstance.has(snapshot.instance)) return;
|
|
59
|
-
batch.renderSnapshotsByInstance.set(snapshot.instance, snapshot);
|
|
60
|
-
batch.renderSnapshots.push(snapshot);
|
|
61
|
-
}
|
|
62
|
-
function captureInlineRenderSnapshot(instance) {
|
|
63
|
-
if (!currentLifecycleCommitBatch?.active) return;
|
|
64
|
-
enqueueInlineRenderSnapshot(currentLifecycleCommitBatch, {
|
|
65
|
-
instance,
|
|
66
|
-
props: instance.props,
|
|
67
|
-
ownerFrame: instance.ownerFrame,
|
|
68
|
-
portalScope: instance.portalScope,
|
|
69
|
-
parentInstance: instance.parentInstance,
|
|
70
|
-
isRoot: instance.isRoot
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
function finalizeInlineReadSubscriptions(instance, token, pendingReadSources, pendingReadSourceVersions) {
|
|
74
|
-
if (currentLifecycleCommitBatch?.active) {
|
|
75
|
-
enqueueReadSubscriptionCommit(currentLifecycleCommitBatch, instance, token, pendingReadSources, pendingReadSourceVersions);
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
finalizeReadableSubscriptionsFromSnapshot(instance, token, pendingReadSources, pendingReadSourceVersions);
|
|
79
|
-
}
|
|
80
|
-
function flushLifecycleCommitBatch(batch) {
|
|
81
|
-
if (!closeLifecycleCommitBatch(batch)) return;
|
|
82
|
-
if (batch.parent?.active) {
|
|
83
|
-
for (const snapshot of batch.renderSnapshots) enqueueInlineRenderSnapshot(batch.parent, snapshot);
|
|
84
|
-
for (const commit of batch.readCommits) enqueueReadSubscriptionCommit(batch.parent, commit.instance, commit.token, commit.pendingReadSources, commit.pendingReadSourceVersions);
|
|
85
|
-
for (const entry of batch.entries) enqueueLifecycleCommit(batch.parent, entry.instance, entry.wasFirstMount);
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
for (const commit of batch.readCommits) finalizeReadableSubscriptionsFromSnapshot(commit.instance, commit.token, commit.pendingReadSources, commit.pendingReadSourceVersions);
|
|
89
|
-
for (const entry of batch.entries) executeCommittedLifecycleOperations(entry.instance, entry.wasFirstMount);
|
|
90
|
-
}
|
|
91
|
-
function discardLifecycleCommitBatch(batch) {
|
|
92
|
-
if (!closeLifecycleCommitBatch(batch)) return;
|
|
93
|
-
for (let index = batch.renderSnapshots.length - 1; index >= 0; index -= 1) {
|
|
94
|
-
const snapshot = batch.renderSnapshots[index];
|
|
95
|
-
snapshot.instance.props = snapshot.props;
|
|
96
|
-
snapshot.instance.ownerFrame = snapshot.ownerFrame;
|
|
97
|
-
snapshot.instance.portalScope = snapshot.portalScope;
|
|
98
|
-
snapshot.instance.parentInstance = snapshot.parentInstance;
|
|
99
|
-
snapshot.instance.isRoot = snapshot.isRoot;
|
|
100
|
-
}
|
|
101
|
-
for (const entry of batch.entries) {
|
|
102
|
-
if (entry.wasFirstMount) entry.instance.mountOperations = [];
|
|
103
|
-
discardCommitOperations(entry.instance);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
6
|
function registerMountOperationForInstance(instance, operation) {
|
|
107
7
|
if (instance) {
|
|
108
8
|
if (isBulkCommitActive()) {
|
|
@@ -121,56 +21,13 @@ function registerCommitOperationForInstance(instance, operation) {
|
|
|
121
21
|
instance.commitOperations.push(operation);
|
|
122
22
|
}
|
|
123
23
|
}
|
|
124
|
-
function settleLifecycleOperationResult(instance, lifecycleGeneration, result) {
|
|
125
|
-
if (isPromiseLike(result)) Promise.resolve(result).then((cleanup) => {
|
|
126
|
-
if (typeof cleanup === "function") {
|
|
127
|
-
if (instance.lifecycleGeneration === lifecycleGeneration && instance.mounted) {
|
|
128
|
-
instance.cleanupFns.push(cleanup);
|
|
129
|
-
return;
|
|
130
|
-
}
|
|
131
|
-
try {
|
|
132
|
-
cleanup();
|
|
133
|
-
} catch (err) {
|
|
134
|
-
logger.error("[Askr] async mount cleanup failed:", err);
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
}, (err) => {
|
|
138
|
-
logger.error("[Askr] async mount operation failed:", err);
|
|
139
|
-
});
|
|
140
|
-
else if (typeof result === "function") instance.cleanupFns.push(result);
|
|
141
|
-
}
|
|
142
|
-
function executeMountOperations(instance) {
|
|
143
|
-
const mountOperations = instance.mountOperations;
|
|
144
|
-
if (mountOperations.length === 0) return;
|
|
145
|
-
const lifecycleGeneration = instance.lifecycleGeneration;
|
|
146
|
-
for (const operation of mountOperations) settleLifecycleOperationResult(instance, lifecycleGeneration, operation());
|
|
147
|
-
instance.mountOperations = [];
|
|
148
|
-
}
|
|
149
|
-
function executeCommitOperations(instance) {
|
|
150
|
-
const commitOperations = instance.commitOperations;
|
|
151
|
-
if (commitOperations.length === 0) return;
|
|
152
|
-
instance.commitOperations = [];
|
|
153
|
-
const lifecycleGeneration = instance.lifecycleGeneration;
|
|
154
|
-
for (const operation of commitOperations) settleLifecycleOperationResult(instance, lifecycleGeneration, operation());
|
|
155
|
-
}
|
|
156
|
-
function discardCommitOperations(instance) {
|
|
157
|
-
instance.commitOperations = [];
|
|
158
|
-
}
|
|
159
|
-
function executeCommittedLifecycleOperations(instance, wasFirstMount) {
|
|
160
|
-
if (wasFirstMount && instance.mountOperations.length > 0) executeMountOperations(instance);
|
|
161
|
-
if (instance.commitOperations.length > 0) executeCommitOperations(instance);
|
|
162
|
-
}
|
|
163
24
|
function commitLifecycleForInstance(instance, wasFirstMount) {
|
|
164
|
-
if (
|
|
165
|
-
|
|
166
|
-
return;
|
|
167
|
-
}
|
|
25
|
+
if ((instance.mountOperations?.length ?? 0) === 0 && (instance.commitOperations?.length ?? 0) === 0) return;
|
|
26
|
+
if (enqueueLifecycleCommitForInstance(instance, wasFirstMount)) return;
|
|
168
27
|
executeCommittedLifecycleOperations(instance, wasFirstMount);
|
|
169
28
|
}
|
|
170
29
|
function commitRenderedComponent(instance) {
|
|
171
|
-
if (instance.mounted && instance.commitOperations
|
|
30
|
+
if (instance.mounted && (instance.commitOperations?.length ?? 0) > 0) commitLifecycleForInstance(instance, false);
|
|
172
31
|
}
|
|
173
32
|
//#endregion
|
|
174
|
-
export { beginLifecycleCommitBatch, captureInlineRenderSnapshot, commitLifecycleForInstance, commitRenderedComponent, discardCommitOperations, discardLifecycleCommitBatch,
|
|
175
|
-
|
|
176
|
-
//# sourceMappingURL=component-lifecycle.js.map
|
|
33
|
+
export { beginLifecycleCommitBatch, captureInlineRenderSnapshot, commitLifecycleForInstance, commitRenderedComponent, discardCommitOperations, discardLifecycleCommitBatch, drainLifecycleCommitErrors, finalizeInlineReadSubscriptions, flushLifecycleCommitBatch, getCurrentLifecycleCommitBatch, registerCommitOperationForInstance, registerLifecycleRollback, registerLifecycleTransaction, registerMountOperationForInstance };
|
|
@@ -35,8 +35,8 @@ declare function beginRenderTracking(instance: ComponentInstance): void;
|
|
|
35
35
|
declare function clearRenderTracking(instance: ComponentInstance): void;
|
|
36
36
|
declare function captureInlineRenderTracking(instance: ComponentInstance): InlineRenderTrackingSnapshot;
|
|
37
37
|
declare function restoreInlineRenderTracking(instance: ComponentInstance, snapshot: InlineRenderTrackingSnapshot): void;
|
|
38
|
-
declare function enterRenderScopedComponent(instance: ComponentInstance, startStateIndex: number): ComponentScopeSnapshot;
|
|
39
|
-
declare function restoreRenderScopedComponent(snapshot: ComponentScopeSnapshot): void;
|
|
38
|
+
declare function enterRenderScopedComponent(instance: ComponentInstance, startStateIndex: number): ComponentScopeSnapshot | null;
|
|
39
|
+
declare function restoreRenderScopedComponent(snapshot: ComponentScopeSnapshot | null): void;
|
|
40
40
|
declare function captureInlineComponentScope(): InstancePortalScopeSnapshot;
|
|
41
41
|
declare function restoreInlineComponentScope(snapshot: InstancePortalScopeSnapshot): void;
|
|
42
42
|
declare function enterComponentExecutionScope(instance: ComponentInstance): object | null;
|
|
@@ -51,5 +51,4 @@ declare function getCurrentStateIndex(): number;
|
|
|
51
51
|
declare function resetStateIndex(): void;
|
|
52
52
|
declare function setStateIndex(value: number): void;
|
|
53
53
|
//#endregion
|
|
54
|
-
export { getSignal };
|
|
55
|
-
//# sourceMappingURL=component-scope.d.ts.map
|
|
54
|
+
export { getSignal };
|
|
@@ -3,6 +3,10 @@ let currentInstance = null;
|
|
|
3
3
|
let currentPortalScope = null;
|
|
4
4
|
let stateIndex = 0;
|
|
5
5
|
let globalRenderCounter = 0;
|
|
6
|
+
let renderScopedDepth = 0;
|
|
7
|
+
let outerRenderScopedInstance = null;
|
|
8
|
+
let outerRenderScopedPortalScope = null;
|
|
9
|
+
let outerRenderScopedStateIndex = 0;
|
|
6
10
|
function ensureAbortController(instance) {
|
|
7
11
|
let controller = instance.abortController;
|
|
8
12
|
if (!controller || controller.signal.aborted) {
|
|
@@ -62,7 +66,7 @@ function getSignal() {
|
|
|
62
66
|
}
|
|
63
67
|
function resetRenderState(instance) {
|
|
64
68
|
instance.stateIndexCheck = -1;
|
|
65
|
-
for (const state of instance.stateValues) if (state) state._hasBeenRead = false;
|
|
69
|
+
for (const state of instance.stateValues ?? []) if (state) state._hasBeenRead = false;
|
|
66
70
|
instance._pendingReadSources = void 0;
|
|
67
71
|
instance._pendingReadSourceVersions = void 0;
|
|
68
72
|
}
|
|
@@ -89,14 +93,30 @@ function restoreInlineRenderTracking(instance, snapshot) {
|
|
|
89
93
|
instance._pendingReadSourceVersions = snapshot.pendingReadSourceVersions;
|
|
90
94
|
}
|
|
91
95
|
function enterRenderScopedComponent(instance, startStateIndex) {
|
|
92
|
-
|
|
96
|
+
let savedScope = null;
|
|
97
|
+
if (renderScopedDepth === 0) {
|
|
98
|
+
outerRenderScopedInstance = currentInstance;
|
|
99
|
+
outerRenderScopedPortalScope = currentPortalScope;
|
|
100
|
+
outerRenderScopedStateIndex = stateIndex;
|
|
101
|
+
} else savedScope = captureScope();
|
|
102
|
+
renderScopedDepth += 1;
|
|
93
103
|
currentInstance = instance;
|
|
94
|
-
currentPortalScope = instance.portalScope ?? savedScope.portalScope;
|
|
104
|
+
currentPortalScope = instance.portalScope ?? (savedScope ? savedScope.portalScope : outerRenderScopedPortalScope);
|
|
95
105
|
stateIndex = startStateIndex;
|
|
96
106
|
return savedScope;
|
|
97
107
|
}
|
|
98
108
|
function restoreRenderScopedComponent(snapshot) {
|
|
99
|
-
|
|
109
|
+
renderScopedDepth -= 1;
|
|
110
|
+
if (snapshot) {
|
|
111
|
+
restoreScope(snapshot);
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
currentInstance = outerRenderScopedInstance;
|
|
115
|
+
currentPortalScope = outerRenderScopedPortalScope;
|
|
116
|
+
stateIndex = outerRenderScopedStateIndex;
|
|
117
|
+
outerRenderScopedInstance = null;
|
|
118
|
+
outerRenderScopedPortalScope = null;
|
|
119
|
+
outerRenderScopedStateIndex = 0;
|
|
100
120
|
}
|
|
101
121
|
function captureInlineComponentScope() {
|
|
102
122
|
return captureInstancePortalScope();
|
|
@@ -140,9 +160,10 @@ function claimHookIndex(instance, hookName) {
|
|
|
140
160
|
const index = getNextStateIndex();
|
|
141
161
|
if (index < instance.stateIndexCheck) throw new Error(`Hook index violation: ${hookName}() call at index ${index}, but previously saw index ${instance.stateIndexCheck}. This happens when render-scoped hooks are called conditionally (inside if/for/etc). Move all ${hookName}() calls to the top level of your component function, before any conditionals.`);
|
|
142
162
|
instance.stateIndexCheck = index;
|
|
163
|
+
const expectedStateIndices = instance.expectedStateIndices ??= [];
|
|
143
164
|
if (instance.firstRenderComplete) {
|
|
144
|
-
if (
|
|
145
|
-
} else
|
|
165
|
+
if (expectedStateIndices[index] !== index) throw new Error(`Hook order violation: ${hookName}() called at index ${index}, but this index was not in the first render's sequence [${expectedStateIndices.join(", ")}]. This usually means ${hookName}() is inside a conditional or loop. Move all render-scoped hooks to the top level of your component function.`);
|
|
166
|
+
} else expectedStateIndices.push(index);
|
|
146
167
|
return index;
|
|
147
168
|
}
|
|
148
169
|
function getCurrentStateIndex() {
|
|
@@ -150,5 +171,3 @@ function getCurrentStateIndex() {
|
|
|
150
171
|
}
|
|
151
172
|
//#endregion
|
|
152
173
|
export { beginRenderTracking, captureInlineComponentScope, captureInlineRenderTracking, claimHookIndex, clearCurrentComponentScope, clearRenderTracking, enterComponentExecutionScope, enterDomCommitScope, enterRenderScopedComponent, exitComponentExecutionScope, getCurrentComponentInstance, getCurrentInstance, getCurrentPortalScope, getCurrentStateIndex, getNextStateIndex, getSignal, getSignalForInstance, resetRenderState, restoreCurrentComponentScope, restoreDomCommitScope, restoreInlineComponentScope, restoreInlineRenderTracking, restoreRenderScopedComponent, setCurrentComponentInstance };
|
|
153
|
-
|
|
154
|
-
//# sourceMappingURL=component-scope.js.map
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { claimHookIndex, getCurrentComponentInstance, getCurrentInstance, getCurrentPortalScope, getCurrentStateIndex, getSignal, setCurrentComponentInstance } from "./component-scope.js";
|
|
1
|
+
import { claimHookIndex, enterDomCommitScope, getCurrentComponentInstance, getCurrentInstance, getCurrentPortalScope, getCurrentStateIndex, getSignal, restoreDomCommitScope, setCurrentComponentInstance } from "./component-scope.js";
|
|
2
2
|
import { cleanupComponent, registerOwnedChildScope, unregisterOwnedChildScope } from "./component-cleanup.js";
|
|
3
|
-
import {
|
|
3
|
+
import { getCurrentLifecycleCommitBatch, registerLifecycleRollback, registerLifecycleTransaction } from "./lifecycle-batch.js";
|
|
4
|
+
import { captureInlineRenderSnapshot, createComponentInstance, mountComponent, mountInstanceInline, registerCommitOperation, renderComponentInline, renderScopedComponent, warnUnusedStateReads } from "./component-internal.js";
|
|
4
5
|
import "./component-facade.js";
|
|
5
|
-
export { captureInlineRenderSnapshot, claimHookIndex, cleanupComponent, createComponentInstance,
|
|
6
|
+
export { captureInlineRenderSnapshot, claimHookIndex, cleanupComponent, createComponentInstance, enterDomCommitScope, getCurrentComponentInstance, getCurrentInstance, getCurrentLifecycleCommitBatch, getCurrentPortalScope, getCurrentStateIndex, getSignal, mountComponent, mountInstanceInline, registerCommitOperation, registerLifecycleRollback, registerLifecycleTransaction, registerOwnedChildScope, renderComponentInline, renderScopedComponent, restoreDomCommitScope, setCurrentComponentInstance, unregisterOwnedChildScope, warnUnusedStateReads };
|
|
@@ -17,6 +17,8 @@ interface ContextFrame {
|
|
|
17
17
|
parent: ContextFrame | null;
|
|
18
18
|
values: Map<ContextKey, unknown> | null;
|
|
19
19
|
}
|
|
20
|
+
/** @internal Reuse immutable empty wrappers for the same provider snapshot. */
|
|
21
|
+
declare function getExecutionContextFrame(parent: ContextFrame | null): ContextFrame;
|
|
20
22
|
declare const CONTEXT_FRAME_SYMBOL: unique symbol;
|
|
21
23
|
declare function getVNodeContextFrame(node: unknown): ContextFrame | undefined;
|
|
22
24
|
declare function markVNodeWithContextFrame(node: unknown, frame: ContextFrame, overwrite?: boolean): void;
|
|
@@ -33,6 +35,8 @@ declare function markVNodeTreeWithContextFrame(node: unknown, frame: ContextFram
|
|
|
33
35
|
* This ensures no context frame remains globally active across await.
|
|
34
36
|
*/
|
|
35
37
|
declare function withContext<T>(frame: ContextFrame | null, fn: () => T): T;
|
|
38
|
+
/** @internal Invoke a two-argument function without allocating a wrapper. */
|
|
39
|
+
declare function callWithContext<TArgs, TContext, TResult>(frame: ContextFrame | null, fn: (args: TArgs, context: TContext) => TResult, args: TArgs, context: TContext): TResult;
|
|
36
40
|
/**
|
|
37
41
|
* Execute an async resource step within its frozen context snapshot.
|
|
38
42
|
*
|
|
@@ -65,5 +69,4 @@ declare function getCurrentContextFrame(): ContextFrame | null;
|
|
|
65
69
|
*/
|
|
66
70
|
declare function getTopContextSnapshot(): ContextFrame | null;
|
|
67
71
|
//#endregion
|
|
68
|
-
export { Context, ContextFrame, ContextKey, defineContext, readContext };
|
|
69
|
-
//# sourceMappingURL=context.d.ts.map
|
|
72
|
+
export { Context, ContextFrame, ContextKey, defineContext, readContext };
|
package/dist/runtime/context.js
CHANGED
|
@@ -2,6 +2,24 @@ import { ELEMENT_TYPE, STATIC_CHILDREN } from "../common/jsx.js";
|
|
|
2
2
|
import { getCurrentComponentInstance } from "./component-scope.js";
|
|
3
3
|
import "./component.js";
|
|
4
4
|
//#region src/runtime/context.ts
|
|
5
|
+
const ROOT_EXECUTION_FRAME = {
|
|
6
|
+
parent: null,
|
|
7
|
+
values: null
|
|
8
|
+
};
|
|
9
|
+
const executionFramesByParent = /* @__PURE__ */ new WeakMap();
|
|
10
|
+
/** @internal Reuse immutable empty wrappers for the same provider snapshot. */
|
|
11
|
+
function getExecutionContextFrame(parent) {
|
|
12
|
+
if (!parent) return ROOT_EXECUTION_FRAME;
|
|
13
|
+
let frame = executionFramesByParent.get(parent);
|
|
14
|
+
if (!frame) {
|
|
15
|
+
frame = {
|
|
16
|
+
parent,
|
|
17
|
+
values: null
|
|
18
|
+
};
|
|
19
|
+
executionFramesByParent.set(parent, frame);
|
|
20
|
+
}
|
|
21
|
+
return frame;
|
|
22
|
+
}
|
|
5
23
|
const CONTEXT_FRAME_SYMBOL = Symbol("__tempoContextFrame__");
|
|
6
24
|
const vnodeContextFrames = /* @__PURE__ */ new WeakMap();
|
|
7
25
|
function getVNodeContextFrame(node) {
|
|
@@ -81,6 +99,16 @@ function withContext(frame, fn) {
|
|
|
81
99
|
currentContextFrame = oldFrame;
|
|
82
100
|
}
|
|
83
101
|
}
|
|
102
|
+
/** @internal Invoke a two-argument function without allocating a wrapper. */
|
|
103
|
+
function callWithContext(frame, fn, args, context) {
|
|
104
|
+
const oldFrame = currentContextFrame;
|
|
105
|
+
currentContextFrame = frame;
|
|
106
|
+
try {
|
|
107
|
+
return fn(args, context);
|
|
108
|
+
} finally {
|
|
109
|
+
currentContextFrame = oldFrame;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
84
112
|
/**
|
|
85
113
|
* Execute an async resource step within its frozen context snapshot.
|
|
86
114
|
*
|
|
@@ -205,6 +233,4 @@ function getCurrentContextFrame() {
|
|
|
205
233
|
return currentContextFrame;
|
|
206
234
|
}
|
|
207
235
|
//#endregion
|
|
208
|
-
export { CONTEXT_FRAME_SYMBOL, defineContext, getCurrentContextFrame, getVNodeContextFrame, markVNodeTreeWithContextFrame, markVNodeWithContextFrame, readContext, withAsyncResourceContext, withContext };
|
|
209
|
-
|
|
210
|
-
//# sourceMappingURL=context.js.map
|
|
236
|
+
export { CONTEXT_FRAME_SYMBOL, callWithContext, defineContext, getCurrentContextFrame, getExecutionContextFrame, getVNodeContextFrame, markVNodeTreeWithContextFrame, markVNodeWithContextFrame, readContext, withAsyncResourceContext, withContext };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ComponentInstance } from "./component-internal.js";
|
|
2
|
-
import {
|
|
2
|
+
import { DOMRange } from "../common/dom-range.js";
|
|
3
|
+
import { ChildScope, ChildScopeTransactionSnapshot } from "./child-scope.js";
|
|
3
4
|
import { ForState } from "./for-internal.js";
|
|
4
5
|
import { VNode } from "../common/vnode.js";
|
|
5
6
|
|
|
@@ -14,9 +15,11 @@ interface BranchControlStateBase {
|
|
|
14
15
|
activeScope: ChildScope | null;
|
|
15
16
|
activeVNodes: VNode[];
|
|
16
17
|
lastRemovedNodes: Node[];
|
|
18
|
+
lastRemovedRanges: DOMRange[];
|
|
17
19
|
parentInstance: ComponentInstance | null;
|
|
18
20
|
_enqueueBoundaryCommit?: (() => void) | null;
|
|
19
21
|
_hasPendingBoundaryCommit?: boolean;
|
|
22
|
+
_transaction?: ControlTransaction | null;
|
|
20
23
|
}
|
|
21
24
|
interface ShowState extends BranchControlStateBase {
|
|
22
25
|
kind: 'show';
|
|
@@ -32,6 +35,23 @@ interface CaseState extends BranchControlStateBase {
|
|
|
32
35
|
matches: MatchBranch[];
|
|
33
36
|
}
|
|
34
37
|
type ControlBoundaryState = ForState<unknown> | ShowState | CaseState;
|
|
38
|
+
type BranchStateSnapshot = {
|
|
39
|
+
activeKey: string | number | null;
|
|
40
|
+
activeScope: ChildScope | null;
|
|
41
|
+
activeVNodes: VNode[];
|
|
42
|
+
lastRemovedNodes: Node[];
|
|
43
|
+
lastRemovedRanges: DOMRange[];
|
|
44
|
+
scopeSnapshots: Map<ChildScope, ChildScopeTransactionSnapshot>;
|
|
45
|
+
fallbackScope?: ChildScope | null;
|
|
46
|
+
truthyScope?: ChildScope | null;
|
|
47
|
+
};
|
|
48
|
+
interface ControlTransaction {
|
|
49
|
+
state: ShowState | CaseState;
|
|
50
|
+
snapshot: BranchStateSnapshot;
|
|
51
|
+
removedScopes: ChildScope[];
|
|
52
|
+
shouldClearDomUpdateState: boolean;
|
|
53
|
+
registered: boolean;
|
|
54
|
+
}
|
|
35
55
|
declare function createShowState(value: unknown, renderTruthy: ShowState['renderTruthy'], renderFallback: ShowState['renderFallback']): ShowState;
|
|
36
56
|
declare function evaluateShowState(state: ShowState): VNode[];
|
|
37
57
|
declare function clearShowDomUpdateState(state: ShowState): void;
|
|
@@ -39,5 +59,4 @@ declare function createCaseState(matches: MatchBranch[], fallback: (() => VNode)
|
|
|
39
59
|
declare function evaluateCaseState(state: CaseState): VNode[];
|
|
40
60
|
declare function clearCaseDomUpdateState(state: CaseState): void;
|
|
41
61
|
//#endregion
|
|
42
|
-
export { CaseState, ControlBoundaryState, MatchBranch, ShowState };
|
|
43
|
-
//# sourceMappingURL=control.d.ts.map
|
|
62
|
+
export { CaseState, ControlBoundaryState, ControlTransaction, MatchBranch, ShowState };
|