@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,62 @@
|
|
|
1
|
+
import { Frame } from "../frame.js";
|
|
2
|
+
export type FrameFetcher = (signal: AbortSignal) => Promise<string>;
|
|
3
|
+
/** Applied content for an address, if any. */
|
|
4
|
+
export declare function peek(a: string): {
|
|
5
|
+
v: number;
|
|
6
|
+
html: string;
|
|
7
|
+
} | null;
|
|
8
|
+
/** Nothing applied and nothing in flight at this address (a batch may take it on). */
|
|
9
|
+
export declare function is_idle(a: string): boolean;
|
|
10
|
+
/** Next request ticket for an address. External channels (streaming, mutations) use this too. */
|
|
11
|
+
export declare function ticket(a: string): number;
|
|
12
|
+
/**
|
|
13
|
+
* Write a frame. Applied only if strictly newer than the current content; stale writes are
|
|
14
|
+
* dropped and reported `false`. Subscribers are notified on apply.
|
|
15
|
+
*/
|
|
16
|
+
export declare function write(f: Frame): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Reserve an address whose content is arriving via an EXTERNAL batch stream (single-flight navigation). A region
|
|
19
|
+
* binder that mounts before its frame lands calls `ensure()`, sees this reservation, and JOINS it
|
|
20
|
+
* instead of starting its own fetch — so a navigation that pulls N regions makes ONE batch request,
|
|
21
|
+
* not N. `write()` fulfils the reservation when the frame arrives; `release()` fails it if the batch
|
|
22
|
+
* ends without one (the binder then falls back to its own fetch). No-op if content or a fetch is
|
|
23
|
+
* already present.
|
|
24
|
+
*/
|
|
25
|
+
export declare function reserve(a: string): void;
|
|
26
|
+
/**
|
|
27
|
+
* Fail an unfulfilled reservation (the batch ended and no frame carried this address). Joined binders
|
|
28
|
+
* reject out of `ensure()` and retry with their own fetch. No-op once content has arrived.
|
|
29
|
+
*/
|
|
30
|
+
export declare function release(a: string): void;
|
|
31
|
+
/** The error a joined reservation rejects with when its batch ended without its frame: the binder's
|
|
32
|
+
* own fetch runs at once (nothing failed — the batch just did not carry it). */
|
|
33
|
+
export declare const BATCH_MISS = "OgygiaBatchMiss";
|
|
34
|
+
/**
|
|
35
|
+
* Subscribe to writes at an address. If content is ALREADY applied, the callback fires immediately
|
|
36
|
+
* with it (a late binder — e.g. a region that mounts after a batch stream already delivered its
|
|
37
|
+
* frame — catches up without a request). Returns an unsubscribe fn. While subscribed the entry
|
|
38
|
+
* never evicts; after the last unsubscribe it lingers EVICT_TTL then drops (unless re-bound).
|
|
39
|
+
*/
|
|
40
|
+
export declare function subscribe(a: string, cb: (f: Frame) => void): () => void;
|
|
41
|
+
/**
|
|
42
|
+
* Ensure an address has content, deduping concurrent callers onto one fetch.
|
|
43
|
+
*
|
|
44
|
+
* - Content already applied (and not `force`): resolves immediately with it.
|
|
45
|
+
* - A fetch is in flight (and not `force`): joins it — N regions, ONE request.
|
|
46
|
+
* - Otherwise starts `fetcher` with a fresh ticket; on success the response is WRITTEN (subject to
|
|
47
|
+
* the staleness check) and the resolved value is whatever the store now holds.
|
|
48
|
+
* - `force` (SWR revalidate) always starts a new fetch; the ticket ordering still guarantees an
|
|
49
|
+
* older in-flight response can't overwrite it.
|
|
50
|
+
*
|
|
51
|
+
* Rejections propagate to every joined caller; retry policy stays with the caller (the element).
|
|
52
|
+
*/
|
|
53
|
+
export declare function ensure(a: string, fetcher: FrameFetcher, opts?: {
|
|
54
|
+
force?: boolean;
|
|
55
|
+
}): Promise<string>;
|
|
56
|
+
/**
|
|
57
|
+
* A waiter is leaving (its element disconnected). Aborts the shared fetch only when the LAST
|
|
58
|
+
* waiter leaves — one unmounting element must not kill a fetch its twin still awaits.
|
|
59
|
+
*/
|
|
60
|
+
export declare function abandon(a: string): void;
|
|
61
|
+
/** Test/HMR hook — drop everything. */
|
|
62
|
+
export declare function _reset(): void;
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import { notify, watch, watcher_count } from "../ref-watch.js";
|
|
2
|
+
// src/runtime/frame-store.ts
|
|
3
|
+
/** Frame addresses live in the hub's watcher space under a namespace, so region binders subscribe
|
|
4
|
+
* through the ONE hub `watch`/`notify` primitive (hub v2 phase W) — the frame store no longer owns
|
|
5
|
+
* a parallel subscriber set. Fetch orchestration (ticket, inflight, reserve, evict) stays here. */
|
|
6
|
+
const frame_id = (a) => "frame:" + a;
|
|
7
|
+
/** Entries with no subscribers linger this long (ms) so quick remounts / SPA swaps reuse content. */
|
|
8
|
+
const EVICT_TTL = 6e4;
|
|
9
|
+
const GLOBAL_KEY = "__ogygia_frames__";
|
|
10
|
+
const store_host = typeof globalThis !== "undefined" ? globalThis : {};
|
|
11
|
+
const entries = store_host[GLOBAL_KEY] ?? (store_host[GLOBAL_KEY] = /* @__PURE__ */ new Map());
|
|
12
|
+
function entry(a) {
|
|
13
|
+
let e = entries.get(a);
|
|
14
|
+
if (!e) {
|
|
15
|
+
e = {
|
|
16
|
+
v: 0,
|
|
17
|
+
html: null,
|
|
18
|
+
seq: 0,
|
|
19
|
+
inflight: null,
|
|
20
|
+
evict: null
|
|
21
|
+
};
|
|
22
|
+
entries.set(a, e);
|
|
23
|
+
}
|
|
24
|
+
return e;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Let an idle entry (no subscribers, no in-flight fetch) linger EVICT_TTL, then drop it. A late binder
|
|
28
|
+
* that mounts inside the window still catches its content (prefetch / batch-stream ahead of the DOM);
|
|
29
|
+
* nothing bound means nothing to keep. Idempotent — resets the timer. Both channels that leave an
|
|
30
|
+
* entry idle call this: a subscriber unbinding, AND a `write()` that lands where nothing is listening
|
|
31
|
+
* (a single-flight mutation for an unmounted region, or a live tick whose address keeps changing).
|
|
32
|
+
* Without the write path, those orphan entries would accumulate forever — they never had a subscriber
|
|
33
|
+
* to trigger eviction.
|
|
34
|
+
*/
|
|
35
|
+
function schedule_evict(a, e) {
|
|
36
|
+
if (watcher_count(frame_id(a)) > 0 || e.inflight) return;
|
|
37
|
+
if (e.evict) clearTimeout(e.evict);
|
|
38
|
+
e.evict = setTimeout(() => {
|
|
39
|
+
const cur = entries.get(a);
|
|
40
|
+
if (cur === e && watcher_count(frame_id(a)) === 0 && !cur.inflight) entries.delete(a);
|
|
41
|
+
}, EVICT_TTL);
|
|
42
|
+
}
|
|
43
|
+
/** Applied content for an address, if any. */
|
|
44
|
+
function peek(a) {
|
|
45
|
+
const e = entries.get(a);
|
|
46
|
+
return e && e.html != null ? {
|
|
47
|
+
v: e.v,
|
|
48
|
+
html: e.html
|
|
49
|
+
} : null;
|
|
50
|
+
}
|
|
51
|
+
/** Nothing applied and nothing in flight at this address (a batch may take it on). */
|
|
52
|
+
function is_idle(a) {
|
|
53
|
+
const e = entries.get(a);
|
|
54
|
+
return !e || e.html == null && !e.inflight;
|
|
55
|
+
}
|
|
56
|
+
/** Next request ticket for an address. External channels (streaming, mutations) use this too. */
|
|
57
|
+
function ticket(a) {
|
|
58
|
+
return ++entry(a).seq;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Write a frame. Applied only if strictly newer than the current content; stale writes are
|
|
62
|
+
* dropped and reported `false`. Subscribers are notified on apply.
|
|
63
|
+
*/
|
|
64
|
+
function write(f) {
|
|
65
|
+
const e = entry(f.a);
|
|
66
|
+
if (f.v <= e.v) return false;
|
|
67
|
+
if (f.v > e.seq) e.seq = f.v;
|
|
68
|
+
e.v = f.v;
|
|
69
|
+
e.html = f.html;
|
|
70
|
+
const held = e.inflight;
|
|
71
|
+
if (held?.settle) {
|
|
72
|
+
e.inflight = null;
|
|
73
|
+
held.settle(f.html);
|
|
74
|
+
}
|
|
75
|
+
notify(frame_id(f.a), f);
|
|
76
|
+
schedule_evict(f.a, e);
|
|
77
|
+
return true;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Reserve an address whose content is arriving via an EXTERNAL batch stream (single-flight navigation). A region
|
|
81
|
+
* binder that mounts before its frame lands calls `ensure()`, sees this reservation, and JOINS it
|
|
82
|
+
* instead of starting its own fetch — so a navigation that pulls N regions makes ONE batch request,
|
|
83
|
+
* not N. `write()` fulfils the reservation when the frame arrives; `release()` fails it if the batch
|
|
84
|
+
* ends without one (the binder then falls back to its own fetch). No-op if content or a fetch is
|
|
85
|
+
* already present.
|
|
86
|
+
*/
|
|
87
|
+
function reserve(a) {
|
|
88
|
+
const e = entry(a);
|
|
89
|
+
if (e.html != null || e.inflight) return;
|
|
90
|
+
if (e.evict) {
|
|
91
|
+
clearTimeout(e.evict);
|
|
92
|
+
e.evict = null;
|
|
93
|
+
}
|
|
94
|
+
let settle;
|
|
95
|
+
let fail;
|
|
96
|
+
const promise = new Promise((res, rej) => {
|
|
97
|
+
settle = res;
|
|
98
|
+
fail = rej;
|
|
99
|
+
});
|
|
100
|
+
promise.catch(() => {});
|
|
101
|
+
e.inflight = {
|
|
102
|
+
ticket: ticket(a),
|
|
103
|
+
promise,
|
|
104
|
+
controller: new AbortController(),
|
|
105
|
+
waiters: 0,
|
|
106
|
+
settle,
|
|
107
|
+
fail
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Fail an unfulfilled reservation (the batch ended and no frame carried this address). Joined binders
|
|
112
|
+
* reject out of `ensure()` and retry with their own fetch. No-op once content has arrived.
|
|
113
|
+
*/
|
|
114
|
+
function release(a) {
|
|
115
|
+
const e = entries.get(a);
|
|
116
|
+
const held = e?.inflight;
|
|
117
|
+
if (!e || !held?.fail || e.html != null) return;
|
|
118
|
+
e.inflight = null;
|
|
119
|
+
const miss = /* @__PURE__ */ new Error("ogygia batch: no frame for " + a);
|
|
120
|
+
miss.name = BATCH_MISS;
|
|
121
|
+
held.fail(miss);
|
|
122
|
+
schedule_evict(a, e);
|
|
123
|
+
}
|
|
124
|
+
/** The error a joined reservation rejects with when its batch ended without its frame: the binder's
|
|
125
|
+
* own fetch runs at once (nothing failed — the batch just did not carry it). */
|
|
126
|
+
const BATCH_MISS = "OgygiaBatchMiss";
|
|
127
|
+
/**
|
|
128
|
+
* Subscribe to writes at an address. If content is ALREADY applied, the callback fires immediately
|
|
129
|
+
* with it (a late binder — e.g. a region that mounts after a batch stream already delivered its
|
|
130
|
+
* frame — catches up without a request). Returns an unsubscribe fn. While subscribed the entry
|
|
131
|
+
* never evicts; after the last unsubscribe it lingers EVICT_TTL then drops (unless re-bound).
|
|
132
|
+
*/
|
|
133
|
+
function subscribe(a, cb) {
|
|
134
|
+
const e = entry(a);
|
|
135
|
+
if (e.evict) {
|
|
136
|
+
clearTimeout(e.evict);
|
|
137
|
+
e.evict = null;
|
|
138
|
+
}
|
|
139
|
+
const off = watch(frame_id(a), cb);
|
|
140
|
+
if (e.html != null) cb({
|
|
141
|
+
a,
|
|
142
|
+
v: e.v,
|
|
143
|
+
html: e.html
|
|
144
|
+
});
|
|
145
|
+
return () => {
|
|
146
|
+
off();
|
|
147
|
+
schedule_evict(a, e);
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Ensure an address has content, deduping concurrent callers onto one fetch.
|
|
152
|
+
*
|
|
153
|
+
* - Content already applied (and not `force`): resolves immediately with it.
|
|
154
|
+
* - A fetch is in flight (and not `force`): joins it — N regions, ONE request.
|
|
155
|
+
* - Otherwise starts `fetcher` with a fresh ticket; on success the response is WRITTEN (subject to
|
|
156
|
+
* the staleness check) and the resolved value is whatever the store now holds.
|
|
157
|
+
* - `force` (SWR revalidate) always starts a new fetch; the ticket ordering still guarantees an
|
|
158
|
+
* older in-flight response can't overwrite it.
|
|
159
|
+
*
|
|
160
|
+
* Rejections propagate to every joined caller; retry policy stays with the caller (the element).
|
|
161
|
+
*/
|
|
162
|
+
function ensure(a, fetcher, opts = {}) {
|
|
163
|
+
const e = entry(a);
|
|
164
|
+
if (!opts.force) {
|
|
165
|
+
if (e.html != null) return Promise.resolve(e.html);
|
|
166
|
+
if (e.inflight) {
|
|
167
|
+
e.inflight.waiters++;
|
|
168
|
+
return e.inflight.promise;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
const controller = new AbortController();
|
|
172
|
+
const t = ticket(a);
|
|
173
|
+
const inflight = {
|
|
174
|
+
ticket: t,
|
|
175
|
+
controller,
|
|
176
|
+
waiters: 1,
|
|
177
|
+
promise: fetcher(controller.signal).then((html) => {
|
|
178
|
+
if (e.inflight === inflight) e.inflight = null;
|
|
179
|
+
write({
|
|
180
|
+
a,
|
|
181
|
+
v: t,
|
|
182
|
+
html
|
|
183
|
+
});
|
|
184
|
+
return e.html ?? html;
|
|
185
|
+
}, (err) => {
|
|
186
|
+
if (e.inflight === inflight) e.inflight = null;
|
|
187
|
+
throw err;
|
|
188
|
+
})
|
|
189
|
+
};
|
|
190
|
+
e.inflight = inflight;
|
|
191
|
+
return inflight.promise;
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* A waiter is leaving (its element disconnected). Aborts the shared fetch only when the LAST
|
|
195
|
+
* waiter leaves — one unmounting element must not kill a fetch its twin still awaits.
|
|
196
|
+
*/
|
|
197
|
+
function abandon(a) {
|
|
198
|
+
const e = entries.get(a);
|
|
199
|
+
if (!e?.inflight) return;
|
|
200
|
+
if (--e.inflight.waiters <= 0) {
|
|
201
|
+
e.inflight.controller.abort();
|
|
202
|
+
e.inflight = null;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
/** Test/HMR hook — drop everything. */
|
|
206
|
+
function _reset() {
|
|
207
|
+
for (const e of entries.values()) {
|
|
208
|
+
if (e.evict) clearTimeout(e.evict);
|
|
209
|
+
e.inflight?.fail?.(/* @__PURE__ */ new Error("reset"));
|
|
210
|
+
e.inflight?.controller.abort();
|
|
211
|
+
}
|
|
212
|
+
entries.clear();
|
|
213
|
+
}
|
|
214
|
+
export { BATCH_MISS, _reset, abandon, ensure, is_idle, peek, release, reserve, subscribe, ticket, write };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function install(): void;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { slots } from "./slots.js";
|
|
2
|
+
import { abandon, ensure, subscribe } from "./frame-store.js";
|
|
3
|
+
import { batch_times, join_batch, streamFrames } from "./frame-nav.js";
|
|
4
|
+
// src/runtime/frames.ts
|
|
5
|
+
/**
|
|
6
|
+
* frames feature: hand the client frame store to core through the {@link ./slots.js slots} seam.
|
|
7
|
+
*
|
|
8
|
+
* Core drives deferred / live / SWR-lake regions off this store (subscribe → apply, ensure →
|
|
9
|
+
* single-flight fetch, abandon → cleanup), and the router single-flights a route's deferred holes through
|
|
10
|
+
* `stream` — but NEITHER may statically import the store, or the ~10 kB store + nav-stream graph
|
|
11
|
+
* lands in every build, including a plain router app with no such region. The generated runtime entry
|
|
12
|
+
* installs this feature only when the app actually ships a deferred / live / lake region, so a
|
|
13
|
+
* static-islands app (and a router app without deferred regions) tree-shakes the whole graph away.
|
|
14
|
+
*/
|
|
15
|
+
function install() {
|
|
16
|
+
slots.frames = {
|
|
17
|
+
subscribe,
|
|
18
|
+
ensure,
|
|
19
|
+
abandon,
|
|
20
|
+
stream: streamFrames,
|
|
21
|
+
join: join_batch,
|
|
22
|
+
batch_times
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export { install };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ClientPlugin } from "../plugin/client.js";
|
|
2
|
+
/** Boot the kitchen-sink runtime (all boot-phase features) with the plugins' browser halves.
|
|
3
|
+
* Idempotent via {@link ./core.js boot}. */
|
|
4
|
+
export declare function bootDev(client_plugins?: readonly ClientPlugin[]): void;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { boot } from "./core.js";
|
|
2
|
+
import { install } from "./frames.js";
|
|
3
|
+
import { install as install$1 } from "./lakes.js";
|
|
4
|
+
import { install as install$2 } from "./morph.js";
|
|
5
|
+
import { install as install$3 } from "./interaction.js";
|
|
6
|
+
import { install as install$4 } from "./form-continuity.js";
|
|
7
|
+
import { install as install$5 } from "./router.js";
|
|
8
|
+
// src/runtime/full.ts
|
|
9
|
+
/**
|
|
10
|
+
* Kitchen-sink browser runtime — every BOOT-phase feature installed. The dev / no-marks entry: the
|
|
11
|
+
* ogygia compiler injects `bootDev()` (see the plugin's `virtual:ogygia-runtime`); a per-app production
|
|
12
|
+
* build instead emits a generated entry (see `vite/runtime-entry.ts`) that boots only the features it
|
|
13
|
+
* uses. Both boot through {@link ./core.js core} in the same {@link ../vite/runtime-entry.js FEATURE_ORDER}.
|
|
14
|
+
* HYDRATE-phase features (context, live, wire, remote-seeds) are never in the boot, dev included: the
|
|
15
|
+
* hydrate core installs them from `virtual:ogygia/hydrate-features` (every one, in dev).
|
|
16
|
+
*
|
|
17
|
+
* Exposed as an explicit FUNCTION, not a top-level side effect: the compiler always calls it, so the
|
|
18
|
+
* boot never depends on a bundler honouring `sideEffects` to survive tree-shaking / dep-prebundling.
|
|
19
|
+
*/
|
|
20
|
+
/** Boot the kitchen-sink runtime (all boot-phase features) with the plugins' browser halves.
|
|
21
|
+
* Idempotent via {@link ./core.js boot}. */
|
|
22
|
+
function bootDev(client_plugins = []) {
|
|
23
|
+
boot([
|
|
24
|
+
install,
|
|
25
|
+
install$1,
|
|
26
|
+
install$2,
|
|
27
|
+
install$3,
|
|
28
|
+
install$4,
|
|
29
|
+
install$5
|
|
30
|
+
], client_plugins);
|
|
31
|
+
}
|
|
32
|
+
export { bootDev };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Region fingerprint — the PURE core (no DOM, no imports) shared by the client reconciler AND the
|
|
3
|
+
* server (Region.svelte, server-delta nav). Kept dependency-free so it is safe in BOTH bundles and
|
|
4
|
+
* so client↔server fingerprints are IDENTICAL BY CONSTRUCTION: the server emits `data-og-fp =
|
|
5
|
+
* fingerprint_of(entry, '', props_payload)` on each island, and the client's `region_props_fp`
|
|
6
|
+
* reads the same entry attribute + '' endpoint + props-script text → the same hash. That parity is
|
|
7
|
+
* what makes server-delta nav safe (the server skips exactly the regions the client says it has).
|
|
8
|
+
*
|
|
9
|
+
* • signature — WHICH region slot (entry + the endpoint's stable id/props, minus exp/sig).
|
|
10
|
+
* • fingerprint — DID ITS INPUTS CHANGE (hash of entry + endpoint + the props seed).
|
|
11
|
+
*/
|
|
12
|
+
/** 64-bit fingerprint over a string → 16-char hex. Two independent 32-bit lanes (FNV-1a-32 and an
|
|
13
|
+
* FNV-style lane with murmur's mixing constant + an xorshift), concatenated. 64 bits on purpose:
|
|
14
|
+
* the server-delta SKIPS a region on a fingerprint match, so a collision would keep stale/wrong
|
|
15
|
+
* content silently — 64 bits makes that a non-risk on any real page. NOT canonical FNV-1a-64: the
|
|
16
|
+
* previous BigInt implementation cost 20 ms per island on a CMS page whose props run to 480 KB
|
|
17
|
+
* (one BigInt allocation per character — 0.4 s of a 3.7 s server render, seen in the profiler);
|
|
18
|
+
* this loop is pure int32 arithmetic and hashes the same page in about a millisecond. Parity is by
|
|
19
|
+
* construction — the same function runs on both legs — so the algorithm is free to change. */
|
|
20
|
+
export declare function fnv1a(s: string): string;
|
|
21
|
+
/** WHICH COPY of a hole: copies of one component share its id, and differ by their props. The key is
|
|
22
|
+
* a short hash of the props PAYLOAD as it rides in the hole's signed endpoint (`?props=`) — the one
|
|
23
|
+
* string the server's request, the page's note and the browser's report all hold, verbatim. */
|
|
24
|
+
export declare function hole_copy_key(payload: string): string;
|
|
25
|
+
/** The copy key of a hole endpoint (its `props` parameter), or '' when it has none. */
|
|
26
|
+
export declare function hole_copy_of(endpoint: string): string;
|
|
27
|
+
/** FNV-1a 32-bit over a string → uint32. The NUMERIC sibling for callers that bucket/mod rather
|
|
28
|
+
* than compare (experiment splits, build-cache keys) — no BigInt, no hex round-trip. This is THE
|
|
29
|
+
* one shared implementation; the driver/vite copies were folded into it. */
|
|
30
|
+
export declare function fnv1a32(s: string): number;
|
|
31
|
+
/**
|
|
32
|
+
* The stable part of a signed endpoint URL: everything up to the volatile `&exp=…&sig=…` tail.
|
|
33
|
+
* A deferred region's endpoint encodes `?id=…&props=…&exp=…&sig=…`; exp/sig rotate per render, so
|
|
34
|
+
* they must NOT enter identity or two renders of the same region would never match. Returns the
|
|
35
|
+
* `id`+`props` portion; empty string when there is no endpoint.
|
|
36
|
+
*/
|
|
37
|
+
export declare function endpoint_key(endpoint: string): string;
|
|
38
|
+
/** Match key: WHICH region slot this is (testable without a DOM). */
|
|
39
|
+
export declare function signature_of(entry: string, endpoint: string): string;
|
|
40
|
+
/** Change key: DID this region's inputs change (testable without a DOM). */
|
|
41
|
+
export declare function fingerprint_of(entry: string, endpoint: string, props_text: string): string;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
// src/runtime/hash.ts
|
|
2
|
+
/**
|
|
3
|
+
* Region fingerprint — the PURE core (no DOM, no imports) shared by the client reconciler AND the
|
|
4
|
+
* server (Region.svelte, server-delta nav). Kept dependency-free so it is safe in BOTH bundles and
|
|
5
|
+
* so client↔server fingerprints are IDENTICAL BY CONSTRUCTION: the server emits `data-og-fp =
|
|
6
|
+
* fingerprint_of(entry, '', props_payload)` on each island, and the client's `region_props_fp`
|
|
7
|
+
* reads the same entry attribute + '' endpoint + props-script text → the same hash. That parity is
|
|
8
|
+
* what makes server-delta nav safe (the server skips exactly the regions the client says it has).
|
|
9
|
+
*
|
|
10
|
+
* • signature — WHICH region slot (entry + the endpoint's stable id/props, minus exp/sig).
|
|
11
|
+
* • fingerprint — DID ITS INPUTS CHANGE (hash of entry + endpoint + the props seed).
|
|
12
|
+
*/
|
|
13
|
+
/** 64-bit fingerprint over a string → 16-char hex. Two independent 32-bit lanes (FNV-1a-32 and an
|
|
14
|
+
* FNV-style lane with murmur's mixing constant + an xorshift), concatenated. 64 bits on purpose:
|
|
15
|
+
* the server-delta SKIPS a region on a fingerprint match, so a collision would keep stale/wrong
|
|
16
|
+
* content silently — 64 bits makes that a non-risk on any real page. NOT canonical FNV-1a-64: the
|
|
17
|
+
* previous BigInt implementation cost 20 ms per island on a CMS page whose props run to 480 KB
|
|
18
|
+
* (one BigInt allocation per character — 0.4 s of a 3.7 s server render, seen in the profiler);
|
|
19
|
+
* this loop is pure int32 arithmetic and hashes the same page in about a millisecond. Parity is by
|
|
20
|
+
* construction — the same function runs on both legs — so the algorithm is free to change. */
|
|
21
|
+
function fnv1a(s) {
|
|
22
|
+
let a = 2166136261;
|
|
23
|
+
let b = 522970236;
|
|
24
|
+
for (let i = 0; i < s.length; i++) {
|
|
25
|
+
const c = s.charCodeAt(i);
|
|
26
|
+
a ^= c;
|
|
27
|
+
a = Math.imul(a, 16777619);
|
|
28
|
+
b ^= c;
|
|
29
|
+
b = Math.imul(b, 668265263);
|
|
30
|
+
b ^= b >>> 15;
|
|
31
|
+
}
|
|
32
|
+
return (a >>> 0).toString(16).padStart(8, "0") + (b >>> 0).toString(16).padStart(8, "0");
|
|
33
|
+
}
|
|
34
|
+
/** WHICH COPY of a hole: copies of one component share its id, and differ by their props. The key is
|
|
35
|
+
* a short hash of the props PAYLOAD as it rides in the hole's signed endpoint (`?props=`) — the one
|
|
36
|
+
* string the server's request, the page's note and the browser's report all hold, verbatim. */
|
|
37
|
+
function hole_copy_key(payload) {
|
|
38
|
+
return fnv1a32(payload).toString(36);
|
|
39
|
+
}
|
|
40
|
+
/** The copy key of a hole endpoint (its `props` parameter), or '' when it has none. */
|
|
41
|
+
function hole_copy_of(endpoint) {
|
|
42
|
+
let at = endpoint.indexOf("&props=");
|
|
43
|
+
if (at === -1) at = endpoint.indexOf("?props=");
|
|
44
|
+
if (at === -1) return "";
|
|
45
|
+
at += 7;
|
|
46
|
+
const end = endpoint.indexOf("&", at);
|
|
47
|
+
return hole_copy_key(endpoint.slice(at, end === -1 ? endpoint.length : end));
|
|
48
|
+
}
|
|
49
|
+
/** FNV-1a 32-bit over a string → uint32. The NUMERIC sibling for callers that bucket/mod rather
|
|
50
|
+
* than compare (experiment splits, build-cache keys) — no BigInt, no hex round-trip. This is THE
|
|
51
|
+
* one shared implementation; the driver/vite copies were folded into it. */
|
|
52
|
+
function fnv1a32(s) {
|
|
53
|
+
let h = 2166136261;
|
|
54
|
+
for (let i = 0; i < s.length; i++) {
|
|
55
|
+
h ^= s.charCodeAt(i);
|
|
56
|
+
h = Math.imul(h, 16777619);
|
|
57
|
+
}
|
|
58
|
+
return h >>> 0;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* The stable part of a signed endpoint URL: everything up to the volatile `&exp=…&sig=…` tail.
|
|
62
|
+
* A deferred region's endpoint encodes `?id=…&props=…&exp=…&sig=…`; exp/sig rotate per render, so
|
|
63
|
+
* they must NOT enter identity or two renders of the same region would never match. Returns the
|
|
64
|
+
* `id`+`props` portion; empty string when there is no endpoint.
|
|
65
|
+
*/
|
|
66
|
+
function endpoint_key(endpoint) {
|
|
67
|
+
if (!endpoint) return "";
|
|
68
|
+
const exp = endpoint.indexOf("&exp=");
|
|
69
|
+
return exp === -1 ? endpoint : endpoint.slice(0, exp);
|
|
70
|
+
}
|
|
71
|
+
/** Match key: WHICH region slot this is (testable without a DOM). */
|
|
72
|
+
function signature_of(entry, endpoint) {
|
|
73
|
+
return entry + " " + endpoint_key(endpoint);
|
|
74
|
+
}
|
|
75
|
+
/** Change key: DID this region's inputs change (testable without a DOM). */
|
|
76
|
+
function fingerprint_of(entry, endpoint, props_text) {
|
|
77
|
+
return fnv1a(entry + " " + endpoint_key(endpoint) + " " + props_text);
|
|
78
|
+
}
|
|
79
|
+
export { endpoint_key, fingerprint_of, fnv1a, fnv1a32, hole_copy_key, hole_copy_of, signature_of };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type HoleFacts = {
|
|
2
|
+
/** The signed capability URL the server minted. */
|
|
3
|
+
endpoint: string;
|
|
4
|
+
/** A hydrating hole's props sidecar, rebuilt from the recorded HTML; `null` for a static hole. */
|
|
5
|
+
sidecar: HTMLScriptElement | null;
|
|
6
|
+
};
|
|
7
|
+
/** The server-minted facts of the hole with this identity on `doc`, or `null`. */
|
|
8
|
+
export declare function hole_facts_of(doc: Document, identity: string): HoleFacts | null;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { HOLES_SCRIPT_TYPE } from "../holes-record.js";
|
|
2
|
+
// src/runtime/hole-facts.ts
|
|
3
|
+
/**
|
|
4
|
+
* THE HOLES RECORD — what the server minted for each deferred hole on a KIT-HYDRATED document,
|
|
5
|
+
* keyed by the hole's identity (`data-og-hole`: the fingerprint of region id + canonical props,
|
|
6
|
+
* computed the same way on both legs). The handle emits it in the document tail
|
|
7
|
+
* (`<script type="application/ogygia-holes">`, server/document-tail.ts), OUTSIDE Kit's root.
|
|
8
|
+
*
|
|
9
|
+
* Why it exists: Kit can give up hydrating such a document — a component threw while hydrating,
|
|
10
|
+
* the markup mismatched — and Svelte then clears Kit's root and mounts it fresh. Every hole is
|
|
11
|
+
* rendered again by the client leg, which cannot mint a signed address: `endpoint=""`, no props
|
|
12
|
+
* sidecar, the fallback standing forever (a site header's account holes went dark this way for
|
|
13
|
+
* signed-in visitors). The record survives the rebuild, so a rebuilt hole gets its facts back the
|
|
14
|
+
* moment it connects, by identity — never by position — and fetches exactly as the SSR element
|
|
15
|
+
* would have. Read lazily, parsed once per document.
|
|
16
|
+
*/
|
|
17
|
+
const HOLES_SELECTOR = `script[type="${HOLES_SCRIPT_TYPE}"]`;
|
|
18
|
+
/** One parse per document: the record, or `null` when the document carries none. */
|
|
19
|
+
const records = /* @__PURE__ */ new WeakMap();
|
|
20
|
+
function parse_record(doc) {
|
|
21
|
+
const el = doc.querySelector(HOLES_SELECTOR);
|
|
22
|
+
if (!el) return null;
|
|
23
|
+
let raw;
|
|
24
|
+
try {
|
|
25
|
+
raw = JSON.parse(el.textContent || "");
|
|
26
|
+
} catch {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
const map = /* @__PURE__ */ new Map();
|
|
30
|
+
for (const identity in raw) {
|
|
31
|
+
const entry = raw[identity];
|
|
32
|
+
if (!entry || typeof entry.endpoint !== "string" || !entry.endpoint) continue;
|
|
33
|
+
map.set(identity, {
|
|
34
|
+
endpoint: entry.endpoint,
|
|
35
|
+
sidecar: typeof entry.sidecar === "string" && entry.sidecar ? sidecar_element(doc, entry.sidecar) : null
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
return map;
|
|
39
|
+
}
|
|
40
|
+
/** The recorded sidecar HTML back into a script element (off the DOM; a `<template>` parses it
|
|
41
|
+
* without running anything — the sidecar is a data script, never executable). */
|
|
42
|
+
function sidecar_element(doc, html) {
|
|
43
|
+
const holder = doc.createElement("template");
|
|
44
|
+
holder.innerHTML = html;
|
|
45
|
+
const el = holder.content.firstElementChild;
|
|
46
|
+
return el && el.tagName === "SCRIPT" ? el : null;
|
|
47
|
+
}
|
|
48
|
+
/** The server-minted facts of the hole with this identity on `doc`, or `null`. */
|
|
49
|
+
function hole_facts_of(doc, identity) {
|
|
50
|
+
let record = records.get(doc);
|
|
51
|
+
if (record === void 0) {
|
|
52
|
+
record = parse_record(doc);
|
|
53
|
+
records.set(doc, record);
|
|
54
|
+
}
|
|
55
|
+
return record?.get(identity) ?? null;
|
|
56
|
+
}
|
|
57
|
+
export { hole_facts_of };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A WEB COMPONENT'S OWN CLASS TOKENS SURVIVE HYDRATION. A custom element's `class` has two writers:
|
|
3
|
+
* Svelte (the author's classes) and the component itself, which may put state on its own host (a
|
|
4
|
+
* theme over a dark image, an indicator position). Svelte's hydration writes `class` WHOLE whenever
|
|
5
|
+
* it differs from Svelte's value (svelte `set_class`), so every token the component added before
|
|
6
|
+
* the island woke was dropped — and a component that does not render again never puts it back.
|
|
7
|
+
*
|
|
8
|
+
* Ogygia knows which tokens are Svelte's for each custom element the restorer reset
|
|
9
|
+
* (runtime/restore.ts records them as `__og_svelte_class`): everything else on that host is the
|
|
10
|
+
* component's. So around an island's hydrate: before it, note each such host's non-Svelte tokens;
|
|
11
|
+
* after it, put back the ones Svelte's write removed. The tokens are read JUST BEFORE the hydrate,
|
|
12
|
+
* not as served: between restore and hydrate the component's own first render (or a script of its)
|
|
13
|
+
* may have added or dropped one from client state, and that is what it wants now. Either order of
|
|
14
|
+
* that render and the hydrate ends the same. Svelte's own tokens are never touched (a
|
|
15
|
+
* client value that differs from the server's still wins), and an element hydration replaced is
|
|
16
|
+
* skipped. An app without a server transform has no such hosts and pays one property read per
|
|
17
|
+
* custom element in the island.
|
|
18
|
+
*/
|
|
19
|
+
/** The expando the restorer writes on a custom element it reset: Svelte's class, as Svelte rendered it. */
|
|
20
|
+
export declare const SVELTE_CLASS = "__og_svelte_class";
|
|
21
|
+
/** Each restored custom element under `region` with tokens that are not Svelte's: [host, tokens]. */
|
|
22
|
+
export declare function note_host_classes(region: Element): Array<[Element, string[]]> | null;
|
|
23
|
+
/** Put back the component's tokens a hydration write removed. */
|
|
24
|
+
export declare function keep_host_classes(noted: Array<[Element, string[]]> | null): void;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// src/runtime/host-classes.ts
|
|
2
|
+
/**
|
|
3
|
+
* A WEB COMPONENT'S OWN CLASS TOKENS SURVIVE HYDRATION. A custom element's `class` has two writers:
|
|
4
|
+
* Svelte (the author's classes) and the component itself, which may put state on its own host (a
|
|
5
|
+
* theme over a dark image, an indicator position). Svelte's hydration writes `class` WHOLE whenever
|
|
6
|
+
* it differs from Svelte's value (svelte `set_class`), so every token the component added before
|
|
7
|
+
* the island woke was dropped — and a component that does not render again never puts it back.
|
|
8
|
+
*
|
|
9
|
+
* Ogygia knows which tokens are Svelte's for each custom element the restorer reset
|
|
10
|
+
* (runtime/restore.ts records them as `__og_svelte_class`): everything else on that host is the
|
|
11
|
+
* component's. So around an island's hydrate: before it, note each such host's non-Svelte tokens;
|
|
12
|
+
* after it, put back the ones Svelte's write removed. The tokens are read JUST BEFORE the hydrate,
|
|
13
|
+
* not as served: between restore and hydrate the component's own first render (or a script of its)
|
|
14
|
+
* may have added or dropped one from client state, and that is what it wants now. Either order of
|
|
15
|
+
* that render and the hydrate ends the same. Svelte's own tokens are never touched (a
|
|
16
|
+
* client value that differs from the server's still wins), and an element hydration replaced is
|
|
17
|
+
* skipped. An app without a server transform has no such hosts and pays one property read per
|
|
18
|
+
* custom element in the island.
|
|
19
|
+
*/
|
|
20
|
+
/** The expando the restorer writes on a custom element it reset: Svelte's class, as Svelte rendered it. */
|
|
21
|
+
const SVELTE_CLASS = "__og_svelte_class";
|
|
22
|
+
/** Each restored custom element under `region` with tokens that are not Svelte's: [host, tokens]. */
|
|
23
|
+
function note_host_classes(region) {
|
|
24
|
+
let out = null;
|
|
25
|
+
for (const el of region.getElementsByTagName("*")) {
|
|
26
|
+
const svelte = el[SVELTE_CLASS];
|
|
27
|
+
if (svelte === void 0) continue;
|
|
28
|
+
const own = new Set(svelte.split(" "));
|
|
29
|
+
let theirs = null;
|
|
30
|
+
for (const t of el.classList) if (!own.has(t)) (theirs ??= []).push(t);
|
|
31
|
+
if (theirs) (out ??= []).push([el, theirs]);
|
|
32
|
+
}
|
|
33
|
+
return out;
|
|
34
|
+
}
|
|
35
|
+
/** Put back the component's tokens a hydration write removed. */
|
|
36
|
+
function keep_host_classes(noted) {
|
|
37
|
+
if (!noted) return;
|
|
38
|
+
for (const [el, theirs] of noted) {
|
|
39
|
+
if (!el.isConnected) continue;
|
|
40
|
+
for (const t of theirs) if (!el.classList.contains(t)) el.classList.add(t);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
export { SVELTE_CLASS, keep_host_classes, note_host_classes };
|