@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,25 @@
|
|
|
1
|
+
import { AfterNavigateCallback, BeforeNavigateCallback } from "./router.js";
|
|
2
|
+
export declare const NAV_HANDLE_KEY: unique symbol;
|
|
3
|
+
export type NavHandle = {
|
|
4
|
+
goto(url: string | URL, opts?: {
|
|
5
|
+
replaceState?: boolean;
|
|
6
|
+
external?: boolean;
|
|
7
|
+
}): Promise<void>;
|
|
8
|
+
invalidate(): Promise<void>;
|
|
9
|
+
invalidateAll(): Promise<void>;
|
|
10
|
+
preloadData(url: string | URL): Promise<unknown>;
|
|
11
|
+
preloadCode(url?: string | URL): Promise<void>;
|
|
12
|
+
disableScrollHandling(): void;
|
|
13
|
+
pushState(): void;
|
|
14
|
+
replaceState(): void;
|
|
15
|
+
beforeNavigate(fn: BeforeNavigateCallback): () => void;
|
|
16
|
+
afterNavigate(fn: AfterNavigateCallback): () => void;
|
|
17
|
+
bust_page_cache(): void;
|
|
18
|
+
};
|
|
19
|
+
/** Publish the document's navigation handle (the router's replaces the MPA one). */
|
|
20
|
+
export declare function publish_nav(handle: NavHandle): void;
|
|
21
|
+
/**
|
|
22
|
+
* The handle when the router feature is not in this runtime (`router: false`): the browser owns
|
|
23
|
+
* navigation. Same contract the router's own functions had for that case.
|
|
24
|
+
*/
|
|
25
|
+
export declare function mpa_nav(): NavHandle;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { speculate_url } from "./speculate-hint.js";
|
|
2
|
+
// src/runtime/nav-handle.ts
|
|
3
|
+
/**
|
|
4
|
+
* THE NAVIGATION HANDLE — how ISLAND-SIDE code (the `$app/navigation` shim, `ogygia/app`, the
|
|
5
|
+
* remote-functions client stub, the lifecycle hooks) reaches the running runtime's navigation
|
|
6
|
+
* WITHOUT importing a runtime module.
|
|
7
|
+
*
|
|
8
|
+
* Why not just import the router: island code is bundled apart from the runtime (an island chunk
|
|
9
|
+
* can load on a csr=true page where the runtime never boots). A runtime module island code imports
|
|
10
|
+
* is SHARED between the two graphs, so the bundler must keep it out of the runtime chunk — and with
|
|
11
|
+
* it everything that module's own lazy chunks need. One `import … from '../runtime/router.ts'` in the
|
|
12
|
+
* navigation shim split the runtime's boot into a dozen files. So island code reads this handle
|
|
13
|
+
* from the global realm (the same pattern as the Kit page bridge, `Symbol.for('ogygia.kit-page')`),
|
|
14
|
+
* and `test/runtime-boot-svelte-free.test.ts` pins that no island-side module imports a boot module.
|
|
15
|
+
*
|
|
16
|
+
* Who publishes it, always, on a document ogygia boots:
|
|
17
|
+
* - the ROUTER feature (./router.ts `install`) — the SPA router's API;
|
|
18
|
+
* - otherwise core (`boot`) publishes {@link mpa_nav}: the browser navigates, preloads become
|
|
19
|
+
* Speculation Rules hints, and `invalidateAll` is still the soft seed refresh (./router-nav.ts,
|
|
20
|
+
* loaded on first use) — exactly what `router: false` apps got before.
|
|
21
|
+
*
|
|
22
|
+
* Island code reads it as `globalThis[Symbol.for('ogygia.nav')]` (the key is repeated there on
|
|
23
|
+
* purpose: importing {@link NAV_HANDLE_KEY} would be the very edge this module exists to avoid).
|
|
24
|
+
*/
|
|
25
|
+
const NAV_HANDLE_KEY = Symbol.for("ogygia.nav");
|
|
26
|
+
/** Publish the document's navigation handle (the router's replaces the MPA one). */
|
|
27
|
+
function publish_nav(handle) {
|
|
28
|
+
globalThis[NAV_HANDLE_KEY] = handle;
|
|
29
|
+
}
|
|
30
|
+
const NO_UNSUBSCRIBE = () => {};
|
|
31
|
+
/**
|
|
32
|
+
* The handle when the router feature is not in this runtime (`router: false`): the browser owns
|
|
33
|
+
* navigation. Same contract the router's own functions had for that case.
|
|
34
|
+
*/
|
|
35
|
+
function mpa_nav() {
|
|
36
|
+
return {
|
|
37
|
+
goto(url, opts = {}) {
|
|
38
|
+
const target = new URL(url, location.href);
|
|
39
|
+
if (target.protocol !== "http:" && target.protocol !== "https:") throw new Error("[ogygia] goto() only supports http(s) URLs");
|
|
40
|
+
if (target.origin !== location.origin && !opts.external) throw new Error("[ogygia] goto() only supports same-origin URLs (pass { external: true } to leave)");
|
|
41
|
+
if (opts.replaceState) location.replace(target.href);
|
|
42
|
+
else location.assign(target.href);
|
|
43
|
+
return Promise.resolve();
|
|
44
|
+
},
|
|
45
|
+
invalidate: () => import("./router-nav.js").then((n) => n.invalidate_all()),
|
|
46
|
+
invalidateAll: () => import("./router-nav.js").then((n) => n.invalidate_all()),
|
|
47
|
+
preloadData(url) {
|
|
48
|
+
speculate_url(url, "prerender");
|
|
49
|
+
return Promise.resolve({
|
|
50
|
+
type: "loaded",
|
|
51
|
+
status: 200,
|
|
52
|
+
data: {}
|
|
53
|
+
});
|
|
54
|
+
},
|
|
55
|
+
preloadCode(url) {
|
|
56
|
+
if (url != null) speculate_url(url, "prefetch");
|
|
57
|
+
return Promise.resolve();
|
|
58
|
+
},
|
|
59
|
+
disableScrollHandling() {},
|
|
60
|
+
pushState() {
|
|
61
|
+
console.warn("[ogygia] pushState() shallow routing is not supported; use goto().");
|
|
62
|
+
},
|
|
63
|
+
replaceState() {
|
|
64
|
+
console.warn("[ogygia] replaceState() shallow routing is not supported; use goto().");
|
|
65
|
+
},
|
|
66
|
+
beforeNavigate: () => NO_UNSUBSCRIBE,
|
|
67
|
+
afterNavigate: () => NO_UNSUBSCRIBE,
|
|
68
|
+
bust_page_cache() {}
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
export { NAV_HANDLE_KEY, mpa_nav, publish_nav };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { onDestroy } from "svelte";
|
|
2
|
+
// src/runtime/nav-hooks.ts
|
|
3
|
+
/**
|
|
4
|
+
* `beforeNavigate` / `afterNavigate` as a COMPONENT sees them (`$app/navigation`, `ogygia/app`):
|
|
5
|
+
* lifecycle-bound like Kit's — the hook is unsubscribed when the calling component is destroyed.
|
|
6
|
+
* The raw registrations (the runtime's navigation handle, ./nav-handle.ts) return an unsubscribe and
|
|
7
|
+
* nothing else; a component that called them on every mount (an island re-mounting on each
|
|
8
|
+
* navigation) left one more callback behind per visit. This module imports `onDestroy` from Svelte,
|
|
9
|
+
* so it lives beside the shims (in an island's chunk, where Svelte already is) — never in the
|
|
10
|
+
* runtime's boot chunk — and it imports nothing from the runtime (island code reaches it only
|
|
11
|
+
* through the navigation handle).
|
|
12
|
+
*
|
|
13
|
+
* Outside a component (a plain module, a test) Svelte throws on `onDestroy`; the registration
|
|
14
|
+
* still stands and the returned unsubscribe is the caller's to call, exactly as before.
|
|
15
|
+
*/
|
|
16
|
+
/** Tie a registration's unsubscribe to the calling component's lifetime; returns it too. */
|
|
17
|
+
function bind_to_component(off) {
|
|
18
|
+
try {
|
|
19
|
+
onDestroy(off);
|
|
20
|
+
} catch {}
|
|
21
|
+
return off;
|
|
22
|
+
}
|
|
23
|
+
export { bind_to_component };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** The value of `attr` on `el` or its NEAREST ancestor that has it, crossing shadow-root boundaries (an
|
|
2
|
+
* island inside a web component's shadow tree still finds the block around the component; a link a
|
|
3
|
+
* component renders in its shadow tree, the router's `data-sveltekit-reload` around the component). */
|
|
4
|
+
export declare function nearest_attr(el: Element, attr: string): string | null;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// src/runtime/nearest-attr.ts
|
|
2
|
+
/** The value of `attr` on `el` or its NEAREST ancestor that has it, crossing shadow-root boundaries (an
|
|
3
|
+
* island inside a web component's shadow tree still finds the block around the component; a link a
|
|
4
|
+
* component renders in its shadow tree, the router's `data-sveltekit-reload` around the component). */
|
|
5
|
+
function nearest_attr(el, attr) {
|
|
6
|
+
const sel = `[${typeof CSS !== "undefined" && CSS.escape ? CSS.escape(attr) : attr}]`;
|
|
7
|
+
let at = el;
|
|
8
|
+
while (at) {
|
|
9
|
+
const hit = at.closest(sel);
|
|
10
|
+
if (hit) return hit.getAttribute(attr);
|
|
11
|
+
const root = at.getRootNode();
|
|
12
|
+
at = root instanceof ShadowRoot ? root.host : null;
|
|
13
|
+
}
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
export { nearest_attr };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ONE IntersectionObserver per distinct `rootMargin`, shared by every element that wants to know
|
|
3
|
+
* when it enters the viewport — `wake:'visible'` islands, `when="visible"` holes, the hydration
|
|
4
|
+
* scheduler's viewport snapshot. An observer per island (150 of them on a measured page) is 150
|
|
5
|
+
* observers the browser walks on every scroll; one per margin is a handful, each walking the same
|
|
6
|
+
* targets in one pass. Callbacks live on a per-observer `WeakMap` keyed by the target, so a
|
|
7
|
+
* disconnected element drops out with its callbacks.
|
|
8
|
+
*
|
|
9
|
+
* SEVERAL callbacks per element per margin. It was one, a second `observe` replacing the first —
|
|
10
|
+
* and the hydration scheduler's viewport snapshot and a `wake:'visible'` island both watch the
|
|
11
|
+
* island at the default margin: the wake replaced the snapshot, so the scheduler never learned
|
|
12
|
+
* where a visible island was and held every one of them for its whole 48 ms snapshot wait (200
|
|
13
|
+
* islands scrolled into view: each woke 62–84 ms late, with nothing ahead of it).
|
|
14
|
+
*/
|
|
15
|
+
type Callback = (intersecting: boolean) => void;
|
|
16
|
+
/**
|
|
17
|
+
* Observe `el` under the shared observer for `rootMargin`; `cb` sees every intersection change
|
|
18
|
+
* (the initial one included) until the returned unobserve is called. Any number of callbacks per
|
|
19
|
+
* element: a later one gets the element's last known state at once (the browser reports an
|
|
20
|
+
* element it already watches only on a change), or the first report with the others.
|
|
21
|
+
*/
|
|
22
|
+
export declare function observe(el: Element, rootMargin: string, cb: Callback): () => void;
|
|
23
|
+
/** Test seam: how many observers exist (one per distinct rootMargin, ever). */
|
|
24
|
+
export declare function observer_count(): number;
|
|
25
|
+
/** Observe until the FIRST time `el` intersects, then fire once and stop. */
|
|
26
|
+
export declare function once_visible(el: Element, rootMargin: string, fire: () => void): () => void;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
// src/runtime/observe.ts
|
|
2
|
+
const observers = /* @__PURE__ */ new Map();
|
|
3
|
+
function shared(rootMargin) {
|
|
4
|
+
let s = observers.get(rootMargin);
|
|
5
|
+
if (!s) {
|
|
6
|
+
const callbacks = /* @__PURE__ */ new WeakMap();
|
|
7
|
+
const last = /* @__PURE__ */ new WeakMap();
|
|
8
|
+
s = {
|
|
9
|
+
io: new IntersectionObserver((entries) => {
|
|
10
|
+
for (const e of entries) {
|
|
11
|
+
last.set(e.target, e.isIntersecting);
|
|
12
|
+
const set = callbacks.get(e.target);
|
|
13
|
+
if (set) for (const cb of Array.from(set)) cb(e.isIntersecting);
|
|
14
|
+
}
|
|
15
|
+
}, { rootMargin }),
|
|
16
|
+
callbacks,
|
|
17
|
+
last
|
|
18
|
+
};
|
|
19
|
+
observers.set(rootMargin, s);
|
|
20
|
+
}
|
|
21
|
+
return s;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Observe `el` under the shared observer for `rootMargin`; `cb` sees every intersection change
|
|
25
|
+
* (the initial one included) until the returned unobserve is called. Any number of callbacks per
|
|
26
|
+
* element: a later one gets the element's last known state at once (the browser reports an
|
|
27
|
+
* element it already watches only on a change), or the first report with the others.
|
|
28
|
+
*/
|
|
29
|
+
function observe(el, rootMargin, cb) {
|
|
30
|
+
const s = shared(rootMargin);
|
|
31
|
+
let set = s.callbacks.get(el);
|
|
32
|
+
if (!set) s.callbacks.set(el, set = /* @__PURE__ */ new Set());
|
|
33
|
+
const first = set.size === 0;
|
|
34
|
+
set.add(cb);
|
|
35
|
+
if (first) s.io.observe(el);
|
|
36
|
+
else if (s.last.has(el)) {
|
|
37
|
+
const state = s.last.get(el);
|
|
38
|
+
queueMicrotask(() => {
|
|
39
|
+
if (s.callbacks.get(el)?.has(cb)) cb(state);
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
return () => {
|
|
43
|
+
const now = s.callbacks.get(el);
|
|
44
|
+
if (!now?.delete(cb) || now.size) return;
|
|
45
|
+
s.callbacks.delete(el);
|
|
46
|
+
s.last.delete(el);
|
|
47
|
+
s.io.unobserve(el);
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
/** Test seam: how many observers exist (one per distinct rootMargin, ever). */
|
|
51
|
+
function observer_count() {
|
|
52
|
+
return observers.size;
|
|
53
|
+
}
|
|
54
|
+
/** Observe until the FIRST time `el` intersects, then fire once and stop. */
|
|
55
|
+
function once_visible(el, rootMargin, fire) {
|
|
56
|
+
const stop = observe(el, rootMargin, (intersecting) => {
|
|
57
|
+
if (!intersecting) return;
|
|
58
|
+
stop();
|
|
59
|
+
fire();
|
|
60
|
+
});
|
|
61
|
+
return stop;
|
|
62
|
+
}
|
|
63
|
+
export { observe, observer_count, once_visible };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Add the time since `t0` to `phase`. */
|
|
2
|
+
export declare function charge(phase: string, t0: number): void;
|
|
3
|
+
/** Run `fn`, charging its time to `phase`. */
|
|
4
|
+
export declare function metered<T>(phase: string, fn: () => T): T;
|
|
5
|
+
/** The cost so far, rounded: `{ ms, phases }`. */
|
|
6
|
+
export declare function own_cost(): {
|
|
7
|
+
ms: number;
|
|
8
|
+
phases: Record<string, number>;
|
|
9
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// src/runtime/own-cost.ts
|
|
2
|
+
/**
|
|
3
|
+
* What MEASURING costs the page's main thread, by phase (ms): the work devtools and the profiler's
|
|
4
|
+
* beacon do only because someone measures — checking each island's markup as it hydrates, building the
|
|
5
|
+
* visit, the testing API's reports. A visitor with devtools off pays none of it, so a test subtracts it
|
|
6
|
+
* (`page().ogygia`) and a CPU comparison across ogygia versions stays about the page.
|
|
7
|
+
*/
|
|
8
|
+
const spent = globalThis[Symbol.for("ogygia.own-cost")] ??= {};
|
|
9
|
+
/** Add the time since `t0` to `phase`. */
|
|
10
|
+
function charge(phase, t0) {
|
|
11
|
+
spent[phase] = (spent[phase] ?? 0) + (performance.now() - t0);
|
|
12
|
+
}
|
|
13
|
+
/** Run `fn`, charging its time to `phase`. */
|
|
14
|
+
function metered(phase, fn) {
|
|
15
|
+
const t0 = performance.now();
|
|
16
|
+
try {
|
|
17
|
+
return fn();
|
|
18
|
+
} finally {
|
|
19
|
+
charge(phase, t0);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
/** The cost so far, rounded: `{ ms, phases }`. */
|
|
23
|
+
function own_cost() {
|
|
24
|
+
const phases = {};
|
|
25
|
+
let ms = 0;
|
|
26
|
+
for (const k in spent) {
|
|
27
|
+
phases[k] = Math.round(spent[k] * 10) / 10;
|
|
28
|
+
ms += spent[k];
|
|
29
|
+
}
|
|
30
|
+
return {
|
|
31
|
+
ms: Math.round(ms * 10) / 10,
|
|
32
|
+
phases
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export { charge, metered, own_cost };
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* # DOM ownership — who owns a node inside a region (internal/notes/dom-ownership.md)
|
|
3
|
+
*
|
|
4
|
+
* Every ogygia DOM writer (the pre-hydration drift check and repair, the morph behind hole answers /
|
|
5
|
+
* live ticks / navigations, drift-watch) asks THIS module whether it may touch an element, instead of
|
|
6
|
+
* re-deriving the answer from its own subset of signals. One answer per element, one precedence:
|
|
7
|
+
*
|
|
8
|
+
* | owner | what |
|
|
9
|
+
* |-----------|-----------------------------------------------------------------------|
|
|
10
|
+
* | `foreign` | a subtree the app declared the live DOM's own (`data-ogygia-keep` / `data-persist` on a plain element) |
|
|
11
|
+
* | `region` | a hydrated region root: Svelte's reactivity owns it now, not a morph |
|
|
12
|
+
* | `page` | `<ogygia-slot>`: host-page content an island adopts whole |
|
|
13
|
+
* | `static` | an element the compiler stamped `data-og-opaque` — render output Svelte's hydration never walks into (`{@html}`, `bind:innerHTML`, a custom element with static children) — or a child element of one stamped `data-og-html` (it may be `{@html}` content) |
|
|
14
|
+
* | `walk` | everything else: render output Svelte's walk binds by position |
|
|
15
|
+
*
|
|
16
|
+
* (Lakes are the sixth owner; the hydrate core lifts them out of both trees before any comparison,
|
|
17
|
+
* so no writer here meets one.) What each writer does with each owner is the contract table in the
|
|
18
|
+
* note; the short form:
|
|
19
|
+
* - the DRIFT CHECK and the REPAIR keep only `walk` in the server's shape — every other owner is one
|
|
20
|
+
* sibling to Svelte's walk (tag + position), never entered;
|
|
21
|
+
* - the MORPH never enters `foreign` or `region` (nor a morph ROOT that is `foreign`), and patches
|
|
22
|
+
* `static` / `page` / `walk` toward the answer;
|
|
23
|
+
* - DRIFT-WATCH ignores a change made inside a non-`walk` subtree (a widget upgrading its own light
|
|
24
|
+
* DOM is not the island drifting).
|
|
25
|
+
*
|
|
26
|
+
* `data-ogygia-keep` on an `<ogygia-region>` is NOT `foreign`: there it names an island that survives
|
|
27
|
+
* navigation (KeepHost) — Svelte owns that island, and it is repaired and hydrated like any other.
|
|
28
|
+
*
|
|
29
|
+
* FACETS (note §11): `owner_of` answers who writes INSIDE an element; the same module answers who
|
|
30
|
+
* writes its ATTRIBUTES (`attributes_writer`, `REGION_RENDER_ATTRS`), who ORDERS its children
|
|
31
|
+
* (`order_owner`), and whether a child EXISTS by the render's doing (`render_made`): one element, four
|
|
32
|
+
* facets, one place. The morph's matching, attribute sync and removal all read them.
|
|
33
|
+
*/
|
|
34
|
+
/** The owner of an element, for the writers that consult it. */
|
|
35
|
+
export type Owner = "foreign" | "region" | "page" | "static" | "walk";
|
|
36
|
+
/** The compiler's server-only stamp: Svelte's hydration never walks inside this element. */
|
|
37
|
+
export declare const OPAQUE_ATTR = "data-og-opaque";
|
|
38
|
+
/** The compiler's server-only stamp on an element holding an `{@html}` BESIDE other children: its
|
|
39
|
+
* child elements may be `{@html}` content, which Svelte never walks into. (PROD output opens an
|
|
40
|
+
* `{@html}` block with the same `<!---->` as any separator, so the exact range is not knowable from
|
|
41
|
+
* the DOM; its child elements are compared by tag and position only, never entered.) */
|
|
42
|
+
export declare const HTML_PARENT_ATTR = "data-og-html";
|
|
43
|
+
/** The app declared this subtree the live DOM's own: a plain element carrying `data-ogygia-keep` or
|
|
44
|
+
* `data-persist` (on a region, keep names a navigation-surviving island instead — not foreign). */
|
|
45
|
+
export declare function is_declared_foreign(el: Element): boolean;
|
|
46
|
+
/** A region whose subtree Svelte's reactivity owns (hydrated), or a kept island (it survives a
|
|
47
|
+
* navigation untouched) — matched by a morph, never entered. `data-hydrated` is only ever set on
|
|
48
|
+
* hyphenated roots, so its probe sits behind a cheap hyphen test. */
|
|
49
|
+
export declare function is_region_owned(el: Element): boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Who owns `el`. First match wins: `foreign` (declared) → `region` → `page` → `static` → `walk`.
|
|
52
|
+
* `foreign` outranks `region` for plain elements only (a region never answers `foreign`), so a kept
|
|
53
|
+
* island is `region` and a kept widget is `foreign`.
|
|
54
|
+
*/
|
|
55
|
+
export declare function owner_of(el: Element): Owner;
|
|
56
|
+
/** True when Svelte's hydration walk binds `el`'s CHILDREN by position — the only subtrees the drift
|
|
57
|
+
* check and the repair keep in the server's shape. */
|
|
58
|
+
export declare function walk_enters(el: Element): boolean;
|
|
59
|
+
/**
|
|
60
|
+
* An UPGRADED CUSTOM ELEMENT: a live web component whose own runtime owns its host. Detected
|
|
61
|
+
* STRUCTURALLY — a hyphenated name with a shadow root or a registered definition — never by a
|
|
62
|
+
* library-specific attribute. The ONE detection every writer uses (the morph's attribute skip and
|
|
63
|
+
* self-owned children, the repair's conflict report).
|
|
64
|
+
*/
|
|
65
|
+
export declare function is_upgraded_ce(el: Element): boolean;
|
|
66
|
+
/**
|
|
67
|
+
* An element whose CHILDREN are partly its own doing, not the render's: an upgraded custom element
|
|
68
|
+
* (it slots / rewrites its light DOM), or a `<dialog>` / `<details>` whose `open` the browser flips.
|
|
69
|
+
* A child it gave itself is `foreign` content inside a `walk`-owned element: the live morph keeps it;
|
|
70
|
+
* the repair removes it only where Svelte's walk needs the position (and reports the conflict).
|
|
71
|
+
*/
|
|
72
|
+
export declare function is_self_owned(el: Element): boolean;
|
|
73
|
+
/** Who writes an element's attributes: its own runtime (an upgraded custom element's host), Svelte's
|
|
74
|
+
* reactivity (a hydrated region root — but see {@link REGION_RENDER_ATTRS}), or the render. */
|
|
75
|
+
export declare function attributes_writer(el: Element): "render" | "element" | "region";
|
|
76
|
+
/** The attributes of a region root that stay the render's: its ADDRESS, which the render that minted
|
|
77
|
+
* it writes (a re-minted hole fetches its new answer there); its content is its answer's. */
|
|
78
|
+
export declare const REGION_RENDER_ATTRS: readonly string[];
|
|
79
|
+
/** Who orders an element's children: the render (positions are its sequence), or the element itself
|
|
80
|
+
* (a self-owned element relocates and wraps its light DOM — positions are not the render's). */
|
|
81
|
+
export declare function order_owner(el: Element): "render" | "element";
|
|
82
|
+
/**
|
|
83
|
+
* Does a self-owned element SLOT its light DOM — show it through a shadow root's `<slot>`s, in
|
|
84
|
+
* document order — rather than render it itself? Then it has no reason to move a child: the children
|
|
85
|
+
* are partly its own (it may add some), but the RENDER's nodes keep the render's order (morph.ts
|
|
86
|
+
* `reconcile_by_identity`). One with no shadow root may relocate and wrap them: its arrangement stands.
|
|
87
|
+
* (a closed shadow root is invisible here: such an element is taken to arrange, the safe side)
|
|
88
|
+
*/
|
|
89
|
+
export declare function slots_light_dom(el: Element): boolean;
|
|
90
|
+
/** A live region whose first HTML was baked into the page by Svelte's `{@html}` (Region.svelte,
|
|
91
|
+
* PromiseRegionAwait): kept for the element's life — Svelte's block anchors stay among its children. */
|
|
92
|
+
export declare const BAKED_ATTR = "data-og-baked";
|
|
93
|
+
/** Record that the render placed `node` (it may remove it once the render stops producing it). */
|
|
94
|
+
export declare function mark_render_made(node: Node): void;
|
|
95
|
+
/**
|
|
96
|
+
* Does `node`, a child of an element-ordered parent, EXIST by the render's doing? Marked by ogygia, or
|
|
97
|
+
* structurally: an `<ogygia-region>` is always render output, and an element whose tag the render
|
|
98
|
+
* produces at this level (`render_tags`) is render output — a runtime does not make the render's
|
|
99
|
+
* elements. Anything else is the element's own: never matched, never removed.
|
|
100
|
+
*/
|
|
101
|
+
export declare function render_made(node: Node, render_tags: ReadonlySet<string>): boolean;
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
// src/runtime/ownership.ts
|
|
2
|
+
/** The compiler's server-only stamp: Svelte's hydration never walks inside this element. */
|
|
3
|
+
const OPAQUE_ATTR = "data-og-opaque";
|
|
4
|
+
/** The compiler's server-only stamp on an element holding an `{@html}` BESIDE other children: its
|
|
5
|
+
* child elements may be `{@html}` content, which Svelte never walks into. (PROD output opens an
|
|
6
|
+
* `{@html}` block with the same `<!---->` as any separator, so the exact range is not knowable from
|
|
7
|
+
* the DOM; its child elements are compared by tag and position only, never entered.) */
|
|
8
|
+
const HTML_PARENT_ATTR = "data-og-html";
|
|
9
|
+
const REGION = "ogygia-region";
|
|
10
|
+
const SLOT = "ogygia-slot";
|
|
11
|
+
/** The app declared this subtree the live DOM's own: a plain element carrying `data-ogygia-keep` or
|
|
12
|
+
* `data-persist` (on a region, keep names a navigation-surviving island instead — not foreign). */
|
|
13
|
+
function is_declared_foreign(el) {
|
|
14
|
+
return el.localName !== REGION && (el.hasAttribute("data-ogygia-keep") || el.hasAttribute("data-persist"));
|
|
15
|
+
}
|
|
16
|
+
/** A region whose subtree Svelte's reactivity owns (hydrated), or a kept island (it survives a
|
|
17
|
+
* navigation untouched) — matched by a morph, never entered. `data-hydrated` is only ever set on
|
|
18
|
+
* hyphenated roots, so its probe sits behind a cheap hyphen test. */
|
|
19
|
+
function is_region_owned(el) {
|
|
20
|
+
const name = el.localName;
|
|
21
|
+
if (!name.includes("-")) return false;
|
|
22
|
+
if (el.hasAttribute("data-hydrated")) return true;
|
|
23
|
+
return name === REGION && el.hasAttribute("data-ogygia-keep");
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Who owns `el`. First match wins: `foreign` (declared) → `region` → `page` → `static` → `walk`.
|
|
27
|
+
* `foreign` outranks `region` for plain elements only (a region never answers `foreign`), so a kept
|
|
28
|
+
* island is `region` and a kept widget is `foreign`.
|
|
29
|
+
*/
|
|
30
|
+
function owner_of(el) {
|
|
31
|
+
if (is_declared_foreign(el)) return "foreign";
|
|
32
|
+
if (is_region_owned(el)) return "region";
|
|
33
|
+
if (el.localName === SLOT) return "page";
|
|
34
|
+
if (el.hasAttribute("data-og-opaque") || el.parentElement?.hasAttribute("data-og-html")) return "static";
|
|
35
|
+
return "walk";
|
|
36
|
+
}
|
|
37
|
+
/** True when Svelte's hydration walk binds `el`'s CHILDREN by position — the only subtrees the drift
|
|
38
|
+
* check and the repair keep in the server's shape. */
|
|
39
|
+
function walk_enters(el) {
|
|
40
|
+
return owner_of(el) === "walk";
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* An UPGRADED CUSTOM ELEMENT: a live web component whose own runtime owns its host. Detected
|
|
44
|
+
* STRUCTURALLY — a hyphenated name with a shadow root or a registered definition — never by a
|
|
45
|
+
* library-specific attribute. The ONE detection every writer uses (the morph's attribute skip and
|
|
46
|
+
* self-owned children, the repair's conflict report).
|
|
47
|
+
*/
|
|
48
|
+
function is_upgraded_ce(el) {
|
|
49
|
+
const name = el.localName;
|
|
50
|
+
if (!name.includes("-")) return false;
|
|
51
|
+
if (el.shadowRoot) return true;
|
|
52
|
+
return typeof customElements !== "undefined" && customElements.get(name) !== void 0;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* An element whose CHILDREN are partly its own doing, not the render's: an upgraded custom element
|
|
56
|
+
* (it slots / rewrites its light DOM), or a `<dialog>` / `<details>` whose `open` the browser flips.
|
|
57
|
+
* A child it gave itself is `foreign` content inside a `walk`-owned element: the live morph keeps it;
|
|
58
|
+
* the repair removes it only where Svelte's walk needs the position (and reports the conflict).
|
|
59
|
+
*/
|
|
60
|
+
function is_self_owned(el) {
|
|
61
|
+
const name = el.localName;
|
|
62
|
+
return name === "dialog" || name === "details" || is_upgraded_ce(el);
|
|
63
|
+
}
|
|
64
|
+
/** Who writes an element's attributes: its own runtime (an upgraded custom element's host), Svelte's
|
|
65
|
+
* reactivity (a hydrated region root — but see {@link REGION_RENDER_ATTRS}), or the render. */
|
|
66
|
+
function attributes_writer(el) {
|
|
67
|
+
if (el.localName === REGION || is_region_owned(el)) return "region";
|
|
68
|
+
return is_upgraded_ce(el) ? "element" : "render";
|
|
69
|
+
}
|
|
70
|
+
/** The attributes of a region root that stay the render's: its ADDRESS, which the render that minted
|
|
71
|
+
* it writes (a re-minted hole fetches its new answer there); its content is its answer's. */
|
|
72
|
+
const REGION_RENDER_ATTRS = ["endpoint"];
|
|
73
|
+
/** Who orders an element's children: the render (positions are its sequence), or the element itself
|
|
74
|
+
* (a self-owned element relocates and wraps its light DOM — positions are not the render's). */
|
|
75
|
+
function order_owner(el) {
|
|
76
|
+
if (el.localName === REGION) return el.hasAttribute("data-og-baked") ? "element" : "render";
|
|
77
|
+
return is_self_owned(el) ? "element" : "render";
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Does a self-owned element SLOT its light DOM — show it through a shadow root's `<slot>`s, in
|
|
81
|
+
* document order — rather than render it itself? Then it has no reason to move a child: the children
|
|
82
|
+
* are partly its own (it may add some), but the RENDER's nodes keep the render's order (morph.ts
|
|
83
|
+
* `reconcile_by_identity`). One with no shadow root may relocate and wrap them: its arrangement stands.
|
|
84
|
+
* (a closed shadow root is invisible here: such an element is taken to arrange, the safe side)
|
|
85
|
+
*/
|
|
86
|
+
function slots_light_dom(el) {
|
|
87
|
+
return el.shadowRoot !== null && is_upgraded_ce(el);
|
|
88
|
+
}
|
|
89
|
+
/** A live region whose first HTML was baked into the page by Svelte's `{@html}` (Region.svelte,
|
|
90
|
+
* PromiseRegionAwait): kept for the element's life — Svelte's block anchors stay among its children. */
|
|
91
|
+
const BAKED_ATTR = "data-og-baked";
|
|
92
|
+
/** The nodes ogygia placed under an element-ordered parent (a morph's claim or insertion, the restore
|
|
93
|
+
* putting Svelte's children back into a planned host). One per document across bundles: the inlined
|
|
94
|
+
* restorer fills the same set (`window.__og_rendered`). */
|
|
95
|
+
function rendered() {
|
|
96
|
+
const w = globalThis;
|
|
97
|
+
return w.__og_rendered ??= /* @__PURE__ */ new WeakSet();
|
|
98
|
+
}
|
|
99
|
+
/** Record that the render placed `node` (it may remove it once the render stops producing it). */
|
|
100
|
+
function mark_render_made(node) {
|
|
101
|
+
rendered().add(node);
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Does `node`, a child of an element-ordered parent, EXIST by the render's doing? Marked by ogygia, or
|
|
105
|
+
* structurally: an `<ogygia-region>` is always render output, and an element whose tag the render
|
|
106
|
+
* produces at this level (`render_tags`) is render output — a runtime does not make the render's
|
|
107
|
+
* elements. Anything else is the element's own: never matched, never removed.
|
|
108
|
+
*/
|
|
109
|
+
function render_made(node, render_tags) {
|
|
110
|
+
if (rendered().has(node)) return true;
|
|
111
|
+
if (node.nodeType !== 1) return false;
|
|
112
|
+
const name = node.localName;
|
|
113
|
+
return name === REGION || render_tags.has(name);
|
|
114
|
+
}
|
|
115
|
+
export { BAKED_ATTR, HTML_PARENT_ATTR, OPAQUE_ATTR, REGION_RENDER_ATTRS, attributes_writer, is_declared_foreign, is_region_owned, is_self_owned, is_upgraded_ce, mark_render_made, order_owner, owner_of, render_made, slots_light_dom, walk_enters };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bounded SPA HTML cache: TTL + max entries + approximate byte budget.
|
|
3
|
+
* Expired entries are dropped on read/insert; overflow drops oldest by timestamp.
|
|
4
|
+
*/
|
|
5
|
+
export type PageCacheEntry = {
|
|
6
|
+
html: string;
|
|
7
|
+
t: number;
|
|
8
|
+
bytes: number;
|
|
9
|
+
};
|
|
10
|
+
export declare class PageCache {
|
|
11
|
+
#private;
|
|
12
|
+
constructor(opts?: {
|
|
13
|
+
ttlMs?: number;
|
|
14
|
+
maxEntries?: number;
|
|
15
|
+
maxBytes?: number;
|
|
16
|
+
});
|
|
17
|
+
get(href: string): string | null;
|
|
18
|
+
set(href: string, html: string): void;
|
|
19
|
+
delete(href: string): void;
|
|
20
|
+
clear(): void;
|
|
21
|
+
get size(): number;
|
|
22
|
+
get bytes(): number;
|
|
23
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// src/runtime/page-cache.ts
|
|
2
|
+
var PageCache = class {
|
|
3
|
+
#map = /* @__PURE__ */ new Map();
|
|
4
|
+
#total_bytes = 0;
|
|
5
|
+
#ttlMs;
|
|
6
|
+
#maxEntries;
|
|
7
|
+
#maxBytes;
|
|
8
|
+
constructor(opts) {
|
|
9
|
+
this.#ttlMs = opts?.ttlMs ?? 8e3;
|
|
10
|
+
this.#maxEntries = opts?.maxEntries ?? 32;
|
|
11
|
+
this.#maxBytes = opts?.maxBytes ?? 4e6;
|
|
12
|
+
}
|
|
13
|
+
#drop(href) {
|
|
14
|
+
const e = this.#map.get(href);
|
|
15
|
+
if (!e) return;
|
|
16
|
+
this.#map.delete(href);
|
|
17
|
+
this.#total_bytes -= e.bytes;
|
|
18
|
+
}
|
|
19
|
+
#evict_expired(now) {
|
|
20
|
+
for (const [href, e] of this.#map) if (now - e.t >= this.#ttlMs) this.#drop(href);
|
|
21
|
+
}
|
|
22
|
+
#evict_overflow() {
|
|
23
|
+
while (this.#map.size > this.#maxEntries || this.#total_bytes > this.#maxBytes) {
|
|
24
|
+
let oldest_href = null;
|
|
25
|
+
let oldest_t = Infinity;
|
|
26
|
+
for (const [href, e] of this.#map) if (e.t < oldest_t) {
|
|
27
|
+
oldest_t = e.t;
|
|
28
|
+
oldest_href = href;
|
|
29
|
+
}
|
|
30
|
+
if (!oldest_href) break;
|
|
31
|
+
this.#drop(oldest_href);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
get(href) {
|
|
35
|
+
const now = Date.now();
|
|
36
|
+
const e = this.#map.get(href);
|
|
37
|
+
if (!e) return null;
|
|
38
|
+
if (now - e.t >= this.#ttlMs) {
|
|
39
|
+
this.#drop(href);
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
this.#map.delete(href);
|
|
43
|
+
e.t = now;
|
|
44
|
+
this.#map.set(href, e);
|
|
45
|
+
return e.html;
|
|
46
|
+
}
|
|
47
|
+
set(href, html) {
|
|
48
|
+
const now = Date.now();
|
|
49
|
+
this.#evict_expired(now);
|
|
50
|
+
this.#drop(href);
|
|
51
|
+
const bytes = html.length * 2;
|
|
52
|
+
this.#map.set(href, {
|
|
53
|
+
html,
|
|
54
|
+
t: now,
|
|
55
|
+
bytes
|
|
56
|
+
});
|
|
57
|
+
this.#total_bytes += bytes;
|
|
58
|
+
this.#evict_overflow();
|
|
59
|
+
}
|
|
60
|
+
delete(href) {
|
|
61
|
+
this.#drop(href);
|
|
62
|
+
}
|
|
63
|
+
clear() {
|
|
64
|
+
this.#map.clear();
|
|
65
|
+
this.#total_bytes = 0;
|
|
66
|
+
}
|
|
67
|
+
get size() {
|
|
68
|
+
return this.#map.size;
|
|
69
|
+
}
|
|
70
|
+
get bytes() {
|
|
71
|
+
return this.#total_bytes;
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
export { PageCache };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { PAGE_DEFER_BOOTSTRAP } from "../page-defer.js";
|
|
2
|
+
/** Reviver: a defer marker `[id]` becomes a real Promise, pending until its resolve script lands (or
|
|
3
|
+
* already-resolved if the resolve raced ahead of the seed). */
|
|
4
|
+
export declare function create_deferred(id: number): Promise<unknown>;
|
|
5
|
+
/** Install the live resolver (which parses the encoded value) and drain anything the inline bootstrap
|
|
6
|
+
* queued before the runtime loaded. `extra_revivers` are the app's transport decoders (custom types in
|
|
7
|
+
* a streamed value). Idempotent — safe to call on every boot; the first call's revivers win. */
|
|
8
|
+
export declare function install_page_defer(extra_revivers?: Record<string, (payload: never) => unknown>): void;
|
|
9
|
+
/** devalue reviver map for the page seed. A DEFER marker becomes a pending Promise (streaming path); a
|
|
10
|
+
* SETTLED marker becomes an already resolved/rejected Promise (non-navigate path). Both keep
|
|
11
|
+
* `page.data.x` a Promise, so `{#await}` works identically regardless of how the page was requested.
|
|
12
|
+
* `extra` merges the app's transport decoders; ogygia's own keys always win on any name clash. */
|
|
13
|
+
export declare function page_defer_revivers(extra?: Record<string, (payload: never) => unknown>): Record<string, (payload: never) => unknown>;
|
|
14
|
+
export { PAGE_DEFER_BOOTSTRAP };
|