@ogygia/core 0.0.0 → 0.11.0
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/LICENSE +21 -0
- package/README.md +7 -1
- package/ambient.d.ts +194 -0
- package/dist/ClientBindingStub.svelte +6 -0
- package/dist/ClientBindingStub.svelte.d.ts +26 -0
- package/dist/KeepHost.svelte +19 -0
- package/dist/KeepHost.svelte.d.ts +10 -0
- package/dist/LakeBoundary.svelte +16 -0
- package/dist/LakeBoundary.svelte.d.ts +11 -0
- package/dist/LateIsland.svelte +22 -0
- package/dist/LateIsland.svelte.d.ts +15 -0
- package/dist/LateIslandAwait.svelte +17 -0
- package/dist/LateIslandAwait.svelte.d.ts +15 -0
- package/dist/LiveHost.svelte +19 -0
- package/dist/LiveHost.svelte.d.ts +10 -0
- package/dist/NestedProvider.svelte +13 -0
- package/dist/NestedProvider.svelte.d.ts +8 -0
- package/dist/OgygiaBoundary.svelte +5 -0
- package/dist/OgygiaBoundary.svelte.d.ts +17 -0
- package/dist/PromiseRegion.svelte +40 -0
- package/dist/PromiseRegion.svelte.d.ts +15 -0
- package/dist/PromiseRegionAwait.svelte +27 -0
- package/dist/PromiseRegionAwait.svelte.d.ts +15 -0
- package/dist/Provide.svelte +27 -0
- package/dist/Provide.svelte.d.ts +8 -0
- package/dist/RawHtml.svelte +9 -0
- package/dist/RawHtml.svelte.d.ts +6 -0
- package/dist/Region.svelte +1173 -0
- package/dist/Region.svelte.d.ts +68 -0
- package/dist/SlotBoundary.svelte +13 -0
- package/dist/SlotBoundary.svelte.d.ts +7 -0
- package/dist/app.d.ts +4 -0
- package/dist/app.js +3 -0
- package/dist/boundary.d.ts +35 -0
- package/dist/boundary.js +127 -0
- package/dist/build-cache.d.ts +13 -0
- package/dist/build-cache.js +77 -0
- package/dist/compiler/blank-styles.d.ts +1 -0
- package/dist/compiler/blank-styles.js +63 -0
- package/dist/compiler/bom.d.ts +2 -0
- package/dist/compiler/bom.js +15 -0
- package/dist/compiler/browser-full.d.ts +8 -0
- package/dist/compiler/browser-full.js +8 -0
- package/dist/compiler/browser.d.ts +11 -0
- package/dist/compiler/browser.js +11 -0
- package/dist/compiler/content/transportables.d.ts +26 -0
- package/dist/compiler/content/transportables.js +219 -0
- package/dist/compiler/ctx.d.ts +180 -0
- package/dist/compiler/ctx.js +183 -0
- package/dist/compiler/debarrel/barrel.d.ts +55 -0
- package/dist/compiler/debarrel/barrel.js +248 -0
- package/dist/compiler/debarrel/options.d.ts +67 -0
- package/dist/compiler/debarrel/options.js +31 -0
- package/dist/compiler/debarrel/parse.d.ts +65 -0
- package/dist/compiler/debarrel/parse.js +256 -0
- package/dist/compiler/debarrel/plugin.d.ts +31 -0
- package/dist/compiler/debarrel/plugin.js +190 -0
- package/dist/compiler/debarrel/rewrite.d.ts +27 -0
- package/dist/compiler/debarrel/rewrite.js +118 -0
- package/dist/compiler/debarrel/svelte.d.ts +13 -0
- package/dist/compiler/debarrel/svelte.js +56 -0
- package/dist/compiler/dev/css-scope.d.ts +16 -0
- package/dist/compiler/dev/css-scope.js +38 -0
- package/dist/compiler/dev/dev-hmr.d.ts +25 -0
- package/dist/compiler/dev/dev-hmr.js +29 -0
- package/dist/compiler/dev/hmr.d.ts +34 -0
- package/dist/compiler/dev/hmr.js +57 -0
- package/dist/compiler/dev/region-bytes.d.ts +34 -0
- package/dist/compiler/dev/region-bytes.js +126 -0
- package/dist/compiler/driver.d.ts +280 -0
- package/dist/compiler/driver.js +1352 -0
- package/dist/compiler/flags.d.ts +16 -0
- package/dist/compiler/flags.js +101 -0
- package/dist/compiler/fouc-css.d.ts +97 -0
- package/dist/compiler/fouc-css.js +335 -0
- package/dist/compiler/free-vars.d.ts +20 -0
- package/dist/compiler/free-vars.js +327 -0
- package/dist/compiler/host.d.ts +65 -0
- package/dist/compiler/host.js +51 -0
- package/dist/compiler/ids.d.ts +84 -0
- package/dist/compiler/ids.js +86 -0
- package/dist/compiler/index.d.ts +11 -0
- package/dist/compiler/index.js +11 -0
- package/dist/compiler/kit.d.ts +129 -0
- package/dist/compiler/kit.js +563 -0
- package/dist/compiler/link/build-output.d.ts +44 -0
- package/dist/compiler/link/build-output.js +147 -0
- package/dist/compiler/link/caps.d.ts +48 -0
- package/dist/compiler/link/caps.js +64 -0
- package/dist/compiler/link/context-detect.d.ts +23 -0
- package/dist/compiler/link/context-detect.js +137 -0
- package/dist/compiler/link/emit-gate.d.ts +11 -0
- package/dist/compiler/link/emit-gate.js +40 -0
- package/dist/compiler/link/entry-shim.d.ts +4 -0
- package/dist/compiler/link/entry-shim.js +29 -0
- package/dist/compiler/link/island-deps.d.ts +142 -0
- package/dist/compiler/link/island-deps.js +525 -0
- package/dist/compiler/link/manifest.d.ts +5 -0
- package/dist/compiler/link/manifest.js +9 -0
- package/dist/compiler/link/page-keys.d.ts +64 -0
- package/dist/compiler/link/page-keys.js +683 -0
- package/dist/compiler/link/registry-stub.d.ts +41 -0
- package/dist/compiler/link/registry-stub.js +212 -0
- package/dist/compiler/link/router-config.d.ts +11 -0
- package/dist/compiler/link/router-config.js +15 -0
- package/dist/compiler/link/router-css.d.ts +22 -0
- package/dist/compiler/link/router-css.js +142 -0
- package/dist/compiler/link/runtime-entry.d.ts +71 -0
- package/dist/compiler/link/runtime-entry.js +132 -0
- package/dist/compiler/link/server-manifest.d.ts +12 -0
- package/dist/compiler/link/server-manifest.js +45 -0
- package/dist/compiler/link/speculation.d.ts +17 -0
- package/dist/compiler/link/speculation.js +36 -0
- package/dist/compiler/link/transport.d.ts +31 -0
- package/dist/compiler/link/transport.js +67 -0
- package/dist/compiler/macros/bake.d.ts +20 -0
- package/dist/compiler/macros/bake.js +317 -0
- package/dist/compiler/macros/browser.d.ts +11 -0
- package/dist/compiler/macros/browser.js +69 -0
- package/dist/compiler/macros/dedent.d.ts +12 -0
- package/dist/compiler/macros/dedent.js +36 -0
- package/dist/compiler/macros/dollar.d.ts +15 -0
- package/dist/compiler/macros/dollar.js +387 -0
- package/dist/compiler/macros/pipeline.d.ts +31 -0
- package/dist/compiler/macros/pipeline.js +106 -0
- package/dist/compiler/macros/source.d.ts +6 -0
- package/dist/compiler/macros/source.js +127 -0
- package/dist/compiler/macros/store.d.ts +17 -0
- package/dist/compiler/macros/store.js +244 -0
- package/dist/compiler/macros/wire.d.ts +14 -0
- package/dist/compiler/macros/wire.js +160 -0
- package/dist/compiler/ownership-stamps.d.ts +6 -0
- package/dist/compiler/ownership-stamps.js +144 -0
- package/dist/compiler/parse/oxc.d.ts +34 -0
- package/dist/compiler/parse/oxc.js +59 -0
- package/dist/compiler/parse/scan.d.ts +43 -0
- package/dist/compiler/parse/scan.js +232 -0
- package/dist/compiler/program.d.ts +140 -0
- package/dist/compiler/program.js +242 -0
- package/dist/compiler/region/emit.d.ts +169 -0
- package/dist/compiler/region/emit.js +286 -0
- package/dist/compiler/region/identity.d.ts +28 -0
- package/dist/compiler/region/identity.js +75 -0
- package/dist/compiler/region/ir.d.ts +65 -0
- package/dist/compiler/region/ir.js +0 -0
- package/dist/compiler/region/transform.d.ts +178 -0
- package/dist/compiler/region/transform.js +1933 -0
- package/dist/compiler/script-request.d.ts +1 -0
- package/dist/compiler/script-request.js +43 -0
- package/dist/context-bridge.d.ts +65 -0
- package/dist/context-bridge.js +217 -0
- package/dist/context-registry.d.ts +40 -0
- package/dist/context-registry.js +15 -0
- package/dist/context.d.ts +72 -0
- package/dist/context.js +158 -0
- package/dist/current-region.d.ts +14 -0
- package/dist/current-region.js +36 -0
- package/dist/document.d.ts +41 -0
- package/dist/document.js +125 -0
- package/dist/entry-hydrate.d.ts +5 -0
- package/dist/entry-hydrate.js +42 -0
- package/dist/escape.d.ts +18 -0
- package/dist/escape.js +37 -0
- package/dist/events/bus.d.ts +33 -0
- package/dist/events/bus.js +153 -0
- package/dist/events/index.d.ts +4 -0
- package/dist/events/index.js +4 -0
- package/dist/events/schema.d.ts +389 -0
- package/dist/events/schema.js +23 -0
- package/dist/events/server-registry.d.ts +7 -0
- package/dist/events/server-registry.js +13 -0
- package/dist/events/sinks.d.ts +64 -0
- package/dist/events/sinks.js +85 -0
- package/dist/fn-transport.d.ts +33 -0
- package/dist/fn-transport.js +140 -0
- package/dist/frame.d.ts +20 -0
- package/dist/frame.js +19 -0
- package/dist/holes-record.d.ts +6 -0
- package/dist/holes-record.js +8 -0
- package/dist/hooks.d.ts +43 -0
- package/dist/hooks.js +1191 -0
- package/dist/hydration-info.d.ts +1 -0
- package/dist/hydration-info.js +31 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.js +17 -0
- package/dist/insights/attr-rules.d.ts +15 -0
- package/dist/insights/attr-rules.js +27 -0
- package/dist/insights/cpu.d.ts +82 -0
- package/dist/insights/cpu.js +177 -0
- package/dist/insights/fp-drift.d.ts +28 -0
- package/dist/insights/fp-drift.js +148 -0
- package/dist/insights/hole-segments.d.ts +26 -0
- package/dist/insights/hole-segments.js +50 -0
- package/dist/insights/html-diff.d.ts +25 -0
- package/dist/insights/html-diff.js +157 -0
- package/dist/insights/hydration-hazards.d.ts +36 -0
- package/dist/insights/hydration-hazards.js +136 -0
- package/dist/insights/hydration-status.d.ts +2 -0
- package/dist/insights/hydration-status.js +0 -0
- package/dist/insights/index.d.ts +14 -0
- package/dist/insights/index.js +12 -0
- package/dist/insights/page-assets.d.ts +211 -0
- package/dist/insights/page-assets.js +608 -0
- package/dist/insights/page-insights.d.ts +749 -0
- package/dist/insights/page-insights.js +2157 -0
- package/dist/insights/session-data.d.ts +108 -0
- package/dist/insights/session-data.js +0 -0
- package/dist/insights/session-insights.d.ts +121 -0
- package/dist/insights/session-insights.js +548 -0
- package/dist/insights/switch.d.ts +53 -0
- package/dist/insights/switch.js +91 -0
- package/dist/insights/testing-version.d.ts +19 -0
- package/dist/insights/testing-version.js +21 -0
- package/dist/insights/third-party.d.ts +75 -0
- package/dist/insights/third-party.js +160 -0
- package/dist/internal-instruments.d.ts +13 -0
- package/dist/internal-instruments.js +12 -0
- package/dist/internal-reconcile.d.ts +3 -0
- package/dist/internal-reconcile.js +3 -0
- package/dist/internal-register.d.ts +7 -0
- package/dist/internal-register.js +7 -0
- package/dist/internal-server.d.ts +7 -0
- package/dist/internal-server.js +7 -0
- package/dist/internal.d.ts +13 -0
- package/dist/internal.js +13 -0
- package/dist/island-graph.d.ts +36 -0
- package/dist/island-graph.js +89 -0
- package/dist/keep-fallback-marker.d.ts +7 -0
- package/dist/keep-fallback-marker.js +9 -0
- package/dist/keep-fallback.d.ts +13 -0
- package/dist/keep-fallback.js +39 -0
- package/dist/kit-paths.d.ts +2 -0
- package/dist/kit-paths.js +39 -0
- package/dist/late-region-registry.d.ts +40 -0
- package/dist/late-region-registry.js +36 -0
- package/dist/live-transport.d.ts +57 -0
- package/dist/live-transport.js +145 -0
- package/dist/markup.d.ts +4 -0
- package/dist/markup.js +4 -0
- package/dist/own-package.d.ts +15 -0
- package/dist/own-package.js +20 -0
- package/dist/page-defer.d.ts +33 -0
- package/dist/page-defer.js +35 -0
- package/dist/page-facts-script.d.ts +7 -0
- package/dist/page-facts-script.js +9 -0
- package/dist/page-seed-registry.d.ts +72 -0
- package/dist/page-seed-registry.js +31 -0
- package/dist/plugin/capability.d.ts +14 -0
- package/dist/plugin/capability.js +44 -0
- package/dist/plugin/client.d.ts +39 -0
- package/dist/plugin/client.js +6 -0
- package/dist/plugin/css.d.ts +3 -0
- package/dist/plugin/css.js +54 -0
- package/dist/plugin/facts.d.ts +42 -0
- package/dist/plugin/facts.js +37 -0
- package/dist/plugin/hooks.d.ts +33 -0
- package/dist/plugin/hooks.js +38 -0
- package/dist/plugin/index.d.ts +127 -0
- package/dist/plugin/index.js +26 -0
- package/dist/plugin/routes.d.ts +32 -0
- package/dist/plugin/routes.js +35 -0
- package/dist/plugin/server.d.ts +27 -0
- package/dist/plugin/server.js +92 -0
- package/dist/plugin/standard-schema.d.ts +27 -0
- package/dist/plugin/standard-schema.js +0 -0
- package/dist/plugin/testing.d.ts +13 -0
- package/dist/plugin/testing.js +54 -0
- package/dist/plugin/utils.d.ts +13 -0
- package/dist/plugin/utils.js +19 -0
- package/dist/portable-form.d.ts +22 -0
- package/dist/portable-form.js +52 -0
- package/dist/preference.d.ts +35 -0
- package/dist/preference.js +84 -0
- package/dist/preload.d.ts +1 -0
- package/dist/preload.js +21 -0
- package/dist/ref-watch.d.ts +31 -0
- package/dist/ref-watch.js +66 -0
- package/dist/ref.d.ts +124 -0
- package/dist/ref.js +272 -0
- package/dist/region-brand.d.ts +8 -0
- package/dist/region-brand.js +10 -0
- package/dist/region-core.d.ts +2 -0
- package/dist/region-core.js +1 -0
- package/dist/region-snippet.d.ts +73 -0
- package/dist/region-snippet.js +351 -0
- package/dist/region.d.ts +127 -0
- package/dist/region.js +162 -0
- package/dist/request-event.d.ts +1 -0
- package/dist/request-event.js +37 -0
- package/dist/router-css.d.ts +39 -0
- package/dist/router-css.js +66 -0
- package/dist/runtime/app-transport.d.ts +2 -0
- package/dist/runtime/app-transport.js +13 -0
- package/dist/runtime/beacon.d.ts +271 -0
- package/dist/runtime/beacon.js +2190 -0
- package/dist/runtime/boot-link.d.ts +1 -0
- package/dist/runtime/boot-link.js +44 -0
- package/dist/runtime/client-hooks.d.ts +5 -0
- package/dist/runtime/client-hooks.js +22 -0
- package/dist/runtime/client-plugins.d.ts +8 -0
- package/dist/runtime/client-plugins.js +34 -0
- package/dist/runtime/concurrency.d.ts +12 -0
- package/dist/runtime/concurrency.js +29 -0
- package/dist/runtime/connected.d.ts +12 -0
- package/dist/runtime/connected.js +16 -0
- package/dist/runtime/context.d.ts +1 -0
- package/dist/runtime/context.js +19 -0
- package/dist/runtime/core.d.ts +15 -0
- package/dist/runtime/core.js +1173 -0
- package/dist/runtime/drift-watch.d.ts +9 -0
- package/dist/runtime/drift-watch.js +60 -0
- package/dist/runtime/entry-locations.d.ts +33 -0
- package/dist/runtime/entry-locations.js +119 -0
- package/dist/runtime/foreign-props.d.ts +8 -0
- package/dist/runtime/foreign-props.js +14 -0
- package/dist/runtime/form-continuity.d.ts +10 -0
- package/dist/runtime/form-continuity.js +107 -0
- package/dist/runtime/frame-nav.d.ts +36 -0
- package/dist/runtime/frame-nav.js +225 -0
- package/dist/runtime/frame-store.d.ts +62 -0
- package/dist/runtime/frame-store.js +214 -0
- package/dist/runtime/frames.d.ts +1 -0
- package/dist/runtime/frames.js +25 -0
- package/dist/runtime/full.d.ts +4 -0
- package/dist/runtime/full.js +32 -0
- package/dist/runtime/hash.d.ts +41 -0
- package/dist/runtime/hash.js +79 -0
- package/dist/runtime/hole-facts.d.ts +8 -0
- package/dist/runtime/hole-facts.js +57 -0
- package/dist/runtime/host-classes.d.ts +24 -0
- package/dist/runtime/host-classes.js +43 -0
- package/dist/runtime/hydrate-core.d.ts +101 -0
- package/dist/runtime/hydrate-core.js +605 -0
- package/dist/runtime/index.d.ts +2 -0
- package/dist/runtime/index.js +1 -0
- package/dist/runtime/interaction-replay.d.ts +11 -0
- package/dist/runtime/interaction-replay.js +70 -0
- package/dist/runtime/interaction.d.ts +33 -0
- package/dist/runtime/interaction.js +217 -0
- package/dist/runtime/island-graph-preload.d.ts +13 -0
- package/dist/runtime/island-graph-preload.js +99 -0
- package/dist/runtime/kit-boot.d.ts +29 -0
- package/dist/runtime/kit-boot.js +60 -0
- package/dist/runtime/kit-page-thread.svelte.d.ts +1 -0
- package/dist/runtime/kit-page-thread.svelte.js +116 -0
- package/dist/runtime/lake-anchors.d.ts +13 -0
- package/dist/runtime/lake-anchors.js +19 -0
- package/dist/runtime/lakes.d.ts +15 -0
- package/dist/runtime/lakes.js +212 -0
- package/dist/runtime/live.d.ts +3 -0
- package/dist/runtime/live.js +17 -0
- package/dist/runtime/load-scheduler.d.ts +53 -0
- package/dist/runtime/load-scheduler.js +317 -0
- package/dist/runtime/morph.d.ts +42 -0
- package/dist/runtime/morph.js +671 -0
- package/dist/runtime/nav-handle.d.ts +25 -0
- package/dist/runtime/nav-handle.js +71 -0
- package/dist/runtime/nav-hooks.d.ts +2 -0
- package/dist/runtime/nav-hooks.js +23 -0
- package/dist/runtime/nearest-attr.d.ts +4 -0
- package/dist/runtime/nearest-attr.js +16 -0
- package/dist/runtime/observe.d.ts +27 -0
- package/dist/runtime/observe.js +63 -0
- package/dist/runtime/own-cost.d.ts +9 -0
- package/dist/runtime/own-cost.js +35 -0
- package/dist/runtime/ownership.d.ts +101 -0
- package/dist/runtime/ownership.js +115 -0
- package/dist/runtime/page-cache.d.ts +23 -0
- package/dist/runtime/page-cache.js +74 -0
- package/dist/runtime/page-defer.d.ts +14 -0
- package/dist/runtime/page-defer.js +103 -0
- package/dist/runtime/parse-html.d.ts +40 -0
- package/dist/runtime/parse-html.js +81 -0
- package/dist/runtime/reconcile.d.ts +41 -0
- package/dist/runtime/reconcile.js +194 -0
- package/dist/runtime/region-attrs.d.ts +95 -0
- package/dist/runtime/region-attrs.js +153 -0
- package/dist/runtime/region-endpoint-url.d.ts +76 -0
- package/dist/runtime/region-endpoint-url.js +169 -0
- package/dist/runtime/region-ids.d.ts +8 -0
- package/dist/runtime/region-ids.js +33 -0
- package/dist/runtime/remote-seeds.d.ts +2 -0
- package/dist/runtime/remote-seeds.js +21 -0
- package/dist/runtime/render-blocking.d.ts +2 -0
- package/dist/runtime/render-blocking.js +30 -0
- package/dist/runtime/restore.d.ts +34 -0
- package/dist/runtime/restore.js +390 -0
- package/dist/runtime/router-nav.d.ts +63 -0
- package/dist/runtime/router-nav.js +740 -0
- package/dist/runtime/router.d.ts +201 -0
- package/dist/runtime/router.js +593 -0
- package/dist/runtime/schedule.d.ts +49 -0
- package/dist/runtime/schedule.js +256 -0
- package/dist/runtime/seeds.d.ts +50 -0
- package/dist/runtime/seeds.js +208 -0
- package/dist/runtime/session.d.ts +52 -0
- package/dist/runtime/session.js +130 -0
- package/dist/runtime/sidecar.d.ts +3 -0
- package/dist/runtime/sidecar.js +56 -0
- package/dist/runtime/slots.d.ts +183 -0
- package/dist/runtime/slots.js +44 -0
- package/dist/runtime/spa-cacheable.d.ts +7 -0
- package/dist/runtime/spa-cacheable.js +18 -0
- package/dist/runtime/speculate-hint.d.ts +1 -0
- package/dist/runtime/speculate-hint.js +35 -0
- package/dist/runtime/svelte-warnings.d.ts +28 -0
- package/dist/runtime/svelte-warnings.js +71 -0
- package/dist/runtime/wire-classes.d.ts +3 -0
- package/dist/runtime/wire-classes.js +69 -0
- package/dist/runtime/wire-format.d.ts +7 -0
- package/dist/runtime/wire-format.js +22 -0
- package/dist/script.d.ts +134 -0
- package/dist/script.js +184 -0
- package/dist/seed-refs.d.ts +105 -0
- package/dist/seed-refs.js +487 -0
- package/dist/server/capability-lifetime.d.ts +28 -0
- package/dist/server/capability-lifetime.js +31 -0
- package/dist/server/dead-kit-resolves.d.ts +1 -0
- package/dist/server/dead-kit-resolves.js +39 -0
- package/dist/server/document-assembly.d.ts +30 -0
- package/dist/server/document-assembly.js +26 -0
- package/dist/server/document-tail.d.ts +113 -0
- package/dist/server/document-tail.js +208 -0
- package/dist/server/endpoint.d.ts +51 -0
- package/dist/server/endpoint.js +90 -0
- package/dist/server/entry-location.d.ts +8 -0
- package/dist/server/entry-location.js +29 -0
- package/dist/server/fingerprint.d.ts +1 -0
- package/dist/server/fingerprint.js +25 -0
- package/dist/server/head-presence.d.ts +45 -0
- package/dist/server/head-presence.js +156 -0
- package/dist/server/hmac.d.ts +38 -0
- package/dist/server/hmac.js +89 -0
- package/dist/server/hole-graph.d.ts +7 -0
- package/dist/server/hole-graph.js +71 -0
- package/dist/server/hole-urls.d.ts +3 -0
- package/dist/server/hole-urls.js +76 -0
- package/dist/server/html-scan.d.ts +19 -0
- package/dist/server/html-scan.js +60 -0
- package/dist/server/kit-context.d.ts +78 -0
- package/dist/server/kit-context.js +110 -0
- package/dist/server/late-wire.d.ts +22 -0
- package/dist/server/late-wire.js +28 -0
- package/dist/server/page-facts.d.ts +25 -0
- package/dist/server/page-facts.js +138 -0
- package/dist/server/page-seed.d.ts +33 -0
- package/dist/server/page-seed.js +60 -0
- package/dist/server/page-stream.d.ts +55 -0
- package/dist/server/page-stream.js +121 -0
- package/dist/server/payload.d.ts +6 -0
- package/dist/server/payload.js +22 -0
- package/dist/server/personal-response.d.ts +6 -0
- package/dist/server/personal-response.js +13 -0
- package/dist/server/props-wire.d.ts +56 -0
- package/dist/server/props-wire.js +178 -0
- package/dist/server/rate-limit.d.ts +22 -0
- package/dist/server/rate-limit.js +63 -0
- package/dist/server/region-css.d.ts +5 -0
- package/dist/server/region-css.js +30 -0
- package/dist/server/region-endpoint.d.ts +35 -0
- package/dist/server/region-endpoint.js +142 -0
- package/dist/server/region-props.d.ts +6 -0
- package/dist/server/region-props.js +44 -0
- package/dist/server/remote-seed-gate.d.ts +50 -0
- package/dist/server/remote-seed-gate.js +66 -0
- package/dist/server/render-cache.d.ts +26 -0
- package/dist/server/render-cache.js +51 -0
- package/dist/server/render-page.d.ts +51 -0
- package/dist/server/render-page.js +176 -0
- package/dist/server/render-region-html.d.ts +2 -0
- package/dist/server/render-region-html.js +19 -0
- package/dist/server/request-stats.d.ts +174 -0
- package/dist/server/request-stats.js +54 -0
- package/dist/server/reversible.d.ts +83 -0
- package/dist/server/reversible.js +994 -0
- package/dist/server/seed-shape.d.ts +22 -0
- package/dist/server/seed-shape.js +24 -0
- package/dist/server/shared-cache.d.ts +35 -0
- package/dist/server/shared-cache.js +104 -0
- package/dist/server/signing-key.d.ts +11 -0
- package/dist/server/signing-key.js +47 -0
- package/dist/server/sized-lru.d.ts +20 -0
- package/dist/server/sized-lru.js +68 -0
- package/dist/server/split-regions.d.ts +81 -0
- package/dist/server/split-regions.js +368 -0
- package/dist/server/stream-regions.d.ts +5 -0
- package/dist/server/stream-regions.js +36 -0
- package/dist/shared-state.d.ts +7 -0
- package/dist/shared-state.js +152 -0
- package/dist/shims/app-environment.d.ts +4 -0
- package/dist/shims/app-environment.js +6 -0
- package/dist/shims/app-navigation.d.ts +33 -0
- package/dist/shims/app-navigation.js +119 -0
- package/dist/shims/app-paths.d.ts +6 -0
- package/dist/shims/app-paths.js +18 -0
- package/dist/shims/app-state.svelte.d.ts +23 -0
- package/dist/shims/app-state.svelte.js +50 -0
- package/dist/shims/app-stores.d.ts +21 -0
- package/dist/shims/app-stores.js +54 -0
- package/dist/shims/kit-bridge.d.ts +29 -0
- package/dist/shims/kit-bridge.js +7 -0
- package/dist/shims/kit-remote/client-stub.d.ts +27 -0
- package/dist/shims/kit-remote/client-stub.js +43 -0
- package/dist/shims/kit-remote/paths-internal-stub.d.ts +3 -0
- package/dist/shims/kit-remote/paths-internal-stub.js +5 -0
- package/dist/shims/kit-remote/remote-cache.d.ts +49 -0
- package/dist/shims/kit-remote/remote-cache.js +73 -0
- package/dist/shims/kit-remote/state-stub.d.ts +8 -0
- package/dist/shims/kit-remote/state-stub.js +8 -0
- package/dist/shims/page-store.svelte.d.ts +39 -0
- package/dist/shims/page-store.svelte.js +77 -0
- package/dist/source.d.ts +29 -0
- package/dist/source.js +87 -0
- package/dist/store-transport.d.ts +86 -0
- package/dist/store-transport.js +229 -0
- package/dist/tool-fetches.d.ts +5 -0
- package/dist/tool-fetches.js +41 -0
- package/dist/transport.d.ts +48 -0
- package/dist/transport.js +181 -0
- package/dist/unscoped-css.d.ts +26 -0
- package/dist/unscoped-css.js +53 -0
- package/dist/vite/dev-maps.d.ts +33 -0
- package/dist/vite/dev-maps.js +140 -0
- package/dist/vite/index.d.ts +19 -0
- package/dist/vite/index.js +820 -0
- package/dist/vite/kit-dirs.d.ts +7 -0
- package/dist/vite/kit-dirs.js +67 -0
- package/dist/vite/late-island.d.ts +25 -0
- package/dist/vite/late-island.js +33 -0
- package/dist/vite/module-map.d.ts +8 -0
- package/dist/vite/module-map.js +144 -0
- package/dist/vite/options.d.ts +208 -0
- package/dist/vite/options.js +74 -0
- package/dist/vite/package-files.d.ts +3 -0
- package/dist/vite/package-files.js +84 -0
- package/dist/vite/paths.d.ts +45 -0
- package/dist/vite/paths.js +112 -0
- package/dist/vite/plugin-api.d.ts +166 -0
- package/dist/vite/plugin-api.js +212 -0
- package/dist/vite/profiler-maps.d.ts +23 -0
- package/dist/vite/profiler-maps.js +178 -0
- package/dist/vite/server-sourcemaps.d.ts +8 -0
- package/dist/vite/server-sourcemaps.js +80 -0
- package/dist/vite/sourcemaps.d.ts +18 -0
- package/dist/vite/sourcemaps.js +80 -0
- package/dist/vite/style-preprocess.d.ts +2 -0
- package/dist/vite/style-preprocess.js +96 -0
- package/package.json +180 -6
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function is_script_request(id: string): boolean;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// src/compiler/script-request.ts
|
|
2
|
+
/**
|
|
3
|
+
* Is this module id a request for the module's SCRIPT? The query decides. vite-plugin-svelte serves
|
|
4
|
+
* a component's extracted CSS as `Foo.svelte?svelte&type=style&lang.css`, and Vite's `?raw`, `?url`,
|
|
5
|
+
* `?inline`, `?worker` are not the module's code either. Passes that strip the query before an
|
|
6
|
+
* extension test took those for the component: the barrel rewrite ran the Svelte parser over plain
|
|
7
|
+
* CSS, threw, and reported every component with a `<style>` as skipped (3,233 false warnings in one
|
|
8
|
+
* production build, burying the real ones). A cache query (`?v=123`, `?t=…`) or ogygia's own
|
|
9
|
+
* (`?og-region`) is still the script. String scanning, no regex: it runs for every module.
|
|
10
|
+
*/
|
|
11
|
+
/** Vite's query flags whose payload is not the module's script */
|
|
12
|
+
const NON_SCRIPT_FLAGS = /* @__PURE__ */ new Set([
|
|
13
|
+
"raw",
|
|
14
|
+
"url",
|
|
15
|
+
"inline",
|
|
16
|
+
"worker",
|
|
17
|
+
"sharedworker",
|
|
18
|
+
"direct"
|
|
19
|
+
]);
|
|
20
|
+
const SCRIPT_LANGS = /* @__PURE__ */ new Set([
|
|
21
|
+
"js",
|
|
22
|
+
"ts",
|
|
23
|
+
"jsx",
|
|
24
|
+
"tsx",
|
|
25
|
+
"mjs",
|
|
26
|
+
"cjs",
|
|
27
|
+
"mts",
|
|
28
|
+
"cts"
|
|
29
|
+
]);
|
|
30
|
+
function is_script_request(id) {
|
|
31
|
+
const q = id.indexOf("?");
|
|
32
|
+
if (q === -1) return true;
|
|
33
|
+
const end = id.indexOf("#", q);
|
|
34
|
+
for (const part of id.slice(q + 1, end === -1 ? void 0 : end).split("&")) {
|
|
35
|
+
const eq = part.indexOf("=");
|
|
36
|
+
const key = eq === -1 ? part : part.slice(0, eq);
|
|
37
|
+
if (NON_SCRIPT_FLAGS.has(key)) return false;
|
|
38
|
+
if (key === "type" && part.slice(eq + 1) !== "script") return false;
|
|
39
|
+
if (key.startsWith("lang.") && !SCRIPT_LANGS.has(key.slice(5))) return false;
|
|
40
|
+
}
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
export { is_script_request };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { SetContextOptions } from "./context-registry.js";
|
|
2
|
+
/** Serialize a context value for the DOM — same codec as island props (one hub key). */
|
|
3
|
+
export declare function serialize_context(value: unknown): string;
|
|
4
|
+
export declare function serialize_provided_context(map: Map<string, unknown>): string | null;
|
|
5
|
+
/**
|
|
6
|
+
* Walk up from an island being hydrated, collecting every `<ogygia-provide>` above it (nearest wins)
|
|
7
|
+
* into one Map, then fold in the single page-level `<script data-ogygia-provide-page>` marker as the
|
|
8
|
+
* ROOT (lowest priority). ogygia seeds `hydrate(…, { context })` with the Map, so a child island's own
|
|
9
|
+
* `getContext('key')` — unchanged — reads a layout's context across the island-root split on a
|
|
10
|
+
* csr=false page.
|
|
11
|
+
*
|
|
12
|
+
* Two providers feed it: a `<Provide>` component (scoped, walked up — nesting/shadowing correct), and
|
|
13
|
+
* the drop-in `setContext` (page marker — one flat root the whole page shares, for existing layouts
|
|
14
|
+
* that just import `setContext` from `ogygia`). Scoped beats root on the same key. Undefined when
|
|
15
|
+
* neither exists (the common case: nothing to seed, no cost). Same decode codec as island props (a
|
|
16
|
+
* `[ogygia.wire]` value revives to its one live instance).
|
|
17
|
+
*/
|
|
18
|
+
export declare function collect_provided_context(start: Element | null): Map<string, unknown> | undefined;
|
|
19
|
+
/** A typed context handle: callable to make a `<Provide>` entry, `.get()` to read (typed). */
|
|
20
|
+
export interface Context<T> {
|
|
21
|
+
/** `theme('dark')` → `{ theme: 'dark' }` — an entry for `<Provide values={[ … ]}>`. */
|
|
22
|
+
(value: T): Record<string, unknown>;
|
|
23
|
+
/** Typed read — plain `getContext(key)` under the hood (seeded across islands), or the default. */
|
|
24
|
+
get(): T | undefined;
|
|
25
|
+
/** The underlying string key, for `getContext(theme.key)` interop. */
|
|
26
|
+
readonly key: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Typed sugar over a string context key, shared with plain `getContext`. Callable to produce a
|
|
30
|
+
* `<Provide>` entry, `.get()` to read (typed). The key is the same string plain `getContext` uses, so
|
|
31
|
+
* typed and untyped code read the same context. An optional default is returned when nothing is
|
|
32
|
+
* provided above.
|
|
33
|
+
*
|
|
34
|
+
* ```ts
|
|
35
|
+
* export const theme = createContext<'light' | 'dark'>('theme', 'light');
|
|
36
|
+
* // provide: <Provide values={[ theme('dark') ]}>…</Provide>
|
|
37
|
+
* // read: theme.get() // typed
|
|
38
|
+
* // getContext('theme') // untyped — same key, same value
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export declare function createContext<T>(key: string, defaultValue?: T): Context<T>;
|
|
42
|
+
/**
|
|
43
|
+
* Drop-in `setContext` — swap `import { setContext } from 'svelte'` for `from 'ogygia'` and an
|
|
44
|
+
* existing csr=false layout's context reaches child islands with NO other change.
|
|
45
|
+
*
|
|
46
|
+
* It does exactly what Svelte's does (sets context for same-root descendants + the SSR-nested tree),
|
|
47
|
+
* AND on the server records the value so the handle can emit one page-level marker every island seeds
|
|
48
|
+
* from — closing the gap where a plain `setContext` shows up on the server but is gone on the client
|
|
49
|
+
* (child islands are separate hydration roots). Only string keys bridge (they must serialize and be
|
|
50
|
+
* read by `getContext('key')`); a symbol key is Svelte-only, same-root, no bridge.
|
|
51
|
+
*
|
|
52
|
+
* GRANULARITY: the optional third argument is the explicit marker — `{ islands: false }` keeps a key
|
|
53
|
+
* host-native (same-root context works, nothing serializes). The default bridges: a missing key in an
|
|
54
|
+
* island is a broken app, extra bytes are not. Ogygia never infers readership from `getContext` call
|
|
55
|
+
* sites (aliased imports and wrapper modules would make any scan miss reads — the fatal direction).
|
|
56
|
+
*
|
|
57
|
+
* This is the FLAT page root: every island on the page inherits it. For scoped/shadowed context use
|
|
58
|
+
* `<Provide>`, which wraps its subtree and beats the root on the same key.
|
|
59
|
+
*/
|
|
60
|
+
export declare function setContext<T>(key: unknown, value: T, opts?: SetContextOptions): T;
|
|
61
|
+
/**
|
|
62
|
+
* Kept for ABI: the build still emits a registration call for each `createContext(...)` export (that
|
|
63
|
+
* used to tag keyless handles by `module#export`). Keys are explicit now, so this is a no-op.
|
|
64
|
+
*/
|
|
65
|
+
export declare function __tag_context(): void;
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import { batch } from "./ref-watch.js";
|
|
2
|
+
import { REF_WIRE_KEY, ref_reducer, ref_reviver } from "./ref.js";
|
|
3
|
+
import { register_wire_kind } from "./live-transport.js";
|
|
4
|
+
import { register_derived_kind, register_store_kind } from "./store-transport.js";
|
|
5
|
+
import { register_snippet_kind } from "./region-snippet.js";
|
|
6
|
+
import { is_branded_fn, register_fn_kind } from "./fn-transport.js";
|
|
7
|
+
import { boundary_problems, format_boundary_finding } from "./boundary.js";
|
|
8
|
+
import { PAGE_CTX_MARKER, record_ctx } from "./context-registry.js";
|
|
9
|
+
import { escape_script_text } from "./escape.js";
|
|
10
|
+
import { getContext, setContext as setContext$1 } from "svelte";
|
|
11
|
+
import { DEV } from "esm-env";
|
|
12
|
+
import { parse, stringify } from "devalue";
|
|
13
|
+
// src/context-bridge.ts
|
|
14
|
+
/**
|
|
15
|
+
* Cross-island context — one bridge, plain `getContext`.
|
|
16
|
+
*
|
|
17
|
+
* Component trees break at every island boundary; the DOM tree does not. A `<Provide values={…}>`
|
|
18
|
+
* writes its values into the DOM (serialized with the SAME codec as island props), and ogygia seeds
|
|
19
|
+
* each island's `hydrate({ context })` from the providers above it — so a child island's own
|
|
20
|
+
* `getContext('key')`, unchanged, reads a (csr=false) layout's context across the island-root split.
|
|
21
|
+
* A `[ogygia.wire]` value resolves to the one live instance (shared + reactive); a plain value is a
|
|
22
|
+
* per-consumer snapshot.
|
|
23
|
+
*
|
|
24
|
+
* `createContext(key)` is optional TYPED sugar over the same string key — callable to make a
|
|
25
|
+
* `<Provide>` entry, `.get()` to read (typed). Nothing DOM-specific on the consumer side.
|
|
26
|
+
*/
|
|
27
|
+
function ensure_ctx_kinds() {
|
|
28
|
+
register_wire_kind();
|
|
29
|
+
register_store_kind();
|
|
30
|
+
register_snippet_kind();
|
|
31
|
+
register_fn_kind();
|
|
32
|
+
register_derived_kind();
|
|
33
|
+
}
|
|
34
|
+
/** The `<Provide>` seam carries classes, stores AND snippets (a snippet freezes/travels live). */
|
|
35
|
+
const PROVIDE_FAMILIES = /* @__PURE__ */ new Set([
|
|
36
|
+
"wire",
|
|
37
|
+
"store",
|
|
38
|
+
"snippet",
|
|
39
|
+
"fn",
|
|
40
|
+
"derived"
|
|
41
|
+
]);
|
|
42
|
+
/** The drop-in page-marker seam deliberately EXCLUDES snippets: there, a bare function must
|
|
43
|
+
* THROW (and be dropped with a dev explanation) rather than be silently frozen as one. */
|
|
44
|
+
const BRIDGE_FAMILIES = /* @__PURE__ */ new Set([
|
|
45
|
+
"wire",
|
|
46
|
+
"store",
|
|
47
|
+
"fn",
|
|
48
|
+
"derived"
|
|
49
|
+
]);
|
|
50
|
+
/** Serialize a context value for the DOM — same codec as island props (one hub key). */
|
|
51
|
+
function serialize_context(value) {
|
|
52
|
+
ensure_ctx_kinds();
|
|
53
|
+
return escape_script_text(stringify(value, { [REF_WIRE_KEY]: ref_reducer(PROVIDE_FAMILIES) }));
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Serialize for the drop-in `setContext` page marker WITHOUT the region-snippet reducer. That reducer
|
|
57
|
+
* treats every function as a snippet (snippets are unbranded functions), which would silently turn a
|
|
58
|
+
* `setContext('trackPageView', fn)` — or a class method — into a bogus snippet instead of failing.
|
|
59
|
+
* Here a function must THROW so the offending value gets dropped (see below). Transportables
|
|
60
|
+
* (`[ogygia.wire]`) and stores (auto-wired: value crosses, islands reunite to one live instance)
|
|
61
|
+
* cross. A snippet in context is a `<Provide>` concern, not this drop-in path.
|
|
62
|
+
*/
|
|
63
|
+
function stringify_bridgeable(value) {
|
|
64
|
+
ensure_ctx_kinds();
|
|
65
|
+
return escape_script_text(stringify(value, { [REF_WIRE_KEY]: ref_reducer(BRIDGE_FAMILIES) }));
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Serialize the drop-in `setContext` page-root bag for the DOM marker. A layout may `setContext` a
|
|
69
|
+
* FUNCTION (e.g. `trackPageView`) or a DOM-holding object — values that genuinely can't cross an
|
|
70
|
+
* island boundary. Rather than crash the page (or bridge a broken value), drop the offenders
|
|
71
|
+
* key-by-key and bridge the rest; in DEV each drop is explained by the boundary classifier (key +
|
|
72
|
+
* path + what to do), so a missing context inside an island is never a mystery. Returns null if
|
|
73
|
+
* nothing serializable remains. The happy path (all serializable) is a single `stringify`.
|
|
74
|
+
*/
|
|
75
|
+
/** DEV threshold for the page-marker payload — islands ship context into every page's HTML. */
|
|
76
|
+
const CTX_SIZE_WARN_BYTES = 32768;
|
|
77
|
+
function serialize_provided_context(map) {
|
|
78
|
+
const obj = {};
|
|
79
|
+
for (const [k, v] of map) obj[k] = v;
|
|
80
|
+
try {
|
|
81
|
+
const payload = stringify_bridgeable(obj);
|
|
82
|
+
if (DEV && payload.length > CTX_SIZE_WARN_BYTES) warn_ctx_size(map, payload.length);
|
|
83
|
+
return payload;
|
|
84
|
+
} catch {
|
|
85
|
+
const safe = {};
|
|
86
|
+
for (const k in obj) try {
|
|
87
|
+
stringify_bridgeable({ [k]: obj[k] });
|
|
88
|
+
safe[k] = obj[k];
|
|
89
|
+
if (DEV) warn_boundary(k, obj[k], false);
|
|
90
|
+
} catch {
|
|
91
|
+
if (DEV) warn_boundary(k, obj[k], true);
|
|
92
|
+
}
|
|
93
|
+
return Object.keys(safe).length ? stringify_bridgeable(safe) : null;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
/** DEV: the page marker is heavy — name the biggest keys so the fix is obvious (mark them
|
|
97
|
+
* { islands: false }, or slim the value). Sizes are per-key serialized lengths. */
|
|
98
|
+
function warn_ctx_size(map, total) {
|
|
99
|
+
const sizes = [];
|
|
100
|
+
for (const [k, v] of map) try {
|
|
101
|
+
sizes.push([k, stringify_bridgeable({ [k]: v }).length]);
|
|
102
|
+
} catch {}
|
|
103
|
+
sizes.sort((a, b) => b[1] - a[1]);
|
|
104
|
+
const top = sizes.slice(0, 3).map(([k, n]) => `'${k}' ~${(n / 1024).toFixed(1)}kB`).join(", ");
|
|
105
|
+
console.warn(`[ogygia] the island context marker is ${(total / 1024).toFixed(1)}kB — it ships in every page's HTML. Biggest keys: ${top}. Slim the values, or mark host-only keys with setContext(key, value, { islands: false }).`);
|
|
106
|
+
}
|
|
107
|
+
/** DEV: explain a dropped (or degraded-but-bridged) context key via the classifier. */
|
|
108
|
+
function warn_boundary(key, value, dropped) {
|
|
109
|
+
const problems = boundary_problems(value, key);
|
|
110
|
+
if (dropped && problems.length === 0) {
|
|
111
|
+
console.warn(`[ogygia] context '${key}' could not be serialized for islands and was dropped.`);
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
for (const f of problems) if (dropped || f.kind === "warn") console.warn(format_boundary_finding(key, f));
|
|
115
|
+
}
|
|
116
|
+
/** Decode one serialized provider payload; a corrupt payload yields nothing (never breaks hydration). */
|
|
117
|
+
function parse_ctx(text) {
|
|
118
|
+
if (!text) return void 0;
|
|
119
|
+
ensure_ctx_kinds();
|
|
120
|
+
try {
|
|
121
|
+
return batch(() => parse(text, { [REF_WIRE_KEY]: ref_reviver(true) }));
|
|
122
|
+
} catch {
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Walk up from an island being hydrated, collecting every `<ogygia-provide>` above it (nearest wins)
|
|
128
|
+
* into one Map, then fold in the single page-level `<script data-ogygia-provide-page>` marker as the
|
|
129
|
+
* ROOT (lowest priority). ogygia seeds `hydrate(…, { context })` with the Map, so a child island's own
|
|
130
|
+
* `getContext('key')` — unchanged — reads a layout's context across the island-root split on a
|
|
131
|
+
* csr=false page.
|
|
132
|
+
*
|
|
133
|
+
* Two providers feed it: a `<Provide>` component (scoped, walked up — nesting/shadowing correct), and
|
|
134
|
+
* the drop-in `setContext` (page marker — one flat root the whole page shares, for existing layouts
|
|
135
|
+
* that just import `setContext` from `ogygia`). Scoped beats root on the same key. Undefined when
|
|
136
|
+
* neither exists (the common case: nothing to seed, no cost). Same decode codec as island props (a
|
|
137
|
+
* `[ogygia.wire]` value revives to its one live instance).
|
|
138
|
+
*/
|
|
139
|
+
function collect_provided_context(start) {
|
|
140
|
+
let el = start;
|
|
141
|
+
let map;
|
|
142
|
+
const fold = (values) => {
|
|
143
|
+
if (!values) return;
|
|
144
|
+
map ??= /* @__PURE__ */ new Map();
|
|
145
|
+
for (const k in values) if (!map.has(k)) map.set(k, values[k]);
|
|
146
|
+
};
|
|
147
|
+
while (el) {
|
|
148
|
+
if (el.tagName === "OGYGIA-PROVIDE") fold(parse_ctx(el.querySelector(":scope > script[data-ogygia-provide]")?.textContent));
|
|
149
|
+
el = el.parentElement;
|
|
150
|
+
}
|
|
151
|
+
if (typeof document !== "undefined") fold(page_ctx());
|
|
152
|
+
return map;
|
|
153
|
+
}
|
|
154
|
+
/** The page's context root, found and parsed ONCE per document (every island's hydrate asks; a
|
|
155
|
+
* search of the whole DOM each time grew with the page). A router swap brings the next page's. */
|
|
156
|
+
let page_ctx_cache = null;
|
|
157
|
+
let page_ctx_reset = false;
|
|
158
|
+
function page_ctx() {
|
|
159
|
+
if (!page_ctx_reset) {
|
|
160
|
+
page_ctx_reset = true;
|
|
161
|
+
document.addEventListener("og:after-swap", () => page_ctx_cache = null);
|
|
162
|
+
}
|
|
163
|
+
return (page_ctx_cache ??= { value: parse_ctx(document.querySelector(`script[${PAGE_CTX_MARKER}]`)?.textContent) }).value;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Typed sugar over a string context key, shared with plain `getContext`. Callable to produce a
|
|
167
|
+
* `<Provide>` entry, `.get()` to read (typed). The key is the same string plain `getContext` uses, so
|
|
168
|
+
* typed and untyped code read the same context. An optional default is returned when nothing is
|
|
169
|
+
* provided above.
|
|
170
|
+
*
|
|
171
|
+
* ```ts
|
|
172
|
+
* export const theme = createContext<'light' | 'dark'>('theme', 'light');
|
|
173
|
+
* // provide: <Provide values={[ theme('dark') ]}>…</Provide>
|
|
174
|
+
* // read: theme.get() // typed
|
|
175
|
+
* // getContext('theme') // untyped — same key, same value
|
|
176
|
+
* ```
|
|
177
|
+
*/
|
|
178
|
+
function createContext(key, defaultValue) {
|
|
179
|
+
const ctx = ((value) => ({ [key]: value }));
|
|
180
|
+
Object.defineProperty(ctx, "key", {
|
|
181
|
+
value: key,
|
|
182
|
+
enumerable: true
|
|
183
|
+
});
|
|
184
|
+
ctx.get = () => {
|
|
185
|
+
const v = getContext(key);
|
|
186
|
+
return v !== void 0 ? v : defaultValue;
|
|
187
|
+
};
|
|
188
|
+
return ctx;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Drop-in `setContext` — swap `import { setContext } from 'svelte'` for `from 'ogygia'` and an
|
|
192
|
+
* existing csr=false layout's context reaches child islands with NO other change.
|
|
193
|
+
*
|
|
194
|
+
* It does exactly what Svelte's does (sets context for same-root descendants + the SSR-nested tree),
|
|
195
|
+
* AND on the server records the value so the handle can emit one page-level marker every island seeds
|
|
196
|
+
* from — closing the gap where a plain `setContext` shows up on the server but is gone on the client
|
|
197
|
+
* (child islands are separate hydration roots). Only string keys bridge (they must serialize and be
|
|
198
|
+
* read by `getContext('key')`); a symbol key is Svelte-only, same-root, no bridge.
|
|
199
|
+
*
|
|
200
|
+
* GRANULARITY: the optional third argument is the explicit marker — `{ islands: false }` keeps a key
|
|
201
|
+
* host-native (same-root context works, nothing serializes). The default bridges: a missing key in an
|
|
202
|
+
* island is a broken app, extra bytes are not. Ogygia never infers readership from `getContext` call
|
|
203
|
+
* sites (aliased imports and wrapper modules would make any scan miss reads — the fatal direction).
|
|
204
|
+
*
|
|
205
|
+
* This is the FLAT page root: every island on the page inherits it. For scoped/shadowed context use
|
|
206
|
+
* `<Provide>`, which wraps its subtree and beats the root on the same key.
|
|
207
|
+
*/
|
|
208
|
+
function setContext(key, value, opts) {
|
|
209
|
+
if (typeof key === "string" && (typeof value !== "function" || is_branded_fn(value))) record_ctx(key, value, opts);
|
|
210
|
+
return setContext$1(key, value);
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Kept for ABI: the build still emits a registration call for each `createContext(...)` export (that
|
|
214
|
+
* used to tag keyless handles by `module#export`). Keys are explicit now, so this is a no-op.
|
|
215
|
+
*/
|
|
216
|
+
function __tag_context() {}
|
|
217
|
+
export { __tag_context, collect_provided_context, createContext, serialize_context, serialize_provided_context, setContext };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Server-side capture for ogygia's drop-in `setContext` (see `./set-context.ts`). A layout that calls
|
|
3
|
+
* `setContext('key', value)` (import swapped from `svelte` to `ogygia`) records the value HERE during
|
|
4
|
+
* SSR; the server handle reads the per-request bag and emits ONE page-level `<script
|
|
5
|
+
* data-ogygia-provide-page>` marker, which every island seeds its own `getContext('key')` from at
|
|
6
|
+
* hydrate. That's how a plain `setContext` in a csr=false layout reaches child islands (separate
|
|
7
|
+
* hydration roots) without a `<Provide>` in the template.
|
|
8
|
+
*
|
|
9
|
+
* Universal-safe by design: the recorder is a slot the SERVER installs (backed by an
|
|
10
|
+
* `AsyncLocalStorage` in `hooks.ts`), so `node:async_hooks` never enters the client bundle — on the
|
|
11
|
+
* client `record_ctx` is a no-op.
|
|
12
|
+
*/
|
|
13
|
+
type Recorder = (key: string, value: unknown) => void;
|
|
14
|
+
/** Server (`hooks.ts`) installs a request-scoped recorder. */
|
|
15
|
+
export declare function set_ctx_recorder(fn: Recorder | null): void;
|
|
16
|
+
/**
|
|
17
|
+
* Options a drop-in `setContext` may carry as its third argument. Svelte's own signature is
|
|
18
|
+
* two-arg, so existing code is untouched — the marker is strictly additive.
|
|
19
|
+
*/
|
|
20
|
+
export interface SetContextOptions {
|
|
21
|
+
/**
|
|
22
|
+
* GRANULARITY MARKER. `false` = this key is host-native: serve it to the same-root tree
|
|
23
|
+
* (Svelte context, unchanged) but never serialize it into the island page marker. Use it
|
|
24
|
+
* for values islands never read — a DOM-ref bag, a host-only callback, a large config
|
|
25
|
+
* object — so they cost nothing on the wire.
|
|
26
|
+
*
|
|
27
|
+
* DEFAULT is `true` (bridge): the safe direction. A missing key inside an island is a
|
|
28
|
+
* broken app; an extra bridged key is just bytes. Ogygia deliberately does NOT infer this
|
|
29
|
+
* from `getContext` call-sites — import aliasing (`import { getContext as x }`), wrapper
|
|
30
|
+
* modules, and custom context layers make any scan under-inclusive, and under-inclusion
|
|
31
|
+
* is the fatal direction. You mark; ogygia never guesses.
|
|
32
|
+
*/
|
|
33
|
+
islands?: boolean;
|
|
34
|
+
}
|
|
35
|
+
/** The drop-in `setContext` calls this — server records for the page bridge, client is a no-op.
|
|
36
|
+
* `opts.islands === false` skips recording: the key stays native-only (never serialized). */
|
|
37
|
+
export declare function record_ctx(key: string, value: unknown, opts?: SetContextOptions): void;
|
|
38
|
+
/** DOM marker the server emits (before `</body>`) and `collect_provided_context` reads. */
|
|
39
|
+
export declare const PAGE_CTX_MARKER = "data-ogygia-provide-page";
|
|
40
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// src/context-registry.ts
|
|
2
|
+
let recorder = null;
|
|
3
|
+
/** Server (`hooks.ts`) installs a request-scoped recorder. */
|
|
4
|
+
function set_ctx_recorder(fn) {
|
|
5
|
+
recorder = fn;
|
|
6
|
+
}
|
|
7
|
+
/** The drop-in `setContext` calls this — server records for the page bridge, client is a no-op.
|
|
8
|
+
* `opts.islands === false` skips recording: the key stays native-only (never serialized). */
|
|
9
|
+
function record_ctx(key, value, opts) {
|
|
10
|
+
if (opts?.islands === false) return;
|
|
11
|
+
recorder?.(key, value);
|
|
12
|
+
}
|
|
13
|
+
/** DOM marker the server emits (before `</body>`) and `collect_provided_context` reads. */
|
|
14
|
+
const PAGE_CTX_MARKER = "data-ogygia-provide-page";
|
|
15
|
+
export { PAGE_CTX_MARKER, record_ctx, set_ctx_recorder };
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mark the current subtree's hydration state. `true` = inside a hydrated island (nested islands
|
|
3
|
+
* degrade). `false` = a LAKE resets its subtree to "dead", so an island inside the lake self-
|
|
4
|
+
* hydrates again (the nearest-boundary rule — DESIGN.md).
|
|
5
|
+
*/
|
|
6
|
+
export declare function setNested(value?: boolean): void;
|
|
7
|
+
/**
|
|
8
|
+
* True when an ancestor island wrapper already marked the subtree. `getContext` returns `undefined`
|
|
9
|
+
* when no ancestor set it (a top-level island) — that absence is exactly "not nested".
|
|
10
|
+
*/
|
|
11
|
+
export declare function isNested(): boolean;
|
|
12
|
+
/** Mark the current subtree as opaque to Kit — a lake's inside (LakeBoundary). */
|
|
13
|
+
export declare function setInLake(): void;
|
|
14
|
+
/** True when the subtree is opaque to Kit (a lake's inside, or a held region's render). */
|
|
15
|
+
export declare function isInLake(): boolean;
|
|
16
|
+
/** Reset the live-snippet mark for the current subtree (an inline island inside a snippet). */
|
|
17
|
+
export declare function setInLiveSnippet(value: boolean): void;
|
|
18
|
+
/** True inside a live snippet's body (and not under an island it renders inline). */
|
|
19
|
+
export declare function isInLiveSnippet(): boolean;
|
|
20
|
+
/** Region.svelte marks the subtree of a server island it is rendering inline (nested). */
|
|
21
|
+
export declare function setHoleInline(): void;
|
|
22
|
+
/** Is this render a server island's component rendering INLINE (nested in an island)? */
|
|
23
|
+
export declare function isHoleInline(): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Does Kit hydrate THIS WHOLE DOCUMENT? The leaf page's effective csr is the single fact that decides
|
|
26
|
+
* it, so a `<Region>` reads it directly — no per-host context cascade. When true, every island (a
|
|
27
|
+
* csr=true page's own, a csr=false layout's chrome, a shared component's) degrades to a plain inline
|
|
28
|
+
* component that Kit hydrates. Server: the route is in the build-time csr=true set. Client: Kit
|
|
29
|
+
* shipped its bootstrap. Same fact on both legs → the inline/island choice can never desync at
|
|
30
|
+
* hydrate. (Replaces the old `CSR_TRUE_KEY` marker + `csr=false` reset, which only re-derived this
|
|
31
|
+
* number indirectly through the context cascade.)
|
|
32
|
+
*/
|
|
33
|
+
export declare function documentIsCsrTrue(error_render?: boolean): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* PUBLIC: is the current page an ogygia page (csr=false), as opposed to a csr=true page Kit hydrates
|
|
36
|
+
* whole? The inverse of {@link documentIsCsrTrue}, so it answers on BOTH legs with no requestEvent
|
|
37
|
+
* handling on the caller's side — server reads the request's route against the build-time csr set,
|
|
38
|
+
* client reads Kit's bootstrap. Meant for shared code (a store, a helper) that must branch on which
|
|
39
|
+
* world it runs in. Off-request on the server (a module init, a prerender helper with no page) there
|
|
40
|
+
* is no document to speak of, so it returns `false`.
|
|
41
|
+
*/
|
|
42
|
+
export declare function isOgygiaPage(): boolean;
|
|
43
|
+
/** The same fact from a route id in hand (the handle has the event): is this route's leaf page
|
|
44
|
+
* csr=true? A build-time answer — never a scan of the rendered document. */
|
|
45
|
+
export declare function route_is_csr_true(id: string | null | undefined): boolean;
|
|
46
|
+
/** The ERROR-page twin: does Kit hydrate this route's `+error.svelte`? Kit renders an error page
|
|
47
|
+
* with the layout branch only (the page node — and its `csr = false` — is dropped), so this reads
|
|
48
|
+
* the layouts' answer; a routeless response (no route matched) is the root layout's. */
|
|
49
|
+
export declare function error_route_is_csr_true(id: string | null | undefined): boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Claim an INLINE-rendered island's entry for this SSR request — true the first time, so the page
|
|
52
|
+
* stamps one `<meta name="ogygia-kit-island" content="<entry>">` per rendered island, however many
|
|
53
|
+
* instances render. The client wrapper's lazy component module reads the stamp before Kit hydrates
|
|
54
|
+
* (emit.ts `lazy_entry_source`): a stamped island's entry is imported, an unstamped one costs
|
|
55
|
+
* nothing. Client / no-request → false (nothing to stamp there).
|
|
56
|
+
*/
|
|
57
|
+
export declare function claim_kit_island(entry: string): boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Claim stylesheet hrefs for this SSR request, returning only the not-yet-claimed ones. A held
|
|
60
|
+
* region's component is server-picked, so its CSS is on no page stylesheet (Kit links CSS from the
|
|
61
|
+
* route's STATIC import graph — it never reads the rendered page). The region wrapper links it from
|
|
62
|
+
* the render pass instead, via `<svelte:head>`; claiming here dedupes so five `Feature` blocks on a
|
|
63
|
+
* page link their shared sheet once. Client / no-request → [] (SSR already linked them).
|
|
64
|
+
*/
|
|
65
|
+
export declare function claim_region_css(hrefs: string[]): string[];
|
|
66
|
+
/**
|
|
67
|
+
* Claim the single runtime-script slot for this SSR request. An island/server placement emits the
|
|
68
|
+
* runtime bootstrap so it hydrates even with the router off; when the router is on, the handle
|
|
69
|
+
* injects the same script into `<head>` (presence-checked) on pages that have no island to emit it.
|
|
70
|
+
* Client / no-request → false (SSR already emitted).
|
|
71
|
+
*/
|
|
72
|
+
export declare function claimRuntimeEmit(): boolean;
|
package/dist/context.js
ADDED
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { kit_hydrates_page } from "./runtime/kit-boot.js";
|
|
2
|
+
import { getContext, setContext } from "svelte";
|
|
3
|
+
import { BROWSER } from "esm-env";
|
|
4
|
+
import { getRequestEvent } from "virtual:ogygia/request-event";
|
|
5
|
+
import { csr_true_routes, error_csr_true_routes, root_layout_csr_true } from "virtual:ogygia/route-csr";
|
|
6
|
+
// src/context.ts
|
|
7
|
+
const NESTED_KEY = Symbol.for("ogygia.nested-island");
|
|
8
|
+
/**
|
|
9
|
+
* Mark the current subtree's hydration state. `true` = inside a hydrated island (nested islands
|
|
10
|
+
* degrade). `false` = a LAKE resets its subtree to "dead", so an island inside the lake self-
|
|
11
|
+
* hydrates again (the nearest-boundary rule — DESIGN.md).
|
|
12
|
+
*/
|
|
13
|
+
function setNested(value = true) {
|
|
14
|
+
setContext(NESTED_KEY, value);
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* True when an ancestor island wrapper already marked the subtree. `getContext` returns `undefined`
|
|
18
|
+
* when no ancestor set it (a top-level island) — that absence is exactly "not nested".
|
|
19
|
+
*/
|
|
20
|
+
function isNested() {
|
|
21
|
+
return getContext(NESTED_KEY) === true;
|
|
22
|
+
}
|
|
23
|
+
const LAKE_KEY = Symbol.for("ogygia.lake-subtree");
|
|
24
|
+
/** Mark the current subtree as opaque to Kit — a lake's inside (LakeBoundary). */
|
|
25
|
+
function setInLake() {
|
|
26
|
+
setContext(LAKE_KEY, true);
|
|
27
|
+
}
|
|
28
|
+
/** True when the subtree is opaque to Kit (a lake's inside, or a held region's render). */
|
|
29
|
+
function isInLake() {
|
|
30
|
+
return getContext(LAKE_KEY) === true;
|
|
31
|
+
}
|
|
32
|
+
const LIVE_SNIPPET_KEY = Symbol.for("ogygia.live-snippet");
|
|
33
|
+
/** Reset the live-snippet mark for the current subtree (an inline island inside a snippet). */
|
|
34
|
+
function setInLiveSnippet(value) {
|
|
35
|
+
setContext(LIVE_SNIPPET_KEY, value);
|
|
36
|
+
}
|
|
37
|
+
/** True inside a live snippet's body (and not under an island it renders inline). */
|
|
38
|
+
function isInLiveSnippet() {
|
|
39
|
+
return getContext(LIVE_SNIPPET_KEY) === true;
|
|
40
|
+
}
|
|
41
|
+
const HOLE_INLINE_KEY = Symbol.for("ogygia.hole-inline");
|
|
42
|
+
/** Region.svelte marks the subtree of a server island it is rendering inline (nested). */
|
|
43
|
+
function setHoleInline() {
|
|
44
|
+
setContext(HOLE_INLINE_KEY, true);
|
|
45
|
+
}
|
|
46
|
+
/** Is this render a server island's component rendering INLINE (nested in an island)? */
|
|
47
|
+
function isHoleInline() {
|
|
48
|
+
return getContext(HOLE_INLINE_KEY) === true;
|
|
49
|
+
}
|
|
50
|
+
/** Kit `route.id`, GROUP segments (`(app)`) stripped — mirrors the compiler's `normalize_route_id`
|
|
51
|
+
* so both sides match whether or not Kit keeps groups in `route.id`. Root → `/`. */
|
|
52
|
+
function normalize_route_id(id) {
|
|
53
|
+
return "/" + id.split("/").filter(Boolean).filter((s) => !(s.startsWith("(") && s.endsWith(")"))).join("/");
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Does Kit hydrate THIS WHOLE DOCUMENT? The leaf page's effective csr is the single fact that decides
|
|
57
|
+
* it, so a `<Region>` reads it directly — no per-host context cascade. When true, every island (a
|
|
58
|
+
* csr=true page's own, a csr=false layout's chrome, a shared component's) degrades to a plain inline
|
|
59
|
+
* component that Kit hydrates. Server: the route is in the build-time csr=true set. Client: Kit
|
|
60
|
+
* shipped its bootstrap. Same fact on both legs → the inline/island choice can never desync at
|
|
61
|
+
* hydrate. (Replaces the old `CSR_TRUE_KEY` marker + `csr=false` reset, which only re-derived this
|
|
62
|
+
* number indirectly through the context cascade.)
|
|
63
|
+
*/
|
|
64
|
+
function documentIsCsrTrue(error_render = false) {
|
|
65
|
+
if (BROWSER) return kit_hydrates_page();
|
|
66
|
+
try {
|
|
67
|
+
const event = getRequestEvent();
|
|
68
|
+
return error_render ? error_route_is_csr_true(event.route?.id) : route_is_csr_true(event.route?.id);
|
|
69
|
+
} catch {
|
|
70
|
+
return false;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* PUBLIC: is the current page an ogygia page (csr=false), as opposed to a csr=true page Kit hydrates
|
|
75
|
+
* whole? The inverse of {@link documentIsCsrTrue}, so it answers on BOTH legs with no requestEvent
|
|
76
|
+
* handling on the caller's side — server reads the request's route against the build-time csr set,
|
|
77
|
+
* client reads Kit's bootstrap. Meant for shared code (a store, a helper) that must branch on which
|
|
78
|
+
* world it runs in. Off-request on the server (a module init, a prerender helper with no page) there
|
|
79
|
+
* is no document to speak of, so it returns `false`.
|
|
80
|
+
*/
|
|
81
|
+
function isOgygiaPage() {
|
|
82
|
+
return !documentIsCsrTrue();
|
|
83
|
+
}
|
|
84
|
+
/** The same fact from a route id in hand (the handle has the event): is this route's leaf page
|
|
85
|
+
* csr=true? A build-time answer — never a scan of the rendered document. */
|
|
86
|
+
function route_is_csr_true(id) {
|
|
87
|
+
return id != null && csr_true_routes.has(normalize_route_id(id));
|
|
88
|
+
}
|
|
89
|
+
/** The ERROR-page twin: does Kit hydrate this route's `+error.svelte`? Kit renders an error page
|
|
90
|
+
* with the layout branch only (the page node — and its `csr = false` — is dropped), so this reads
|
|
91
|
+
* the layouts' answer; a routeless response (no route matched) is the root layout's. */
|
|
92
|
+
function error_route_is_csr_true(id) {
|
|
93
|
+
if (id == null) return root_layout_csr_true;
|
|
94
|
+
return error_csr_true_routes.has(normalize_route_id(id));
|
|
95
|
+
}
|
|
96
|
+
/** Per-request: only one `data-ogygia-runtime` script should be emitted (the first island). */
|
|
97
|
+
const runtime_claimed = /* @__PURE__ */ new WeakMap();
|
|
98
|
+
/** Per-request: stylesheet hrefs already linked for held regions rendered in this SSR pass. */
|
|
99
|
+
const region_css_claimed = /* @__PURE__ */ new WeakMap();
|
|
100
|
+
/** Per-request: island entries already stamped `<meta name="ogygia-kit-island">` in this pass. */
|
|
101
|
+
const kit_island_claimed = /* @__PURE__ */ new WeakMap();
|
|
102
|
+
/**
|
|
103
|
+
* Claim an INLINE-rendered island's entry for this SSR request — true the first time, so the page
|
|
104
|
+
* stamps one `<meta name="ogygia-kit-island" content="<entry>">` per rendered island, however many
|
|
105
|
+
* instances render. The client wrapper's lazy component module reads the stamp before Kit hydrates
|
|
106
|
+
* (emit.ts `lazy_entry_source`): a stamped island's entry is imported, an unstamped one costs
|
|
107
|
+
* nothing. Client / no-request → false (nothing to stamp there).
|
|
108
|
+
*/
|
|
109
|
+
function claim_kit_island(entry) {
|
|
110
|
+
if (!entry) return false;
|
|
111
|
+
try {
|
|
112
|
+
const event = getRequestEvent();
|
|
113
|
+
let seen = kit_island_claimed.get(event);
|
|
114
|
+
if (!seen) kit_island_claimed.set(event, seen = /* @__PURE__ */ new Set());
|
|
115
|
+
if (seen.has(entry)) return false;
|
|
116
|
+
seen.add(entry);
|
|
117
|
+
return true;
|
|
118
|
+
} catch {
|
|
119
|
+
return false;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Claim stylesheet hrefs for this SSR request, returning only the not-yet-claimed ones. A held
|
|
124
|
+
* region's component is server-picked, so its CSS is on no page stylesheet (Kit links CSS from the
|
|
125
|
+
* route's STATIC import graph — it never reads the rendered page). The region wrapper links it from
|
|
126
|
+
* the render pass instead, via `<svelte:head>`; claiming here dedupes so five `Feature` blocks on a
|
|
127
|
+
* page link their shared sheet once. Client / no-request → [] (SSR already linked them).
|
|
128
|
+
*/
|
|
129
|
+
function claim_region_css(hrefs) {
|
|
130
|
+
if (!hrefs.length) return [];
|
|
131
|
+
try {
|
|
132
|
+
const event = getRequestEvent();
|
|
133
|
+
let seen = region_css_claimed.get(event);
|
|
134
|
+
if (!seen) region_css_claimed.set(event, seen = /* @__PURE__ */ new Set());
|
|
135
|
+
const fresh = hrefs.filter((h) => !seen.has(h));
|
|
136
|
+
for (const h of fresh) seen.add(h);
|
|
137
|
+
return fresh;
|
|
138
|
+
} catch {
|
|
139
|
+
return [];
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Claim the single runtime-script slot for this SSR request. An island/server placement emits the
|
|
144
|
+
* runtime bootstrap so it hydrates even with the router off; when the router is on, the handle
|
|
145
|
+
* injects the same script into `<head>` (presence-checked) on pages that have no island to emit it.
|
|
146
|
+
* Client / no-request → false (SSR already emitted).
|
|
147
|
+
*/
|
|
148
|
+
function claimRuntimeEmit() {
|
|
149
|
+
try {
|
|
150
|
+
const event = getRequestEvent();
|
|
151
|
+
if (runtime_claimed.has(event)) return false;
|
|
152
|
+
runtime_claimed.set(event, true);
|
|
153
|
+
return true;
|
|
154
|
+
} catch {
|
|
155
|
+
return false;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
export { claimRuntimeEmit, claim_kit_island, claim_region_css, documentIsCsrTrue, error_route_is_csr_true, isHoleInline, isInLake, isInLiveSnippet, isNested, isOgygiaPage, route_is_csr_true, setHoleInline, setInLake, setInLiveSnippet, setNested };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** Runtime sets the region it is about to hydrate so a nested `get()` knows where to start walking. */
|
|
2
|
+
export declare function set_current_region(el: Element | null): void;
|
|
3
|
+
/** The region currently being hydrated (or null) — read by the context feature's client DOM walk. */
|
|
4
|
+
export declare function current_region(): Element | null;
|
|
5
|
+
export interface ForeignHydrate {
|
|
6
|
+
/** The MFE origin the island's entry was loaded from. */
|
|
7
|
+
origin: string;
|
|
8
|
+
/** The absolute entry URL — the island's identity for once-per-island warnings. */
|
|
9
|
+
entry: string;
|
|
10
|
+
}
|
|
11
|
+
/** Runtime marks the foreign island it is about to delegate-hydrate (null when done). */
|
|
12
|
+
export declare function set_foreign_hydrate(info: ForeignHydrate | null): void;
|
|
13
|
+
/** The foreign island currently hydrating (or null) — read by the page shims' dev warning. */
|
|
14
|
+
export declare function foreign_hydrate(): ForeignHydrate | null;
|