@ogygia/core 0.0.0 → 0.11.1
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 +185 -0
- package/dist/compiler/ctx.js +203 -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,70 @@
|
|
|
1
|
+
import { interaction_link } from "./slots.js";
|
|
2
|
+
import { emit } from "../events/bus.js";
|
|
3
|
+
// src/runtime/interaction-replay.ts
|
|
4
|
+
const resolve_address = (region, addr) => interaction_link().resolve_address(region, addr);
|
|
5
|
+
const DEVTOOLS = typeof __OGYGIA_DEVTOOLS__ !== "undefined" ? __OGYGIA_DEVTOOLS__ : false;
|
|
6
|
+
/** Re-apply what the user typed while the island was waking, at each field's ADDRESS; sync `bind:`. */
|
|
7
|
+
function restore_fields(region, fields) {
|
|
8
|
+
for (const s of fields) {
|
|
9
|
+
const el = resolve_address(region, s.addr);
|
|
10
|
+
if (!el || el.tagName !== s.tag) continue;
|
|
11
|
+
const f = el;
|
|
12
|
+
if (f === s.el) continue;
|
|
13
|
+
let changed = false;
|
|
14
|
+
if (f.value !== s.el.value) {
|
|
15
|
+
f.value = s.el.value;
|
|
16
|
+
changed = true;
|
|
17
|
+
}
|
|
18
|
+
if (s.el instanceof HTMLInputElement && f.checked !== s.el.checked) {
|
|
19
|
+
f.checked = s.el.checked;
|
|
20
|
+
changed = true;
|
|
21
|
+
}
|
|
22
|
+
if (changed) {
|
|
23
|
+
try {
|
|
24
|
+
const { selectionStart, selectionEnd } = s.el;
|
|
25
|
+
if (selectionStart != null && selectionEnd != null) f.setSelectionRange(selectionStart, selectionEnd);
|
|
26
|
+
} catch {}
|
|
27
|
+
f.dispatchEvent(new Event("input", { bubbles: true }));
|
|
28
|
+
f.dispatchEvent(new Event("change", { bubbles: true }));
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Replay the queued clicks in arrival order at each click's address (tag-checked against drift).
|
|
34
|
+
* One frame later: hydration just (re)bound the island's web-component wiring (a dropdown web
|
|
35
|
+
* component's `target` element, set by a reactive statement) and many components apply such
|
|
36
|
+
* changes in their own render tick. A synchronous replay lands before that tick and toggles
|
|
37
|
+
* nothing; after a frame the component is settled.
|
|
38
|
+
*/
|
|
39
|
+
function replay_clicks(region, queued) {
|
|
40
|
+
const replay = () => {
|
|
41
|
+
for (const q of queued) {
|
|
42
|
+
const t = resolve_address(region, q.addr);
|
|
43
|
+
if (!t || t.tagName !== q.tag) continue;
|
|
44
|
+
const deep = q.deep;
|
|
45
|
+
(deep && deep.isConnected && t.shadowRoot?.contains(deep) ? deep : t).dispatchEvent(new MouseEvent("click", q.init));
|
|
46
|
+
}
|
|
47
|
+
queued.length = 0;
|
|
48
|
+
};
|
|
49
|
+
if (typeof requestAnimationFrame === "function") requestAnimationFrame(replay);
|
|
50
|
+
else replay();
|
|
51
|
+
}
|
|
52
|
+
/** The island is live: fields back, focus back, clicks replayed. */
|
|
53
|
+
function after_wake(region, fields, active_addr, queued) {
|
|
54
|
+
restore_fields(region, fields);
|
|
55
|
+
if (active_addr) {
|
|
56
|
+
const el = resolve_address(region, active_addr);
|
|
57
|
+
if (el instanceof HTMLElement && document.activeElement !== el) el.focus();
|
|
58
|
+
}
|
|
59
|
+
const replayed = queued.length;
|
|
60
|
+
replay_clicks(region, queued);
|
|
61
|
+
if (DEVTOOLS) emit({
|
|
62
|
+
domain: "runtime",
|
|
63
|
+
name: "interaction.replay",
|
|
64
|
+
entry: region.getAttribute("entry") || void 0,
|
|
65
|
+
fp: region.getAttribute("data-og-fp") || void 0,
|
|
66
|
+
clicks: replayed,
|
|
67
|
+
fields: fields.length
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
export { after_wake, replay_clicks };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/** Feature entry: fill the `interaction` slot — wake a cold island on first use, warm on hover. */
|
|
2
|
+
export declare function install(): void;
|
|
3
|
+
/** Child-index path from `region` down to `el` — survives node replacement by position. */
|
|
4
|
+
export declare function element_address(region: Element, el: Element): number[] | null;
|
|
5
|
+
/** The element now sitting at `addr` under `region` (post-hydration), or null. */
|
|
6
|
+
export declare function resolve_address(region: Element, addr: number[]): Element | null;
|
|
7
|
+
export type FieldSnapshot = {
|
|
8
|
+
/** The PRE-hydration node. Values are read from it AT RESTORE TIME: the wake fires on the very
|
|
9
|
+
* first keydown — BEFORE that key's character has landed — and more keystrokes land in this
|
|
10
|
+
* node while the island loads. A detached node keeps its `.value`, so at restore it holds
|
|
11
|
+
* everything the user typed up to the moment hydration swapped it out. */
|
|
12
|
+
el: HTMLInputElement;
|
|
13
|
+
addr: number[];
|
|
14
|
+
tag: string;
|
|
15
|
+
};
|
|
16
|
+
export type QueuedClick = {
|
|
17
|
+
addr: number[];
|
|
18
|
+
/** The deepest node of the click's composed path when it lies INSIDE a web component's shadow
|
|
19
|
+
* tree (a design-system button's inner <button>): a host-level replay never reaches the shadow-internal
|
|
20
|
+
* handler that actually toggles the component, so the replay lands here instead. */
|
|
21
|
+
deep: EventTarget | null;
|
|
22
|
+
tag: string;
|
|
23
|
+
init: MouseEventInit;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Arm a cold `wake="interaction"` region.
|
|
27
|
+
*
|
|
28
|
+
* @param region the `<ogygia-region>` element
|
|
29
|
+
* @param warm prefetch the island module (no hydrate) — wired to the pointer entering the region
|
|
30
|
+
* @param fire begin hydration; resolves when the island is live
|
|
31
|
+
* @returns disarm() — forget the region (disconnected before any interaction)
|
|
32
|
+
*/
|
|
33
|
+
export declare function arm_interaction(region: Element, warm: () => void, fire: () => Promise<void> | void): () => void;
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import { slots } from "./slots.js";
|
|
2
|
+
import { warm_island_module } from "./region-endpoint-url.js";
|
|
3
|
+
import { island_entry_of } from "./entry-locations.js";
|
|
4
|
+
// src/runtime/interaction.ts
|
|
5
|
+
/**
|
|
6
|
+
* WHAT A VISITOR DOES BEFORE AN ISLAND IS LIVE IS NOT LOST. `wake: 'interaction'` — the island sleeps
|
|
7
|
+
* until someone uses it; and every scheduled island (`load` / `idle` / `visible` / media) is armed the
|
|
8
|
+
* same way until it is live, since its server markup has no handlers either: a press on it wakes it at
|
|
9
|
+
* once (a gesture), and the click is replayed when it is live.
|
|
10
|
+
*
|
|
11
|
+
* WAKE (capture-phase): `pointerdown` | `keydown` | `focusin` | `click`. The first of these starts
|
|
12
|
+
* hydration. WARM (not a wake): the pointer moving over the region prefetches the island module, so
|
|
13
|
+
* by the time the press lands the chunk is usually cached and the wake is one microtask.
|
|
14
|
+
*
|
|
15
|
+
* DELEGATED: the listeners live on the DOCUMENT, once — five per armed island used to be five
|
|
16
|
+
* hundred on a page of interaction islands. An event resolves to the nearest ARMED region above its
|
|
17
|
+
* target (`closest`, walking up past nested regions that are not armed) and that region's state
|
|
18
|
+
* handles it exactly as its own capture listener did.
|
|
19
|
+
*
|
|
20
|
+
* HYDRATION REPLACES NODES. Svelte's hydrate pass may recreate the region's DOM, so nothing
|
|
21
|
+
* captured before the wake can be replayed/restored by node reference — the original elements are
|
|
22
|
+
* disconnected afterwards. Everything below is therefore re-resolved POSITIONALLY: an element is
|
|
23
|
+
* recorded as its child-index path from the region ("address"), and after hydration the element
|
|
24
|
+
* now sitting at that address receives the replay/restore. The hydrated markup mirrors the SSR
|
|
25
|
+
* markup (same component, same props), so addresses stay valid; a tag-name check guards drift.
|
|
26
|
+
*
|
|
27
|
+
* WHAT SURVIVES THE WAKE:
|
|
28
|
+
* - **Clicks are queued + replayed.** While waking, `click` events are `preventDefault()`ed and
|
|
29
|
+
* recorded (address + coordinates); after hydration each re-dispatches at its address. Cancel-
|
|
30
|
+
* then-replay means a checkbox / link / summary activates exactly ONCE — on the replay, where
|
|
31
|
+
* the island's handlers exist. Enter/Space activation arrives as a derived click → same path.
|
|
32
|
+
* - **Typing lands natively and is restored.** Characters are in the DOM before hydration starts;
|
|
33
|
+
* hydration resets `.value` from SSR state, so field values (+ checkedness + selection) are
|
|
34
|
+
* snapshotted at wake and re-applied at the field's address, with `input`/`change` events so
|
|
35
|
+
* `bind:` syncs. Keydowns are never synthetically replayed (untrusted keys produce no text).
|
|
36
|
+
* - **Focus is restored** at the focused element's address.
|
|
37
|
+
*
|
|
38
|
+
* Replayed events are NOT trusted user gestures (`event.isTrusted === false`): `window.open`,
|
|
39
|
+
* clipboard, fullscreen from the first interaction will be blocked by the browser, and a component
|
|
40
|
+
* that ignores untrusted clicks ignores the replay. Components can detect the situation via
|
|
41
|
+
* `hydratedBy() === 'interaction'`. A click that opens a link elsewhere (a modifier or the middle
|
|
42
|
+
* button) is never canceled: the browser does it on the server markup, and an untrusted replay could not.
|
|
43
|
+
*
|
|
44
|
+
* The capture (this module) is what must run synchronously inside the first event. The RESTORE +
|
|
45
|
+
* REPLAY half (./interaction-replay.ts) is only needed once an island has woken, so it loads when a
|
|
46
|
+
* pointer reaches an armed island or input lands — off the boot path, ahead of the replay.
|
|
47
|
+
*/
|
|
48
|
+
/** Feature entry: fill the `interaction` slot — wake a cold island on first use, warm on hover. */
|
|
49
|
+
function install() {
|
|
50
|
+
slots.interaction = (el, fire) => {
|
|
51
|
+
const warm = () => {
|
|
52
|
+
const entry = island_entry_of(el);
|
|
53
|
+
if (entry) warm_island_module(entry, void 0, "user");
|
|
54
|
+
};
|
|
55
|
+
return arm_interaction(el, warm, () => Promise.resolve(fire()));
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
const WAKE_EVENTS = [
|
|
59
|
+
"pointerdown",
|
|
60
|
+
"keydown",
|
|
61
|
+
"focusin",
|
|
62
|
+
"click"
|
|
63
|
+
];
|
|
64
|
+
const ARMED_SELECTOR = "ogygia-region";
|
|
65
|
+
/** Form controls whose typed value must survive hydration. */
|
|
66
|
+
const VALUE_SELECTOR = "input, textarea, select";
|
|
67
|
+
/** Child-index path from `region` down to `el` — survives node replacement by position. */
|
|
68
|
+
function element_address(region, el) {
|
|
69
|
+
const addr = [];
|
|
70
|
+
let node = el;
|
|
71
|
+
while (node !== region) {
|
|
72
|
+
const parent = node.parentElement;
|
|
73
|
+
if (!parent) return null;
|
|
74
|
+
addr.unshift(Array.prototype.indexOf.call(parent.children, node));
|
|
75
|
+
node = parent;
|
|
76
|
+
}
|
|
77
|
+
return addr;
|
|
78
|
+
}
|
|
79
|
+
/** The element now sitting at `addr` under `region` (post-hydration), or null. */
|
|
80
|
+
function resolve_address(region, addr) {
|
|
81
|
+
let node = region;
|
|
82
|
+
for (const i of addr) {
|
|
83
|
+
const next = node.children[i];
|
|
84
|
+
if (!next) return null;
|
|
85
|
+
node = next;
|
|
86
|
+
}
|
|
87
|
+
return node;
|
|
88
|
+
}
|
|
89
|
+
function snapshot_fields(region) {
|
|
90
|
+
const out = [];
|
|
91
|
+
for (const el of region.querySelectorAll(VALUE_SELECTOR)) {
|
|
92
|
+
const addr = element_address(region, el);
|
|
93
|
+
if (!addr) continue;
|
|
94
|
+
out.push({
|
|
95
|
+
el,
|
|
96
|
+
addr,
|
|
97
|
+
tag: el.tagName
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
return out;
|
|
101
|
+
}
|
|
102
|
+
const armed = /* @__PURE__ */ new Map();
|
|
103
|
+
let installed = false;
|
|
104
|
+
let replay_promise = null;
|
|
105
|
+
function replay() {
|
|
106
|
+
slots.interaction_link ??= { resolve_address };
|
|
107
|
+
return replay_promise ??= import("./interaction-replay.js");
|
|
108
|
+
}
|
|
109
|
+
/** The nearest ARMED region above an event's target (past nested regions that are not armed), never
|
|
110
|
+
* past a live one: a click inside an awake island is that island's, whatever sleeps around it. */
|
|
111
|
+
function armed_region_of(target) {
|
|
112
|
+
let el = target instanceof Element ? target.closest(ARMED_SELECTOR) : null;
|
|
113
|
+
while (el) {
|
|
114
|
+
const a = armed.get(el);
|
|
115
|
+
if (a) return a;
|
|
116
|
+
if (el.hasAttribute("data-hydrated")) return null;
|
|
117
|
+
el = el.parentElement?.closest(ARMED_SELECTOR) ?? null;
|
|
118
|
+
}
|
|
119
|
+
return null;
|
|
120
|
+
}
|
|
121
|
+
/** A click that opens a link elsewhere (a new tab or window): the browser does it on the server markup,
|
|
122
|
+
* and a replayed — untrusted — click could not. */
|
|
123
|
+
function opens_elsewhere(e, target) {
|
|
124
|
+
return (e.button !== 0 || e.ctrlKey || e.metaKey || e.shiftKey) && !!target.closest("a[href]");
|
|
125
|
+
}
|
|
126
|
+
function on_wake_event(e) {
|
|
127
|
+
if (armed.size === 0) return;
|
|
128
|
+
const a = armed_region_of(e.target);
|
|
129
|
+
if (a) wake(a, e);
|
|
130
|
+
}
|
|
131
|
+
/** `pointerover` bubbles (unlike `pointerenter`) — the pointer crossing INTO an armed region, from
|
|
132
|
+
* any descendant, warms its module once. */
|
|
133
|
+
function on_warm_event(e) {
|
|
134
|
+
if (armed.size === 0) return;
|
|
135
|
+
const a = armed_region_of(e.target);
|
|
136
|
+
if (!a || a.warmed) return;
|
|
137
|
+
a.warmed = true;
|
|
138
|
+
a.warm();
|
|
139
|
+
replay();
|
|
140
|
+
}
|
|
141
|
+
function install_listeners() {
|
|
142
|
+
if (installed) return;
|
|
143
|
+
installed = true;
|
|
144
|
+
for (const type of WAKE_EVENTS) document.addEventListener(type, on_wake_event, { capture: true });
|
|
145
|
+
document.addEventListener("pointerover", on_warm_event, {
|
|
146
|
+
capture: true,
|
|
147
|
+
passive: true
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
function wake(a, e) {
|
|
151
|
+
const { region, queued } = a;
|
|
152
|
+
if (e.type === "click" && e.target instanceof Element && !opens_elsewhere(e, e.target)) {
|
|
153
|
+
const addr = element_address(region, e.target);
|
|
154
|
+
if (addr) {
|
|
155
|
+
const me = e;
|
|
156
|
+
e.preventDefault();
|
|
157
|
+
const path = typeof e.composedPath === "function" ? e.composedPath() : [];
|
|
158
|
+
const deep = path.length && path[0] !== e.target ? path[0] : null;
|
|
159
|
+
queued.push({
|
|
160
|
+
addr,
|
|
161
|
+
deep,
|
|
162
|
+
tag: e.target.tagName,
|
|
163
|
+
init: {
|
|
164
|
+
bubbles: true,
|
|
165
|
+
cancelable: true,
|
|
166
|
+
composed: true,
|
|
167
|
+
clientX: me.clientX,
|
|
168
|
+
clientY: me.clientY,
|
|
169
|
+
button: me.button,
|
|
170
|
+
ctrlKey: me.ctrlKey,
|
|
171
|
+
metaKey: me.metaKey,
|
|
172
|
+
shiftKey: me.shiftKey,
|
|
173
|
+
altKey: me.altKey,
|
|
174
|
+
detail: me.detail
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
if (a.woken) return;
|
|
180
|
+
a.woken = true;
|
|
181
|
+
region.setAttribute("data-og-woke", "interaction");
|
|
182
|
+
const fields = snapshot_fields(region);
|
|
183
|
+
const active = document.activeElement;
|
|
184
|
+
const active_addr = active instanceof Element && region.contains(active) ? element_address(region, active) : null;
|
|
185
|
+
const disarm = () => armed.delete(region);
|
|
186
|
+
Promise.all([replay(), Promise.resolve(a.fire())]).then(([r]) => {
|
|
187
|
+
disarm();
|
|
188
|
+
r.after_wake(region, fields, active_addr, queued);
|
|
189
|
+
}, (err) => {
|
|
190
|
+
disarm();
|
|
191
|
+
replay().then((r) => r.replay_clicks(region, queued));
|
|
192
|
+
console.error("[ogygia] interaction island failed to hydrate — leaving it static.", err);
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Arm a cold `wake="interaction"` region.
|
|
197
|
+
*
|
|
198
|
+
* @param region the `<ogygia-region>` element
|
|
199
|
+
* @param warm prefetch the island module (no hydrate) — wired to the pointer entering the region
|
|
200
|
+
* @param fire begin hydration; resolves when the island is live
|
|
201
|
+
* @returns disarm() — forget the region (disconnected before any interaction)
|
|
202
|
+
*/
|
|
203
|
+
function arm_interaction(region, warm, fire) {
|
|
204
|
+
armed.set(region, {
|
|
205
|
+
region,
|
|
206
|
+
warm,
|
|
207
|
+
fire,
|
|
208
|
+
woken: false,
|
|
209
|
+
warmed: false,
|
|
210
|
+
queued: []
|
|
211
|
+
});
|
|
212
|
+
install_listeners();
|
|
213
|
+
return () => {
|
|
214
|
+
armed.delete(region);
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
export { arm_interaction, element_address, install, resolve_address };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** Marks a link this module inserted (tests and devtools tell them from the HTML's own). */
|
|
2
|
+
export declare const GRAPH_PRELOAD_ATTR = "data-ogygia-graph-preload";
|
|
3
|
+
/** Merge one graph script's text; hrefs resolve against `base` (the document the text came from).
|
|
4
|
+
* Its locations (`s`) go to the runtime's one identity → location map. */
|
|
5
|
+
export declare function register_island_graph(text: string, base?: string): void;
|
|
6
|
+
/**
|
|
7
|
+
* Start fetching every chunk `entry`'s code needs: one modulepreload link per chunk not linked yet.
|
|
8
|
+
* Call it in the same task as the entry's `import()`. An entry the page has no graph for (dev, an
|
|
9
|
+
* island inside a fetched hole answer) preloads nothing — its `import()` still finds its chunks.
|
|
10
|
+
*/
|
|
11
|
+
export declare function preload_island_graph(entry: string, base?: string, priority?: "high" | "auto" | "low"): void;
|
|
12
|
+
/** Test seam: forget every graph read and every chunk linked. */
|
|
13
|
+
export declare function reset_island_graph(): void;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { ISLAND_GRAPH_ATTR, decode_island_graph, decode_island_locations } from "../island-graph.js";
|
|
2
|
+
import { note_entry_location } from "./entry-locations.js";
|
|
3
|
+
import { runtime_session } from "./session.js";
|
|
4
|
+
// src/runtime/island-graph-preload.ts
|
|
5
|
+
/**
|
|
6
|
+
* PRELOAD AN ISLAND'S GRAPH AT WAKE — the runtime half of the island graph (../island-graph.ts).
|
|
7
|
+
*
|
|
8
|
+
* The page carries, as data, the chunks each island entry needs. When an island starts to load (its
|
|
9
|
+
* wake, after the wake gate; a hover or router warm), `preload_island_graph(entry)` inserts one
|
|
10
|
+
* `<link rel="modulepreload">` per chunk not yet linked, in the same task as the entry's `import()`.
|
|
11
|
+
* The browser then fetches the entry and its whole graph at once — no waterfall of discovering each
|
|
12
|
+
* import after the last one parsed — and only for islands that actually start.
|
|
13
|
+
*
|
|
14
|
+
* The graph is read lazily from every `script[data-ogygia-graph]` in the document (the document
|
|
15
|
+
* tail, a head copy a self-contained render emitted, the body a router swap brought in), each script
|
|
16
|
+
* once. Chunks are content-hashed URLs and entries are identities (their files, content-hashed too,
|
|
17
|
+
* resolve through runtime/entry-locations.ts), so a list read on one page is never wrong on the
|
|
18
|
+
* next: nothing to invalidate. A router warm reads the NEXT page's graph out of its fetched HTML
|
|
19
|
+
* (`register_island_graph`) before that page is in the DOM.
|
|
20
|
+
*/
|
|
21
|
+
const GRAPH_SELECTOR = `script[${ISLAND_GRAPH_ATTR}]`;
|
|
22
|
+
const MODULEPRELOAD_SELECTOR = "link[rel=\"modulepreload\"]";
|
|
23
|
+
/** Marks a link this module inserted (tests and devtools tell them from the HTML's own). */
|
|
24
|
+
const GRAPH_PRELOAD_ATTR = "data-ogygia-graph-preload";
|
|
25
|
+
/** entry URL (absolute) → its chunk URLs (absolute). */
|
|
26
|
+
const graph = /* @__PURE__ */ new Map();
|
|
27
|
+
let read_scripts = /* @__PURE__ */ new WeakSet();
|
|
28
|
+
/** Chunk URLs (absolute) already linked — ours, or a modulepreload the HTML carried. */
|
|
29
|
+
let linked = null;
|
|
30
|
+
function absolute(href, base) {
|
|
31
|
+
try {
|
|
32
|
+
return new URL(href, base).href;
|
|
33
|
+
} catch {
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
/** Merge one graph script's text; hrefs resolve against `base` (the document the text came from).
|
|
38
|
+
* Its locations (`s`) go to the runtime's one identity → location map. */
|
|
39
|
+
function register_island_graph(text, base = location.href) {
|
|
40
|
+
for (const [entry, src] of decode_island_locations(text)) note_entry_location(entry, src, base);
|
|
41
|
+
for (const [entry, hrefs] of decode_island_graph(text)) {
|
|
42
|
+
const key = absolute(entry, base);
|
|
43
|
+
if (!key || graph.has(key)) continue;
|
|
44
|
+
const list = [];
|
|
45
|
+
for (const href of hrefs) {
|
|
46
|
+
const url = absolute(href, base);
|
|
47
|
+
if (url) list.push(url);
|
|
48
|
+
}
|
|
49
|
+
graph.set(key, list);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
function read_document_graphs() {
|
|
53
|
+
for (const s of document.querySelectorAll(GRAPH_SELECTOR)) {
|
|
54
|
+
if (read_scripts.has(s)) continue;
|
|
55
|
+
read_scripts.add(s);
|
|
56
|
+
register_island_graph(s.textContent ?? "");
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
function linked_set() {
|
|
60
|
+
if (linked) return linked;
|
|
61
|
+
linked = /* @__PURE__ */ new Set();
|
|
62
|
+
for (const l of document.querySelectorAll(MODULEPRELOAD_SELECTOR)) {
|
|
63
|
+
const url = absolute(l.getAttribute("href") ?? "", location.href);
|
|
64
|
+
if (url) linked.add(url);
|
|
65
|
+
}
|
|
66
|
+
return linked;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Start fetching every chunk `entry`'s code needs: one modulepreload link per chunk not linked yet.
|
|
70
|
+
* Call it in the same task as the entry's `import()`. An entry the page has no graph for (dev, an
|
|
71
|
+
* island inside a fetched hole answer) preloads nothing — its `import()` still finds its chunks.
|
|
72
|
+
*/
|
|
73
|
+
function preload_island_graph(entry, base = location.href, priority = "auto") {
|
|
74
|
+
if (typeof document === "undefined") return;
|
|
75
|
+
const key = absolute(entry, base);
|
|
76
|
+
if (!key) return;
|
|
77
|
+
if (!graph.has(key)) read_document_graphs();
|
|
78
|
+
const hrefs = graph.get(key);
|
|
79
|
+
if (!hrefs || hrefs.length === 0) return;
|
|
80
|
+
const seen = linked_set();
|
|
81
|
+
for (const href of hrefs) {
|
|
82
|
+
if (seen.has(href)) continue;
|
|
83
|
+
seen.add(href);
|
|
84
|
+
const link = document.createElement("link");
|
|
85
|
+
link.rel = "modulepreload";
|
|
86
|
+
if (priority !== "auto") link.setAttribute("fetchpriority", priority);
|
|
87
|
+
link.href = href;
|
|
88
|
+
link.setAttribute(GRAPH_PRELOAD_ATTR, "");
|
|
89
|
+
runtime_session.claim_page_head(link);
|
|
90
|
+
document.head.appendChild(link);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
/** Test seam: forget every graph read and every chunk linked. */
|
|
94
|
+
function reset_island_graph() {
|
|
95
|
+
graph.clear();
|
|
96
|
+
read_scripts = /* @__PURE__ */ new WeakSet();
|
|
97
|
+
linked = null;
|
|
98
|
+
}
|
|
99
|
+
export { GRAPH_PRELOAD_ATTR, preload_island_graph, register_island_graph, reset_island_graph };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export declare class KitBoot {
|
|
2
|
+
#private;
|
|
3
|
+
/**
|
|
4
|
+
* The route fact, when the server stamped it: `<meta name="ogygia-csr" content="true">` on a
|
|
5
|
+
* csr=true document. `null` when the document carries no such meta (an older document, a
|
|
6
|
+
* fragment) — then the inline-script probe below decides.
|
|
7
|
+
*/
|
|
8
|
+
static meta_of(doc: ParentNode): boolean | null;
|
|
9
|
+
/** Meta first; else ONE probe over the document's inline scripts (side-channel scripts skipped). */
|
|
10
|
+
static document_has(doc?: ParentNode): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Same check over an HTML string, bounded to the last 64 KB before `end` (pass the index of
|
|
13
|
+
* `</body>`; defaults to the end of the string). A 2.6 MB document is never scanned whole: Kit's
|
|
14
|
+
* boot sits at the end of the body, so the window is exact, not a heuristic. The side-channel
|
|
15
|
+
* strip still applies inside the window (P0 above); a side-channel script cut by the window's
|
|
16
|
+
* start cannot false-match either — its payload never carries a literal `<script` (devalue and
|
|
17
|
+
* JSON escape `<`), and `#INLINE` needs one.
|
|
18
|
+
*/
|
|
19
|
+
static html_has(html: string, end?: number): boolean;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Mixed mode: on a csr=true page, Kit boots and hydrates the whole tree (including our island
|
|
23
|
+
* components). THE one answer for the live document — read once (the meta, else the probe), cached
|
|
24
|
+
* on the session, cleared when the router prepares the next document. Every caller (the region
|
|
25
|
+
* element's guards, the router's start, the wrapper's client leg) reads this cache; none probes
|
|
26
|
+
* the document on its own.
|
|
27
|
+
*/
|
|
28
|
+
export declare function kit_hydrates_page(): boolean;
|
|
29
|
+
export declare const html_has_kit_bootstrap: typeof KitBoot.html_has;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { runtime_session } from "./session.js";
|
|
2
|
+
// src/runtime/kit-boot.ts
|
|
3
|
+
/**
|
|
4
|
+
* Detect whether a document is a Kit csr=true page (Kit boots and hydrates the tree).
|
|
5
|
+
* Must NOT treat ogygia side-channel scripts as evidence — their payloads can reflect
|
|
6
|
+
* attacker-controlled URL substrings like `__sveltekit_` (P0).
|
|
7
|
+
*/
|
|
8
|
+
var KitBoot = class KitBoot {
|
|
9
|
+
static #ASSIGN = /__sveltekit_\w+\s*=/;
|
|
10
|
+
static #SIDECHANNEL = /<script\b[^>]*(?:\bdata-ogygia-(?:props|page|remote)\b|type=["']application\/ogygia-(?:props|page|remote)["'])[^>]*>[\s\S]*?<\/script>/gi;
|
|
11
|
+
static #INLINE = /<script\b(?![^>]*\bsrc=)[^>]*>[^<]*__sveltekit_\w+\s*=/i;
|
|
12
|
+
/**
|
|
13
|
+
* The route fact, when the server stamped it: `<meta name="ogygia-csr" content="true">` on a
|
|
14
|
+
* csr=true document. `null` when the document carries no such meta (an older document, a
|
|
15
|
+
* fragment) — then the inline-script probe below decides.
|
|
16
|
+
*/
|
|
17
|
+
static meta_of(doc) {
|
|
18
|
+
const meta = doc.querySelector("meta[name=\"ogygia-csr\"]");
|
|
19
|
+
return meta ? meta.getAttribute("content") === "true" : null;
|
|
20
|
+
}
|
|
21
|
+
/** Meta first; else ONE probe over the document's inline scripts (side-channel scripts skipped). */
|
|
22
|
+
static document_has(doc = document) {
|
|
23
|
+
const meta = KitBoot.meta_of(doc);
|
|
24
|
+
if (meta !== null) return meta;
|
|
25
|
+
for (const s of doc.querySelectorAll("script:not([src])")) {
|
|
26
|
+
if ((s.getAttribute("type") || "").startsWith("application/ogygia-")) continue;
|
|
27
|
+
if (s.hasAttribute("data-ogygia-props") || s.hasAttribute("data-ogygia-page") || s.hasAttribute("data-ogygia-remote")) continue;
|
|
28
|
+
if (KitBoot.#ASSIGN.test(s.textContent || "")) return true;
|
|
29
|
+
}
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
/** How far before `end` the string check looks. Kit appends its boot script at the END of the
|
|
33
|
+
* body (render.js), right before `</body>`, so this window holds it whenever it exists. */
|
|
34
|
+
static #WINDOW = 65536;
|
|
35
|
+
/**
|
|
36
|
+
* Same check over an HTML string, bounded to the last 64 KB before `end` (pass the index of
|
|
37
|
+
* `</body>`; defaults to the end of the string). A 2.6 MB document is never scanned whole: Kit's
|
|
38
|
+
* boot sits at the end of the body, so the window is exact, not a heuristic. The side-channel
|
|
39
|
+
* strip still applies inside the window (P0 above); a side-channel script cut by the window's
|
|
40
|
+
* start cannot false-match either — its payload never carries a literal `<script` (devalue and
|
|
41
|
+
* JSON escape `<`), and `#INLINE` needs one.
|
|
42
|
+
*/
|
|
43
|
+
static html_has(html, end = html.length) {
|
|
44
|
+
const window = html.slice(Math.max(0, end - KitBoot.#WINDOW), end);
|
|
45
|
+
return KitBoot.#INLINE.test(window.replace(KitBoot.#SIDECHANNEL, ""));
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Mixed mode: on a csr=true page, Kit boots and hydrates the whole tree (including our island
|
|
50
|
+
* components). THE one answer for the live document — read once (the meta, else the probe), cached
|
|
51
|
+
* on the session, cleared when the router prepares the next document. Every caller (the region
|
|
52
|
+
* element's guards, the router's start, the wrapper's client leg) reads this cache; none probes
|
|
53
|
+
* the document on its own.
|
|
54
|
+
*/
|
|
55
|
+
function kit_hydrates_page() {
|
|
56
|
+
if (runtime_session.kit_page === void 0) runtime_session.kit_page = typeof document !== "undefined" && KitBoot.document_has(document);
|
|
57
|
+
return runtime_session.kit_page;
|
|
58
|
+
}
|
|
59
|
+
const html_has_kit_bootstrap = KitBoot.html_has.bind(KitBoot);
|
|
60
|
+
export { KitBoot, html_has_kit_bootstrap, kit_hydrates_page };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function kit_page_thread(): Promise<void> | null;
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
// src/runtime/kit-page-thread.svelte.ts
|
|
2
|
+
/**
|
|
3
|
+
* KIT-WORLD PAGE THREAD (wait side). On a Kit-hydrated (csr=true) document the handle ships no
|
|
4
|
+
* `application/ogygia-page` seed — Kit's own data blob is the truth, and the `$app/state` shim reads
|
|
5
|
+
* it through the bridge Kit's generated client entry publishes on `Symbol.for('ogygia.kit-page')`
|
|
6
|
+
* (KIT_PAGE_THREAD in vite/index.ts; read side in shims/page-store.svelte.ts).
|
|
7
|
+
*
|
|
8
|
+
* That entry arrives by Kit's boot `import()` — a network fetch — while an island of OURS on that
|
|
9
|
+
* document (inside a lake, inside a hole's answer) is already in the SSR tree and wakes on its own
|
|
10
|
+
* schedule. `wake:'idle'` fires while the browser waits for Kit's chunks. The island then hydrated
|
|
11
|
+
* against an empty `page.data` → a `{#if page.data.x}` took the other branch → Svelte discarded the
|
|
12
|
+
* island's server DOM and re-rendered it EMPTY (a customer's header search bar, ~1 in 3 loads — a
|
|
13
|
+
* race, so it looked erratic). So an island of ours on a Kit document waits before its hydrate turn.
|
|
14
|
+
* Its server HTML stays on screen meanwhile — waiting costs nothing visible, a discard costs the island.
|
|
15
|
+
*
|
|
16
|
+
* WHAT IS WAITED FOR — two moments, both exact, neither a guess:
|
|
17
|
+
*
|
|
18
|
+
* 1. The bridge is PUBLISHED. An accessor latch on the symbol: Kit's entry's plain assignment
|
|
19
|
+
* resolves it, whatever order the two worlds load in.
|
|
20
|
+
* 2. Kit has APPLIED its page. The bridge holds a LIVE reference to Kit's `$app/state` page, assigned
|
|
21
|
+
* when the entry EVALUATES — but that page is still Kit's pre-start default until `start()`'s
|
|
22
|
+
* `initialize()` runs `update(result.props.page)`, ~150–350 ms later (field: bridge=Y with
|
|
23
|
+
* data.keys=0, the island hydrates and collapses, data lands 200 ms too late). A wait that
|
|
24
|
+
* resolved on (1) alone closed only the first window. Kit's page object carries the marker
|
|
25
|
+
* itself: it is constructed with `status = -1` (and a placeholder URL) and `update()` assigns the
|
|
26
|
+
* real status. `status !== -1` is "Kit applied its page" — for an EMPTY-data page too, which is
|
|
27
|
+
* why this is not "data has keys" (that cannot tell empty-applied from not-yet-applied, and only
|
|
28
|
+
* a timeout could paper over it). Every field of that page is a `$state.raw`, so the assignment
|
|
29
|
+
* is a reactive write and an effect reading `status` re-runs on it: the exact moment, no polling.
|
|
30
|
+
*
|
|
31
|
+
* Nothing here touches the `$page` store (removed in Kit 3): the `$app/state` page object is what
|
|
32
|
+
* both Kit 2 and Kit 3 publish. No timeout either: a Kit document whose `start()` never runs has no
|
|
33
|
+
* page truth for such an island to hydrate against, and its own Kit components are equally dead —
|
|
34
|
+
* the island stays as its visible server HTML, which is the honest state.
|
|
35
|
+
*
|
|
36
|
+
* `null` when the page is already applied (the common late-wake case: a fetched hole's islands, a
|
|
37
|
+
* click long after boot) — the caller skips the await entirely.
|
|
38
|
+
*/
|
|
39
|
+
const KIT_PAGE_KEY = Symbol.for("ogygia.kit-page");
|
|
40
|
+
/** Kit constructs its `$app/state` page with this status; `initialize()` replaces it with the real one. */
|
|
41
|
+
const KIT_PRE_START_STATUS = -1;
|
|
42
|
+
let pending = null;
|
|
43
|
+
function bridge_of() {
|
|
44
|
+
return globalThis[KIT_PAGE_KEY];
|
|
45
|
+
}
|
|
46
|
+
/** Reads Kit's live `status` — a reactive read when called inside an effect. */
|
|
47
|
+
function page_applied(bridge) {
|
|
48
|
+
if (bridge == null) return false;
|
|
49
|
+
try {
|
|
50
|
+
return bridge.page?.status !== KIT_PRE_START_STATUS;
|
|
51
|
+
} catch {
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* DEV ONLY: after this long still waiting, say so once. The wait itself has no timeout by design (an
|
|
57
|
+
* island of ours has no page truth to hydrate against until Kit applies its page, and its server HTML
|
|
58
|
+
* is the honest state meanwhile) — but a Kit boot that never happens must be diagnosable, not silent.
|
|
59
|
+
* Dead code in a production build.
|
|
60
|
+
*/
|
|
61
|
+
const DEV_STILL_WAITING_MS = 5e3;
|
|
62
|
+
function kit_page_thread() {
|
|
63
|
+
if (page_applied(bridge_of())) return null;
|
|
64
|
+
return pending ??= new Promise((resolve) => {
|
|
65
|
+
let slow = null;
|
|
66
|
+
if (import.meta.env.DEV) slow = setTimeout(() => {
|
|
67
|
+
const bridge = bridge_of();
|
|
68
|
+
console.warn(`[ogygia] islands inside a lake / hole answer on this Kit (csr=true) page have waited ${DEV_STILL_WAITING_MS / 1e3}s for Kit to apply its page and are still holding their server HTML. ` + (bridge == null ? `Kit's client entry has not evaluated (no page bridge yet) — Kit's boot script may be blocked, failing, or missing.` : `Kit's client entry evaluated but start() has not applied the page (status is still -1) — Kit's start() may have thrown; check the console above.`) + ` They hydrate the moment Kit does; nothing is discarded meanwhile.`);
|
|
69
|
+
}, DEV_STILL_WAITING_MS);
|
|
70
|
+
const done = () => {
|
|
71
|
+
if (slow !== null) clearTimeout(slow);
|
|
72
|
+
pending = null;
|
|
73
|
+
resolve();
|
|
74
|
+
};
|
|
75
|
+
await_bridge((bridge) => await_applied(bridge, done));
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
/** Moment 1: the symbol is assigned. Calls back synchronously if it already is. */
|
|
79
|
+
function await_bridge(cb) {
|
|
80
|
+
const g = globalThis;
|
|
81
|
+
if (g[KIT_PAGE_KEY] != null) return cb(g[KIT_PAGE_KEY]);
|
|
82
|
+
let value;
|
|
83
|
+
const settle = (v) => {
|
|
84
|
+
value = v;
|
|
85
|
+
Object.defineProperty(g, KIT_PAGE_KEY, {
|
|
86
|
+
value: v,
|
|
87
|
+
writable: true,
|
|
88
|
+
configurable: true,
|
|
89
|
+
enumerable: true
|
|
90
|
+
});
|
|
91
|
+
cb(v);
|
|
92
|
+
};
|
|
93
|
+
try {
|
|
94
|
+
Object.defineProperty(g, KIT_PAGE_KEY, {
|
|
95
|
+
configurable: true,
|
|
96
|
+
enumerable: true,
|
|
97
|
+
get: () => value,
|
|
98
|
+
set: settle
|
|
99
|
+
});
|
|
100
|
+
} catch {
|
|
101
|
+
const tick = () => g[KIT_PAGE_KEY] != null ? settle(g[KIT_PAGE_KEY]) : setTimeout(tick, 50);
|
|
102
|
+
tick();
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
/** Moment 2: Kit assigns the real status onto its live page — observed by an effect, resolved once. */
|
|
106
|
+
function await_applied(bridge, done) {
|
|
107
|
+
if (page_applied(bridge)) return done();
|
|
108
|
+
const stop = $effect.root(() => {
|
|
109
|
+
$effect(() => {
|
|
110
|
+
if (!page_applied(bridge)) return;
|
|
111
|
+
queueMicrotask(stop);
|
|
112
|
+
done();
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
export { kit_page_thread };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface NodeLike {
|
|
2
|
+
nodeType: number;
|
|
3
|
+
data?: string;
|
|
4
|
+
}
|
|
5
|
+
export interface ParentLike {
|
|
6
|
+
appendChild(node: NodeLike): unknown;
|
|
7
|
+
}
|
|
8
|
+
export interface FragmentLike {
|
|
9
|
+
lastChild: NodeLike | null;
|
|
10
|
+
removeChild(node: NodeLike): unknown;
|
|
11
|
+
}
|
|
12
|
+
/** Relocate trailing empty comments from `frag` into `lake`. Returns how many moved. */
|
|
13
|
+
export declare function relocate_trailing_empty_comments(frag: FragmentLike, lake: ParentLike): number;
|