@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
package/dist/ref.js
ADDED
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
import { emit } from "./events/bus.js";
|
|
2
|
+
import { batch, notify, watch, watcher_count, watchers } from "./ref-watch.js";
|
|
3
|
+
// src/ref.ts
|
|
4
|
+
const DEVTOOLS = typeof __OGYGIA_DEVTOOLS__ !== "undefined" ? __OGYGIA_DEVTOOLS__ : false;
|
|
5
|
+
const REGISTRY_KEY = Symbol.for("ogygia.hub");
|
|
6
|
+
function registry() {
|
|
7
|
+
const g = globalThis;
|
|
8
|
+
return g[REGISTRY_KEY] ??= {
|
|
9
|
+
kinds: /* @__PURE__ */ new Map(),
|
|
10
|
+
order: [],
|
|
11
|
+
ids: /* @__PURE__ */ new WeakMap(),
|
|
12
|
+
instances: /* @__PURE__ */ new Map([["page", /* @__PURE__ */ new Map()], ["session", /* @__PURE__ */ new Map()]]),
|
|
13
|
+
instance_kind: /* @__PURE__ */ new WeakMap(),
|
|
14
|
+
scope_disposers: /* @__PURE__ */ new Map(),
|
|
15
|
+
keep_owner: /* @__PURE__ */ new Map()
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
/** Register a kind. Idempotent by discriminator — a re-registration (second bundle evaluating
|
|
19
|
+
* the same module) keeps the FIRST, so identity state never forks. */
|
|
20
|
+
function register_kind(kind) {
|
|
21
|
+
const reg = registry();
|
|
22
|
+
if (reg.kinds.has(kind.k)) return;
|
|
23
|
+
reg.kinds.set(kind.k, kind);
|
|
24
|
+
reg.order.push(kind);
|
|
25
|
+
}
|
|
26
|
+
function mint_id() {
|
|
27
|
+
const c = globalThis.crypto;
|
|
28
|
+
if (c?.randomUUID) return c.randomUUID();
|
|
29
|
+
return "r" + Math.random().toString(36).slice(2) + Math.random().toString(36).slice(2);
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Mint: live value → Ref, or undefined to fall through to devalue's normal handling.
|
|
33
|
+
* `only` restricts the dispatch to named kinds — a seam may deliberately exclude a family
|
|
34
|
+
* (the drop-in context path excludes snippets so a stray function THROWS instead of being
|
|
35
|
+
* silently mis-read as one). Same instance → same id, always.
|
|
36
|
+
*/
|
|
37
|
+
function mint(value, only) {
|
|
38
|
+
if (value === null || typeof value !== "object" && typeof value !== "function") return void 0;
|
|
39
|
+
const reg = registry();
|
|
40
|
+
for (const kind of reg.order) {
|
|
41
|
+
if (only && !only.has(kind.k)) continue;
|
|
42
|
+
if (!kind.match(value)) continue;
|
|
43
|
+
const { t, d } = kind.encode(value);
|
|
44
|
+
let i = reg.ids.get(value);
|
|
45
|
+
if (i === void 0) {
|
|
46
|
+
i = kind.stable_id?.(d) ?? mint_id();
|
|
47
|
+
reg.ids.set(value, i);
|
|
48
|
+
}
|
|
49
|
+
const ref = {
|
|
50
|
+
k: kind.k,
|
|
51
|
+
i,
|
|
52
|
+
d
|
|
53
|
+
};
|
|
54
|
+
if (t !== void 0) ref.t = t;
|
|
55
|
+
if (DEVTOOLS) emit({
|
|
56
|
+
domain: "hub",
|
|
57
|
+
name: "hub.mint",
|
|
58
|
+
kind: kind.k,
|
|
59
|
+
id: i,
|
|
60
|
+
tag: t
|
|
61
|
+
});
|
|
62
|
+
return ref;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* RESOLVE SINK (reconciler R3) — a hook the runtime installs during an island's hydration to learn
|
|
67
|
+
* which page-scoped ids that island resolves, WITHOUT the hub knowing anything about the DOM.
|
|
68
|
+
* `resolve()` calls the current sink with each id it freshly remembers in the page scope; the
|
|
69
|
+
* runtime's sink attributes it to the island currently hydrating (region → id-set), so a reconcile
|
|
70
|
+
* nav can dispose exactly the ids owned by REMOVED regions. Null when no island is hydrating.
|
|
71
|
+
*/
|
|
72
|
+
let resolve_sink = null;
|
|
73
|
+
function set_resolve_sink(fn) {
|
|
74
|
+
resolve_sink = fn;
|
|
75
|
+
}
|
|
76
|
+
/** The live bucket for a scope (never 'request' — that scope is never stored). */
|
|
77
|
+
function bucket(reg, scope) {
|
|
78
|
+
let b = reg.instances.get(scope);
|
|
79
|
+
if (b === void 0) reg.instances.set(scope, b = /* @__PURE__ */ new Map());
|
|
80
|
+
return b;
|
|
81
|
+
}
|
|
82
|
+
/** Memoize an instance in a scope's bucket, recording its kind for later disposal. No MAX_LIVE
|
|
83
|
+
* cap since phase D — the 'page' bucket is emptied by `dispose_scope('page')` on every nav, so
|
|
84
|
+
* it can't creep across the tab's lifetime the way the old unbounded map could. */
|
|
85
|
+
function remember_in(reg, scope, key, instance, kind_k) {
|
|
86
|
+
bucket(reg, scope).set(key, instance);
|
|
87
|
+
reg.instance_kind.set(instance, kind_k);
|
|
88
|
+
if (scope === "page" && resolve_sink !== null) resolve_sink(key);
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* DISPOSE a whole scope (hub v2, phase D) — tear down every instance in its bucket via the
|
|
92
|
+
* instance's `kind.dispose`, run any registered scope-disposers (side-effect cleanups like the
|
|
93
|
+
* remote cache), then empty the bucket. `dispose_scope('page')` on nav is what replaces the old
|
|
94
|
+
* MAX_LIVE cap: stale page-scoped aliases go, session/forever instances stay.
|
|
95
|
+
*
|
|
96
|
+
* SAFETY: a page-bucket instance that is ALSO in a longer-lived bucket (a wire class aliased into
|
|
97
|
+
* 'session' for continuity) is NOT torn down — only its page alias is dropped. Its resources
|
|
98
|
+
* belong to the session and outlive the nav.
|
|
99
|
+
*/
|
|
100
|
+
function dispose_scope(scope) {
|
|
101
|
+
const reg = registry();
|
|
102
|
+
const b = reg.instances.get(scope);
|
|
103
|
+
if (DEVTOOLS) emit({
|
|
104
|
+
domain: "hub",
|
|
105
|
+
name: "hub.dispose",
|
|
106
|
+
scope,
|
|
107
|
+
count: b?.size ?? 0
|
|
108
|
+
});
|
|
109
|
+
if (b !== void 0 && b.size > 0) {
|
|
110
|
+
const survivors = /* @__PURE__ */ new Set();
|
|
111
|
+
if (scope === "page") for (const inst of bucket(reg, "session").values()) survivors.add(inst);
|
|
112
|
+
for (const inst of b.values()) {
|
|
113
|
+
if (survivors.has(inst)) continue;
|
|
114
|
+
const kind = reg.kinds.get(reg.instance_kind.get(inst) ?? "");
|
|
115
|
+
try {
|
|
116
|
+
kind?.dispose?.(inst);
|
|
117
|
+
} catch {}
|
|
118
|
+
}
|
|
119
|
+
b.clear();
|
|
120
|
+
}
|
|
121
|
+
const ds = reg.scope_disposers.get(scope);
|
|
122
|
+
if (ds !== void 0) for (const fn of Array.from(ds)) try {
|
|
123
|
+
fn();
|
|
124
|
+
} catch {}
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* DISPOSE specific page-scoped ids (reconciler R3) — the SELECTIVE counterpart to dispose_scope.
|
|
128
|
+
* A reconcile nav keeps matched islands mounted, so it can't blanket-dispose the page scope; it
|
|
129
|
+
* disposes only the ids owned by REMOVED regions. Each id's instance is torn down via its
|
|
130
|
+
* kind.dispose and removed from the page bucket, instance_kind, and dep_index — UNLESS it is also
|
|
131
|
+
* session-aliased (continuity), in which case only nothing happens (the session bucket keeps it).
|
|
132
|
+
* ids not present in the page bucket are skipped silently.
|
|
133
|
+
*/
|
|
134
|
+
function dispose_ids(ids) {
|
|
135
|
+
const reg = registry();
|
|
136
|
+
const page = bucket(reg, "page");
|
|
137
|
+
const survivors = new Set(bucket(reg, "session").values());
|
|
138
|
+
let dt_disposed = 0;
|
|
139
|
+
for (const id of ids) {
|
|
140
|
+
const inst = page.get(id);
|
|
141
|
+
if (inst === void 0) continue;
|
|
142
|
+
page.delete(id);
|
|
143
|
+
if (DEVTOOLS) dt_disposed++;
|
|
144
|
+
if (survivors.has(inst)) continue;
|
|
145
|
+
const kind = reg.kinds.get(reg.instance_kind.get(inst) ?? "");
|
|
146
|
+
reg.instance_kind.delete(inst);
|
|
147
|
+
try {
|
|
148
|
+
kind?.dispose?.(inst);
|
|
149
|
+
} catch {}
|
|
150
|
+
}
|
|
151
|
+
if (DEVTOOLS && dt_disposed > 0) emit({
|
|
152
|
+
domain: "hub",
|
|
153
|
+
name: "hub.dispose",
|
|
154
|
+
scope: "ids",
|
|
155
|
+
count: dt_disposed
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
/** Register a side-effect cleanup to run whenever `scope` is disposed. Returns an unregister fn.
|
|
159
|
+
* Lets subsystems (the remote cache) fold their nav-time clearing into scope disposal. */
|
|
160
|
+
function register_scope_disposer(scope, fn) {
|
|
161
|
+
const reg = registry();
|
|
162
|
+
let set = reg.scope_disposers.get(scope);
|
|
163
|
+
if (set === void 0) reg.scope_disposers.set(scope, set = /* @__PURE__ */ new Set());
|
|
164
|
+
set.add(fn);
|
|
165
|
+
return () => reg.scope_disposers.get(scope)?.delete(fn);
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Resolve: Ref → live value.
|
|
169
|
+
*
|
|
170
|
+
* Second arg is a {@link Scope} (or a legacy boolean shim: `true` ⇒ 'page', `false` ⇒ 'request').
|
|
171
|
+
* 'page'/'session' (browser) memoize by id — decoding the same ref twice returns the SAME instance
|
|
172
|
+
* (the liveness mechanism), and a kind-named ref reunites with the session bucket across
|
|
173
|
+
* navigations (the kind's `merge` reconciles fresh server data in; default kept-wins). 'request'
|
|
174
|
+
* (server, defer/streaming renders) always decodes fresh: memoizing across requests would leak one
|
|
175
|
+
* user's state into another's HTML.
|
|
176
|
+
*/
|
|
177
|
+
function resolve(ref, scope_or_remember) {
|
|
178
|
+
const scope = typeof scope_or_remember === "boolean" ? scope_or_remember ? "page" : "request" : scope_or_remember;
|
|
179
|
+
const remember = scope !== "request";
|
|
180
|
+
const reg = registry();
|
|
181
|
+
if (remember) {
|
|
182
|
+
const existing = bucket(reg, "page").get(ref.i);
|
|
183
|
+
if (existing !== void 0) {
|
|
184
|
+
const w = watchers().get(ref.i);
|
|
185
|
+
if (w !== void 0 && w.size > 0) {
|
|
186
|
+
const kind = reg.kinds.get(ref.k);
|
|
187
|
+
if (kind?.merge !== void 0) {
|
|
188
|
+
kind.merge(existing, ref);
|
|
189
|
+
notify(ref.i, existing);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
if (DEVTOOLS) emit({
|
|
193
|
+
domain: "hub",
|
|
194
|
+
name: "hub.resolve",
|
|
195
|
+
kind: ref.k,
|
|
196
|
+
id: ref.i,
|
|
197
|
+
scope,
|
|
198
|
+
tag: ref.t,
|
|
199
|
+
hit: true
|
|
200
|
+
});
|
|
201
|
+
return existing;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
const kind = reg.kinds.get(ref.k);
|
|
205
|
+
if (kind === void 0) throw new Error(`[ogygia] cannot resolve a "${ref.k}" ref: no such kind is registered on this side. The module that registers it must be imported as a VALUE in this bundle.`);
|
|
206
|
+
if (remember) {
|
|
207
|
+
const name = kind.keep_name?.(ref);
|
|
208
|
+
if (typeof name === "string") {
|
|
209
|
+
const tag = ref.t ?? ref.k;
|
|
210
|
+
const owner = reg.keep_owner.get(name);
|
|
211
|
+
if (owner === void 0) reg.keep_owner.set(name, tag);
|
|
212
|
+
else if (owner !== tag && typeof console !== "undefined") console.error(`[ogygia] two transportables both use continuity id "${name}" ("${owner}" and "${tag}"). A continuity id must be unique per class — rename one, or they will clobber each other in the session Keep.`);
|
|
213
|
+
const kept = bucket(reg, "session").get(name);
|
|
214
|
+
if (kept !== void 0) {
|
|
215
|
+
kind.merge?.(kept, ref);
|
|
216
|
+
remember_in(reg, "page", ref.i, kept, ref.k);
|
|
217
|
+
if (DEVTOOLS) emit({
|
|
218
|
+
domain: "hub",
|
|
219
|
+
name: "hub.resolve",
|
|
220
|
+
kind: ref.k,
|
|
221
|
+
id: ref.i,
|
|
222
|
+
scope,
|
|
223
|
+
tag: ref.t,
|
|
224
|
+
hit: true
|
|
225
|
+
});
|
|
226
|
+
return kept;
|
|
227
|
+
}
|
|
228
|
+
const instance = kind.decode(ref);
|
|
229
|
+
if (instance !== null && typeof instance === "object") {
|
|
230
|
+
remember_in(reg, "session", name, instance, ref.k);
|
|
231
|
+
remember_in(reg, "page", ref.i, instance, ref.k);
|
|
232
|
+
}
|
|
233
|
+
if (DEVTOOLS) emit({
|
|
234
|
+
domain: "hub",
|
|
235
|
+
name: "hub.resolve",
|
|
236
|
+
kind: ref.k,
|
|
237
|
+
id: ref.i,
|
|
238
|
+
scope,
|
|
239
|
+
tag: ref.t,
|
|
240
|
+
hit: false
|
|
241
|
+
});
|
|
242
|
+
return instance;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
const instance = kind.decode(ref);
|
|
246
|
+
if (remember && instance !== null && typeof instance === "object") remember_in(reg, "page", ref.i, instance, ref.k);
|
|
247
|
+
if (DEVTOOLS) emit({
|
|
248
|
+
domain: "hub",
|
|
249
|
+
name: "hub.resolve",
|
|
250
|
+
kind: ref.k,
|
|
251
|
+
id: ref.i,
|
|
252
|
+
scope,
|
|
253
|
+
tag: ref.t,
|
|
254
|
+
hit: false
|
|
255
|
+
});
|
|
256
|
+
return instance;
|
|
257
|
+
}
|
|
258
|
+
/** Resolve a bag of refs as one transaction (sugar over {@link batch}). */
|
|
259
|
+
function resolve_batch(refs, scope) {
|
|
260
|
+
return batch(() => refs.map((r) => resolve(r, scope)));
|
|
261
|
+
}
|
|
262
|
+
/** Devalue custom-type name for hub refs on the wire (the ONE key every seam will converge on). */
|
|
263
|
+
const REF_WIRE_KEY = "OgygiaRef";
|
|
264
|
+
/** Devalue reducer for a seam. `only` deliberately restricts which families may cross there. */
|
|
265
|
+
function ref_reducer(only) {
|
|
266
|
+
return (value) => mint(value, only);
|
|
267
|
+
}
|
|
268
|
+
/** Devalue reviver for a seam. Browser passes `remember: true`; the server must pass `false`. */
|
|
269
|
+
function ref_reviver(remember) {
|
|
270
|
+
return (ref) => resolve(ref, remember);
|
|
271
|
+
}
|
|
272
|
+
export { REF_WIRE_KEY, batch, dispose_ids, dispose_scope, mint, notify, ref_reducer, ref_reviver, register_kind, register_scope_disposer, resolve, resolve_batch, set_resolve_sink, watch, watcher_count };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The brand marking a held-region value (`region()` results / deferred tickets). It lives ALONE, with
|
|
3
|
+
* no imports, on purpose: the client transport hook only needs to TEST `value[REGION_BRAND]` to know
|
|
4
|
+
* whether to decode a region — and importing that test from `region.js` used to drag the whole
|
|
5
|
+
* `region → region-snippet → svelte/server` graph (~20kB) into every client that installs the hook.
|
|
6
|
+
* `Symbol.for` so every bundle (server render, client hook, runtime) agrees on one brand.
|
|
7
|
+
*/
|
|
8
|
+
export declare const REGION_BRAND: unique symbol;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// src/region-brand.ts
|
|
2
|
+
/**
|
|
3
|
+
* The brand marking a held-region value (`region()` results / deferred tickets). It lives ALONE, with
|
|
4
|
+
* no imports, on purpose: the client transport hook only needs to TEST `value[REGION_BRAND]` to know
|
|
5
|
+
* whether to decode a region — and importing that test from `region.js` used to drag the whole
|
|
6
|
+
* `region → region-snippet → svelte/server` graph (~20kB) into every client that installs the hook.
|
|
7
|
+
* `Symbol.for` so every bundle (server render, client hook, runtime) agrees on one brand.
|
|
8
|
+
*/
|
|
9
|
+
const REGION_BRAND = Symbol.for("ogygia.region");
|
|
10
|
+
export { REGION_BRAND };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { isRegion, og_html_region, region } from "./region.js";
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { Component, Snippet } from "svelte";
|
|
2
|
+
/** Devalue custom-type name a region snippet crosses under (wire-stable; was `OgygiaS`). */
|
|
3
|
+
export declare const REGION_SNIPPET_WIRE_KEY = "OgygiaS";
|
|
4
|
+
/** The serializable stand-in a region snippet crosses as, discriminated by mode. */
|
|
5
|
+
export type RegionSnippetDescriptor = {
|
|
6
|
+
m: "live";
|
|
7
|
+
e: string;
|
|
8
|
+
p: Record<string, unknown>;
|
|
9
|
+
} | {
|
|
10
|
+
m: "static";
|
|
11
|
+
h: string;
|
|
12
|
+
} | {
|
|
13
|
+
m: "slot";
|
|
14
|
+
id: string;
|
|
15
|
+
};
|
|
16
|
+
/** A snippet stamped with its region descriptor. */
|
|
17
|
+
type RegionSnippet = Snippet & {
|
|
18
|
+
__ogRegion?: RegionSnippetDescriptor;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Definition-site factory (compiler-emitted). Brands the snippet AS WRITTEN (`native`) — it keeps
|
|
22
|
+
* rendering in place, in the host's tree: the host's context, its scoped CSS, a nested island as a plain
|
|
23
|
+
* page island — with the descriptor (`__ogRegion`, what crosses the wire) and its PORTABLE form: the
|
|
24
|
+
* body compiled to `Entry`, rendered in isolation on the server and hydrated alone on the client. Only a
|
|
25
|
+
* boundary swaps the portable form in (portable-form.ts, via {@link prepare_region_props}), so the server
|
|
26
|
+
* markup and the client's revived snippet agree. `Entry` is `null` in a client bundle (the far side
|
|
27
|
+
* imports it by url). The native function is branded in place (not wrapped), so its identity — what a
|
|
28
|
+
* `{@render}` keys on — is stable across re-evaluations of the prop.
|
|
29
|
+
*/
|
|
30
|
+
export declare function og_portable(native: Snippet, Entry: Component | null, props: Record<string, unknown>, url: string): RegionSnippet;
|
|
31
|
+
export interface RawRegionSnippet {
|
|
32
|
+
/** Single-root HTML for SSR + hydration match (same rule as `createRawSnippet`). */
|
|
33
|
+
render: (...captures: unknown[]) => string;
|
|
34
|
+
/** Client behavior after mount/adoption. DROPPED if this snippet is reduced across a wire. */
|
|
35
|
+
setup?: (root: Element, ...captures: unknown[]) => (() => void) | void;
|
|
36
|
+
/** Devalue-serializable inputs — same law as island props. */
|
|
37
|
+
captures?: unknown[];
|
|
38
|
+
}
|
|
39
|
+
/** Lift a parameterless snippet, or a raw `{ render, setup?, captures? }`, into a region snippet. */
|
|
40
|
+
export declare function region_snippet(input: Snippet | RawRegionSnippet): RegionSnippet;
|
|
41
|
+
/**
|
|
42
|
+
* Prepare an island's props for crossing: freeze each BARE snippet prop to a single-rooted static
|
|
43
|
+
* region snippet, so the SAME value renders the island body AND serializes — the body HTML and the
|
|
44
|
+
* revived client snippet then agree byte-for-byte, and hydration adopts cleanly. Server-only (uses SSR
|
|
45
|
+
* capture). A branded (live) snippet, at any depth, is swapped for its PORTABLE form; non-snippet values
|
|
46
|
+
* pass through untouched. Returns the original object when nothing changed (no needless copy).
|
|
47
|
+
*/
|
|
48
|
+
export declare function prepare_region_props(input: Record<string, unknown>): Record<string, unknown>;
|
|
49
|
+
/** The SSR marker that fences an island's in-place children so the client can adopt exactly that range.
|
|
50
|
+
* `display:contents` keeps it layout-neutral. */
|
|
51
|
+
export declare function slot_marker_open(id: string): string;
|
|
52
|
+
export declare const SLOT_MARKER_CLOSE = "</ogygia-slot>";
|
|
53
|
+
export declare function next_slot_id(key?: string): string;
|
|
54
|
+
/** The serialize-only stand-in for in-place children: a branded value the codec reduces to a `slot`
|
|
55
|
+
* descriptor. Never rendered (the server body renders the real children); on the client it revives to a
|
|
56
|
+
* snippet that ADOPTS the marked DOM range. */
|
|
57
|
+
export declare function slot_pointer(id: string): RegionSnippet;
|
|
58
|
+
/** The hub kind: a snippet is a renderable Ref ("a snippet is a region", now literal). A branded
|
|
59
|
+
* region snippet crosses as its descriptor; a bare snippet FREEZES at the boundary (server-only —
|
|
60
|
+
* the BROWSER guard also keeps `capture_static` → `svelte/server` DCE-able out of client bundles);
|
|
61
|
+
* a bare function on the CLIENT falls through (never claimed — it can't freeze there). */
|
|
62
|
+
/** Explicit registration — called at module scope AND from live-transport's install():
|
|
63
|
+
* a bare side-effect import gets tree-shaken (the package marks JS side-effect-free),
|
|
64
|
+
* which silently un-registers the kind in client bundles. A CALLED import cannot be dropped. */
|
|
65
|
+
export declare function register_snippet_kind(): void;
|
|
66
|
+
/** Codec encode (legacy `OgygiaS` wire shape: the bare descriptor). Branded region snippet → its
|
|
67
|
+
* descriptor; a bare snippet → frozen static; anything else falls through. */
|
|
68
|
+
export declare function reduce_region_snippet(value: unknown): RegionSnippetDescriptor | undefined;
|
|
69
|
+
/** Codec decode. Rebuild a live snippet from the descriptor (both modes). Snippets are functions,
|
|
70
|
+
* which the hub deliberately never memoizes — each consumer revives its own (stateless until
|
|
71
|
+
* rendered), exactly the pre-hub behavior. */
|
|
72
|
+
export declare function revive_region_snippet(desc: RegionSnippetDescriptor): RegionSnippet;
|
|
73
|
+
export {};
|