@askrjs/askr 0.0.51 → 0.0.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bench/components/benchmark-row.d.ts +2 -2
- package/dist/bench/components/benchmark-row.js +0 -2
- package/dist/bench/components/benchmark-table.js +0 -2
- package/dist/benchmark.d.ts +1 -2
- package/dist/benchmark.js +2 -4
- package/dist/bin/askr-ssg.d.ts +1 -2
- package/dist/bin/askr-ssg.js +21 -6
- package/dist/boot/hydration.js +10 -11
- package/dist/boot/index.d.ts +1 -2
- package/dist/boot/index.js +20 -11
- package/dist/boot/root-lifecycle.d.ts +6 -3
- package/dist/boot/root-lifecycle.js +14 -10
- package/dist/boot/route-startup.js +13 -4
- package/dist/boot/types.d.ts +1 -2
- package/dist/common/attr-names.js +0 -2
- package/dist/common/component.d.ts +1 -2
- package/dist/common/control.d.ts +1 -2
- package/dist/common/control.js +0 -2
- package/dist/common/dom-range.d.ts +13 -0
- package/dist/common/env.js +1 -7
- package/dist/common/error-boundary.d.ts +1 -2
- package/dist/common/invariant.js +0 -2
- package/dist/common/jsx.d.ts +1 -2
- package/dist/common/jsx.js +0 -2
- package/dist/common/logger.js +0 -2
- package/dist/common/promise.js +0 -2
- package/dist/common/props.d.ts +1 -2
- package/dist/common/render-context.js +0 -2
- package/dist/common/route-activity.js +0 -2
- package/dist/common/router-internal.js +0 -2
- package/dist/common/router.d.ts +1 -2
- package/dist/common/ssr-errors.d.ts +1 -2
- package/dist/common/ssr-errors.js +0 -2
- package/dist/common/ssr.d.ts +1 -2
- package/dist/common/ssr.js +0 -2
- package/dist/common/vnode.d.ts +1 -2
- package/dist/common/vnode.js +0 -2
- package/dist/components/error-boundary.d.ts +1 -2
- package/dist/components/error-boundary.js +0 -2
- package/dist/components/link.d.ts +2 -2
- package/dist/components/link.js +0 -2
- package/dist/control/case.d.ts +1 -2
- package/dist/control/case.js +0 -2
- package/dist/control/for.d.ts +1 -2
- package/dist/control/for.js +0 -2
- package/dist/control/shared.d.ts +1 -2
- package/dist/control/shared.js +0 -2
- package/dist/control/show.d.ts +1 -2
- package/dist/control/show.js +0 -2
- package/dist/data/data-runtime.d.ts +1 -2
- package/dist/data/data-runtime.js +3 -5
- package/dist/data/invalidation-listeners.js +0 -2
- package/dist/data/invalidation.d.ts +1 -2
- package/dist/data/invalidation.js +0 -2
- package/dist/data/mutation-cell.d.ts +1 -2
- package/dist/data/mutation-cell.js +6 -5
- package/dist/data/query-cell.d.ts +3 -2
- package/dist/data/query-cell.js +43 -9
- package/dist/data/query-key.js +0 -2
- package/dist/data/shared.js +2 -3
- package/dist/data/types.d.ts +1 -2
- package/dist/foundations/icon/icon.d.ts +1 -2
- package/dist/foundations/icon/icon.js +0 -2
- package/dist/foundations/icon/icon.types.d.ts +1 -2
- package/dist/foundations/interactions/dismissable.d.ts +1 -2
- package/dist/foundations/interactions/dismissable.js +0 -2
- package/dist/foundations/interactions/focusable.d.ts +1 -2
- package/dist/foundations/interactions/focusable.js +0 -2
- package/dist/foundations/interactions/hoverable.d.ts +1 -2
- package/dist/foundations/interactions/hoverable.js +0 -2
- package/dist/foundations/interactions/interaction-policy.d.ts +1 -2
- package/dist/foundations/interactions/interaction-policy.js +0 -2
- package/dist/foundations/interactions/pressable.d.ts +1 -2
- package/dist/foundations/interactions/pressable.js +0 -2
- package/dist/foundations/interactions/roving-focus.d.ts +1 -2
- package/dist/foundations/interactions/roving-focus.js +0 -2
- package/dist/foundations/state/controllable.d.ts +1 -2
- package/dist/foundations/state/controllable.js +0 -2
- package/dist/foundations/structures/collection.d.ts +1 -2
- package/dist/foundations/structures/collection.js +0 -2
- package/dist/foundations/structures/layer.d.ts +1 -2
- package/dist/foundations/structures/layer.js +0 -2
- package/dist/foundations/structures/layout.d.ts +1 -2
- package/dist/foundations/structures/layout.js +0 -2
- package/dist/foundations/structures/presence.d.ts +1 -2
- package/dist/foundations/structures/presence.js +0 -2
- package/dist/foundations/structures/slot.d.ts +1 -2
- package/dist/foundations/structures/slot.js +0 -2
- package/dist/foundations/utilities/aria.d.ts +1 -2
- package/dist/foundations/utilities/aria.js +0 -2
- package/dist/foundations/utilities/compose-handlers.d.ts +1 -2
- package/dist/foundations/utilities/compose-handlers.js +0 -2
- package/dist/foundations/utilities/compose-ref.d.ts +1 -2
- package/dist/foundations/utilities/compose-ref.js +0 -2
- package/dist/foundations/utilities/event-types.d.ts +1 -2
- package/dist/foundations/utilities/merge-props.d.ts +1 -2
- package/dist/foundations/utilities/merge-props.js +0 -2
- package/dist/foundations/utilities/use-id.d.ts +1 -2
- package/dist/foundations/utilities/use-id.js +0 -2
- package/dist/fx/fx.d.ts +1 -2
- package/dist/fx/fx.js +0 -2
- package/dist/fx/noop.js +0 -2
- package/dist/fx/timing.d.ts +1 -2
- package/dist/fx/timing.js +0 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +0 -2
- package/dist/jsx/types.d.ts +1 -2
- package/dist/jsx/utils.d.ts +1 -2
- package/dist/jsx/utils.js +0 -2
- package/dist/jsx-dev-runtime.d.ts +16 -2
- package/dist/jsx-dev-runtime.js +3 -12
- package/dist/jsx-runtime.d.ts +16 -2
- package/dist/jsx-runtime.js +15 -24
- package/dist/jsx-runtime2.d.ts +1 -1
- package/dist/renderer/attributes.js +28 -6
- package/dist/renderer/boundaries.js +48 -172
- package/dist/renderer/boundary-materialization.js +72 -0
- package/dist/renderer/boundary-range-adoption.js +76 -0
- package/dist/renderer/boundary-range-sync.js +101 -0
- package/dist/renderer/boundary-state.js +50 -0
- package/dist/renderer/child-shape.js +0 -2
- package/dist/renderer/children-fastpath.js +3 -3
- package/dist/renderer/children.js +0 -2
- package/dist/renderer/cleanup.js +70 -13
- package/dist/renderer/component-host-cleanup.js +123 -48
- package/dist/renderer/component-host-instances.js +59 -8
- package/dist/renderer/component-host-replacement.js +105 -0
- package/dist/renderer/component-host-results.js +138 -0
- package/dist/renderer/component-host.js +94 -169
- package/dist/renderer/dom-host.js +0 -2
- package/dist/renderer/dom-internal.js +110 -53
- package/dist/renderer/dom-range.js +161 -0
- package/dist/renderer/dom.js +5 -4
- package/dist/renderer/element-children.js +112 -32
- package/dist/renderer/error-boundary-dom.js +19 -11
- package/dist/renderer/evaluate-dom-range.js +3 -4
- package/dist/renderer/evaluate-reconcile.js +12 -37
- package/dist/renderer/evaluate.js +14 -3
- package/dist/renderer/fastpath.js +4 -12
- package/dist/renderer/for-commit-dom-map.js +6 -18
- package/dist/renderer/for-commit-removal.js +7 -16
- package/dist/renderer/for-commit-reorder.js +0 -2
- package/dist/renderer/for-commit.js +172 -44
- package/dist/renderer/hydration-boundaries.js +60 -0
- package/dist/renderer/hydration-listener-transaction.js +49 -0
- package/dist/renderer/index.js +8 -7
- package/dist/renderer/intrinsic-blueprint-analysis.js +202 -0
- package/dist/renderer/intrinsic-blueprint-bindings.js +152 -0
- package/dist/renderer/intrinsic-blueprint-materialization.js +100 -0
- package/dist/renderer/intrinsic-blueprint.js +30 -0
- package/dist/renderer/intrinsic-hydration-adoption.js +66 -0
- package/dist/renderer/keyed-children.js +3 -9
- package/dist/renderer/keyed.js +10 -10
- package/dist/renderer/namespaces.js +0 -2
- package/dist/renderer/prop-bindings.js +56 -21
- package/dist/renderer/reactive-child-dom.js +10 -4
- package/dist/renderer/reactive-child-sources.js +0 -2
- package/dist/renderer/reactive-children.js +29 -20
- package/dist/renderer/reconcile-commit.js +0 -2
- package/dist/renderer/reconcile-fastpaths.js +4 -11
- package/dist/renderer/reconcile-resolution.js +31 -55
- package/dist/renderer/reconcile.js +0 -2
- package/dist/renderer/retained-element-rollback.js +159 -148
- package/dist/renderer/stable-patch.js +3 -4
- package/dist/renderer/static-reuse.js +0 -2
- package/dist/renderer/utils.js +18 -9
- package/dist/router/access.js +0 -2
- package/dist/router/activity.d.ts +1 -2
- package/dist/router/activity.js +0 -2
- package/dist/router/authoring.d.ts +1 -2
- package/dist/router/authoring.js +0 -2
- package/dist/router/internal-types.d.ts +1 -2
- package/dist/router/lazy.d.ts +1 -2
- package/dist/router/lazy.js +0 -2
- package/dist/router/manifest.d.ts +1 -2
- package/dist/router/manifest.js +0 -2
- package/dist/router/match.js +0 -2
- package/dist/router/navigate.d.ts +1 -2
- package/dist/router/navigate.js +4 -7
- package/dist/router/navigation-registry.d.ts +1 -2
- package/dist/router/navigation-registry.js +0 -2
- package/dist/router/navigation-scroll.d.ts +1 -2
- package/dist/router/navigation-scroll.js +0 -2
- package/dist/router/navigation-targets.d.ts +3 -4
- package/dist/router/navigation-targets.js +419 -40
- package/dist/router/policy.d.ts +1 -2
- package/dist/router/policy.js +0 -2
- package/dist/router/rendering.d.ts +1 -2
- package/dist/router/rendering.js +4 -3
- package/dist/router/resolution.d.ts +1 -2
- package/dist/router/resolution.js +0 -2
- package/dist/router/route-context.js +0 -2
- package/dist/router/route-matching.d.ts +1 -2
- package/dist/router/route-matching.js +0 -2
- package/dist/router/route-query.d.ts +1 -2
- package/dist/router/route-query.js +1 -3
- package/dist/router/store.d.ts +1 -2
- package/dist/router/store.js +0 -2
- package/dist/runtime/access.d.ts +1 -2
- package/dist/runtime/access.js +0 -2
- package/dist/runtime/child-scope.d.ts +21 -2
- package/dist/runtime/child-scope.js +101 -54
- package/dist/runtime/component-cleanup.d.ts +1 -2
- package/dist/runtime/component-cleanup.js +2 -4
- package/dist/runtime/component-commit.js +25 -23
- package/dist/runtime/component-facade.js +5 -3
- package/dist/runtime/component-internal.d.ts +11 -6
- package/dist/runtime/component-internal.js +63 -45
- package/dist/runtime/component-lifecycle.d.ts +2 -41
- package/dist/runtime/component-lifecycle.js +6 -149
- package/dist/runtime/component-scope.d.ts +3 -4
- package/dist/runtime/component-scope.js +27 -8
- package/dist/runtime/component.js +4 -3
- package/dist/runtime/context.d.ts +5 -2
- package/dist/runtime/context.js +29 -3
- package/dist/runtime/control.d.ts +22 -3
- package/dist/runtime/control.js +168 -55
- package/dist/runtime/derive.d.ts +1 -2
- package/dist/runtime/derive.js +0 -2
- package/dist/runtime/dev-namespace.d.ts +5 -6
- package/dist/runtime/dev-namespace.js +32 -25
- package/dist/runtime/effect.d.ts +8 -5
- package/dist/runtime/effect.js +158 -75
- package/dist/runtime/error-boundary.d.ts +1 -2
- package/dist/runtime/error-boundary.js +0 -2
- package/dist/runtime/events.d.ts +3 -3
- package/dist/runtime/events.js +66 -69
- package/dist/runtime/execution-model.d.ts +1 -2
- package/dist/runtime/execution-model.js +0 -2
- package/dist/runtime/fastlane.d.ts +1 -2
- package/dist/runtime/fastlane.js +0 -2
- package/dist/runtime/for-bench.d.ts +1 -2
- package/dist/runtime/for-bench.js +9 -167
- package/dist/runtime/for-internal.d.ts +68 -5
- package/dist/runtime/for-internal.js +201 -14
- package/dist/runtime/for-reconcile.d.ts +1 -2
- package/dist/runtime/for-reconcile.js +76 -23
- package/dist/runtime/for-scopes.d.ts +5 -5
- package/dist/runtime/for-scopes.js +168 -48
- package/dist/runtime/for-signals.d.ts +13 -4
- package/dist/runtime/for-signals.js +155 -81
- package/dist/runtime/for-types.d.ts +1 -2
- package/dist/runtime/for.d.ts +2 -2
- package/dist/runtime/for.js +3 -3
- package/dist/runtime/index.d.ts +5 -5
- package/dist/runtime/index.js +12 -10
- package/dist/runtime/lifecycle-batch.d.ts +59 -0
- package/dist/runtime/lifecycle-batch.js +178 -0
- package/dist/runtime/lifecycle-operation-settlement.d.ts +5 -0
- package/dist/runtime/lifecycle-operation-settlement.js +51 -0
- package/dist/runtime/lifecycle-operations.d.ts +1 -2
- package/dist/runtime/lifecycle-operations.js +5 -6
- package/dist/runtime/perf-metrics.d.ts +8 -7
- package/dist/runtime/perf-metrics.js +4 -68
- package/dist/runtime/portal.d.ts +1 -2
- package/dist/runtime/portal.js +103 -11
- package/dist/runtime/readable.d.ts +9 -4
- package/dist/runtime/readable.js +41 -17
- package/dist/runtime/resource-cell.js +2 -4
- package/dist/runtime/resource-operation.d.ts +1 -2
- package/dist/runtime/resource-operation.js +37 -34
- package/dist/runtime/runtime.d.ts +1 -2
- package/dist/runtime/runtime.js +0 -2
- package/dist/runtime/scheduler.d.ts +1 -2
- package/dist/runtime/scheduler.js +8 -11
- package/dist/runtime/selector-store.js +0 -2
- package/dist/runtime/selector.d.ts +1 -2
- package/dist/runtime/selector.js +3 -11
- package/dist/runtime/snapshot-source.d.ts +1 -2
- package/dist/runtime/snapshot-source.js +0 -2
- package/dist/runtime/state.d.ts +1 -2
- package/dist/runtime/state.js +1 -3
- package/dist/ssg/batch-render.js +0 -2
- package/dist/ssg/create-static-gen.d.ts +4 -2
- package/dist/ssg/create-static-gen.js +65 -14
- package/dist/ssg/generate-metadata.js +0 -2
- package/dist/ssg/generation-plan.js +0 -2
- package/dist/ssg/incremental-manifest.js +1 -3
- package/dist/ssg/resolve-ssg-data.js +0 -2
- package/dist/ssg/route-utils.js +0 -2
- package/dist/ssg/static-routes.js +0 -2
- package/dist/ssg/types.d.ts +2 -3
- package/dist/ssg/write-static-files.js +16 -12
- package/dist/ssr/attrs.js +0 -2
- package/dist/ssr/boundaries.js +16 -5
- package/dist/ssr/component-runtime.js +1 -27
- package/dist/ssr/context.d.ts +1 -2
- package/dist/ssr/context.js +0 -2
- package/dist/ssr/errors.d.ts +1 -2
- package/dist/ssr/errors.js +0 -2
- package/dist/ssr/escape.js +0 -2
- package/dist/ssr/hydration-data.js +0 -2
- package/dist/ssr/hydration-verify.d.ts +1 -2
- package/dist/ssr/hydration-verify.js +34 -7
- package/dist/ssr/index-internal.d.ts +1 -2
- package/dist/ssr/index-internal.js +0 -2
- package/dist/ssr/render-keys.js +0 -2
- package/dist/ssr/render-resolved.d.ts +1 -2
- package/dist/ssr/render-resolved.js +0 -2
- package/dist/ssr/render-sync.d.ts +1 -2
- package/dist/ssr/render-sync.js +27 -19
- package/dist/ssr/route-policy-resolution.js +0 -2
- package/dist/ssr/route-render.d.ts +1 -2
- package/dist/ssr/route-render.js +0 -2
- package/dist/ssr/sink.d.ts +1 -2
- package/dist/ssr/sink.js +0 -2
- package/dist/ssr/types.d.ts +1 -2
- package/dist/ssr/verify-hydration.js +0 -2
- package/dist/testing/index.d.ts +1 -2
- package/dist/testing/index.js +0 -2
- package/package.json +57 -44
- package/dist/bench/components/benchmark-row.d.ts.map +0 -1
- package/dist/bench/components/benchmark-row.js.map +0 -1
- package/dist/bench/components/benchmark-table.js.map +0 -1
- package/dist/benchmark.d.ts.map +0 -1
- package/dist/benchmark.js.map +0 -1
- package/dist/bin/askr-ssg.d.ts.map +0 -1
- package/dist/bin/askr-ssg.js.map +0 -1
- package/dist/boot/hydration.js.map +0 -1
- package/dist/boot/index.d.ts.map +0 -1
- package/dist/boot/index.js.map +0 -1
- package/dist/boot/root-lifecycle.d.ts.map +0 -1
- package/dist/boot/root-lifecycle.js.map +0 -1
- package/dist/boot/route-startup.js.map +0 -1
- package/dist/boot/types.d.ts.map +0 -1
- package/dist/common/attr-names.js.map +0 -1
- package/dist/common/component.d.ts.map +0 -1
- package/dist/common/control.d.ts.map +0 -1
- package/dist/common/control.js.map +0 -1
- package/dist/common/env.js.map +0 -1
- package/dist/common/error-boundary.d.ts.map +0 -1
- package/dist/common/invariant.js.map +0 -1
- package/dist/common/jsx.d.ts.map +0 -1
- package/dist/common/jsx.js.map +0 -1
- package/dist/common/logger.js.map +0 -1
- package/dist/common/promise.js.map +0 -1
- package/dist/common/props.d.ts.map +0 -1
- package/dist/common/render-context.js.map +0 -1
- package/dist/common/route-activity.js.map +0 -1
- package/dist/common/router-internal.js.map +0 -1
- package/dist/common/router.d.ts.map +0 -1
- package/dist/common/ssr-errors.d.ts.map +0 -1
- package/dist/common/ssr-errors.js.map +0 -1
- package/dist/common/ssr.d.ts.map +0 -1
- package/dist/common/ssr.js.map +0 -1
- package/dist/common/vnode.d.ts.map +0 -1
- package/dist/common/vnode.js.map +0 -1
- package/dist/components/error-boundary.d.ts.map +0 -1
- package/dist/components/error-boundary.js.map +0 -1
- package/dist/components/link.d.ts.map +0 -1
- package/dist/components/link.js.map +0 -1
- package/dist/control/case.d.ts.map +0 -1
- package/dist/control/case.js.map +0 -1
- package/dist/control/for.d.ts.map +0 -1
- package/dist/control/for.js.map +0 -1
- package/dist/control/shared.d.ts.map +0 -1
- package/dist/control/shared.js.map +0 -1
- package/dist/control/show.d.ts.map +0 -1
- package/dist/control/show.js.map +0 -1
- package/dist/data/data-runtime.d.ts.map +0 -1
- package/dist/data/data-runtime.js.map +0 -1
- package/dist/data/invalidation-listeners.js.map +0 -1
- package/dist/data/invalidation.d.ts.map +0 -1
- package/dist/data/invalidation.js.map +0 -1
- package/dist/data/mutation-cell.d.ts.map +0 -1
- package/dist/data/mutation-cell.js.map +0 -1
- package/dist/data/query-cell.d.ts.map +0 -1
- package/dist/data/query-cell.js.map +0 -1
- package/dist/data/query-key.js.map +0 -1
- package/dist/data/shared.js.map +0 -1
- package/dist/data/types.d.ts.map +0 -1
- package/dist/foundations/icon/icon.d.ts.map +0 -1
- package/dist/foundations/icon/icon.js.map +0 -1
- package/dist/foundations/icon/icon.types.d.ts.map +0 -1
- package/dist/foundations/interactions/dismissable.d.ts.map +0 -1
- package/dist/foundations/interactions/dismissable.js.map +0 -1
- package/dist/foundations/interactions/focusable.d.ts.map +0 -1
- package/dist/foundations/interactions/focusable.js.map +0 -1
- package/dist/foundations/interactions/hoverable.d.ts.map +0 -1
- package/dist/foundations/interactions/hoverable.js.map +0 -1
- package/dist/foundations/interactions/interaction-policy.d.ts.map +0 -1
- package/dist/foundations/interactions/interaction-policy.js.map +0 -1
- package/dist/foundations/interactions/pressable.d.ts.map +0 -1
- package/dist/foundations/interactions/pressable.js.map +0 -1
- package/dist/foundations/interactions/roving-focus.d.ts.map +0 -1
- package/dist/foundations/interactions/roving-focus.js.map +0 -1
- package/dist/foundations/state/controllable.d.ts.map +0 -1
- package/dist/foundations/state/controllable.js.map +0 -1
- package/dist/foundations/structures/collection.d.ts.map +0 -1
- package/dist/foundations/structures/collection.js.map +0 -1
- package/dist/foundations/structures/layer.d.ts.map +0 -1
- package/dist/foundations/structures/layer.js.map +0 -1
- package/dist/foundations/structures/layout.d.ts.map +0 -1
- package/dist/foundations/structures/layout.js.map +0 -1
- package/dist/foundations/structures/presence.d.ts.map +0 -1
- package/dist/foundations/structures/presence.js.map +0 -1
- package/dist/foundations/structures/slot.d.ts.map +0 -1
- package/dist/foundations/structures/slot.js.map +0 -1
- package/dist/foundations/utilities/aria.d.ts.map +0 -1
- package/dist/foundations/utilities/aria.js.map +0 -1
- package/dist/foundations/utilities/compose-handlers.d.ts.map +0 -1
- package/dist/foundations/utilities/compose-handlers.js.map +0 -1
- package/dist/foundations/utilities/compose-ref.d.ts.map +0 -1
- package/dist/foundations/utilities/compose-ref.js.map +0 -1
- package/dist/foundations/utilities/event-types.d.ts.map +0 -1
- package/dist/foundations/utilities/merge-props.d.ts.map +0 -1
- package/dist/foundations/utilities/merge-props.js.map +0 -1
- package/dist/foundations/utilities/use-id.d.ts.map +0 -1
- package/dist/foundations/utilities/use-id.js.map +0 -1
- package/dist/fx/fx.d.ts.map +0 -1
- package/dist/fx/fx.js.map +0 -1
- package/dist/fx/noop.js.map +0 -1
- package/dist/fx/timing.d.ts.map +0 -1
- package/dist/fx/timing.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/jsx/types.d.ts.map +0 -1
- package/dist/jsx/utils.d.ts.map +0 -1
- package/dist/jsx/utils.js.map +0 -1
- package/dist/jsx-dev-runtime.d.ts.map +0 -1
- package/dist/jsx-dev-runtime.js.map +0 -1
- package/dist/jsx-runtime.d.ts.map +0 -1
- package/dist/jsx-runtime.js.map +0 -1
- package/dist/renderer/attributes.js.map +0 -1
- package/dist/renderer/boundaries.js.map +0 -1
- package/dist/renderer/child-shape.js.map +0 -1
- package/dist/renderer/children-fastpath.js.map +0 -1
- package/dist/renderer/children.js.map +0 -1
- package/dist/renderer/cleanup.js.map +0 -1
- package/dist/renderer/component-host-cleanup.js.map +0 -1
- package/dist/renderer/component-host-instances.js.map +0 -1
- package/dist/renderer/component-host.js.map +0 -1
- package/dist/renderer/dom-host.js.map +0 -1
- package/dist/renderer/dom-internal.js.map +0 -1
- package/dist/renderer/element-children.js.map +0 -1
- package/dist/renderer/error-boundary-dom.js.map +0 -1
- package/dist/renderer/evaluate-dom-range.js.map +0 -1
- package/dist/renderer/evaluate-reconcile.js.map +0 -1
- package/dist/renderer/evaluate.js.map +0 -1
- package/dist/renderer/fastpath.js.map +0 -1
- package/dist/renderer/for-commit-dom-map.js.map +0 -1
- package/dist/renderer/for-commit-removal.js.map +0 -1
- package/dist/renderer/for-commit-reorder.js.map +0 -1
- package/dist/renderer/for-commit.js.map +0 -1
- package/dist/renderer/index.js.map +0 -1
- package/dist/renderer/keyed-children.js.map +0 -1
- package/dist/renderer/keyed.js.map +0 -1
- package/dist/renderer/namespaces.js.map +0 -1
- package/dist/renderer/prop-bindings.js.map +0 -1
- package/dist/renderer/reactive-child-dom.js.map +0 -1
- package/dist/renderer/reactive-child-sources.js.map +0 -1
- package/dist/renderer/reactive-children.js.map +0 -1
- package/dist/renderer/reconcile-commit.js.map +0 -1
- package/dist/renderer/reconcile-fastpaths.js.map +0 -1
- package/dist/renderer/reconcile-resolution.js.map +0 -1
- package/dist/renderer/reconcile.js.map +0 -1
- package/dist/renderer/retained-element-rollback.js.map +0 -1
- package/dist/renderer/stable-patch.js.map +0 -1
- package/dist/renderer/static-reuse.js.map +0 -1
- package/dist/renderer/utils.js.map +0 -1
- package/dist/router/access.js.map +0 -1
- package/dist/router/activity.d.ts.map +0 -1
- package/dist/router/activity.js.map +0 -1
- package/dist/router/authoring.d.ts.map +0 -1
- package/dist/router/authoring.js.map +0 -1
- package/dist/router/internal-types.d.ts.map +0 -1
- package/dist/router/lazy.d.ts.map +0 -1
- package/dist/router/lazy.js.map +0 -1
- package/dist/router/manifest.d.ts.map +0 -1
- package/dist/router/manifest.js.map +0 -1
- package/dist/router/match.js.map +0 -1
- package/dist/router/navigate.d.ts.map +0 -1
- package/dist/router/navigate.js.map +0 -1
- package/dist/router/navigation-registry.d.ts.map +0 -1
- package/dist/router/navigation-registry.js.map +0 -1
- package/dist/router/navigation-scroll.d.ts.map +0 -1
- package/dist/router/navigation-scroll.js.map +0 -1
- package/dist/router/navigation-targets.d.ts.map +0 -1
- package/dist/router/navigation-targets.js.map +0 -1
- package/dist/router/policy.d.ts.map +0 -1
- package/dist/router/policy.js.map +0 -1
- package/dist/router/rendering.d.ts.map +0 -1
- package/dist/router/rendering.js.map +0 -1
- package/dist/router/resolution.d.ts.map +0 -1
- package/dist/router/resolution.js.map +0 -1
- package/dist/router/route-context.js.map +0 -1
- package/dist/router/route-matching.d.ts.map +0 -1
- package/dist/router/route-matching.js.map +0 -1
- package/dist/router/route-query.d.ts.map +0 -1
- package/dist/router/route-query.js.map +0 -1
- package/dist/router/store.d.ts.map +0 -1
- package/dist/router/store.js.map +0 -1
- package/dist/runtime/access.d.ts.map +0 -1
- package/dist/runtime/access.js.map +0 -1
- package/dist/runtime/child-scope.d.ts.map +0 -1
- package/dist/runtime/child-scope.js.map +0 -1
- package/dist/runtime/component-cleanup.d.ts.map +0 -1
- package/dist/runtime/component-cleanup.js.map +0 -1
- package/dist/runtime/component-commit.js.map +0 -1
- package/dist/runtime/component-internal.d.ts.map +0 -1
- package/dist/runtime/component-internal.js.map +0 -1
- package/dist/runtime/component-lifecycle.d.ts.map +0 -1
- package/dist/runtime/component-lifecycle.js.map +0 -1
- package/dist/runtime/component-scope.d.ts.map +0 -1
- package/dist/runtime/component-scope.js.map +0 -1
- package/dist/runtime/context.d.ts.map +0 -1
- package/dist/runtime/context.js.map +0 -1
- package/dist/runtime/control.d.ts.map +0 -1
- package/dist/runtime/control.js.map +0 -1
- package/dist/runtime/derive.d.ts.map +0 -1
- package/dist/runtime/derive.js.map +0 -1
- package/dist/runtime/dev-namespace.d.ts.map +0 -1
- package/dist/runtime/dev-namespace.js.map +0 -1
- package/dist/runtime/effect.d.ts.map +0 -1
- package/dist/runtime/effect.js.map +0 -1
- package/dist/runtime/error-boundary.d.ts.map +0 -1
- package/dist/runtime/error-boundary.js.map +0 -1
- package/dist/runtime/events.d.ts.map +0 -1
- package/dist/runtime/events.js.map +0 -1
- package/dist/runtime/execution-model.d.ts.map +0 -1
- package/dist/runtime/execution-model.js.map +0 -1
- package/dist/runtime/fastlane.d.ts.map +0 -1
- package/dist/runtime/fastlane.js.map +0 -1
- package/dist/runtime/for-bench.d.ts.map +0 -1
- package/dist/runtime/for-bench.js.map +0 -1
- package/dist/runtime/for-internal.d.ts.map +0 -1
- package/dist/runtime/for-internal.js.map +0 -1
- package/dist/runtime/for-reconcile.d.ts.map +0 -1
- package/dist/runtime/for-reconcile.js.map +0 -1
- package/dist/runtime/for-scopes.d.ts.map +0 -1
- package/dist/runtime/for-scopes.js.map +0 -1
- package/dist/runtime/for-signals.d.ts.map +0 -1
- package/dist/runtime/for-signals.js.map +0 -1
- package/dist/runtime/for-types.d.ts.map +0 -1
- package/dist/runtime/lifecycle-operations.d.ts.map +0 -1
- package/dist/runtime/lifecycle-operations.js.map +0 -1
- package/dist/runtime/perf-metrics.d.ts.map +0 -1
- package/dist/runtime/perf-metrics.js.map +0 -1
- package/dist/runtime/portal.d.ts.map +0 -1
- package/dist/runtime/portal.js.map +0 -1
- package/dist/runtime/readable.d.ts.map +0 -1
- package/dist/runtime/readable.js.map +0 -1
- package/dist/runtime/resource-cell.js.map +0 -1
- package/dist/runtime/resource-operation.d.ts.map +0 -1
- package/dist/runtime/resource-operation.js.map +0 -1
- package/dist/runtime/runtime.d.ts.map +0 -1
- package/dist/runtime/runtime.js.map +0 -1
- package/dist/runtime/scheduler.d.ts.map +0 -1
- package/dist/runtime/scheduler.js.map +0 -1
- package/dist/runtime/selector-store.js.map +0 -1
- package/dist/runtime/selector.d.ts.map +0 -1
- package/dist/runtime/selector.js.map +0 -1
- package/dist/runtime/snapshot-source.d.ts.map +0 -1
- package/dist/runtime/snapshot-source.js.map +0 -1
- package/dist/runtime/state.d.ts.map +0 -1
- package/dist/runtime/state.js.map +0 -1
- package/dist/ssg/batch-render.js.map +0 -1
- package/dist/ssg/create-static-gen.d.ts.map +0 -1
- package/dist/ssg/create-static-gen.js.map +0 -1
- package/dist/ssg/generate-metadata.js.map +0 -1
- package/dist/ssg/generation-plan.js.map +0 -1
- package/dist/ssg/incremental-manifest.js.map +0 -1
- package/dist/ssg/resolve-ssg-data.js.map +0 -1
- package/dist/ssg/route-utils.js.map +0 -1
- package/dist/ssg/static-routes.js.map +0 -1
- package/dist/ssg/types.d.ts.map +0 -1
- package/dist/ssg/write-static-files.js.map +0 -1
- package/dist/ssr/attrs.js.map +0 -1
- package/dist/ssr/boundaries.js.map +0 -1
- package/dist/ssr/component-runtime.js.map +0 -1
- package/dist/ssr/context.d.ts.map +0 -1
- package/dist/ssr/context.js.map +0 -1
- package/dist/ssr/errors.d.ts.map +0 -1
- package/dist/ssr/errors.js.map +0 -1
- package/dist/ssr/escape.js.map +0 -1
- package/dist/ssr/hydration-data.js.map +0 -1
- package/dist/ssr/hydration-verify.d.ts.map +0 -1
- package/dist/ssr/hydration-verify.js.map +0 -1
- package/dist/ssr/index-internal.d.ts.map +0 -1
- package/dist/ssr/index-internal.js.map +0 -1
- package/dist/ssr/render-keys.js.map +0 -1
- package/dist/ssr/render-resolved.d.ts.map +0 -1
- package/dist/ssr/render-resolved.js.map +0 -1
- package/dist/ssr/render-sync.d.ts.map +0 -1
- package/dist/ssr/render-sync.js.map +0 -1
- package/dist/ssr/route-policy-resolution.js.map +0 -1
- package/dist/ssr/route-render.d.ts.map +0 -1
- package/dist/ssr/route-render.js.map +0 -1
- package/dist/ssr/sink.d.ts.map +0 -1
- package/dist/ssr/sink.js.map +0 -1
- package/dist/ssr/types.d.ts.map +0 -1
- package/dist/ssr/verify-hydration.js.map +0 -1
- package/dist/testing/index.d.ts.map +0 -1
- package/dist/testing/index.js.map +0 -1
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { logger } from "../common/logger.js";
|
|
2
|
+
import { isPromiseLike } from "../common/promise.js";
|
|
3
|
+
//#region src/runtime/lifecycle-operation-settlement.ts
|
|
4
|
+
function settleLifecycleOperationResult(instance, lifecycleGeneration, result) {
|
|
5
|
+
if (isPromiseLike(result)) Promise.resolve(result).then((cleanup) => {
|
|
6
|
+
if (typeof cleanup === "function") {
|
|
7
|
+
if (instance.lifecycleGeneration === lifecycleGeneration && instance.mounted) {
|
|
8
|
+
(instance.cleanupFns ??= []).push(cleanup);
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
try {
|
|
12
|
+
cleanup();
|
|
13
|
+
} catch (err) {
|
|
14
|
+
logger.error("[Askr] async mount cleanup failed:", err);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}, (err) => {
|
|
18
|
+
logger.error("[Askr] async mount operation failed:", err);
|
|
19
|
+
});
|
|
20
|
+
else if (typeof result === "function") (instance.cleanupFns ??= []).push(result);
|
|
21
|
+
}
|
|
22
|
+
function executeOperations(instance, operations) {
|
|
23
|
+
if (operations.length === 0) return [];
|
|
24
|
+
const lifecycleGeneration = instance.lifecycleGeneration;
|
|
25
|
+
const errors = [];
|
|
26
|
+
for (const operation of operations) try {
|
|
27
|
+
settleLifecycleOperationResult(instance, lifecycleGeneration, operation());
|
|
28
|
+
} catch (error) {
|
|
29
|
+
errors.push(error);
|
|
30
|
+
}
|
|
31
|
+
return errors;
|
|
32
|
+
}
|
|
33
|
+
function discardCommitOperations(instance) {
|
|
34
|
+
instance.commitOperations = [];
|
|
35
|
+
}
|
|
36
|
+
function executeCommittedLifecycleOperations(instance, wasFirstMount) {
|
|
37
|
+
const errors = [];
|
|
38
|
+
if (wasFirstMount && (instance.mountOperations?.length ?? 0) > 0) {
|
|
39
|
+
const operations = instance.mountOperations;
|
|
40
|
+
instance.mountOperations = [];
|
|
41
|
+
errors.push(...executeOperations(instance, operations));
|
|
42
|
+
}
|
|
43
|
+
if ((instance.commitOperations?.length ?? 0) > 0) {
|
|
44
|
+
const operations = instance.commitOperations;
|
|
45
|
+
instance.commitOperations = [];
|
|
46
|
+
errors.push(...executeOperations(instance, operations));
|
|
47
|
+
}
|
|
48
|
+
if (errors.length > 0) throw new AggregateError(errors, `Committed lifecycle operations failed for ${instance.id}`);
|
|
49
|
+
}
|
|
50
|
+
//#endregion
|
|
51
|
+
export { discardCommitOperations, executeCommittedLifecycleOperations };
|
|
@@ -27,5 +27,4 @@ declare function task(fn: () => void | (() => void) | PromiseLike<void | (() =>
|
|
|
27
27
|
*/
|
|
28
28
|
declare function capture<T>(fn: () => T): () => T;
|
|
29
29
|
//#endregion
|
|
30
|
-
export { ActivityPredicate, TimerOptions, capture, documentVisible, on, routeActive, stream, task, timer, windowFocused };
|
|
31
|
-
//# sourceMappingURL=lifecycle-operations.d.ts.map
|
|
30
|
+
export { ActivityPredicate, TimerOptions, capture, documentVisible, on, routeActive, stream, task, timer, windowFocused };
|
|
@@ -12,14 +12,15 @@ function allPredicatesPass(predicates) {
|
|
|
12
12
|
return true;
|
|
13
13
|
}
|
|
14
14
|
function getLifecycleSlot(instance, index, kind, create) {
|
|
15
|
-
const
|
|
15
|
+
const lifecycleSlots = instance.lifecycleSlots ??= [];
|
|
16
|
+
const existing = lifecycleSlots[index];
|
|
16
17
|
if (existing) {
|
|
17
18
|
const slot = existing;
|
|
18
19
|
if (slot.kind !== kind) throw new Error(`${kind}() lifecycle order violation: slot ${index} already belongs to ${slot.kind}(). Keep lifecycle primitives in a stable top-level order.`);
|
|
19
20
|
return existing;
|
|
20
21
|
}
|
|
21
22
|
const slot = create();
|
|
22
|
-
|
|
23
|
+
lifecycleSlots[index] = slot;
|
|
23
24
|
return slot;
|
|
24
25
|
}
|
|
25
26
|
function routeActive(pathOrPaths) {
|
|
@@ -63,7 +64,7 @@ function commitListenerSlot(instance, slot) {
|
|
|
63
64
|
}
|
|
64
65
|
if (!slot.cleanupRegistered) {
|
|
65
66
|
slot.cleanupRegistered = true;
|
|
66
|
-
instance.cleanupFns.push(() => {
|
|
67
|
+
(instance.cleanupFns ??= []).push(() => {
|
|
67
68
|
detachListenerSlot(slot);
|
|
68
69
|
slot.cleanupRegistered = false;
|
|
69
70
|
});
|
|
@@ -122,7 +123,7 @@ function commitTimerSlot(instance, slot) {
|
|
|
122
123
|
}
|
|
123
124
|
if (!slot.cleanupRegistered) {
|
|
124
125
|
slot.cleanupRegistered = true;
|
|
125
|
-
instance.cleanupFns.push(() => {
|
|
126
|
+
(instance.cleanupFns ??= []).push(() => {
|
|
126
127
|
stopTimerSlot(slot);
|
|
127
128
|
slot.cleanupRegistered = false;
|
|
128
129
|
});
|
|
@@ -191,5 +192,3 @@ function capture(fn) {
|
|
|
191
192
|
}
|
|
192
193
|
//#endregion
|
|
193
194
|
export { capture, documentVisible, on, routeActive, stream, task, timer, windowFocused };
|
|
194
|
-
|
|
195
|
-
//# sourceMappingURL=lifecycle-operations.js.map
|
|
@@ -17,10 +17,11 @@ type PerfMetrics = {
|
|
|
17
17
|
ssgWorkerRenderTimeMs: number;
|
|
18
18
|
ssgWriteTimeMs: number;
|
|
19
19
|
};
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
declare
|
|
23
|
-
declare
|
|
24
|
-
declare
|
|
25
|
-
declare
|
|
26
|
-
|
|
20
|
+
type IncrementPerfMetric = (key: 'selectorInvalidations' | 'selectorCandidateReads' | 'reactivePropReevaluations' | 'skippedDomPropWrites' | 'classListPatchOps' | 'delegatedAncestorHops' | 'hydrationBoundaryActivations' | 'ssrTagCacheHits' | 'ssgWorkerCount', delta?: number) => void;
|
|
21
|
+
type AddPerfDuration = (key: 'ssgRenderTimeMs' | 'ssgWorkerRenderTimeMs' | 'ssgWriteTimeMs', deltaMs: number) => void;
|
|
22
|
+
declare const getPerfMetricsStore: () => PerfMetrics | null;
|
|
23
|
+
declare const incrementPerfMetric: IncrementPerfMetric;
|
|
24
|
+
declare const addPerfDuration: AddPerfDuration;
|
|
25
|
+
declare const recordSchedulerFlushTaskCount: (taskCount: number) => void;
|
|
26
|
+
declare const getPerfMetrics: () => Readonly<PerfMetrics> | undefined;
|
|
27
|
+
declare const resetPerfMetrics: () => void;
|
|
@@ -1,70 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
function createInitialPerfMetrics() {
|
|
6
|
-
return {
|
|
7
|
-
selectorInvalidations: 0,
|
|
8
|
-
selectorCandidateReads: 0,
|
|
9
|
-
reactivePropReevaluations: 0,
|
|
10
|
-
skippedDomPropWrites: 0,
|
|
11
|
-
classListPatchOps: 0,
|
|
12
|
-
delegatedAncestorHops: 0,
|
|
13
|
-
hydrationBoundaryActivations: 0,
|
|
14
|
-
ssrTagCacheHits: 0,
|
|
15
|
-
lastSchedulerTaskCountPerFlush: 0,
|
|
16
|
-
maxSchedulerTaskCountPerFlush: 0,
|
|
17
|
-
schedulerFlushCount: 0,
|
|
18
|
-
schedulerTaskExecutions: 0,
|
|
19
|
-
ssgWorkerCount: 0,
|
|
20
|
-
ssgRenderTimeMs: 0,
|
|
21
|
-
ssgWorkerRenderTimeMs: 0,
|
|
22
|
-
ssgWriteTimeMs: 0
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
function shouldCollectPerfMetrics() {
|
|
26
|
-
if (isDevelopmentEnvironment()) return true;
|
|
27
|
-
if (!BENCH_BUILD_ENABLED) return false;
|
|
28
|
-
try {
|
|
29
|
-
return !!globalThis.__ASKR_BENCH__;
|
|
30
|
-
} catch {
|
|
31
|
-
return false;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
function getPerfStore() {
|
|
35
|
-
if (cachedPerfStore) return cachedPerfStore;
|
|
36
|
-
if (!shouldCollectPerfMetrics()) return null;
|
|
37
|
-
try {
|
|
38
|
-
const g = globalThis;
|
|
39
|
-
if (!g.__ASKR_PERF__) g.__ASKR_PERF__ = createInitialPerfMetrics();
|
|
40
|
-
cachedPerfStore = g.__ASKR_PERF__;
|
|
41
|
-
return cachedPerfStore;
|
|
42
|
-
} catch {
|
|
43
|
-
return null;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
function getPerfMetricsStore() {
|
|
47
|
-
return getPerfStore();
|
|
48
|
-
}
|
|
49
|
-
function incrementPerfMetric(key, delta = 1) {
|
|
50
|
-
const store = getPerfStore();
|
|
51
|
-
if (!store) return;
|
|
52
|
-
store[key] += delta;
|
|
53
|
-
}
|
|
54
|
-
function addPerfDuration(key, deltaMs) {
|
|
55
|
-
const store = getPerfStore();
|
|
56
|
-
if (!store) return;
|
|
57
|
-
store[key] += deltaMs;
|
|
58
|
-
}
|
|
59
|
-
function recordSchedulerFlushTaskCount(taskCount) {
|
|
60
|
-
const store = getPerfStore();
|
|
61
|
-
if (!store) return;
|
|
62
|
-
store.lastSchedulerTaskCountPerFlush = taskCount;
|
|
63
|
-
store.maxSchedulerTaskCountPerFlush = Math.max(store.maxSchedulerTaskCountPerFlush, taskCount);
|
|
64
|
-
store.schedulerFlushCount += 1;
|
|
65
|
-
store.schedulerTaskExecutions += taskCount;
|
|
66
|
-
}
|
|
1
|
+
const getPerfMetricsStore = () => null;
|
|
2
|
+
const incrementPerfMetric = () => {};
|
|
3
|
+
const addPerfDuration = () => {};
|
|
4
|
+
const recordSchedulerFlushTaskCount = () => {};
|
|
67
5
|
//#endregion
|
|
68
6
|
export { addPerfDuration, getPerfMetricsStore, incrementPerfMetric, recordSchedulerFlushTaskCount };
|
|
69
|
-
|
|
70
|
-
//# sourceMappingURL=perf-metrics.js.map
|
package/dist/runtime/portal.d.ts
CHANGED
|
@@ -18,5 +18,4 @@ declare function clearDefaultPortalForInstance(instance: ComponentInstance): voi
|
|
|
18
18
|
declare const DefaultPortal: Portal<RenderableChild>;
|
|
19
19
|
declare function Portal(props: PortalProps): null;
|
|
20
20
|
//#endregion
|
|
21
|
-
export { DefaultPortal, Portal, PortalProps, definePortal };
|
|
22
|
-
//# sourceMappingURL=portal.d.ts.map
|
|
21
|
+
export { DefaultPortal, Portal, PortalProps, definePortal };
|
package/dist/runtime/portal.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { enqueueRuntimeTask } from "./access.js";
|
|
1
|
+
import { enqueueRuntimeTask, getRuntimeRenderer } from "./access.js";
|
|
2
2
|
import { markReactivePropsDirtySource, markReadableDerivedSubscribersDirty, notifyReadableReaders, recordReadableRead } from "./readable.js";
|
|
3
3
|
import { getCurrentComponentInstance, getCurrentPortalScope } from "./component-scope.js";
|
|
4
|
+
import { cleanupComponent } from "./component-cleanup.js";
|
|
5
|
+
import { getCurrentLifecycleCommitBatch, registerLifecycleTransaction } from "./lifecycle-batch.js";
|
|
6
|
+
import "./component-lifecycle.js";
|
|
4
7
|
import "./component.js";
|
|
5
8
|
//#region src/runtime/portal.ts
|
|
6
9
|
function createPortalSlot() {
|
|
@@ -50,6 +53,8 @@ function definePortal() {
|
|
|
50
53
|
let _defaultPortalStates = /* @__PURE__ */ new Map();
|
|
51
54
|
let _hasPendingDefaultPortalValue = false;
|
|
52
55
|
let _pendingDefaultPortalValue = void 0;
|
|
56
|
+
let _pendingDefaultPortalWrites = /* @__PURE__ */ new WeakMap();
|
|
57
|
+
const _batchPortalWrites = /* @__PURE__ */ new WeakMap();
|
|
53
58
|
function createExplicitHostSource(readCount) {
|
|
54
59
|
let source = (() => {
|
|
55
60
|
recordReadableRead(source);
|
|
@@ -69,6 +74,7 @@ function createDefaultPortalState() {
|
|
|
69
74
|
const state = {
|
|
70
75
|
portal: definePortal(),
|
|
71
76
|
owner: null,
|
|
77
|
+
host: null,
|
|
72
78
|
cleanupOwners: /* @__PURE__ */ new WeakSet(),
|
|
73
79
|
explicitHostOwners: /* @__PURE__ */ new Set(),
|
|
74
80
|
explicitHostCleanupOwners: /* @__PURE__ */ new WeakSet(),
|
|
@@ -91,6 +97,35 @@ function disposeDefaultPortalScope(scope) {
|
|
|
91
97
|
function isComponentPortalScope(scope) {
|
|
92
98
|
return Array.isArray(scope.cleanupFns);
|
|
93
99
|
}
|
|
100
|
+
function isEmptyPortalValue(value) {
|
|
101
|
+
return value === null || value === void 0 || value === false;
|
|
102
|
+
}
|
|
103
|
+
function detachDefaultPortalHostOutput(state) {
|
|
104
|
+
const host = state.host;
|
|
105
|
+
const target = host?.target;
|
|
106
|
+
const parent = target?.parentNode;
|
|
107
|
+
if (!host || !target || !parent) return;
|
|
108
|
+
const portalHost = target;
|
|
109
|
+
const hostedInstances = new Set(portalHost.__ASKR_INSTANCES ?? []);
|
|
110
|
+
if (portalHost.__ASKR_INSTANCE) hostedInstances.add(portalHost.__ASKR_INSTANCE);
|
|
111
|
+
for (const instance of hostedInstances) if (instance !== host) cleanupComponent(instance);
|
|
112
|
+
try {
|
|
113
|
+
delete portalHost.__ASKR_INSTANCE;
|
|
114
|
+
delete portalHost.__ASKR_INSTANCES;
|
|
115
|
+
delete portalHost.__ASKR_WRAPPER_HOST;
|
|
116
|
+
} catch {}
|
|
117
|
+
getRuntimeRenderer().teardownNodeSubtree(target);
|
|
118
|
+
const placeholder = document.createComment("");
|
|
119
|
+
placeholder.__ASKR_INSTANCE = host;
|
|
120
|
+
parent.replaceChild(placeholder, target);
|
|
121
|
+
host.target = null;
|
|
122
|
+
host._placeholder = placeholder;
|
|
123
|
+
}
|
|
124
|
+
function applyDefaultPortalWrite(state, children, owner) {
|
|
125
|
+
state.portal.render({ children });
|
|
126
|
+
state.owner = owner;
|
|
127
|
+
if (isEmptyPortalValue(children)) detachDefaultPortalHostOutput(state);
|
|
128
|
+
}
|
|
94
129
|
function isStaleDefaultPortalScope(scope) {
|
|
95
130
|
if (!isComponentPortalScope(scope)) return false;
|
|
96
131
|
if (scope.target && scope.target.isConnected === false) return true;
|
|
@@ -125,10 +160,70 @@ function writeDefaultPortal(props, owner) {
|
|
|
125
160
|
return;
|
|
126
161
|
}
|
|
127
162
|
const state = getDefaultPortalState(scope);
|
|
163
|
+
const batch = getCurrentLifecycleCommitBatch();
|
|
164
|
+
if (batch) {
|
|
165
|
+
let writes = _batchPortalWrites.get(batch);
|
|
166
|
+
if (!writes) {
|
|
167
|
+
writes = /* @__PURE__ */ new Map();
|
|
168
|
+
_batchPortalWrites.set(batch, writes);
|
|
169
|
+
}
|
|
170
|
+
const existing = writes.get(state);
|
|
171
|
+
if (existing) {
|
|
172
|
+
existing.owner = owner;
|
|
173
|
+
existing.children = props.children;
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
const transaction = {
|
|
177
|
+
state,
|
|
178
|
+
owner,
|
|
179
|
+
children: props.children,
|
|
180
|
+
batch
|
|
181
|
+
};
|
|
182
|
+
if (registerLifecycleTransaction(state, () => {
|
|
183
|
+
if (_batchPortalWrites.get(batch)?.get(state) !== transaction) return;
|
|
184
|
+
_batchPortalWrites.get(batch)?.delete(state);
|
|
185
|
+
applyDefaultPortalWrite(state, transaction.children, transaction.owner);
|
|
186
|
+
}, () => {
|
|
187
|
+
if (_batchPortalWrites.get(batch)?.get(state) === transaction) _batchPortalWrites.get(batch)?.delete(state);
|
|
188
|
+
}, () => {
|
|
189
|
+
const parentBatch = batch.parent;
|
|
190
|
+
const parentWrite = parentBatch ? _batchPortalWrites.get(parentBatch)?.get(state) : void 0;
|
|
191
|
+
if (parentWrite) {
|
|
192
|
+
parentWrite.owner = transaction.owner;
|
|
193
|
+
parentWrite.children = transaction.children;
|
|
194
|
+
}
|
|
195
|
+
_batchPortalWrites.get(batch)?.delete(state);
|
|
196
|
+
})) {
|
|
197
|
+
writes.set(state, transaction);
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
const pending = _pendingDefaultPortalWrites.get(state);
|
|
202
|
+
if (pending) {
|
|
203
|
+
pending.owner = owner;
|
|
204
|
+
pending.children = props.children;
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
const transaction = {
|
|
208
|
+
state,
|
|
209
|
+
owner,
|
|
210
|
+
children: props.children
|
|
211
|
+
};
|
|
212
|
+
if (registerLifecycleTransaction(transaction, () => {
|
|
213
|
+
if (_pendingDefaultPortalWrites.get(state) !== transaction) return;
|
|
214
|
+
_pendingDefaultPortalWrites.delete(state);
|
|
215
|
+
_hasPendingDefaultPortalValue = false;
|
|
216
|
+
_pendingDefaultPortalValue = void 0;
|
|
217
|
+
applyDefaultPortalWrite(state, transaction.children, transaction.owner);
|
|
218
|
+
}, () => {
|
|
219
|
+
if (_pendingDefaultPortalWrites.get(state) === transaction) _pendingDefaultPortalWrites.delete(state);
|
|
220
|
+
})) {
|
|
221
|
+
_pendingDefaultPortalWrites.set(state, transaction);
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
128
224
|
_hasPendingDefaultPortalValue = false;
|
|
129
225
|
_pendingDefaultPortalValue = void 0;
|
|
130
|
-
state.
|
|
131
|
-
state.owner = owner;
|
|
226
|
+
applyDefaultPortalWrite(state, props.children, owner);
|
|
132
227
|
}
|
|
133
228
|
function applyPendingDefaultPortalValue(scope) {
|
|
134
229
|
if (!_hasPendingDefaultPortalValue) return;
|
|
@@ -144,13 +239,10 @@ function registerDefaultPortalOwner(owner) {
|
|
|
144
239
|
const state = getDefaultPortalState(scope);
|
|
145
240
|
if (state.cleanupOwners.has(owner)) return;
|
|
146
241
|
state.cleanupOwners.add(owner);
|
|
147
|
-
owner.cleanupFns.push(() => {
|
|
242
|
+
(owner.cleanupFns ??= []).push(() => {
|
|
148
243
|
const currentState = _defaultPortalStates.get(scope);
|
|
149
244
|
if (!currentState) return;
|
|
150
|
-
if (currentState.owner === owner)
|
|
151
|
-
currentState.portal.render({ children: void 0 });
|
|
152
|
-
currentState.owner = null;
|
|
153
|
-
}
|
|
245
|
+
if (currentState.owner === owner) applyDefaultPortalWrite(currentState, void 0, null);
|
|
154
246
|
currentState.cleanupOwners.delete(owner);
|
|
155
247
|
});
|
|
156
248
|
}
|
|
@@ -162,7 +254,7 @@ function registerExplicitDefaultPortalHost(scope, state, owner) {
|
|
|
162
254
|
}
|
|
163
255
|
if (!state.explicitHostCleanupOwners.has(owner)) {
|
|
164
256
|
state.explicitHostCleanupOwners.add(owner);
|
|
165
|
-
owner.cleanupFns.push(() => {
|
|
257
|
+
(owner.cleanupFns ??= []).push(() => {
|
|
166
258
|
if (_defaultPortalStates.get(scope) !== state) return;
|
|
167
259
|
state.explicitHostCleanupOwners.delete(owner);
|
|
168
260
|
enqueueRuntimeTask(() => {
|
|
@@ -182,6 +274,7 @@ function clearDefaultPortalForInstance(instance) {
|
|
|
182
274
|
_pendingDefaultPortalValue = void 0;
|
|
183
275
|
state.portal.render({ children: void 0 });
|
|
184
276
|
state.owner = null;
|
|
277
|
+
detachDefaultPortalHostOutput(state);
|
|
185
278
|
}
|
|
186
279
|
const DefaultPortal = (() => {
|
|
187
280
|
function Host(props) {
|
|
@@ -189,6 +282,7 @@ const DefaultPortal = (() => {
|
|
|
189
282
|
const scope = resolveDefaultPortalScope(owner);
|
|
190
283
|
if (!scope) return null;
|
|
191
284
|
const state = getDefaultPortalState(scope);
|
|
285
|
+
state.host = owner;
|
|
192
286
|
if (!(props?.__askrAutoDefaultPortal === true)) registerExplicitDefaultPortalHost(scope, state, owner);
|
|
193
287
|
else if (readExplicitDefaultPortalHosts(state) > 0) return null;
|
|
194
288
|
applyPendingDefaultPortalValue(scope);
|
|
@@ -209,5 +303,3 @@ function Portal(props) {
|
|
|
209
303
|
}
|
|
210
304
|
//#endregion
|
|
211
305
|
export { DefaultPortal, Portal, clearDefaultPortalForInstance, definePortal, disposeDefaultPortalScope };
|
|
212
|
-
|
|
213
|
-
//# sourceMappingURL=portal.js.map
|
|
@@ -12,9 +12,15 @@ interface ReadableSource<T = unknown> {
|
|
|
12
12
|
_derivedSubscribers?: Set<DerivedSubscriber>;
|
|
13
13
|
_version?: number;
|
|
14
14
|
}
|
|
15
|
+
interface FineGrainedReadCollector {
|
|
16
|
+
_pendingFineGrainedReadSource: ReadableSource<unknown> | null;
|
|
17
|
+
_pendingFineGrainedReadSources: ReadableSource<unknown> | ReadableSource<unknown>[] | Set<ReadableSource<unknown>> | null;
|
|
18
|
+
}
|
|
15
19
|
declare function markReadableUsage(source: unknown): void;
|
|
16
20
|
declare function recordReadableRead(source: ReadableSource<unknown>): void;
|
|
17
|
-
declare function withFineGrainedReadTracking<T>(
|
|
21
|
+
declare function withFineGrainedReadTracking<T>(collector: FineGrainedReadCollector, fn: () => T): T;
|
|
22
|
+
/** @internal Whether the active grouped effect coalesces item-property reads. */
|
|
23
|
+
declare function shouldCoalesceFineGrainedItemReads(): boolean;
|
|
18
24
|
declare function finalizeReadableSubscriptions(instance: ComponentInstance): void;
|
|
19
25
|
declare function finalizeReadableSubscriptionsFromSnapshot(instance: ComponentInstance, token: number | undefined, newSet: Set<ReadableSource<unknown>> | undefined, pendingReadSourceVersions?: Map<ReadableSource<unknown>, number> | undefined): void;
|
|
20
26
|
declare function cleanupReadableSubscriptions(instance: ComponentInstance): void;
|
|
@@ -23,7 +29,6 @@ declare function syncDerivedDependencySubscriptions(subscriber: DerivedSubscribe
|
|
|
23
29
|
declare function clearDerivedDependencySubscriptions(subscriber: DerivedSubscriber, sources: Set<ReadableSource<unknown>>): void;
|
|
24
30
|
declare function markReadableDerivedSubscribersDirty(source: ReadableSource<unknown>): void;
|
|
25
31
|
declare function markReactivePropsDirtySource(source: ReadableSource<unknown>): void;
|
|
26
|
-
declare function notifyReadableReaders(source: ReadableSource<unknown>, skipInstance?: ComponentInstance | null): boolean;
|
|
32
|
+
declare function notifyReadableReaders(source: ReadableSource<unknown>, skipInstance?: ComponentInstance | null, skipOwnedBy?: ComponentInstance | null): boolean;
|
|
27
33
|
//#endregion
|
|
28
|
-
export { DerivedSubscriber, ReadableSource };
|
|
29
|
-
//# sourceMappingURL=readable.d.ts.map
|
|
34
|
+
export { DerivedSubscriber, FineGrainedReadCollector, ReadableSource };
|
package/dist/runtime/readable.js
CHANGED
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
import { enqueueRuntimeTask, markRuntimeReactivePropsDirtySource } from "./access.js";
|
|
2
2
|
import { getCurrentInstance } from "./component-scope.js";
|
|
3
3
|
import "./component.js";
|
|
4
|
-
//#region src/runtime/readable.ts
|
|
5
4
|
function markReadableUsage(source) {
|
|
6
5
|
if (source && typeof source === "function" && ("_hasBeenRead" in source || "_readers" in source)) {
|
|
7
6
|
const readable = source;
|
|
8
7
|
readable._hasBeenRead = true;
|
|
9
|
-
readable._hasEverBeenRead = true;
|
|
10
8
|
}
|
|
11
9
|
}
|
|
12
10
|
let currentDerivedSubscriber = null;
|
|
13
11
|
let suppressComponentReadTrackingDepth = 0;
|
|
14
|
-
let
|
|
12
|
+
let currentFineGrainedReadCollector = null;
|
|
15
13
|
function scheduleReadableInstanceUpdate(instance) {
|
|
16
14
|
if (instance.hasPendingUpdate) return;
|
|
17
15
|
instance.hasPendingUpdate = true;
|
|
@@ -26,9 +24,21 @@ function scheduleReadableInstanceUpdate(instance) {
|
|
|
26
24
|
});
|
|
27
25
|
}
|
|
28
26
|
function recordReadableRead(source) {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
if (currentFineGrainedReadCollector) {
|
|
28
|
+
const first = currentFineGrainedReadCollector._pendingFineGrainedReadSource;
|
|
29
|
+
if (!first) currentFineGrainedReadCollector._pendingFineGrainedReadSource = source;
|
|
30
|
+
else if (first !== source) {
|
|
31
|
+
let sources = currentFineGrainedReadCollector._pendingFineGrainedReadSources;
|
|
32
|
+
if (!sources) currentFineGrainedReadCollector._pendingFineGrainedReadSources = source;
|
|
33
|
+
else if (Array.isArray(sources)) {
|
|
34
|
+
if (!sources.includes(source)) sources.push(source);
|
|
35
|
+
} else if (sources instanceof Set) sources.add(source);
|
|
36
|
+
else if (sources !== source) currentFineGrainedReadCollector._pendingFineGrainedReadSources = [
|
|
37
|
+
first,
|
|
38
|
+
sources,
|
|
39
|
+
source
|
|
40
|
+
];
|
|
41
|
+
}
|
|
32
42
|
return;
|
|
33
43
|
}
|
|
34
44
|
if (currentDerivedSubscriber) {
|
|
@@ -48,15 +58,19 @@ function recordReadableRead(source) {
|
|
|
48
58
|
}
|
|
49
59
|
pendingVersions.set(source, sourceVersion);
|
|
50
60
|
}
|
|
51
|
-
function withFineGrainedReadTracking(
|
|
52
|
-
const
|
|
53
|
-
|
|
61
|
+
function withFineGrainedReadTracking(collector, fn) {
|
|
62
|
+
const previousCollector = currentFineGrainedReadCollector;
|
|
63
|
+
currentFineGrainedReadCollector = collector;
|
|
54
64
|
try {
|
|
55
|
-
return fn();
|
|
65
|
+
return fn.call(collector);
|
|
56
66
|
} finally {
|
|
57
|
-
|
|
67
|
+
currentFineGrainedReadCollector = previousCollector;
|
|
58
68
|
}
|
|
59
69
|
}
|
|
70
|
+
/** @internal Whether the active grouped effect coalesces item-property reads. */
|
|
71
|
+
function shouldCoalesceFineGrainedItemReads() {
|
|
72
|
+
return (currentFineGrainedReadCollector?._owner)?._coalesceForItemReads === true;
|
|
73
|
+
}
|
|
60
74
|
function finalizeReadableSubscriptions(instance) {
|
|
61
75
|
const newSet = instance._pendingReadSources;
|
|
62
76
|
const token = instance._currentRenderToken;
|
|
@@ -88,7 +102,7 @@ function finalizeReadableSubscriptionsFromSnapshot(instance, token, newSet, pend
|
|
|
88
102
|
}
|
|
89
103
|
readers.set(instance, instance.lastRenderToken ?? 0);
|
|
90
104
|
}
|
|
91
|
-
instance._lastReadSources = newSet
|
|
105
|
+
instance._lastReadSources = newSet?.size ? newSet : void 0;
|
|
92
106
|
if (needsFollowUpUpdate) scheduleReadableInstanceUpdate(instance);
|
|
93
107
|
}
|
|
94
108
|
function cleanupReadableSubscriptions(instance) {
|
|
@@ -99,7 +113,7 @@ function cleanupReadableSubscriptions(instance) {
|
|
|
99
113
|
return;
|
|
100
114
|
}
|
|
101
115
|
for (const source of sources) source._readers?.delete(instance);
|
|
102
|
-
instance._lastReadSources =
|
|
116
|
+
instance._lastReadSources = void 0;
|
|
103
117
|
instance._pendingReadSources = void 0;
|
|
104
118
|
instance._pendingReadSourceVersions = void 0;
|
|
105
119
|
}
|
|
@@ -139,13 +153,25 @@ function markReactivePropsDirtySource(source) {
|
|
|
139
153
|
markRuntimeReactivePropsDirtySource(source);
|
|
140
154
|
} catch {}
|
|
141
155
|
}
|
|
142
|
-
function notifyReadableReaders(source, skipInstance) {
|
|
156
|
+
function notifyReadableReaders(source, skipInstance, skipOwnedBy) {
|
|
143
157
|
source._version = (source._version ?? 0) + 1;
|
|
144
158
|
const readers = source._readers;
|
|
145
159
|
let didScheduleUpdate = false;
|
|
146
160
|
if (!readers || readers.size === 0) return false;
|
|
147
161
|
for (const [instance, token] of readers) {
|
|
148
162
|
if (skipInstance && instance === skipInstance) continue;
|
|
163
|
+
if (skipOwnedBy) {
|
|
164
|
+
let owner = instance;
|
|
165
|
+
let isOwned = false;
|
|
166
|
+
while (owner) {
|
|
167
|
+
if (owner === skipOwnedBy) {
|
|
168
|
+
isOwned = true;
|
|
169
|
+
break;
|
|
170
|
+
}
|
|
171
|
+
owner = owner.parentInstance;
|
|
172
|
+
}
|
|
173
|
+
if (isOwned) continue;
|
|
174
|
+
}
|
|
149
175
|
if (instance.lastRenderToken !== token) continue;
|
|
150
176
|
if (instance.hasPendingUpdate) continue;
|
|
151
177
|
scheduleReadableInstanceUpdate(instance);
|
|
@@ -154,6 +180,4 @@ function notifyReadableReaders(source, skipInstance) {
|
|
|
154
180
|
return didScheduleUpdate;
|
|
155
181
|
}
|
|
156
182
|
//#endregion
|
|
157
|
-
export { cleanupReadableSubscriptions, clearDerivedDependencySubscriptions, finalizeReadableSubscriptions, finalizeReadableSubscriptionsFromSnapshot, markReactivePropsDirtySource, markReadableDerivedSubscribersDirty, markReadableUsage, notifyReadableReaders, recordReadableRead, syncDerivedDependencySubscriptions, withDerivedReadTracking, withFineGrainedReadTracking };
|
|
158
|
-
|
|
159
|
-
//# sourceMappingURL=readable.js.map
|
|
183
|
+
export { cleanupReadableSubscriptions, clearDerivedDependencySubscriptions, finalizeReadableSubscriptions, finalizeReadableSubscriptionsFromSnapshot, markReactivePropsDirtySource, markReadableDerivedSubscribersDirty, markReadableUsage, notifyReadableReaders, recordReadableRead, shouldCoalesceFineGrainedItemReads, syncDerivedDependencySubscriptions, withDerivedReadTracking, withFineGrainedReadTracking };
|
|
@@ -59,7 +59,7 @@ var ResourceCell = class {
|
|
|
59
59
|
result = withAsyncResourceContext(this.resourceFrame, () => this.fn({ signal: controller.signal }));
|
|
60
60
|
} catch (err) {
|
|
61
61
|
this.pending = false;
|
|
62
|
-
this.error = err;
|
|
62
|
+
this.error = err instanceof Error ? err : new Error(String(err));
|
|
63
63
|
if (notify) this.notifySubscribers();
|
|
64
64
|
return;
|
|
65
65
|
}
|
|
@@ -84,7 +84,7 @@ var ResourceCell = class {
|
|
|
84
84
|
if (this.controller !== controller) return;
|
|
85
85
|
if (controller.signal.aborted || err instanceof Error && err.name === "AbortError" || typeof DOMException !== "undefined" && err instanceof DOMException && err.name === "AbortError") return;
|
|
86
86
|
this.pending = false;
|
|
87
|
-
this.error = err;
|
|
87
|
+
this.error = err instanceof Error ? err : new Error(String(err));
|
|
88
88
|
try {
|
|
89
89
|
if (this.ownerName) logger.error(`[Askr] Async resource error in ${this.ownerName}:`, err);
|
|
90
90
|
else logger.error("[Askr] Async resource error:", err);
|
|
@@ -110,5 +110,3 @@ var ResourceCell = class {
|
|
|
110
110
|
};
|
|
111
111
|
//#endregion
|
|
112
112
|
export { ResourceCell };
|
|
113
|
-
|
|
114
|
-
//# sourceMappingURL=resource-cell.js.map
|
|
@@ -9,5 +9,4 @@ declare function resource<T, const TDeps extends readonly unknown[]>(fn: (opts:
|
|
|
9
9
|
signal: AbortSignal;
|
|
10
10
|
}) => PromiseLike<T> | T, deps: TDeps): ResourceResult<T>;
|
|
11
11
|
//#endregion
|
|
12
|
-
export { ResourceResult, resource };
|
|
13
|
-
//# sourceMappingURL=resource-operation.d.ts.map
|
|
12
|
+
export { ResourceResult, resource };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { enqueueRuntimeLane } from "./access.js";
|
|
2
2
|
import { getCurrentContextFrame } from "./context.js";
|
|
3
3
|
import { getCurrentComponentInstance } from "./component-scope.js";
|
|
4
|
+
import { registerCommitOperationForInstance } from "./component-lifecycle.js";
|
|
4
5
|
import "./component.js";
|
|
5
6
|
import { brandSnapshotSource } from "./snapshot-source.js";
|
|
6
7
|
import { SSRDataMissingError } from "../common/ssr-errors.js";
|
|
@@ -95,27 +96,29 @@ function resource(fn, deps = []) {
|
|
|
95
96
|
}
|
|
96
97
|
} else {
|
|
97
98
|
const scheduledGeneration = cell.generation;
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
99
|
+
registerCommitOperationForInstance(inst, () => {
|
|
100
|
+
enqueueRuntimeLane("post", () => {
|
|
101
|
+
if (!inst.notifyUpdate || cell.generation !== scheduledGeneration) return;
|
|
102
|
+
try {
|
|
103
|
+
cell.start(false, false);
|
|
104
|
+
} catch (err) {
|
|
105
|
+
const cur = holder();
|
|
106
|
+
cur.snapshot.value = cell.value;
|
|
107
|
+
cur.snapshot.pending = cell.pending;
|
|
108
|
+
cur.snapshot.error = err ?? null;
|
|
109
|
+
holder.set(cur);
|
|
110
|
+
inst.notifyUpdate?.();
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
if (!cell.pending) {
|
|
114
|
+
const cur = holder();
|
|
115
|
+
cur.snapshot.value = cell.value;
|
|
116
|
+
cur.snapshot.pending = cell.pending;
|
|
117
|
+
cur.snapshot.error = cell.error;
|
|
118
|
+
holder.set(cur);
|
|
119
|
+
inst.notifyUpdate?.();
|
|
120
|
+
}
|
|
121
|
+
});
|
|
119
122
|
});
|
|
120
123
|
}
|
|
121
124
|
}
|
|
@@ -139,17 +142,19 @@ function resource(fn, deps = []) {
|
|
|
139
142
|
}
|
|
140
143
|
} else {
|
|
141
144
|
const scheduledGeneration = cell.generation;
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
145
|
+
registerCommitOperationForInstance(inst, () => {
|
|
146
|
+
enqueueRuntimeLane("post", () => {
|
|
147
|
+
if (!inst.notifyUpdate || cell.generation !== scheduledGeneration) return;
|
|
148
|
+
cell.start(false, false);
|
|
149
|
+
if (!cell.pending) {
|
|
150
|
+
const cur = holder();
|
|
151
|
+
cur.snapshot.value = cell.value;
|
|
152
|
+
cur.snapshot.pending = cell.pending;
|
|
153
|
+
cur.snapshot.error = cell.error;
|
|
154
|
+
holder.set(cur);
|
|
155
|
+
inst.notifyUpdate?.();
|
|
156
|
+
}
|
|
157
|
+
});
|
|
153
158
|
});
|
|
154
159
|
}
|
|
155
160
|
} catch (err) {
|
|
@@ -166,5 +171,3 @@ function resource(fn, deps = []) {
|
|
|
166
171
|
}
|
|
167
172
|
//#endregion
|
|
168
173
|
export { resource };
|
|
169
|
-
|
|
170
|
-
//# sourceMappingURL=resource-operation.js.map
|