@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,286 @@
|
|
|
1
|
+
import { lazyEntryVirtualId, regionBindingVirtualId } from "../ids.js";
|
|
2
|
+
// src/compiler/region/emit.ts
|
|
3
|
+
/**
|
|
4
|
+
* Region EMIT — codegen from a lowered descriptor to per-island virtual-module SOURCE. Pure leaves:
|
|
5
|
+
* `descriptor → source string`, no state, no AST. The one shared set of emitters the `.svelte` host
|
|
6
|
+
* and the `.ts` registry both call, so a `wake:` mark lowers to byte-identical artifacts from either
|
|
7
|
+
* entry point:
|
|
8
|
+
* - the ENTRY (`island_entry_source` / `region_entry_source`) — a JS re-export of the real component;
|
|
9
|
+
* - the WRAPPER (`island_wrapper_source`) — the mountable `.svelte` that renders `<ogygia-region>`;
|
|
10
|
+
* - the BINDING legs (`make_region_binding` / `wrapper_attach_binding` / `make_wake_island`) — the
|
|
11
|
+
* leg-split descriptor (SSR carries the signer + server render; client is metadata-only).
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Source of the generated `__renderHtml(props)` for a binding's SSR leg. The returned HTML must be
|
|
15
|
+
* self-sufficient when it crosses a wire, so it carries stylesheets THREE ways:
|
|
16
|
+
* - the component's OWN `<link>`s (its island entry's CSS assets — the page never imported it);
|
|
17
|
+
* - links NESTED regions emitted into `render().head` (a region rendered inside this render pass —
|
|
18
|
+
* props-composition, a recomposer's leaves — emits its `<link>`s via `svelte:head`, and keeping
|
|
19
|
+
* only `.body` would silently drop them: the leaf arrives unstyled);
|
|
20
|
+
* - the body itself (which may contain nested self-describing `<ogygia-region>` island markup).
|
|
21
|
+
*/
|
|
22
|
+
function render_html_source(moduleUrl) {
|
|
23
|
+
return `(props) => __ogRegionHtml(__ogRegionComp, ${JSON.stringify(moduleUrl)}, props)`;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* The component-import line for a generated module — a NAMED export (`import { Header as X } from
|
|
27
|
+
* '@barrel'`, the asRegion/barrel escape hatch) or a plain default (`import X from './X.svelte'`, a
|
|
28
|
+
* `.svelte` file or a package default). `exportName` is undefined/`'default'` for the default case.
|
|
29
|
+
*/
|
|
30
|
+
function component_import_line(local, spec, exportName) {
|
|
31
|
+
return exportName && exportName !== "default" ? `import { ${exportName} as ${local} } from ${JSON.stringify(spec)};` : `import ${local} from ${JSON.stringify(spec)};`;
|
|
32
|
+
}
|
|
33
|
+
/** JS re-export of the real component — the held region's entry (SSR render + client hydrate). */
|
|
34
|
+
function region_entry_source(componentPath, iid, exportName) {
|
|
35
|
+
return component_import_line(`__OgygiaComp_${iid}`, componentPath, exportName) + `
|
|
36
|
+
export default __OgygiaComp_${iid};\n`;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* The island ENTRY module — a JS re-export of the real component, loaded on both client hydrate and
|
|
40
|
+
* server render. The transportables import registers every `[ogygia.wire]` codec before props decode,
|
|
41
|
+
* so an island receiving a transportable prop never needs to import the class itself. Shared by the
|
|
42
|
+
* `.svelte` host and the `.ts` registry (a `wake:` mark) so a mountable binding is built the same way
|
|
43
|
+
* from either.
|
|
44
|
+
*/
|
|
45
|
+
function island_entry_source(componentPath, iid, exportName) {
|
|
46
|
+
return `import 'virtual:ogygia/transportables-eager';\n` + component_import_line(`__OgygiaComp_${iid}`, componentPath, exportName) + `
|
|
47
|
+
export default __OgygiaComp_${iid};\n` + FOREIGN_HYDRATE_MARK + `import { og_entry_hydrate as __og_hy, og_entry_unmount as __og_unmount } from 'ogygia/internal';
|
|
48
|
+
export function __og_hydrate(target, props, options) {
|
|
49
|
+
\treturn __og_hy(__OgygiaComp_${iid}, target, props, options);\n}\nexport { __og_unmount };\n`;
|
|
50
|
+
}
|
|
51
|
+
/** Where an island entry's foreign-hydrate exports begin (compiler/driver.ts cuts from here). */
|
|
52
|
+
const FOREIGN_HYDRATE_MARK = "// og:foreign-hydrate\n";
|
|
53
|
+
/**
|
|
54
|
+
* The island WRAPPER (`.svelte`) — a MOUNTABLE component that renders `<ogygia-region>` on its wake
|
|
55
|
+
* schedule. Placing it (`<C/>`, `<svelte:component this={C}/>`) emits the shell; the island's JS is
|
|
56
|
+
* fetched only when the shell wakes (e.g. `wake: 'visible'` → on scroll-into-view). Shared by the
|
|
57
|
+
* `.svelte` host and the `.ts` registry. `entry_url` is the resolved client/dev module URL the caller
|
|
58
|
+
* computes (ctx-dependent); `lang` is the `<script>` lang attribute (`''` for plain JS).
|
|
59
|
+
*/
|
|
60
|
+
function island_wrapper_source(iid, componentPath, entryPath, strategy, options, exportName, entry_url, lang) {
|
|
61
|
+
const strategy_attrs = strategy_to_attr(strategy, options);
|
|
62
|
+
const persist_attr = options?.keep ? ` __keep={${JSON.stringify(options.keep)}}` : "";
|
|
63
|
+
return `<script${lang}>\n\timport { Region as OgygiaRegion__Wrapper } from 'ogygia/internal';\n\timport __OgygiaEntry from ${JSON.stringify(entryPath)};\n\t${component_import_line("__OgygiaCss", componentPath, exportName)}\n\tlet { children, ...__props } = $props();\n<\/script>\n<OgygiaRegion__Wrapper __mode="island" ${strategy_attrs}${persist_attr} __entry={${JSON.stringify(entry_url)}} __component={__OgygiaEntry} __css={__OgygiaCss} {__props} {children} />\n`;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* The island wrapper's CLIENT leg (a csr=true-capable host imports it; Kit hydrates the island
|
|
67
|
+
* inline as a normal component). The SSR wrapper imports the component statically — it must
|
|
68
|
+
* render. The client wrapper must NOT: Kit links a route's `node.stylesheets` and preloads from the
|
|
69
|
+
* page's STATIC client graph, so a registry of N marked blocks imported by a csr=true route linked
|
|
70
|
+
* every block's CSS + chunk on every page (a newsroom page: 172 stylesheets for 4 islands). The
|
|
71
|
+
* component therefore comes through `lazy_entry_source` — a top-level-await module that imports
|
|
72
|
+
* the real entry only for the islands this document RENDERED (the SSR stamped a
|
|
73
|
+
* `<meta name="ogygia-kit-island">` per rendered island), so Kit still hydrates them in place with
|
|
74
|
+
* the component in hand, and a block nobody rendered costs nothing. Mounted fresh on a Kit
|
|
75
|
+
* client-side navigation (no SSR, no stamp), the wrapper loads the entry on demand and renders once
|
|
76
|
+
* it lands — a client render, so no hydration to mismatch.
|
|
77
|
+
*/
|
|
78
|
+
function island_wrapper_client_source(iid, lazyPath, strategy, options, entry_url, lang) {
|
|
79
|
+
const strategy_attrs = strategy_to_attr(strategy, options);
|
|
80
|
+
const persist_attr = options?.keep ? ` __keep={${JSON.stringify(options.keep)}}` : "";
|
|
81
|
+
return `<script${lang}>\n\timport { Region as OgygiaRegion__Wrapper } from 'ogygia/internal';\n\timport __OgygiaEntry, { load as __OgygiaLoad } from ${JSON.stringify(lazyPath)};\n\tlet { children, ...__props } = $props();\n<\/script>\n<OgygiaRegion__Wrapper __mode="island" ${strategy_attrs}${persist_attr} __entry={${JSON.stringify(entry_url)}} __component={__OgygiaEntry} __load={__OgygiaLoad} {__props} {children} />\n`;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* The client wrapper's component source (`lazyEntryVirtualId`). Decides ONCE, at module
|
|
85
|
+
* evaluation — before Kit hydrates, because Kit awaits the page node's import and a top-level
|
|
86
|
+
* await holds it. The two facts it reads are the document's own: `documentIsCsrTrue()` (the ONE
|
|
87
|
+
* csr fact Region reads on both legs) and the `<meta name="ogygia-kit-island">` stamp Region
|
|
88
|
+
* emits per rendered inline island (context.ts `claim_kit_island`).
|
|
89
|
+
* - not a Kit-hydrated document (the runtime woke this island's parent; no stamp exists there):
|
|
90
|
+
* import the entry now — a nested island must be in hand when its parent hydrates;
|
|
91
|
+
* - a Kit document that rendered this island: import the entry now, Kit hydrates it in place;
|
|
92
|
+
* - a Kit document that did NOT render it (an unrendered registry block): `undefined`, nothing
|
|
93
|
+
* fetched, nothing linked — `load()` is the on-demand path a client-side navigation takes.
|
|
94
|
+
* `entry_url` is the same string Region bakes into the stamp (`__entry`), on both legs.
|
|
95
|
+
*/
|
|
96
|
+
function lazy_entry_source(entryPath, entry_url) {
|
|
97
|
+
const entry = JSON.stringify(entryPath);
|
|
98
|
+
return `import { documentIsCsrTrue } from 'ogygia/internal';\nconst rendered = typeof document !== 'undefined' && !!document.querySelector(${JSON.stringify(`meta[name="ogygia-kit-island"][content=${JSON.stringify(entry_url)}]`)});\nexport default documentIsCsrTrue() && !rendered ? undefined : (await import(${entry})).default;\nexport const load = () => import(${entry}).then((m) => m.default);\n`;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Build the held-region descriptor shared by the `.svelte` and `.ts` paths. It ALWAYS carries a
|
|
102
|
+
* client chunk + `__module` (the region MIGHT be woken); when used statically the chunk is simply
|
|
103
|
+
* never fetched (HTML only at runtime). Two marker flavors feed it:
|
|
104
|
+
* - `wake: 'x'` → bakes `__hydrate: 'x'` — `region(C, props)` wakes on that schedule.
|
|
105
|
+
* - `region: 'raw'` → bakes NO schedule — `region(C, props, { wake })` sets it at the call.
|
|
106
|
+
* `region()` reads `opts.wake ?? binding.__hydrate`, so a baked schedule is the default and the call
|
|
107
|
+
* can override. `kind` is always `'hydrate'` so the chunk is emitted; `server:true` — the endpoint
|
|
108
|
+
* renders the HTML either way.
|
|
109
|
+
*/
|
|
110
|
+
function make_region_binding(opts) {
|
|
111
|
+
let meta = `__ogRegion: ${JSON.stringify(opts.iid)}, __module: ${JSON.stringify(opts.moduleUrl)}`;
|
|
112
|
+
if (opts.hydrate) meta += `, __hydrate: ${JSON.stringify(opts.hydrate)}`;
|
|
113
|
+
if (opts.hydrate && opts.hydrateMargin != null) meta += `, __hydrateMargin: ${JSON.stringify(opts.hydrateMargin)}`;
|
|
114
|
+
return {
|
|
115
|
+
id: opts.iid,
|
|
116
|
+
virtualPath: opts.entryPath,
|
|
117
|
+
source: region_entry_source(opts.componentPath, opts.iid, opts.exportName),
|
|
118
|
+
bindingPath: regionBindingVirtualId(opts.iid),
|
|
119
|
+
bindingSsrSource: component_import_line("__ogRegionComp", opts.componentPath, opts.exportName) + `
|
|
120
|
+
import { makeRegionEndpoint as __ogRegionSign, render_region_html as __ogRegionHtml } from 'ogygia/internal/server';
|
|
121
|
+
export default { ${meta}, __component: __ogRegionComp, __sign: __ogRegionSign, __renderHtml: ${render_html_source(opts.moduleUrl)} };\n`,
|
|
122
|
+
bindingClientSource: `export default { ${meta} };\n`,
|
|
123
|
+
hostPath: opts.hostPath,
|
|
124
|
+
componentPath: opts.componentPath,
|
|
125
|
+
server: true,
|
|
126
|
+
kind: "hydrate",
|
|
127
|
+
held: true,
|
|
128
|
+
lakes: [],
|
|
129
|
+
identity: opts.identity
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* A `wake`-marked import is rewritten to a binding that is BOTH placeable and holdable: `<C/>` (or a
|
|
134
|
+
* dynamic `<C/>` portable binding) renders the island wrapper, while `region(C)` reads a descriptor.
|
|
135
|
+
* We get both from ONE binding by attaching the descriptor fields onto the wrapper component as own
|
|
136
|
+
* properties — Svelte ignores them when rendering `<C/>`, and `region()` sees `__ogRegion` and reads
|
|
137
|
+
* `__component`/`__sign`/`__hydrate`. The baked `__hydrate` is the mark's schedule; a `region()` call
|
|
138
|
+
* can still override it. Leg-split like a held descriptor: the SSR leg carries the signer + server
|
|
139
|
+
* render (server-only), the client leg is metadata. Returns `{ ssr, client }` module sources.
|
|
140
|
+
*/
|
|
141
|
+
function wrapper_attach_binding(opts) {
|
|
142
|
+
let meta = `__ogRegion: ${JSON.stringify(opts.iid)}, __module: ${JSON.stringify(opts.moduleUrl)}`;
|
|
143
|
+
if (opts.hydrate) meta += `, __hydrate: ${JSON.stringify(opts.hydrate)}`;
|
|
144
|
+
if (opts.hydrate && opts.hydrateMargin != null) meta += `, __hydrateMargin: ${JSON.stringify(opts.hydrateMargin)}`;
|
|
145
|
+
return {
|
|
146
|
+
ssr: `import __OgygiaWrap from ${JSON.stringify(opts.wrapperPath)};\n` + component_import_line("__ogRegionComp", opts.componentPath, opts.exportName) + `
|
|
147
|
+
import { makeRegionEndpoint as __ogRegionSign, render_region_html as __ogRegionHtml } from 'ogygia/internal/server';
|
|
148
|
+
Object.assign(__OgygiaWrap, { ${meta}, __component: __ogRegionComp, __sign: __ogRegionSign, __renderHtml: ${render_html_source(opts.moduleUrl)} });\nexport default __OgygiaWrap;\n`,
|
|
149
|
+
client: `import __OgygiaWrap from ${JSON.stringify(opts.wrapperPath)};\nObject.assign(__OgygiaWrap, { ${meta} });\nexport default __OgygiaWrap;\n`
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* The complete island record for a `wake:` mark — the ONE emitter shared by the `.svelte` host (a
|
|
154
|
+
* placed `import X with { wake }`) and the `.ts` registry (a `wake:` mark handed to a renderer). The
|
|
155
|
+
* binding it produces is BOTH mountable (placing it, incl. via `<svelte:component>`, renders the
|
|
156
|
+
* `<ogygia-region>` shell that fetches the island JS only on its schedule) AND holdable (the descriptor
|
|
157
|
+
* fields ride on the wrapper, so `region(C)` still works). Threading both paths through here is what
|
|
158
|
+
* keeps `.svelte` and `.ts` `wake:` byte-identical — a `.ts` `wake: 'visible'` is exactly a `.svelte`
|
|
159
|
+
* `wake: 'visible'`. Callers own the host-specific import rewrite; this owns the record.
|
|
160
|
+
* `moduleUrl` is the resolved client/dev module URL; `lang` is the wrapper `<script>` lang (`''` = JS).
|
|
161
|
+
*/
|
|
162
|
+
function make_wake_island(opts) {
|
|
163
|
+
const margin = opts.strategy === "visible" ? opts.options?.margin : void 0;
|
|
164
|
+
const attach = wrapper_attach_binding({
|
|
165
|
+
iid: opts.iid,
|
|
166
|
+
wrapperPath: opts.wrapperPath,
|
|
167
|
+
componentPath: opts.componentPath,
|
|
168
|
+
moduleUrl: opts.moduleUrl,
|
|
169
|
+
hydrate: opts.strategy,
|
|
170
|
+
hydrateMargin: margin,
|
|
171
|
+
exportName: opts.exportName
|
|
172
|
+
});
|
|
173
|
+
const lazyPath = lazyEntryVirtualId(opts.iid);
|
|
174
|
+
return {
|
|
175
|
+
id: opts.iid,
|
|
176
|
+
virtualPath: opts.entryPath,
|
|
177
|
+
wrapperPath: opts.wrapperPath,
|
|
178
|
+
wrapperSource: island_wrapper_source(opts.iid, opts.componentPath, opts.entryPath, opts.strategy, opts.options, opts.exportName, opts.moduleUrl, opts.lang),
|
|
179
|
+
wrapperClientSource: island_wrapper_client_source(opts.iid, lazyPath, opts.strategy, opts.options, opts.moduleUrl, opts.lang),
|
|
180
|
+
lazyPath,
|
|
181
|
+
lazySource: lazy_entry_source(opts.entryPath, opts.moduleUrl),
|
|
182
|
+
bindingPath: regionBindingVirtualId(opts.iid),
|
|
183
|
+
bindingSsrSource: attach.ssr,
|
|
184
|
+
bindingClientSource: attach.client,
|
|
185
|
+
source: island_entry_source(opts.componentPath, opts.iid, opts.exportName),
|
|
186
|
+
hostPath: opts.hostPath,
|
|
187
|
+
componentPath: opts.componentPath,
|
|
188
|
+
server: !!opts.held,
|
|
189
|
+
...opts.held ? { held: true } : {},
|
|
190
|
+
kind: "hydrate",
|
|
191
|
+
lakes: [],
|
|
192
|
+
identity: opts.identity,
|
|
193
|
+
strategy: opts.strategy,
|
|
194
|
+
keep: opts.options?.keep
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* The SERVER-island wrapper (`.svelte`) — `render: 'deferred'`: a hole whose HTML is fetched on the
|
|
199
|
+
* `wake` schedule. `__defer` carries the fetch schedule; `__cacheTtl` (when signed) sets the hole's
|
|
200
|
+
* response cache; a deferred island that ALSO hydrates carries `__hydrate` + `__module` (its client
|
|
201
|
+
* entry URL). `module_url` is the resolved client/dev entry URL (used only when it hydrates); `lang`
|
|
202
|
+
* is the wrapper `<script>` lang.
|
|
203
|
+
*/
|
|
204
|
+
function server_wrapper_source(iid, componentPath, entryPath, options, exportName, module_url, lang, component = true) {
|
|
205
|
+
const deferred_hydrate = !!options?.hydrate;
|
|
206
|
+
const fetch_when = options?.when || "load";
|
|
207
|
+
let server_attrs = `__defer={${JSON.stringify(fetch_when)}}`;
|
|
208
|
+
if (options?.stitch) server_attrs += ` __stitch={${JSON.stringify(options.stitch)}}`;
|
|
209
|
+
if (options?.prefetch) server_attrs += ` __prefetch={${JSON.stringify(options.prefetch)}}`;
|
|
210
|
+
if (options?.margin != null) server_attrs += ` __margin={${JSON.stringify(options.margin)}}`;
|
|
211
|
+
if (options?.cacheTtlSec != null) server_attrs += ` __cacheTtl={${JSON.stringify(options.cacheTtlSec)}}`;
|
|
212
|
+
if (deferred_hydrate) {
|
|
213
|
+
server_attrs += ` __hydrate={${JSON.stringify(options.hydrate)}}`;
|
|
214
|
+
server_attrs += ` __module={${JSON.stringify(module_url)}}`;
|
|
215
|
+
if (options.hydrateMargin != null) server_attrs += ` __hydrateMargin={${JSON.stringify(options.hydrateMargin)}}`;
|
|
216
|
+
}
|
|
217
|
+
return `<script${lang}>\n\timport { Region as OgygiaRegion__Wrapper } from 'ogygia/internal';\n` + (component ? `\timport __OgygiaEntry from ${JSON.stringify(entryPath)};\n\t${component_import_line("__OgygiaCss", componentPath, exportName)}\n` : "") + ` let { ogygiaFallback, ...__props } = \$props();
|
|
218
|
+
<\/script>
|
|
219
|
+
<OgygiaRegion__Wrapper __mode="server" __entry={${JSON.stringify(iid)}} ` + (component ? `__component={__OgygiaEntry} __css={__OgygiaCss} ` : "") + `{__props} ${server_attrs} {ogygiaFallback} />\n`;
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* The LAKE wrapper (`.svelte`) — `render: page, wake: none`: a frozen region inside a hydrated island.
|
|
223
|
+
* A `swr` lake carries an endpoint (`__when` + `__props`) to remount on its schedule; `cache`/`empty`
|
|
224
|
+
* are wrapper-only. Static `<OgygiaLakeInner>` (not dynamic) preserves the LAKE-ENVELOPE; the client
|
|
225
|
+
* build swaps that import for the render-nothing stub. `lang` is the wrapper `<script>` lang.
|
|
226
|
+
*/
|
|
227
|
+
function lake_wrapper_source(iid, componentPath, options, exportName, lang) {
|
|
228
|
+
const remount = options?.remount || "cache";
|
|
229
|
+
const needs_endpoint = remount === "swr";
|
|
230
|
+
const when = options?.when || (needs_endpoint ? "load" : void 0);
|
|
231
|
+
let attrs = `__entry={${JSON.stringify(iid)}} __remount={${JSON.stringify(remount)}}`;
|
|
232
|
+
if (options?.maxAgeMs != null) attrs += ` __maxAge={${JSON.stringify(options.maxAgeMs)}}`;
|
|
233
|
+
if (options?.onExpire) attrs += ` __onExpire={${JSON.stringify(options.onExpire)}}`;
|
|
234
|
+
if (needs_endpoint) {
|
|
235
|
+
attrs += ` __when={${JSON.stringify(when || "load")}} __props={__props}`;
|
|
236
|
+
if (options?.margin != null) attrs += ` __margin={${JSON.stringify(options.margin)}}`;
|
|
237
|
+
}
|
|
238
|
+
return `<script${lang}>\n\timport { Region as OgygiaRegion__Wrapper } from 'ogygia/internal';\n\t${component_import_line("OgygiaLakeInner", componentPath, exportName)}\n\tlet __props = $props();\n<\/script>\n<OgygiaRegion__Wrapper __mode="lake" ${attrs}><OgygiaLakeInner {...__props} /></OgygiaRegion__Wrapper>\n`;
|
|
239
|
+
}
|
|
240
|
+
/** Map a hydrate strategy (+ options) to the Island wrapper attribute markup. */
|
|
241
|
+
function strategy_to_attr(strategy, options) {
|
|
242
|
+
if (!strategy || strategy === "load") return "load";
|
|
243
|
+
if (strategy === "idle") return "idle";
|
|
244
|
+
if (strategy === "interaction") return "interaction";
|
|
245
|
+
if (strategy === "visible") return options && options.margin != null ? `visible=${JSON.stringify(options.margin)}` : "visible";
|
|
246
|
+
return `media=${JSON.stringify(strategy)}`;
|
|
247
|
+
}
|
|
248
|
+
/** Rewrite `$app/{state,stores,navigation}` string literals to absolute shim paths. */
|
|
249
|
+
const APP_SHIM_IMPORT = /(['"])\$app\/(state|stores|navigation)\1/g;
|
|
250
|
+
const REGEXP_META = /[.*+?^${}()|[\]\\]/g;
|
|
251
|
+
const IMPORT_AS_CLAUSE = /^(.+?)(?:\s+as\s+(\w+))?$/;
|
|
252
|
+
/**
|
|
253
|
+
* Rewrite a lake binding's import to the render-nothing placeholder (client island modules only).
|
|
254
|
+
* Default imports are repointed; named imports drop that specifier (and keep siblings) then add a
|
|
255
|
+
* default import of the placeholder under the same local name.
|
|
256
|
+
*
|
|
257
|
+
* @internal Used by the plugin client emit and unit tests.
|
|
258
|
+
*/
|
|
259
|
+
function rewrite_lake_import_to_placeholder(src, local, placeholder) {
|
|
260
|
+
const esc = local.replace(REGEXP_META, "\\$&");
|
|
261
|
+
const ph = JSON.stringify(placeholder);
|
|
262
|
+
src = src.replace(new RegExp(`import\\s+${esc}\\s+from\\s+(['"])[^'"]+\\1`, "g"), `import ${local} from ${ph}`);
|
|
263
|
+
src = src.replace(new RegExp(`import\\s*\\{([^}]*)\\}\\s*from\\s*(['"])([^'"]+)\\2`, "g"), (full, specs, _q, from) => {
|
|
264
|
+
const parts = String(specs).split(",").map((s) => s.trim()).filter(Boolean);
|
|
265
|
+
const kept = [];
|
|
266
|
+
let hit = false;
|
|
267
|
+
for (const p of parts) {
|
|
268
|
+
const m = p.match(IMPORT_AS_CLAUSE);
|
|
269
|
+
if (!m) {
|
|
270
|
+
kept.push(p);
|
|
271
|
+
continue;
|
|
272
|
+
}
|
|
273
|
+
const imported = m[1].trim();
|
|
274
|
+
if ((m[2] || imported).trim() === local) {
|
|
275
|
+
hit = true;
|
|
276
|
+
continue;
|
|
277
|
+
}
|
|
278
|
+
kept.push(p);
|
|
279
|
+
}
|
|
280
|
+
if (!hit) return full;
|
|
281
|
+
const named = kept.length ? `import { ${kept.join(", ")} } from ${JSON.stringify(from)};` : "";
|
|
282
|
+
return `import ${local} from ${ph};${named ? "\n " + named : ""}`;
|
|
283
|
+
});
|
|
284
|
+
return src;
|
|
285
|
+
}
|
|
286
|
+
export { APP_SHIM_IMPORT, FOREIGN_HYDRATE_MARK, component_import_line, island_entry_source, island_wrapper_client_source, island_wrapper_source, lake_wrapper_source, lazy_entry_source, make_region_binding, make_wake_island, rewrite_lake_import_to_placeholder, server_wrapper_source, strategy_to_attr };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fingerprint of a region mark for dedupe. Same component path + same key → one wrapper/entry.
|
|
3
|
+
* @param mark
|
|
4
|
+
*/
|
|
5
|
+
export declare function strategyKey(mark: {
|
|
6
|
+
strategy: string;
|
|
7
|
+
options?: Record<string, unknown> | null;
|
|
8
|
+
}): string;
|
|
9
|
+
/**
|
|
10
|
+
* Cross-host stable identity: posix component path + {@link strategyKey}.
|
|
11
|
+
* Drives region ids so multiple hosts / import sites / `<A />` usages share one module.
|
|
12
|
+
*/
|
|
13
|
+
export declare function regionIdentity(componentRelPath: string, mark: {
|
|
14
|
+
strategy: string;
|
|
15
|
+
options?: Record<string, unknown> | null;
|
|
16
|
+
}): string;
|
|
17
|
+
/**
|
|
18
|
+
* A server-rendered region's RENDER identity: what the islands endpoint renders — the component
|
|
19
|
+
* alone (posix path, `#export` for a named one). A region id names a WRAPPER (the component ⊕ its
|
|
20
|
+
* page-side schedule ⊕ the build's salt); the endpoint's render of a component is the same under
|
|
21
|
+
* every schedule, so a capability that names its render identity is answered by any build that
|
|
22
|
+
* still serves the component as a region, whatever its schedule, its preset or the build's salt.
|
|
23
|
+
* Unsalted: it is never a file name (nothing to enumerate) and only rides inside a signed URL.
|
|
24
|
+
* @param identityOrPath a {@link regionIdentity} (its component half is taken) or a component path
|
|
25
|
+
*/
|
|
26
|
+
export declare function renderId(identityOrPath: string): string;
|
|
27
|
+
/** Hash an identity string (optional production salt) → 12-char region id. */
|
|
28
|
+
export declare function regionId(identityKey: string, salt?: string): string;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { createHash } from "../host.js";
|
|
2
|
+
// src/compiler/region/identity.ts
|
|
3
|
+
/**
|
|
4
|
+
* Region identity — the JOIN KEY of the whole compiler. Two files that mark the same component the
|
|
5
|
+
* same way independently mint the SAME id, and the linker collapses them; that is why a blind,
|
|
6
|
+
* file-local front-end and a dumb cross-file reducer stay decoupled. Pure functions, no state.
|
|
7
|
+
*
|
|
8
|
+
* strategyKey — a mark's dedupe fingerprint (schedule + the options baked into the wrapper)
|
|
9
|
+
* regionIdentity — posix component path ⊕ strategyKey (cross-host stable identity)
|
|
10
|
+
* regionId — hash(identity, optional prod salt) → the 12-char content-hashed id
|
|
11
|
+
*/
|
|
12
|
+
const PATH_SEP = /[/\\]/;
|
|
13
|
+
/**
|
|
14
|
+
* Fingerprint of a region mark for dedupe. Same component path + same key → one wrapper/entry.
|
|
15
|
+
* @param mark
|
|
16
|
+
*/
|
|
17
|
+
function strategyKey(mark) {
|
|
18
|
+
const o = mark.options || {};
|
|
19
|
+
if (mark.strategy === "server") {
|
|
20
|
+
let k = `defer:${o.when ?? "load"}`;
|
|
21
|
+
if (o.margin != null) k += `:margin:${o.margin}`;
|
|
22
|
+
if (o.cacheTtlSec != null) k += `:ttl:${o.cacheTtlSec}`;
|
|
23
|
+
if (o.stitch) k += `:stitch:${o.stitch}`;
|
|
24
|
+
if (o.prefetch) k += `:prefetch:${o.prefetch}`;
|
|
25
|
+
if (o.hydrate) {
|
|
26
|
+
k += `+hydrate:${o.hydrate}`;
|
|
27
|
+
if (o.hydrateMargin != null) k += `:hmargin:${o.hydrateMargin}`;
|
|
28
|
+
}
|
|
29
|
+
return k;
|
|
30
|
+
}
|
|
31
|
+
if (mark.strategy === "lake") {
|
|
32
|
+
let k = `lake:${o.remount || "cache"}`;
|
|
33
|
+
if (o.when) k += `:when:${o.when}`;
|
|
34
|
+
if (o.maxAgeMs != null) k += `:maxAge:${o.maxAgeMs}`;
|
|
35
|
+
if (o.onExpire) k += `:onExpire:${o.onExpire}`;
|
|
36
|
+
if (o.margin != null) k += `:margin:${o.margin}`;
|
|
37
|
+
return k;
|
|
38
|
+
}
|
|
39
|
+
if (mark.strategy === "held") {
|
|
40
|
+
let k = `region:${o.hydrate || "raw"}`;
|
|
41
|
+
if (o.hydrateMargin != null) k += `:hmargin:${o.hydrateMargin}`;
|
|
42
|
+
return k;
|
|
43
|
+
}
|
|
44
|
+
let k = `hydrate:${mark.strategy}`;
|
|
45
|
+
if (o.margin != null) k += `:margin:${o.margin}`;
|
|
46
|
+
if (o.keep != null) k += `:keep:${o.keep}`;
|
|
47
|
+
return k;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Cross-host stable identity: posix component path + {@link strategyKey}.
|
|
51
|
+
* Drives region ids so multiple hosts / import sites / `<A />` usages share one module.
|
|
52
|
+
*/
|
|
53
|
+
function regionIdentity(componentRelPath, mark) {
|
|
54
|
+
return `${String(componentRelPath).split(PATH_SEP).join("/")}\0${strategyKey(mark)}`;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* A server-rendered region's RENDER identity: what the islands endpoint renders — the component
|
|
58
|
+
* alone (posix path, `#export` for a named one). A region id names a WRAPPER (the component ⊕ its
|
|
59
|
+
* page-side schedule ⊕ the build's salt); the endpoint's render of a component is the same under
|
|
60
|
+
* every schedule, so a capability that names its render identity is answered by any build that
|
|
61
|
+
* still serves the component as a region, whatever its schedule, its preset or the build's salt.
|
|
62
|
+
* Unsalted: it is never a file name (nothing to enumerate) and only rides inside a signed URL.
|
|
63
|
+
* @param identityOrPath a {@link regionIdentity} (its component half is taken) or a component path
|
|
64
|
+
*/
|
|
65
|
+
function renderId(identityOrPath) {
|
|
66
|
+
const nul = identityOrPath.indexOf("\0");
|
|
67
|
+
const component = (nul === -1 ? identityOrPath : identityOrPath.slice(0, nul)).split(PATH_SEP).join("/");
|
|
68
|
+
return createHash("md5").update(`render\0${component}`).digest("hex").slice(0, 12);
|
|
69
|
+
}
|
|
70
|
+
/** Hash an identity string (optional production salt) → 12-char region id. */
|
|
71
|
+
function regionId(identityKey, salt = "") {
|
|
72
|
+
const msg = salt ? `${salt}\0${identityKey}` : identityKey;
|
|
73
|
+
return createHash("md5").update(msg).digest("hex").slice(0, 12);
|
|
74
|
+
}
|
|
75
|
+
export { regionId, regionIdentity, renderId, strategyKey };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { ImportKeys } from "./transform.js";
|
|
2
|
+
import { AstNode } from "../parse/oxc.js";
|
|
3
|
+
/** A Svelte / ESTree node as the front-end walks it — dynamic access, loosely typed by design. */
|
|
4
|
+
export type SvelteNode = AstNode;
|
|
5
|
+
/** A region mark — the `{ strategy, options }` a `with { … }` clause or `asRegion(…)` resolves to. */
|
|
6
|
+
export interface RegionMark {
|
|
7
|
+
strategy: string;
|
|
8
|
+
options: Record<string, unknown>;
|
|
9
|
+
}
|
|
10
|
+
/** One host import the analyze pass indexed: its ImportDeclaration node + the `with {…}`-stripped text. */
|
|
11
|
+
export interface HostImport {
|
|
12
|
+
/** the ImportDeclaration (or the synthetic one an asRegion call stands for), with its offsets */
|
|
13
|
+
node: SvelteNode & {
|
|
14
|
+
start: number;
|
|
15
|
+
end: number;
|
|
16
|
+
};
|
|
17
|
+
cleaned: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* `FileIR` — analyze's output, lower's input. Everything the lowering pass reads about one file,
|
|
21
|
+
* bundled as plain data. Cross-file knowledge never enters here: a file's IR knows only its own
|
|
22
|
+
* source, never what another file did (the join is by content-hashed region id, in the Program).
|
|
23
|
+
*/
|
|
24
|
+
export interface FileIR {
|
|
25
|
+
source: string;
|
|
26
|
+
id: string;
|
|
27
|
+
/** the parsed Svelte AST (root `.fragment` / `.instance` / `.module`). */
|
|
28
|
+
ast: SvelteNode;
|
|
29
|
+
/** `<script>` (instance) top-level statements. */
|
|
30
|
+
instance_body: SvelteNode[];
|
|
31
|
+
/** `<script module>` top-level statements. */
|
|
32
|
+
module_body: SvelteNode[];
|
|
33
|
+
/** the `<script>` lang attribute (`''` for plain JS) — baked into generated wrapper scripts. */
|
|
34
|
+
lang: string;
|
|
35
|
+
/** posix root-relative host path — the stable prefix of error messages + snippet identities. */
|
|
36
|
+
rel_host: string;
|
|
37
|
+
/** the resolved import-attribute key names for this build. */
|
|
38
|
+
import_keys: ImportKeys;
|
|
39
|
+
/** localName → { node, cleaned } for every host import. */
|
|
40
|
+
imports: Map<string, HostImport>;
|
|
41
|
+
/** localName → the region mark it carries (a `with {…}` import or an asRegion synthetic import). */
|
|
42
|
+
marked_components: Map<string, RegionMark>;
|
|
43
|
+
/** ImportDeclaration nodes to remove from the host (unused marked imports / consumed barrels). */
|
|
44
|
+
imports_to_strip: Set<{
|
|
45
|
+
start: number;
|
|
46
|
+
end: number;
|
|
47
|
+
}>;
|
|
48
|
+
/** the asRegion call sites — the local binding, the component local, and the const statement node. */
|
|
49
|
+
as_regions: Array<{
|
|
50
|
+
local: string;
|
|
51
|
+
compLocal: string;
|
|
52
|
+
node: {
|
|
53
|
+
start: number;
|
|
54
|
+
end: number;
|
|
55
|
+
};
|
|
56
|
+
}>;
|
|
57
|
+
/** the asRegion `const` statement nodes (skipped by the stray-asRegion walk + barrel-cleanup). */
|
|
58
|
+
as_region_nodes: Set<SvelteNode>;
|
|
59
|
+
/** asRegion local → the barrel export name it pulls (undefined → default import). */
|
|
60
|
+
synthetic_export: Map<string, string | undefined>;
|
|
61
|
+
/** a hydrate island with real host children was placed (the app needs the wire slot revivers). */
|
|
62
|
+
has_island_children: boolean;
|
|
63
|
+
/** the cheap island-hint gate result (a marker-less snippet-only file is not "hinted"). */
|
|
64
|
+
has_island_hint: boolean;
|
|
65
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { IslandDescriptor } from "../program.js";
|
|
2
|
+
import { regionId, regionIdentity, strategyKey } from "./identity.js";
|
|
3
|
+
import { regionBindingVirtualId } from "../ids.js";
|
|
4
|
+
import { foucCssVirtualId } from "../fouc-css.js";
|
|
5
|
+
import { SourceMap } from "magic-string";
|
|
6
|
+
import * as NodePath from "node:path";
|
|
7
|
+
/** The resolved context the adapter/driver threads into a host transform. */
|
|
8
|
+
interface HostCtx {
|
|
9
|
+
root: string;
|
|
10
|
+
libDir: string;
|
|
11
|
+
readFile: (abs: string) => string | null;
|
|
12
|
+
pathModule: typeof NodePath;
|
|
13
|
+
dev: boolean;
|
|
14
|
+
virtualPathFor: (hostId: string, iid: string) => string;
|
|
15
|
+
/** Absent: the island's wrapper virtual id (`wrapperVirtualId`). */
|
|
16
|
+
wrapperPathFor?: (hostId: string, iid: string) => string;
|
|
17
|
+
devUrlFor: (virtualPath: string) => string;
|
|
18
|
+
/**
|
|
19
|
+
* The REAL source file a module derives from — the resolution base for its relative specifiers.
|
|
20
|
+
* A generated entry (a portable-snippet synth is authored markup re-processed under a
|
|
21
|
+
* `virtual:ogygia/…` id) has no directory of its own: every `./x` / `../x` inside it must resolve
|
|
22
|
+
* against the file the slice was cut from, exactly as the driver's `resolve_id` already rebases
|
|
23
|
+
* that entry's plain imports. Identity for a real file. Optional for legacy callers (= identity).
|
|
24
|
+
*/
|
|
25
|
+
originOf?: (id: string) => string;
|
|
26
|
+
/** Install-independent identity (`<pkg-name>/<rel>`) for files under a declared `ogygia.files`
|
|
27
|
+
* package — `null`/absent falls back to root-relative (see CompileCtx.pkg_identity). */
|
|
28
|
+
pkg_identity?: (abs: string) => string | null;
|
|
29
|
+
/** SvelteKit `appDir` (default `_app`) — where island chunks are emitted + served (base-less; Kit's
|
|
30
|
+
* `asset()` adds `base`/assets at render). */
|
|
31
|
+
appDir?: string;
|
|
32
|
+
visibleMargin: string | undefined;
|
|
33
|
+
presets: Record<string, unknown>;
|
|
34
|
+
importKeys: Partial<ImportKeys> | undefined;
|
|
35
|
+
/** Absent or empty: no salt. */
|
|
36
|
+
idSalt?: string;
|
|
37
|
+
/** Absent: true (a binding links its real wrapper; `false` links the client stub). */
|
|
38
|
+
linkVirtualIsland?: boolean;
|
|
39
|
+
/** Absent or empty: the built-in `CLIENT_BINDING_STUB`. */
|
|
40
|
+
clientBindingStub?: string;
|
|
41
|
+
routeCsr: boolean | undefined;
|
|
42
|
+
ssr: boolean;
|
|
43
|
+
}
|
|
44
|
+
/** The resolved context threaded into a `.ts`/`.js` region mint (`transformTsRegions`). */
|
|
45
|
+
interface TsRegionCtx {
|
|
46
|
+
root: string;
|
|
47
|
+
libDir: string;
|
|
48
|
+
pathModule: typeof NodePath;
|
|
49
|
+
dev: boolean;
|
|
50
|
+
virtualPathFor: (hostId: string, iid: string) => string;
|
|
51
|
+
devUrlFor: (virtualPath: string) => string;
|
|
52
|
+
/** SvelteKit `appDir` (default `_app`) — where island chunks are emitted + served (base-less; Kit's
|
|
53
|
+
* `asset()` adds `base`/assets at render). */
|
|
54
|
+
appDir?: string;
|
|
55
|
+
importKeys: Partial<ImportKeys> | undefined;
|
|
56
|
+
/** Absent or empty: no salt. */
|
|
57
|
+
idSalt?: string;
|
|
58
|
+
/** Guarded (typeof) — the ts-region leg falls back to `wrapperVirtualId` when absent. */
|
|
59
|
+
wrapperPathFor?: (hostId: string, iid: string) => string;
|
|
60
|
+
/** Guarded (`!= null`) — only a `visible` strategy reads it. */
|
|
61
|
+
visibleMargin?: string;
|
|
62
|
+
/** Guarded (typeof) — install-independent identity for declared `ogygia.files` package files. */
|
|
63
|
+
pkg_identity?: (abs: string) => string | null;
|
|
64
|
+
}
|
|
65
|
+
export declare const ISLAND_DIR = ".ogygia";
|
|
66
|
+
/** True for a GENERATED island glue id (virtual island entry / wrapper / region binding, or the legacy
|
|
67
|
+
* on-disk `.ogygia/` shape) — the ids that are ogygia's own emit, not authored app/component source. */
|
|
68
|
+
export declare function is_island_path(id: string): boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Default import-attribute keys — the two-dial grammar. Internal role names stay `hydrate`/`defer`
|
|
71
|
+
* (the wire format + runtime keep those anchors); the user-facing ATTRIBUTE names are the values.
|
|
72
|
+
* Override via `ogygia({ importKeys })`.
|
|
73
|
+
* - `render` attribute → the MODE: `static` (inline HTML) | `deferred` (a hole, fetched) | `live`
|
|
74
|
+
* (a hole that revalidates). Defaults to `static`.
|
|
75
|
+
* - `fetch` attribute → a `deferred` hole's TIMING, when its HTML arrives (default `load`):
|
|
76
|
+
* `with { render: 'deferred', fetch: 'visible' }`.
|
|
77
|
+
* - `wake` attribute → when an island's JS runs (`none`: a lake). Never a hole's timing.
|
|
78
|
+
*/
|
|
79
|
+
export declare const DEFAULT_IMPORT_KEYS: {
|
|
80
|
+
readonly wake: "wake";
|
|
81
|
+
readonly fetch: "fetch";
|
|
82
|
+
readonly render: "render";
|
|
83
|
+
readonly preset: "preset";
|
|
84
|
+
readonly region: "region";
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* Import-attribute key names claimed by the transform
|
|
88
|
+
* (`with { wake | fetch | render | preset | region }`). Override via `ogygia({ importKeys })` when
|
|
89
|
+
* another tool already uses the default names.
|
|
90
|
+
*/
|
|
91
|
+
export type ImportKeys = {
|
|
92
|
+
/** When an island's JS runs (default attribute `'wake'`); `'none'` makes a lake. For `live` it is
|
|
93
|
+
* the revalidate schedule. */
|
|
94
|
+
wake: string;
|
|
95
|
+
/** A `render: 'deferred'` hole's timing — when its HTML arrives (default attribute `'fetch'`):
|
|
96
|
+
* `'load'` | `'idle'` | `'visible'` | `'interaction'` | a media query. */
|
|
97
|
+
fetch: string;
|
|
98
|
+
/** The delivery MODE (default attribute `'render'`): `static` | `deferred` | `live`. */
|
|
99
|
+
render: string;
|
|
100
|
+
/** Named preset attribute (default `'preset'`). */
|
|
101
|
+
preset: string;
|
|
102
|
+
/** Held-across-a-boundary marker (default attribute `'region'`, only value `'raw'`) — a component
|
|
103
|
+
* a registry hands to `region()` where the transform can't see the call. */
|
|
104
|
+
region: string;
|
|
105
|
+
};
|
|
106
|
+
export declare function normalize_import_keys(overrides?: Partial<ImportKeys> | null): ImportKeys;
|
|
107
|
+
export declare function import_keys_hint(import_keys: ImportKeys): RegExp;
|
|
108
|
+
/** Deterministic short id for a region (stable across dev + build).
|
|
109
|
+
* When `salt` is set (production `OGYGIA_SECRET`), ids are not offline-computable (P1-ID).
|
|
110
|
+
* Paths are always posix so SSR/client builds agree across OS path separators. */
|
|
111
|
+
export declare function islandId(relHostPath: string, index: string | number, salt?: string): string;
|
|
112
|
+
/**
|
|
113
|
+
* Deterministic client chunk path for a hydrate island (mirrors `og-runtime.<hash>.js`).
|
|
114
|
+
* SSR bakes this into `<ogygia-region entry>` so the sticky runtime can `import(entry)` with no
|
|
115
|
+
* app-wide regions map — Kit builds server before client, so content-hashed Vite names can't hand off.
|
|
116
|
+
*/
|
|
117
|
+
export declare function islandChunkFileName(iid: string, appDir?: string): string;
|
|
118
|
+
/** App-internal URL for {@link islandChunkFileName}: `/<appDir>/immutable/…` (leading slash, appDir,
|
|
119
|
+
* NO base). It is what SSR bakes onto `<ogygia-region entry>`; `Region.svelte` runs it through Kit's
|
|
120
|
+
* `asset()` at render time, which is the sole authority on `base` / the assets CDN / relative paths —
|
|
121
|
+
* so a base is never baked here (that would double-apply it). NOT the on-disk output filename. */
|
|
122
|
+
export declare function islandPublicUrl(iid: string, appDir?: string): string;
|
|
123
|
+
/** Portable wrapper module id — SSR / csr=true host binding (Island/ServerIsland/Lake shell). */
|
|
124
|
+
export declare function wrapperVirtualId(iid: string): string;
|
|
125
|
+
/**
|
|
126
|
+
* The local bindings a file hands to `import.meta.og.asRegion(X)`. An island's identity is keyed on
|
|
127
|
+
* the import that binds `X` (`'<specifier>#<export>'`), and the prescan derives it from the raw
|
|
128
|
+
* source on disk — so no pass that runs before the transform may rewrite that import (the debarrel
|
|
129
|
+
* pass leaves declarations binding these names alone, as it does marked imports). A textual scan on
|
|
130
|
+
* purpose: it runs before any parse, on every transformed file.
|
|
131
|
+
*/
|
|
132
|
+
export declare function asRegionLocals(code: string): Set<string>;
|
|
133
|
+
/**
|
|
134
|
+
* csr=false CLIENT host binding target. Kit still emits those page nodes; pointing marked
|
|
135
|
+
* imports here (instead of wrappers) keeps N island wrappers/entries out of the page graph so
|
|
136
|
+
* `emitFile` owns hydrate modules and Rolldown does not thin-facade them. Hydration uses
|
|
137
|
+
* `import(entry)` only — this stub is never loaded for island JS.
|
|
138
|
+
*
|
|
139
|
+
* Beside the stub the transform emits `import 'virtual:ogygia/fouc-css/<entry>'` so Kit still
|
|
140
|
+
* links stylesheets (FOUC) via CSS-only side effects. Importing the full `.svelte` JS module
|
|
141
|
+
* dual-owns it with the emitFile island entry and Rolldown thin-facades `og-region.*`.
|
|
142
|
+
* Omitting CSS entirely orphans rules (scoped class hashes, no stylesheet).
|
|
143
|
+
*/
|
|
144
|
+
export declare const CLIENT_BINDING_STUB = "virtual:ogygia/client-binding-stub";
|
|
145
|
+
/**
|
|
146
|
+
* The `with { region: … }` marker has ONE value — `'raw'` (an adjective: "a raw/held region"). It
|
|
147
|
+
* carries NO schedule: the wake timing is set at the `region()` call (`region(C, props, { wake })`)
|
|
148
|
+
* or, in a block tree, per node. This is the only surviving import-attribute marker for a component
|
|
149
|
+
* a registry hands to `region()` where the transform can't see the call site.
|
|
150
|
+
*
|
|
151
|
+
* @param raw the marker value
|
|
152
|
+
* @param where host label for error messages
|
|
153
|
+
* @param regionKey configured `region` attribute name (for the message)
|
|
154
|
+
*/
|
|
155
|
+
export declare function normalize_region_value(raw: string, where: string, regionKey?: string): void;
|
|
156
|
+
/**
|
|
157
|
+
* Validate a `wake:` schedule value on a held import (a `.ts` registry / remote). Accepts the wake
|
|
158
|
+
* strategies (`load` / `idle` / `visible` / `interaction`) or a media query — the same vocabulary as
|
|
159
|
+
* a placed island's `wake:`. Returns the value unchanged (it becomes the baked `__hydrate`).
|
|
160
|
+
*/
|
|
161
|
+
export declare function normalize_hydrate_value(raw: string, where: string, wakeKey?: string): string;
|
|
162
|
+
export declare function transformHost(source: string, id: string, ctx: HostCtx): {
|
|
163
|
+
code: string;
|
|
164
|
+
map: SourceMap;
|
|
165
|
+
islands: never[];
|
|
166
|
+
} | {
|
|
167
|
+
code: string;
|
|
168
|
+
map: SourceMap;
|
|
169
|
+
islands: IslandDescriptor[];
|
|
170
|
+
hasWireCrossing: boolean;
|
|
171
|
+
} | null;
|
|
172
|
+
export declare function transformTsRegions(source: string, id: string, ctx: TsRegionCtx): {
|
|
173
|
+
code: string;
|
|
174
|
+
map: SourceMap;
|
|
175
|
+
islands: IslandDescriptor[];
|
|
176
|
+
hasWireCrossing: boolean;
|
|
177
|
+
} | null;
|
|
178
|
+
export { foucCssVirtualId, regionBindingVirtualId, regionId, regionIdentity, strategyKey };
|