@askrjs/askr 0.0.50 → 0.0.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bench/components/benchmark-row.d.ts +2 -2
- package/dist/bench/components/benchmark-row.js +0 -2
- package/dist/bench/components/benchmark-table.js +0 -2
- package/dist/benchmark.d.ts +1 -2
- package/dist/benchmark.js +5 -6
- package/dist/bin/askr-ssg.d.ts +1 -2
- package/dist/bin/askr-ssg.js +21 -6
- package/dist/boot/hydration.js +10 -11
- package/dist/boot/index.d.ts +1 -2
- package/dist/boot/index.js +21 -11
- package/dist/boot/root-lifecycle.d.ts +6 -3
- package/dist/boot/root-lifecycle.js +18 -14
- package/dist/boot/route-startup.js +13 -4
- package/dist/boot/types.d.ts +1 -2
- package/dist/common/attr-names.js +0 -2
- package/dist/common/component.d.ts +1 -2
- package/dist/common/control.d.ts +1 -2
- package/dist/common/control.js +0 -2
- package/dist/common/dom-range.d.ts +13 -0
- package/dist/common/env.js +1 -7
- package/dist/common/error-boundary.d.ts +15 -0
- package/dist/common/invariant.js +15 -0
- package/dist/common/jsx.d.ts +1 -2
- package/dist/common/jsx.js +0 -2
- package/dist/{dev → common}/logger.js +5 -8
- package/dist/common/promise.js +0 -2
- package/dist/common/props.d.ts +1 -2
- package/dist/common/render-context.js +0 -2
- package/dist/common/route-activity.js +0 -2
- package/dist/common/router-internal.js +0 -2
- package/dist/common/router.d.ts +1 -2
- package/dist/common/ssr-errors.d.ts +1 -2
- package/dist/common/ssr-errors.js +0 -2
- package/dist/common/ssr.d.ts +1 -2
- package/dist/common/ssr.js +0 -2
- package/dist/common/vnode.d.ts +1 -2
- package/dist/common/vnode.js +0 -2
- package/dist/components/error-boundary.d.ts +2 -16
- package/dist/components/error-boundary.js +2 -76
- package/dist/components/index.d.ts +2 -1
- package/dist/components/link.d.ts +2 -2
- package/dist/components/link.js +2 -2
- package/dist/control/case.d.ts +1 -2
- package/dist/control/case.js +1 -2
- package/dist/control/for.d.ts +3 -4
- package/dist/control/for.js +2 -4
- package/dist/control/shared.d.ts +1 -2
- package/dist/control/shared.js +0 -2
- package/dist/control/show.d.ts +1 -2
- package/dist/control/show.js +1 -2
- package/dist/data/data-runtime.d.ts +1 -2
- package/dist/data/data-runtime.js +3 -5
- package/dist/data/invalidation-listeners.js +0 -2
- package/dist/data/invalidation.d.ts +1 -2
- package/dist/data/invalidation.js +2 -4
- package/dist/data/mutation-cell.d.ts +1 -2
- package/dist/data/mutation-cell.js +7 -6
- package/dist/data/query-cell.d.ts +3 -2
- package/dist/data/query-cell.js +45 -11
- package/dist/data/query-key.js +0 -2
- package/dist/data/shared.js +3 -3
- package/dist/data/testing.js +2 -0
- package/dist/data/types.d.ts +1 -2
- package/dist/foundations/icon/icon.d.ts +1 -2
- package/dist/foundations/icon/icon.js +0 -2
- package/dist/foundations/icon/icon.types.d.ts +1 -2
- package/dist/foundations/index.d.ts +1 -1
- package/dist/foundations/index.js +1 -1
- package/dist/foundations/interactions/dismissable.d.ts +1 -2
- package/dist/foundations/interactions/dismissable.js +0 -2
- package/dist/foundations/interactions/focusable.d.ts +1 -2
- package/dist/foundations/interactions/focusable.js +0 -2
- package/dist/foundations/interactions/hoverable.d.ts +1 -2
- package/dist/foundations/interactions/hoverable.js +0 -2
- package/dist/foundations/interactions/interaction-policy.d.ts +1 -2
- package/dist/foundations/interactions/interaction-policy.js +0 -2
- package/dist/foundations/interactions/pressable.d.ts +1 -2
- package/dist/foundations/interactions/pressable.js +0 -2
- package/dist/foundations/interactions/roving-focus.d.ts +1 -2
- package/dist/foundations/interactions/roving-focus.js +0 -2
- package/dist/foundations/state/controllable.d.ts +1 -3
- package/dist/foundations/state/controllable.js +1 -2
- package/dist/foundations/structures/collection.d.ts +1 -2
- package/dist/foundations/structures/collection.js +0 -2
- package/dist/foundations/structures/index.d.ts +1 -1
- package/dist/foundations/structures/index.js +2 -1
- package/dist/foundations/structures/layer.d.ts +1 -2
- package/dist/foundations/structures/layer.js +0 -2
- package/dist/foundations/structures/layout.d.ts +1 -2
- package/dist/foundations/structures/layout.js +0 -2
- package/dist/foundations/structures/portal.d.ts +2 -24
- package/dist/foundations/structures/portal.js +3 -187
- package/dist/foundations/structures/presence.d.ts +1 -2
- package/dist/foundations/structures/presence.js +0 -2
- package/dist/foundations/structures/slot.d.ts +1 -2
- package/dist/foundations/structures/slot.js +0 -2
- package/dist/foundations/utilities/aria.d.ts +1 -2
- package/dist/foundations/utilities/aria.js +0 -2
- package/dist/foundations/utilities/compose-handlers.d.ts +1 -2
- package/dist/foundations/utilities/compose-handlers.js +0 -2
- package/dist/foundations/utilities/compose-ref.d.ts +1 -2
- package/dist/foundations/utilities/compose-ref.js +0 -2
- package/dist/foundations/utilities/event-types.d.ts +1 -2
- package/dist/foundations/utilities/merge-props.d.ts +1 -2
- package/dist/foundations/utilities/merge-props.js +0 -2
- package/dist/foundations/utilities/use-id.d.ts +1 -2
- package/dist/foundations/utilities/use-id.js +0 -2
- package/dist/fx/fx.d.ts +1 -2
- package/dist/fx/fx.js +2 -4
- package/dist/fx/index.js +1 -0
- package/dist/fx/noop.js +0 -2
- package/dist/fx/timing.d.ts +1 -2
- package/dist/fx/timing.js +0 -2
- package/dist/index.d.ts +4 -4
- package/dist/index.js +4 -6
- package/dist/jsx/types.d.ts +1 -2
- package/dist/jsx/utils.d.ts +1 -2
- package/dist/jsx/utils.js +0 -2
- package/dist/jsx-dev-runtime.d.ts +16 -2
- package/dist/jsx-dev-runtime.js +4 -12
- package/dist/jsx-runtime.d.ts +16 -2
- package/dist/jsx-runtime.js +16 -24
- package/dist/jsx-runtime2.d.ts +1 -1
- package/dist/renderer/attributes.js +29 -6
- package/dist/renderer/boundaries.js +50 -174
- package/dist/renderer/boundary-materialization.js +72 -0
- package/dist/renderer/boundary-range-adoption.js +76 -0
- package/dist/renderer/boundary-range-sync.js +101 -0
- package/dist/renderer/boundary-state.js +50 -0
- package/dist/renderer/child-shape.js +2 -4
- package/dist/renderer/children-fastpath.js +149 -0
- package/dist/renderer/children.js +3 -140
- package/dist/renderer/cleanup.js +72 -15
- package/dist/renderer/component-host-cleanup.js +124 -49
- package/dist/renderer/component-host-instances.js +60 -9
- package/dist/renderer/component-host-replacement.js +105 -0
- package/dist/renderer/component-host-results.js +138 -0
- package/dist/renderer/component-host.js +95 -170
- package/dist/renderer/dom-host.js +0 -2
- package/dist/renderer/dom-internal.js +115 -57
- package/dist/renderer/dom-range.js +161 -0
- package/dist/renderer/dom.js +7 -5
- package/dist/renderer/element-children.js +112 -32
- package/dist/renderer/error-boundary-dom.js +70 -13
- package/dist/renderer/evaluate-dom-range.js +3 -4
- package/dist/renderer/evaluate-reconcile.js +18 -42
- package/dist/renderer/evaluate.js +14 -3
- package/dist/renderer/fastpath.js +7 -14
- package/dist/renderer/for-commit-dom-map.js +6 -18
- package/dist/renderer/for-commit-removal.js +8 -17
- package/dist/renderer/for-commit-reorder.js +2 -4
- package/dist/renderer/for-commit.js +173 -45
- package/dist/renderer/hydration-boundaries.js +60 -0
- package/dist/renderer/hydration-listener-transaction.js +49 -0
- package/dist/renderer/index.js +11 -8
- package/dist/renderer/intrinsic-blueprint-analysis.js +202 -0
- package/dist/renderer/intrinsic-blueprint-bindings.js +152 -0
- package/dist/renderer/intrinsic-blueprint-materialization.js +100 -0
- package/dist/renderer/intrinsic-blueprint.js +30 -0
- package/dist/renderer/intrinsic-hydration-adoption.js +66 -0
- package/dist/renderer/keyed-children.js +3 -9
- package/dist/renderer/keyed.js +10 -10
- package/dist/renderer/namespaces.js +0 -2
- package/dist/renderer/prop-bindings.js +59 -24
- package/dist/renderer/reactive-child-dom.js +10 -4
- package/dist/renderer/reactive-child-sources.js +0 -2
- package/dist/renderer/reactive-children.js +33 -24
- package/dist/renderer/reconcile-commit.js +0 -2
- package/dist/renderer/reconcile-fastpaths.js +6 -12
- package/dist/renderer/reconcile-resolution.js +32 -56
- package/dist/renderer/reconcile.js +0 -2
- package/dist/renderer/retained-element-rollback.js +161 -149
- package/dist/renderer/stable-patch.js +5 -7
- package/dist/renderer/static-reuse.js +0 -2
- package/dist/renderer/utils.js +20 -10
- package/dist/resources/index.js +1 -2
- package/dist/router/access.js +0 -2
- package/dist/router/activity.d.ts +1 -2
- package/dist/router/activity.js +20 -24
- package/dist/router/authoring.d.ts +1 -2
- package/dist/router/authoring.js +1 -3
- package/dist/router/index.d.ts +1 -1
- package/dist/router/internal-types.d.ts +1 -2
- package/dist/router/lazy.d.ts +1 -2
- package/dist/router/lazy.js +0 -2
- package/dist/router/manifest.d.ts +1 -2
- package/dist/router/manifest.js +0 -2
- package/dist/router/match.js +0 -2
- package/dist/router/navigate.d.ts +1 -2
- package/dist/router/navigate.js +5 -8
- package/dist/router/navigation-registry.d.ts +1 -2
- package/dist/router/navigation-registry.js +1 -3
- package/dist/router/navigation-scroll.d.ts +1 -2
- package/dist/router/navigation-scroll.js +0 -2
- package/dist/router/navigation-targets.d.ts +3 -4
- package/dist/router/navigation-targets.js +425 -44
- package/dist/router/policy.d.ts +1 -2
- package/dist/router/policy.js +0 -2
- package/dist/router/rendering.d.ts +1 -2
- package/dist/router/rendering.js +5 -3
- package/dist/router/resolution.d.ts +2 -16
- package/dist/router/resolution.js +6 -175
- package/dist/router/route-context.js +0 -2
- package/dist/router/route-matching.d.ts +19 -0
- package/dist/router/route-matching.js +173 -0
- package/dist/router/route-query.d.ts +1 -2
- package/dist/router/route-query.js +1 -3
- package/dist/router/route.js +4 -2
- package/dist/router/store.d.ts +1 -2
- package/dist/router/store.js +0 -2
- package/dist/router/testing.js +4 -0
- package/dist/runtime/access.d.ts +19 -0
- package/dist/runtime/access.js +0 -2
- package/dist/runtime/child-scope.d.ts +21 -2
- package/dist/runtime/child-scope.js +101 -54
- package/dist/runtime/component-cleanup.d.ts +1 -2
- package/dist/runtime/component-cleanup.js +3 -5
- package/dist/runtime/component-commit.js +26 -24
- package/dist/runtime/component-facade.js +5 -3
- package/dist/runtime/component-internal.d.ts +12 -7
- package/dist/runtime/component-internal.js +64 -46
- package/dist/runtime/component-lifecycle.d.ts +2 -41
- package/dist/runtime/component-lifecycle.js +6 -149
- package/dist/runtime/component-scope.d.ts +4 -5
- package/dist/runtime/component-scope.js +27 -8
- package/dist/runtime/component.js +4 -3
- package/dist/runtime/context.d.ts +5 -2
- package/dist/runtime/context.js +29 -3
- package/dist/runtime/control.d.ts +22 -3
- package/dist/runtime/control.js +168 -55
- package/dist/runtime/derive.d.ts +1 -2
- package/dist/runtime/derive.js +0 -2
- package/dist/runtime/dev-namespace.d.ts +30 -0
- package/dist/runtime/dev-namespace.js +32 -25
- package/dist/runtime/effect.d.ts +8 -5
- package/dist/runtime/effect.js +158 -75
- package/dist/runtime/error-boundary.d.ts +4 -0
- package/dist/runtime/error-boundary.js +29 -0
- package/dist/runtime/events.d.ts +58 -0
- package/dist/runtime/events.js +67 -70
- package/dist/runtime/execution-model.d.ts +6 -0
- package/dist/runtime/execution-model.js +0 -2
- package/dist/runtime/fastlane.d.ts +33 -0
- package/dist/runtime/fastlane.js +0 -2
- package/dist/runtime/for-bench.d.ts +1 -2
- package/dist/runtime/for-bench.js +9 -167
- package/dist/runtime/for-internal.d.ts +73 -10
- package/dist/runtime/for-internal.js +201 -14
- package/dist/runtime/for-reconcile.d.ts +1 -2
- package/dist/runtime/for-reconcile.js +76 -23
- package/dist/runtime/for-scopes.d.ts +5 -5
- package/dist/runtime/for-scopes.js +168 -48
- package/dist/runtime/for-signals.d.ts +14 -5
- package/dist/runtime/for-signals.js +157 -83
- package/dist/runtime/for-types.d.ts +8 -0
- package/dist/runtime/for.d.ts +2 -2
- package/dist/runtime/for.js +3 -3
- package/dist/runtime/index.d.ts +24 -0
- package/dist/runtime/index.js +33 -0
- package/dist/runtime/lifecycle-batch.d.ts +59 -0
- package/dist/runtime/lifecycle-batch.js +178 -0
- package/dist/runtime/lifecycle-operation-settlement.d.ts +5 -0
- package/dist/runtime/lifecycle-operation-settlement.js +51 -0
- package/dist/runtime/lifecycle-operations.d.ts +1 -2
- package/dist/runtime/lifecycle-operations.js +5 -6
- package/dist/runtime/perf-metrics.d.ts +27 -0
- package/dist/runtime/perf-metrics.js +4 -68
- package/dist/runtime/portal.d.ts +21 -0
- package/dist/runtime/portal.js +305 -0
- package/dist/runtime/readable.d.ts +9 -4
- package/dist/runtime/readable.js +41 -17
- package/dist/runtime/resource-cell.js +3 -5
- package/dist/runtime/resource-operation.d.ts +1 -2
- package/dist/runtime/resource-operation.js +38 -35
- package/dist/runtime/runtime.d.ts +2 -3
- package/dist/runtime/runtime.js +0 -2
- package/dist/runtime/scheduler.d.ts +1 -2
- package/dist/runtime/scheduler.js +10 -13
- package/dist/runtime/selector-store.js +22 -0
- package/dist/runtime/selector.d.ts +1 -2
- package/dist/runtime/selector.js +6 -29
- package/dist/runtime/snapshot-source.d.ts +1 -2
- package/dist/runtime/snapshot-source.js +0 -2
- package/dist/runtime/state.d.ts +1 -2
- package/dist/runtime/state.js +1 -3
- package/dist/ssg/batch-render.js +0 -2
- package/dist/ssg/create-static-gen.d.ts +4 -2
- package/dist/ssg/create-static-gen.js +66 -14
- package/dist/ssg/generate-metadata.js +0 -2
- package/dist/ssg/generation-plan.js +0 -2
- package/dist/ssg/incremental-manifest.js +1 -3
- package/dist/ssg/resolve-ssg-data.js +0 -2
- package/dist/ssg/route-utils.js +0 -2
- package/dist/ssg/static-routes.js +1 -2
- package/dist/ssg/types.d.ts +2 -3
- package/dist/ssg/write-static-files.js +16 -12
- package/dist/ssr/attrs.js +0 -2
- package/dist/ssr/boundaries.js +17 -6
- package/dist/ssr/component-runtime.js +4 -30
- package/dist/ssr/context.d.ts +1 -2
- package/dist/ssr/context.js +0 -2
- package/dist/ssr/errors.d.ts +1 -2
- package/dist/ssr/errors.js +0 -2
- package/dist/ssr/escape.js +0 -2
- package/dist/ssr/hydration-data.js +0 -2
- package/dist/ssr/hydration-verify.d.ts +1 -2
- package/dist/ssr/hydration-verify.js +34 -7
- package/dist/ssr/index-internal.d.ts +1 -2
- package/dist/ssr/index-internal.js +0 -2
- package/dist/ssr/render-keys.js +0 -2
- package/dist/ssr/render-resolved.d.ts +1 -2
- package/dist/ssr/render-resolved.js +1 -3
- package/dist/ssr/render-sync.d.ts +1 -2
- package/dist/ssr/render-sync.js +28 -20
- package/dist/ssr/route-policy-resolution.js +2 -3
- package/dist/ssr/route-render.d.ts +1 -2
- package/dist/ssr/route-render.js +2 -3
- package/dist/ssr/sink.d.ts +1 -2
- package/dist/ssr/sink.js +0 -2
- package/dist/ssr/types.d.ts +1 -2
- package/dist/ssr/verify-hydration.js +0 -2
- package/dist/testing/index.d.ts +1 -2
- package/dist/testing/index.js +3 -4
- package/package.json +60 -47
- package/dist/bench/components/benchmark-row.d.ts.map +0 -1
- package/dist/bench/components/benchmark-row.js.map +0 -1
- package/dist/bench/components/benchmark-table.js.map +0 -1
- package/dist/benchmark.d.ts.map +0 -1
- package/dist/benchmark.js.map +0 -1
- package/dist/bin/askr-ssg.d.ts.map +0 -1
- package/dist/bin/askr-ssg.js.map +0 -1
- package/dist/boot/hydration.js.map +0 -1
- package/dist/boot/index.d.ts.map +0 -1
- package/dist/boot/index.js.map +0 -1
- package/dist/boot/root-lifecycle.d.ts.map +0 -1
- package/dist/boot/root-lifecycle.js.map +0 -1
- package/dist/boot/route-startup.js.map +0 -1
- package/dist/boot/types.d.ts.map +0 -1
- package/dist/common/attr-names.js.map +0 -1
- package/dist/common/component.d.ts.map +0 -1
- package/dist/common/control.d.ts.map +0 -1
- package/dist/common/control.js.map +0 -1
- package/dist/common/env.js.map +0 -1
- package/dist/common/jsx.d.ts.map +0 -1
- package/dist/common/jsx.js.map +0 -1
- package/dist/common/promise.js.map +0 -1
- package/dist/common/props.d.ts.map +0 -1
- package/dist/common/render-context.js.map +0 -1
- package/dist/common/route-activity.js.map +0 -1
- package/dist/common/router-internal.js.map +0 -1
- package/dist/common/router.d.ts.map +0 -1
- package/dist/common/ssr-errors.d.ts.map +0 -1
- package/dist/common/ssr-errors.js.map +0 -1
- package/dist/common/ssr.d.ts.map +0 -1
- package/dist/common/ssr.js.map +0 -1
- package/dist/common/vnode.d.ts.map +0 -1
- package/dist/common/vnode.js.map +0 -1
- package/dist/components/error-boundary.d.ts.map +0 -1
- package/dist/components/error-boundary.js.map +0 -1
- package/dist/components/link.d.ts.map +0 -1
- package/dist/components/link.js.map +0 -1
- package/dist/control/case.d.ts.map +0 -1
- package/dist/control/case.js.map +0 -1
- package/dist/control/for.d.ts.map +0 -1
- package/dist/control/for.js.map +0 -1
- package/dist/control/shared.d.ts.map +0 -1
- package/dist/control/shared.js.map +0 -1
- package/dist/control/show.d.ts.map +0 -1
- package/dist/control/show.js.map +0 -1
- package/dist/data/data-runtime.d.ts.map +0 -1
- package/dist/data/data-runtime.js.map +0 -1
- package/dist/data/invalidation-listeners.js.map +0 -1
- package/dist/data/invalidation.d.ts.map +0 -1
- package/dist/data/invalidation.js.map +0 -1
- package/dist/data/mutation-cell.d.ts.map +0 -1
- package/dist/data/mutation-cell.js.map +0 -1
- package/dist/data/query-cell.d.ts.map +0 -1
- package/dist/data/query-cell.js.map +0 -1
- package/dist/data/query-key.js.map +0 -1
- package/dist/data/shared.js.map +0 -1
- package/dist/data/types.d.ts.map +0 -1
- package/dist/dev/invariant.js +0 -29
- package/dist/dev/invariant.js.map +0 -1
- package/dist/dev/logger.js.map +0 -1
- package/dist/foundations/icon/icon.d.ts.map +0 -1
- package/dist/foundations/icon/icon.js.map +0 -1
- package/dist/foundations/icon/icon.types.d.ts.map +0 -1
- package/dist/foundations/interactions/dismissable.d.ts.map +0 -1
- package/dist/foundations/interactions/dismissable.js.map +0 -1
- package/dist/foundations/interactions/focusable.d.ts.map +0 -1
- package/dist/foundations/interactions/focusable.js.map +0 -1
- package/dist/foundations/interactions/hoverable.d.ts.map +0 -1
- package/dist/foundations/interactions/hoverable.js.map +0 -1
- package/dist/foundations/interactions/interaction-policy.d.ts.map +0 -1
- package/dist/foundations/interactions/interaction-policy.js.map +0 -1
- package/dist/foundations/interactions/pressable.d.ts.map +0 -1
- package/dist/foundations/interactions/pressable.js.map +0 -1
- package/dist/foundations/interactions/roving-focus.d.ts.map +0 -1
- package/dist/foundations/interactions/roving-focus.js.map +0 -1
- package/dist/foundations/state/controllable.d.ts.map +0 -1
- package/dist/foundations/state/controllable.js.map +0 -1
- package/dist/foundations/structures/collection.d.ts.map +0 -1
- package/dist/foundations/structures/collection.js.map +0 -1
- package/dist/foundations/structures/layer.d.ts.map +0 -1
- package/dist/foundations/structures/layer.js.map +0 -1
- package/dist/foundations/structures/layout.d.ts.map +0 -1
- package/dist/foundations/structures/layout.js.map +0 -1
- package/dist/foundations/structures/portal.d.ts.map +0 -1
- package/dist/foundations/structures/portal.js.map +0 -1
- package/dist/foundations/structures/presence.d.ts.map +0 -1
- package/dist/foundations/structures/presence.js.map +0 -1
- package/dist/foundations/structures/slot.d.ts.map +0 -1
- package/dist/foundations/structures/slot.js.map +0 -1
- package/dist/foundations/utilities/aria.d.ts.map +0 -1
- package/dist/foundations/utilities/aria.js.map +0 -1
- package/dist/foundations/utilities/compose-handlers.d.ts.map +0 -1
- package/dist/foundations/utilities/compose-handlers.js.map +0 -1
- package/dist/foundations/utilities/compose-ref.d.ts.map +0 -1
- package/dist/foundations/utilities/compose-ref.js.map +0 -1
- package/dist/foundations/utilities/event-types.d.ts.map +0 -1
- package/dist/foundations/utilities/merge-props.d.ts.map +0 -1
- package/dist/foundations/utilities/merge-props.js.map +0 -1
- package/dist/foundations/utilities/use-id.d.ts.map +0 -1
- package/dist/foundations/utilities/use-id.js.map +0 -1
- package/dist/fx/fx.d.ts.map +0 -1
- package/dist/fx/fx.js.map +0 -1
- package/dist/fx/noop.js.map +0 -1
- package/dist/fx/timing.d.ts.map +0 -1
- package/dist/fx/timing.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/jsx/types.d.ts.map +0 -1
- package/dist/jsx/utils.d.ts.map +0 -1
- package/dist/jsx/utils.js.map +0 -1
- package/dist/jsx-dev-runtime.d.ts.map +0 -1
- package/dist/jsx-dev-runtime.js.map +0 -1
- package/dist/jsx-runtime.d.ts.map +0 -1
- package/dist/jsx-runtime.js.map +0 -1
- package/dist/renderer/attributes.js.map +0 -1
- package/dist/renderer/boundaries.js.map +0 -1
- package/dist/renderer/child-shape.js.map +0 -1
- package/dist/renderer/children.js.map +0 -1
- package/dist/renderer/cleanup.js.map +0 -1
- package/dist/renderer/component-host-cleanup.js.map +0 -1
- package/dist/renderer/component-host-instances.js.map +0 -1
- package/dist/renderer/component-host.js.map +0 -1
- package/dist/renderer/dom-host.js.map +0 -1
- package/dist/renderer/dom-internal.js.map +0 -1
- package/dist/renderer/element-children.js.map +0 -1
- package/dist/renderer/error-boundary-dom.js.map +0 -1
- package/dist/renderer/evaluate-dom-range.js.map +0 -1
- package/dist/renderer/evaluate-reconcile.js.map +0 -1
- package/dist/renderer/evaluate.js.map +0 -1
- package/dist/renderer/fastpath.js.map +0 -1
- package/dist/renderer/for-commit-dom-map.js.map +0 -1
- package/dist/renderer/for-commit-removal.js.map +0 -1
- package/dist/renderer/for-commit-reorder.js.map +0 -1
- package/dist/renderer/for-commit.js.map +0 -1
- package/dist/renderer/index.js.map +0 -1
- package/dist/renderer/keyed-children.js.map +0 -1
- package/dist/renderer/keyed.js.map +0 -1
- package/dist/renderer/namespaces.js.map +0 -1
- package/dist/renderer/prop-bindings.js.map +0 -1
- package/dist/renderer/reactive-child-dom.js.map +0 -1
- package/dist/renderer/reactive-child-sources.js.map +0 -1
- package/dist/renderer/reactive-children.js.map +0 -1
- package/dist/renderer/reconcile-commit.js.map +0 -1
- package/dist/renderer/reconcile-fastpaths.js.map +0 -1
- package/dist/renderer/reconcile-resolution.js.map +0 -1
- package/dist/renderer/reconcile.js.map +0 -1
- package/dist/renderer/retained-element-rollback.js.map +0 -1
- package/dist/renderer/stable-patch.js.map +0 -1
- package/dist/renderer/static-reuse.js.map +0 -1
- package/dist/renderer/utils.js.map +0 -1
- package/dist/router/access.js.map +0 -1
- package/dist/router/activity.d.ts.map +0 -1
- package/dist/router/activity.js.map +0 -1
- package/dist/router/authoring.d.ts.map +0 -1
- package/dist/router/authoring.js.map +0 -1
- package/dist/router/internal-types.d.ts.map +0 -1
- package/dist/router/lazy.d.ts.map +0 -1
- package/dist/router/lazy.js.map +0 -1
- package/dist/router/manifest.d.ts.map +0 -1
- package/dist/router/manifest.js.map +0 -1
- package/dist/router/match.js.map +0 -1
- package/dist/router/navigate.d.ts.map +0 -1
- package/dist/router/navigate.js.map +0 -1
- package/dist/router/navigation-registry.d.ts.map +0 -1
- package/dist/router/navigation-registry.js.map +0 -1
- package/dist/router/navigation-scroll.d.ts.map +0 -1
- package/dist/router/navigation-scroll.js.map +0 -1
- package/dist/router/navigation-targets.d.ts.map +0 -1
- package/dist/router/navigation-targets.js.map +0 -1
- package/dist/router/policy.d.ts.map +0 -1
- package/dist/router/policy.js.map +0 -1
- package/dist/router/rendering.d.ts.map +0 -1
- package/dist/router/rendering.js.map +0 -1
- package/dist/router/resolution.d.ts.map +0 -1
- package/dist/router/resolution.js.map +0 -1
- package/dist/router/route-context.js.map +0 -1
- package/dist/router/route-query.d.ts.map +0 -1
- package/dist/router/route-query.js.map +0 -1
- package/dist/router/store.d.ts.map +0 -1
- package/dist/router/store.js.map +0 -1
- package/dist/runtime/access.js.map +0 -1
- package/dist/runtime/child-scope.d.ts.map +0 -1
- package/dist/runtime/child-scope.js.map +0 -1
- package/dist/runtime/component-cleanup.d.ts.map +0 -1
- package/dist/runtime/component-cleanup.js.map +0 -1
- package/dist/runtime/component-commit.js.map +0 -1
- package/dist/runtime/component-contracts.js +0 -5
- package/dist/runtime/component-internal.d.ts.map +0 -1
- package/dist/runtime/component-internal.js.map +0 -1
- package/dist/runtime/component-lifecycle.d.ts.map +0 -1
- package/dist/runtime/component-lifecycle.js.map +0 -1
- package/dist/runtime/component-scope.d.ts.map +0 -1
- package/dist/runtime/component-scope.js.map +0 -1
- package/dist/runtime/context.d.ts.map +0 -1
- package/dist/runtime/context.js.map +0 -1
- package/dist/runtime/control.d.ts.map +0 -1
- package/dist/runtime/control.js.map +0 -1
- package/dist/runtime/derive.d.ts.map +0 -1
- package/dist/runtime/derive.js.map +0 -1
- package/dist/runtime/dev-namespace.js.map +0 -1
- package/dist/runtime/effect.d.ts.map +0 -1
- package/dist/runtime/effect.js.map +0 -1
- package/dist/runtime/events.js.map +0 -1
- package/dist/runtime/execution-model.js.map +0 -1
- package/dist/runtime/fastlane.js.map +0 -1
- package/dist/runtime/for-bench.d.ts.map +0 -1
- package/dist/runtime/for-bench.js.map +0 -1
- package/dist/runtime/for-internal.d.ts.map +0 -1
- package/dist/runtime/for-internal.js.map +0 -1
- package/dist/runtime/for-reconcile.d.ts.map +0 -1
- package/dist/runtime/for-reconcile.js.map +0 -1
- package/dist/runtime/for-scopes.d.ts.map +0 -1
- package/dist/runtime/for-scopes.js.map +0 -1
- package/dist/runtime/for-signals.d.ts.map +0 -1
- package/dist/runtime/for-signals.js.map +0 -1
- package/dist/runtime/lifecycle-operations.d.ts.map +0 -1
- package/dist/runtime/lifecycle-operations.js.map +0 -1
- package/dist/runtime/perf-metrics.js.map +0 -1
- package/dist/runtime/readable.d.ts.map +0 -1
- package/dist/runtime/readable.js.map +0 -1
- package/dist/runtime/resource-cell.js.map +0 -1
- package/dist/runtime/resource-operation.d.ts.map +0 -1
- package/dist/runtime/resource-operation.js.map +0 -1
- package/dist/runtime/runtime.d.ts.map +0 -1
- package/dist/runtime/runtime.js.map +0 -1
- package/dist/runtime/scheduler.d.ts.map +0 -1
- package/dist/runtime/scheduler.js.map +0 -1
- package/dist/runtime/selector.d.ts.map +0 -1
- package/dist/runtime/selector.js.map +0 -1
- package/dist/runtime/snapshot-source.d.ts.map +0 -1
- package/dist/runtime/snapshot-source.js.map +0 -1
- package/dist/runtime/state.d.ts.map +0 -1
- package/dist/runtime/state.js.map +0 -1
- package/dist/ssg/batch-render.js.map +0 -1
- package/dist/ssg/create-static-gen.d.ts.map +0 -1
- package/dist/ssg/create-static-gen.js.map +0 -1
- package/dist/ssg/generate-metadata.js.map +0 -1
- package/dist/ssg/generation-plan.js.map +0 -1
- package/dist/ssg/incremental-manifest.js.map +0 -1
- package/dist/ssg/resolve-ssg-data.js.map +0 -1
- package/dist/ssg/route-utils.js.map +0 -1
- package/dist/ssg/static-routes.js.map +0 -1
- package/dist/ssg/types.d.ts.map +0 -1
- package/dist/ssg/write-static-files.js.map +0 -1
- package/dist/ssr/attrs.js.map +0 -1
- package/dist/ssr/boundaries.js.map +0 -1
- package/dist/ssr/component-runtime.js.map +0 -1
- package/dist/ssr/context.d.ts.map +0 -1
- package/dist/ssr/context.js.map +0 -1
- package/dist/ssr/errors.d.ts.map +0 -1
- package/dist/ssr/errors.js.map +0 -1
- package/dist/ssr/escape.js.map +0 -1
- package/dist/ssr/hydration-data.js.map +0 -1
- package/dist/ssr/hydration-verify.d.ts.map +0 -1
- package/dist/ssr/hydration-verify.js.map +0 -1
- package/dist/ssr/index-internal.d.ts.map +0 -1
- package/dist/ssr/index-internal.js.map +0 -1
- package/dist/ssr/render-keys.js.map +0 -1
- package/dist/ssr/render-resolved.d.ts.map +0 -1
- package/dist/ssr/render-resolved.js.map +0 -1
- package/dist/ssr/render-sync.d.ts.map +0 -1
- package/dist/ssr/render-sync.js.map +0 -1
- package/dist/ssr/route-policy-resolution.js.map +0 -1
- package/dist/ssr/route-render.d.ts.map +0 -1
- package/dist/ssr/route-render.js.map +0 -1
- package/dist/ssr/sink.d.ts.map +0 -1
- package/dist/ssr/sink.js.map +0 -1
- package/dist/ssr/types.d.ts.map +0 -1
- package/dist/ssr/verify-hydration.js.map +0 -1
- package/dist/testing/index.d.ts.map +0 -1
- package/dist/testing/index.js.map +0 -1
|
@@ -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
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
//#region src/runtime/perf-metrics.d.ts
|
|
2
|
+
type PerfMetrics = {
|
|
3
|
+
selectorInvalidations: number;
|
|
4
|
+
selectorCandidateReads: number;
|
|
5
|
+
reactivePropReevaluations: number;
|
|
6
|
+
skippedDomPropWrites: number;
|
|
7
|
+
classListPatchOps: number;
|
|
8
|
+
delegatedAncestorHops: number;
|
|
9
|
+
hydrationBoundaryActivations: number;
|
|
10
|
+
ssrTagCacheHits: number;
|
|
11
|
+
lastSchedulerTaskCountPerFlush: number;
|
|
12
|
+
maxSchedulerTaskCountPerFlush: number;
|
|
13
|
+
schedulerFlushCount: number;
|
|
14
|
+
schedulerTaskExecutions: number;
|
|
15
|
+
ssgWorkerCount: number;
|
|
16
|
+
ssgRenderTimeMs: number;
|
|
17
|
+
ssgWorkerRenderTimeMs: number;
|
|
18
|
+
ssgWriteTimeMs: number;
|
|
19
|
+
};
|
|
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
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ComponentInstance } from "./component-internal.js";
|
|
2
|
+
import { RenderableChild } from "../common/vnode.js";
|
|
3
|
+
|
|
4
|
+
//#region src/runtime/portal.d.ts
|
|
5
|
+
interface Portal<T extends RenderableChild = RenderableChild> {
|
|
6
|
+
(): unknown;
|
|
7
|
+
render(props: {
|
|
8
|
+
children?: T;
|
|
9
|
+
}): unknown;
|
|
10
|
+
}
|
|
11
|
+
interface PortalProps {
|
|
12
|
+
children?: RenderableChild;
|
|
13
|
+
}
|
|
14
|
+
declare function definePortal<T extends RenderableChild = RenderableChild>(): Portal<T>;
|
|
15
|
+
declare function _resetDefaultPortal(): void;
|
|
16
|
+
declare function disposeDefaultPortalScope(scope: object | null): void;
|
|
17
|
+
declare function clearDefaultPortalForInstance(instance: ComponentInstance): void;
|
|
18
|
+
declare const DefaultPortal: Portal<RenderableChild>;
|
|
19
|
+
declare function Portal(props: PortalProps): null;
|
|
20
|
+
//#endregion
|
|
21
|
+
export { DefaultPortal, Portal, PortalProps, definePortal };
|
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
import { enqueueRuntimeTask, getRuntimeRenderer } from "./access.js";
|
|
2
|
+
import { markReactivePropsDirtySource, markReadableDerivedSubscribersDirty, notifyReadableReaders, recordReadableRead } from "./readable.js";
|
|
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";
|
|
7
|
+
import "./component.js";
|
|
8
|
+
//#region src/runtime/portal.ts
|
|
9
|
+
function createPortalSlot() {
|
|
10
|
+
let currentValue;
|
|
11
|
+
const source = (() => {
|
|
12
|
+
recordReadableRead(source);
|
|
13
|
+
return currentValue;
|
|
14
|
+
});
|
|
15
|
+
return {
|
|
16
|
+
read() {
|
|
17
|
+
return source();
|
|
18
|
+
},
|
|
19
|
+
write(value) {
|
|
20
|
+
if (Object.is(currentValue, value)) return;
|
|
21
|
+
currentValue = value;
|
|
22
|
+
markReadableDerivedSubscribersDirty(source);
|
|
23
|
+
markReactivePropsDirtySource(source);
|
|
24
|
+
notifyReadableReaders(source);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
function definePortal() {
|
|
29
|
+
if (typeof createPortalSlot === "function") {
|
|
30
|
+
const slot = createPortalSlot();
|
|
31
|
+
function PortalHost() {
|
|
32
|
+
return slot.read();
|
|
33
|
+
}
|
|
34
|
+
PortalHost.render = function PortalRender(props) {
|
|
35
|
+
slot.write(props.children);
|
|
36
|
+
return null;
|
|
37
|
+
};
|
|
38
|
+
return PortalHost;
|
|
39
|
+
}
|
|
40
|
+
let mounted = false;
|
|
41
|
+
let value;
|
|
42
|
+
function PortalHostFallback() {
|
|
43
|
+
mounted = true;
|
|
44
|
+
return value;
|
|
45
|
+
}
|
|
46
|
+
PortalHostFallback.render = function PortalRenderFallback(props) {
|
|
47
|
+
if (!mounted) return null;
|
|
48
|
+
value = props.children;
|
|
49
|
+
return null;
|
|
50
|
+
};
|
|
51
|
+
return PortalHostFallback;
|
|
52
|
+
}
|
|
53
|
+
let _defaultPortalStates = /* @__PURE__ */ new Map();
|
|
54
|
+
let _hasPendingDefaultPortalValue = false;
|
|
55
|
+
let _pendingDefaultPortalValue = void 0;
|
|
56
|
+
let _pendingDefaultPortalWrites = /* @__PURE__ */ new WeakMap();
|
|
57
|
+
const _batchPortalWrites = /* @__PURE__ */ new WeakMap();
|
|
58
|
+
function createExplicitHostSource(readCount) {
|
|
59
|
+
let source = (() => {
|
|
60
|
+
recordReadableRead(source);
|
|
61
|
+
return readCount();
|
|
62
|
+
});
|
|
63
|
+
return source;
|
|
64
|
+
}
|
|
65
|
+
function readExplicitDefaultPortalHosts(state) {
|
|
66
|
+
return state.explicitHostSource();
|
|
67
|
+
}
|
|
68
|
+
function notifyExplicitDefaultPortalHostReaders(state) {
|
|
69
|
+
markReadableDerivedSubscribersDirty(state.explicitHostSource);
|
|
70
|
+
markReactivePropsDirtySource(state.explicitHostSource);
|
|
71
|
+
notifyReadableReaders(state.explicitHostSource);
|
|
72
|
+
}
|
|
73
|
+
function createDefaultPortalState() {
|
|
74
|
+
const state = {
|
|
75
|
+
portal: definePortal(),
|
|
76
|
+
owner: null,
|
|
77
|
+
host: null,
|
|
78
|
+
cleanupOwners: /* @__PURE__ */ new WeakSet(),
|
|
79
|
+
explicitHostOwners: /* @__PURE__ */ new Set(),
|
|
80
|
+
explicitHostCleanupOwners: /* @__PURE__ */ new WeakSet(),
|
|
81
|
+
explicitHostSource: (() => 0)
|
|
82
|
+
};
|
|
83
|
+
state.explicitHostSource = createExplicitHostSource(() => state.explicitHostOwners.size);
|
|
84
|
+
return state;
|
|
85
|
+
}
|
|
86
|
+
function isExplicitHostOwnerConnected(owner) {
|
|
87
|
+
if (owner.target) return owner.target.isConnected;
|
|
88
|
+
if (owner._placeholder) return owner._placeholder.isConnected;
|
|
89
|
+
return owner.mounted;
|
|
90
|
+
}
|
|
91
|
+
function disposeDefaultPortalScope(scope) {
|
|
92
|
+
if (!scope) return;
|
|
93
|
+
const state = _defaultPortalStates.get(scope);
|
|
94
|
+
if (state) state.portal.render({ children: void 0 });
|
|
95
|
+
_defaultPortalStates.delete(scope);
|
|
96
|
+
}
|
|
97
|
+
function isComponentPortalScope(scope) {
|
|
98
|
+
return Array.isArray(scope.cleanupFns);
|
|
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
|
+
}
|
|
129
|
+
function isStaleDefaultPortalScope(scope) {
|
|
130
|
+
if (!isComponentPortalScope(scope)) return false;
|
|
131
|
+
if (scope.target && scope.target.isConnected === false) return true;
|
|
132
|
+
return scope.mounted === false;
|
|
133
|
+
}
|
|
134
|
+
function pruneStaleDefaultPortalScopes() {
|
|
135
|
+
if (_defaultPortalStates.size === 0) return;
|
|
136
|
+
for (const scope of Array.from(_defaultPortalStates.keys())) if (isStaleDefaultPortalScope(scope)) disposeDefaultPortalScope(scope);
|
|
137
|
+
}
|
|
138
|
+
function getSingleDefaultPortalScope() {
|
|
139
|
+
pruneStaleDefaultPortalScopes();
|
|
140
|
+
if (_defaultPortalStates.size !== 1) return null;
|
|
141
|
+
return _defaultPortalStates.keys().next().value ?? null;
|
|
142
|
+
}
|
|
143
|
+
function getDefaultPortalState(scope) {
|
|
144
|
+
let state = _defaultPortalStates.get(scope);
|
|
145
|
+
if (!state) {
|
|
146
|
+
state = createDefaultPortalState();
|
|
147
|
+
_defaultPortalStates.set(scope, state);
|
|
148
|
+
}
|
|
149
|
+
return state;
|
|
150
|
+
}
|
|
151
|
+
function resolveDefaultPortalScope(owner) {
|
|
152
|
+
return owner?.portalScope ?? getCurrentPortalScope() ?? getSingleDefaultPortalScope();
|
|
153
|
+
}
|
|
154
|
+
function writeDefaultPortal(props, owner) {
|
|
155
|
+
const scope = resolveDefaultPortalScope(owner);
|
|
156
|
+
if (!scope) {
|
|
157
|
+
if (_defaultPortalStates.size !== 0) return;
|
|
158
|
+
_hasPendingDefaultPortalValue = true;
|
|
159
|
+
_pendingDefaultPortalValue = props.children;
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
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
|
+
}
|
|
224
|
+
_hasPendingDefaultPortalValue = false;
|
|
225
|
+
_pendingDefaultPortalValue = void 0;
|
|
226
|
+
applyDefaultPortalWrite(state, props.children, owner);
|
|
227
|
+
}
|
|
228
|
+
function applyPendingDefaultPortalValue(scope) {
|
|
229
|
+
if (!_hasPendingDefaultPortalValue) return;
|
|
230
|
+
const state = getDefaultPortalState(scope);
|
|
231
|
+
state.portal.render({ children: _pendingDefaultPortalValue });
|
|
232
|
+
state.owner = null;
|
|
233
|
+
_hasPendingDefaultPortalValue = false;
|
|
234
|
+
_pendingDefaultPortalValue = void 0;
|
|
235
|
+
}
|
|
236
|
+
function registerDefaultPortalOwner(owner) {
|
|
237
|
+
const scope = resolveDefaultPortalScope(owner);
|
|
238
|
+
if (!scope) return;
|
|
239
|
+
const state = getDefaultPortalState(scope);
|
|
240
|
+
if (state.cleanupOwners.has(owner)) return;
|
|
241
|
+
state.cleanupOwners.add(owner);
|
|
242
|
+
(owner.cleanupFns ??= []).push(() => {
|
|
243
|
+
const currentState = _defaultPortalStates.get(scope);
|
|
244
|
+
if (!currentState) return;
|
|
245
|
+
if (currentState.owner === owner) applyDefaultPortalWrite(currentState, void 0, null);
|
|
246
|
+
currentState.cleanupOwners.delete(owner);
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
function registerExplicitDefaultPortalHost(scope, state, owner) {
|
|
250
|
+
if (!owner) return;
|
|
251
|
+
if (!state.explicitHostOwners.has(owner)) {
|
|
252
|
+
state.explicitHostOwners.add(owner);
|
|
253
|
+
notifyExplicitDefaultPortalHostReaders(state);
|
|
254
|
+
}
|
|
255
|
+
if (!state.explicitHostCleanupOwners.has(owner)) {
|
|
256
|
+
state.explicitHostCleanupOwners.add(owner);
|
|
257
|
+
(owner.cleanupFns ??= []).push(() => {
|
|
258
|
+
if (_defaultPortalStates.get(scope) !== state) return;
|
|
259
|
+
state.explicitHostCleanupOwners.delete(owner);
|
|
260
|
+
enqueueRuntimeTask(() => {
|
|
261
|
+
if (_defaultPortalStates.get(scope) !== state) return;
|
|
262
|
+
if (isExplicitHostOwnerConnected(owner)) return;
|
|
263
|
+
if (state.explicitHostOwners.delete(owner)) notifyExplicitDefaultPortalHostReaders(state);
|
|
264
|
+
});
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
function clearDefaultPortalForInstance(instance) {
|
|
269
|
+
const scope = instance.portalScope;
|
|
270
|
+
if (!scope) return;
|
|
271
|
+
const state = _defaultPortalStates.get(scope);
|
|
272
|
+
if (!state) return;
|
|
273
|
+
_hasPendingDefaultPortalValue = false;
|
|
274
|
+
_pendingDefaultPortalValue = void 0;
|
|
275
|
+
state.portal.render({ children: void 0 });
|
|
276
|
+
state.owner = null;
|
|
277
|
+
detachDefaultPortalHostOutput(state);
|
|
278
|
+
}
|
|
279
|
+
const DefaultPortal = (() => {
|
|
280
|
+
function Host(props) {
|
|
281
|
+
const owner = getCurrentComponentInstance();
|
|
282
|
+
const scope = resolveDefaultPortalScope(owner);
|
|
283
|
+
if (!scope) return null;
|
|
284
|
+
const state = getDefaultPortalState(scope);
|
|
285
|
+
state.host = owner;
|
|
286
|
+
if (!(props?.__askrAutoDefaultPortal === true)) registerExplicitDefaultPortalHost(scope, state, owner);
|
|
287
|
+
else if (readExplicitDefaultPortalHosts(state) > 0) return null;
|
|
288
|
+
applyPendingDefaultPortalValue(scope);
|
|
289
|
+
const value = state.portal();
|
|
290
|
+
return value === void 0 ? null : value;
|
|
291
|
+
}
|
|
292
|
+
Host.render = function Render(props) {
|
|
293
|
+
writeDefaultPortal(props, getCurrentComponentInstance());
|
|
294
|
+
return null;
|
|
295
|
+
};
|
|
296
|
+
return Host;
|
|
297
|
+
})();
|
|
298
|
+
function Portal(props) {
|
|
299
|
+
const owner = getCurrentComponentInstance();
|
|
300
|
+
if (owner) registerDefaultPortalOwner(owner);
|
|
301
|
+
writeDefaultPortal(props, owner);
|
|
302
|
+
return null;
|
|
303
|
+
}
|
|
304
|
+
//#endregion
|
|
305
|
+
export { DefaultPortal, Portal, clearDefaultPortalForInstance, definePortal, disposeDefaultPortalScope };
|
|
@@ -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 };
|