@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,181 @@
|
|
|
1
|
+
import { REGION_BRAND } from "./region-brand.js";
|
|
2
|
+
import { frameAddress } from "./frame.js";
|
|
3
|
+
import { ticket, write } from "./runtime/frame-store.js";
|
|
4
|
+
import { REF_WIRE_KEY, mint, ref_reducer, ref_reviver, register_kind, resolve } from "./ref.js";
|
|
5
|
+
import { register_wire_kind } from "./live-transport.js";
|
|
6
|
+
import { register_derived_kind, register_store_kind } from "./store-transport.js";
|
|
7
|
+
import { register_snippet_kind } from "./region-snippet.js";
|
|
8
|
+
import { register_fn_kind } from "./fn-transport.js";
|
|
9
|
+
// src/transport.ts
|
|
10
|
+
/**
|
|
11
|
+
* `ogygiaTransport` — the SvelteKit `transport` entry that lets a held region cross the wire.
|
|
12
|
+
*
|
|
13
|
+
* A held region holds a live component, which devalue can't serialize. This teaches the wire to carry
|
|
14
|
+
* one: at **encode** (server → wire) it signs the capability and drops the component, sending just
|
|
15
|
+
* the ticket; at **decode** (client) it rebuilds a `deferred` region. It fires only when a
|
|
16
|
+
* held region actually crosses the wire — an inline region rendered in the same pass never touches it.
|
|
17
|
+
*
|
|
18
|
+
* Install once, in the app's UNIVERSAL hooks (kept separate from `ogygiaHandle`, which is
|
|
19
|
+
* server-only), so no server code leaks into the client:
|
|
20
|
+
*
|
|
21
|
+
* ```ts
|
|
22
|
+
* // src/hooks.ts
|
|
23
|
+
* import { ogygiaTransport } from 'ogygia';
|
|
24
|
+
* export const transport = { ...ogygiaTransport };
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
/** The region ENCODE law (ticket pass-through / dual signs at crossing / awaited-inline bakes /
|
|
28
|
+
* inline-unawaited throws), byte-for-byte the pre-hub behavior. */
|
|
29
|
+
function encode_region(value) {
|
|
30
|
+
{
|
|
31
|
+
if (typeof value !== "object" || value === null) return false;
|
|
32
|
+
const f = value;
|
|
33
|
+
if (f[REGION_BRAND] !== true) return false;
|
|
34
|
+
if (f.kind === "deferred") return pack(f.id, f.props, f.url, f.module, f.hydrate, f.hydrateMargin, f.html);
|
|
35
|
+
if (f.kind === "dual") {
|
|
36
|
+
const sign = f.sign;
|
|
37
|
+
const props = f.props ?? {};
|
|
38
|
+
return pack(f.id, props, sign(f.id, props), f.module, f.hydrate, f.hydrateMargin, f.html);
|
|
39
|
+
}
|
|
40
|
+
if (typeof f.html === "string") return pack("", f.props ?? {}, "", "", void 0, void 0, f.html);
|
|
41
|
+
throw new Error("[ogygia] a held region reached the wire but its component is a plain import, so nothing built a chunk for it. `await` the region before returning it from a remote/load — an awaited region bakes its SSR HTML and crosses as an HTML-only ticket. Or import the component `with { region: 'raw' }` (or a `wake:` mark) to make it a signed, fetchable capability. On a csr=false page you can also skip the wire entirely: call `get()` in a universal `+page.ts` load / the component — its data reaches the render by reference.");
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
/** The region DECODE law (single-flight frame write for baked HTML + deferred rebuild),
|
|
45
|
+
* byte-for-byte the pre-hub behavior. */
|
|
46
|
+
function decode_region(raw) {
|
|
47
|
+
if (raw.x != null && raw.u && typeof document !== "undefined") {
|
|
48
|
+
const a = frameAddress(raw.u);
|
|
49
|
+
write({
|
|
50
|
+
a,
|
|
51
|
+
v: ticket(a),
|
|
52
|
+
html: raw.x
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
return {
|
|
56
|
+
[REGION_BRAND]: true,
|
|
57
|
+
kind: "deferred",
|
|
58
|
+
id: raw.i,
|
|
59
|
+
props: raw.p,
|
|
60
|
+
url: raw.u,
|
|
61
|
+
module: raw.m,
|
|
62
|
+
...raw.h ? { hydrate: raw.h } : {},
|
|
63
|
+
...raw.g ? { hydrateMargin: raw.g } : {},
|
|
64
|
+
...raw.x != null ? { html: raw.x } : {}
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* A region value AS THE BROWSER RECEIVES IT: through the crossing (encode, then decode) on the server,
|
|
69
|
+
* itself in the browser (it already crossed). A promise `of` resolves to a wire value — a remote's
|
|
70
|
+
* answer — so a server render that awaits one renders this form, the same shape the browser hydrates
|
|
71
|
+
* against (PromiseRegionAwait.svelte). Not a region: unchanged. A plain inline region nothing awaited
|
|
72
|
+
* throws, exactly as the crossing would.
|
|
73
|
+
*/
|
|
74
|
+
function wire_form(value) {
|
|
75
|
+
if (typeof document !== "undefined") return value;
|
|
76
|
+
const encoded = encode_region(value);
|
|
77
|
+
return encoded === false ? value : decode_region(encoded);
|
|
78
|
+
}
|
|
79
|
+
/** The hub kind: a held/dual/awaited region — the RENDERABLE Ref. `d` is the EncodedRegion.
|
|
80
|
+
* Decode is deliberately un-memoized at the legacy seam (the wrapper below passes ids through
|
|
81
|
+
* raw); hub-memoized region identity arrives with the one-key collapse, where it becomes the
|
|
82
|
+
* foundation for persistent regions (the reconciler resolves by id). */
|
|
83
|
+
function register_region_kind() {
|
|
84
|
+
register_kind({
|
|
85
|
+
k: "region",
|
|
86
|
+
match(value) {
|
|
87
|
+
return value[REGION_BRAND] === true;
|
|
88
|
+
},
|
|
89
|
+
encode(value) {
|
|
90
|
+
const packed = encode_region(value);
|
|
91
|
+
if (packed === false) throw new Error("[ogygia] region kind claimed a non-region value");
|
|
92
|
+
return { d: packed };
|
|
93
|
+
},
|
|
94
|
+
decode(ref) {
|
|
95
|
+
return decode_region(ref.d);
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
const REGION_ONLY = /* @__PURE__ */ new Set(["region"]);
|
|
100
|
+
/** Every hub family the ONE `OgygiaRef` transport entry carries (hub v2 phase Y — symmetry).
|
|
101
|
+
* Region stays in the list for decode-completeness, but the `Region` entry below is first in
|
|
102
|
+
* object order so regions still ENCODE through it (legacy `EncodedRegion` wire shape kept). */
|
|
103
|
+
const ALL_FAMILIES = /* @__PURE__ */ new Set([
|
|
104
|
+
"wire",
|
|
105
|
+
"store",
|
|
106
|
+
"snippet",
|
|
107
|
+
"fn",
|
|
108
|
+
"derived",
|
|
109
|
+
"region"
|
|
110
|
+
]);
|
|
111
|
+
let all_kinds_ready = false;
|
|
112
|
+
let all_families_reducer = null;
|
|
113
|
+
function ensure_all_kinds() {
|
|
114
|
+
if (!all_kinds_ready) {
|
|
115
|
+
all_kinds_ready = true;
|
|
116
|
+
register_wire_kind();
|
|
117
|
+
register_store_kind();
|
|
118
|
+
register_snippet_kind();
|
|
119
|
+
register_fn_kind();
|
|
120
|
+
register_derived_kind();
|
|
121
|
+
register_region_kind();
|
|
122
|
+
}
|
|
123
|
+
return all_families_reducer ??= ref_reducer(ALL_FAMILIES);
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* The SvelteKit `transport` entry (install once in universal hooks). TWO entries, ONE codec
|
|
127
|
+
* underneath (hub v2 phase Y): `Region` preserves the legacy region wire shape/tag for
|
|
128
|
+
* compatibility; `OgygiaRef` carries EVERY OTHER hub kind through the same `ref_reducer` /
|
|
129
|
+
* `ref_reviver` the island seams use — so a universal `load` can put a store, wire class, fn or
|
|
130
|
+
* resumable derived in `page.data`, and a remote function can take/return one, all by identity.
|
|
131
|
+
* Kit routes remote args + load data through this same `transport`, so the symmetry is total.
|
|
132
|
+
* Decode is REQUEST-scoped on the server (no `document`) — client-sent identity never memoizes
|
|
133
|
+
* across requests — and PAGE-scoped in the browser (reunification).
|
|
134
|
+
*/
|
|
135
|
+
const ogygiaTransport = {
|
|
136
|
+
Region: {
|
|
137
|
+
encode(value) {
|
|
138
|
+
if (typeof value !== "object" || value === null) return false;
|
|
139
|
+
if (value[REGION_BRAND] !== true) return false;
|
|
140
|
+
register_region_kind();
|
|
141
|
+
const ref = mint(value, REGION_ONLY);
|
|
142
|
+
if (ref === void 0) return false;
|
|
143
|
+
return {
|
|
144
|
+
...ref.d,
|
|
145
|
+
hi: ref.i
|
|
146
|
+
};
|
|
147
|
+
},
|
|
148
|
+
decode(raw) {
|
|
149
|
+
register_region_kind();
|
|
150
|
+
const remember = typeof document !== "undefined" && typeof raw.hi === "string" && raw.hi.length > 0;
|
|
151
|
+
return resolve({
|
|
152
|
+
k: "region",
|
|
153
|
+
i: raw.hi ?? (raw.i || ""),
|
|
154
|
+
d: raw
|
|
155
|
+
}, remember);
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
[REF_WIRE_KEY]: {
|
|
159
|
+
encode(value) {
|
|
160
|
+
if (value === null || typeof value !== "object" && typeof value !== "function") return false;
|
|
161
|
+
return ensure_all_kinds()(value) ?? false;
|
|
162
|
+
},
|
|
163
|
+
decode(ref) {
|
|
164
|
+
ensure_all_kinds();
|
|
165
|
+
return ref_reviver(typeof document !== "undefined")(ref);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
function pack(id, props, url, module, hydrate, hydrateMargin, html) {
|
|
170
|
+
const out = {
|
|
171
|
+
i: id,
|
|
172
|
+
p: props,
|
|
173
|
+
u: url,
|
|
174
|
+
m: module
|
|
175
|
+
};
|
|
176
|
+
if (hydrate) out.h = hydrate;
|
|
177
|
+
if (hydrateMargin) out.g = hydrateMargin;
|
|
178
|
+
if (html != null) out.x = html;
|
|
179
|
+
return out;
|
|
180
|
+
}
|
|
181
|
+
export { ogygiaTransport, register_region_kind, wire_form };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The comment an unscoped CSS fallback carries in the shipped stylesheet. When the build cannot
|
|
3
|
+
* compile a component's scoped CSS (compiler/fouc-css.ts), it ships the raw style bodies, which
|
|
4
|
+
* then apply to the WHOLE page (`.bar {…}` instead of `.bar.svelte-x {…}`). A build log line is
|
|
5
|
+
* easy to miss, so the CSS itself says so, and devtools (the page's sheets) and the profiler (the
|
|
6
|
+
* weighed CSS files) name the component. Import-free: the browser loads this too.
|
|
7
|
+
*
|
|
8
|
+
* A legal comment (`/*!`) so a minifier keeps it; the file NAME only, never the build machine's path.
|
|
9
|
+
*/
|
|
10
|
+
export declare const UNSCOPED_MARK = "ogygia-unscoped:";
|
|
11
|
+
export declare function unscoped_marker(abs: string, why: string): string;
|
|
12
|
+
export interface UnscopedStyles {
|
|
13
|
+
/** the component's file name (`Card.svelte`) */
|
|
14
|
+
file: string;
|
|
15
|
+
/** why the build could not scope it (the compiler's first message line) */
|
|
16
|
+
why: string;
|
|
17
|
+
}
|
|
18
|
+
/** The finding both devtools and the profiler raise, in the same words. */
|
|
19
|
+
export declare function unscoped_finding(list: readonly UnscopedStyles[]): {
|
|
20
|
+
code: "css-unscoped";
|
|
21
|
+
message: string;
|
|
22
|
+
fix: string;
|
|
23
|
+
};
|
|
24
|
+
/** Every unscoped fallback a stylesheet's text carries, once per file. Plain scan, no regex: it
|
|
25
|
+
* runs over whole stylesheets in the browser. */
|
|
26
|
+
export declare function find_unscoped(css: string): UnscopedStyles[];
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// src/unscoped-css.ts
|
|
2
|
+
/**
|
|
3
|
+
* The comment an unscoped CSS fallback carries in the shipped stylesheet. When the build cannot
|
|
4
|
+
* compile a component's scoped CSS (compiler/fouc-css.ts), it ships the raw style bodies, which
|
|
5
|
+
* then apply to the WHOLE page (`.bar {…}` instead of `.bar.svelte-x {…}`). A build log line is
|
|
6
|
+
* easy to miss, so the CSS itself says so, and devtools (the page's sheets) and the profiler (the
|
|
7
|
+
* weighed CSS files) name the component. Import-free: the browser loads this too.
|
|
8
|
+
*
|
|
9
|
+
* A legal comment (`/*!`) so a minifier keeps it; the file NAME only, never the build machine's path.
|
|
10
|
+
*/
|
|
11
|
+
const UNSCOPED_MARK = "ogygia-unscoped:";
|
|
12
|
+
function unscoped_marker(abs, why) {
|
|
13
|
+
const name = abs.slice(Math.max(abs.lastIndexOf("/"), abs.lastIndexOf("\\")) + 1);
|
|
14
|
+
const safe = (s) => s.split("*/").join("* /").split("\n").join(" ").slice(0, 160);
|
|
15
|
+
return `/*! ${UNSCOPED_MARK} ${safe(name)} | ${safe(why)} */\n`;
|
|
16
|
+
}
|
|
17
|
+
/** The finding both devtools and the profiler raise, in the same words. */
|
|
18
|
+
function unscoped_finding(list) {
|
|
19
|
+
const names = list.slice(0, 4).map((u) => u.why ? `${u.file} (${u.why})` : u.file);
|
|
20
|
+
const one = list.length === 1;
|
|
21
|
+
return {
|
|
22
|
+
code: "css-unscoped",
|
|
23
|
+
message: `${names.join(", ")}${list.length > 4 ? ` and ${list.length - 4} more` : ""}: ${one ? "its" : "their"} styles shipped without the component's scope, so every rule in them applies to the whole page. A \`.row\` or \`.bar\` in ${one ? "it" : "them"} restyles any element with that class, in any component. The build could not compile ${one ? "it" : "them"} and fell back to the raw style ${one ? "body" : "bodies"}.`,
|
|
24
|
+
fix: `The build log has a line "scoped CSS for … could not be compiled" with the full reason. Usually a style language the build cannot read here (scss and sass are compiled; less and stylus are not) or markup the compiler rejects. Fix that and rebuild.`
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
/** Every unscoped fallback a stylesheet's text carries, once per file. Plain scan, no regex: it
|
|
28
|
+
* runs over whole stylesheets in the browser. */
|
|
29
|
+
function find_unscoped(css) {
|
|
30
|
+
const out = [];
|
|
31
|
+
const seen = /* @__PURE__ */ new Set();
|
|
32
|
+
let at = css.indexOf(UNSCOPED_MARK);
|
|
33
|
+
while (at !== -1) {
|
|
34
|
+
const end = css.indexOf("*/", at);
|
|
35
|
+
if (end === -1) break;
|
|
36
|
+
const body = css.slice(at + 16, end).trim();
|
|
37
|
+
const bar = body.indexOf(" | ");
|
|
38
|
+
const u = bar === -1 ? {
|
|
39
|
+
file: body,
|
|
40
|
+
why: ""
|
|
41
|
+
} : {
|
|
42
|
+
file: body.slice(0, bar),
|
|
43
|
+
why: body.slice(bar + 3).trim()
|
|
44
|
+
};
|
|
45
|
+
if (!seen.has(u.file)) {
|
|
46
|
+
seen.add(u.file);
|
|
47
|
+
out.push(u);
|
|
48
|
+
}
|
|
49
|
+
at = css.indexOf(UNSCOPED_MARK, end);
|
|
50
|
+
}
|
|
51
|
+
return out;
|
|
52
|
+
}
|
|
53
|
+
export { UNSCOPED_MARK, find_unscoped, unscoped_finding, unscoped_marker };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ViteDevServer } from "vite";
|
|
2
|
+
export declare const DEV_MAPS: unique symbol;
|
|
3
|
+
export declare const DEV_PAGE_KEYS: unique symbol;
|
|
4
|
+
/** what an island's code reads of `page.data`, as the build would say: its keys, or `'all'` with
|
|
5
|
+
* the lines that make it so; `null` when nothing in it reads the page */
|
|
6
|
+
export interface DevPageKeys {
|
|
7
|
+
keys: string[] | "all" | null;
|
|
8
|
+
why: {
|
|
9
|
+
file: string;
|
|
10
|
+
line: number | null;
|
|
11
|
+
why: string;
|
|
12
|
+
}[];
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* THE BUILD'S SEED ANSWER, ON THE DEV SERVER: the build pins which `page.data` keys each island's
|
|
16
|
+
* code reads (seed shaping); the dev server does not — every island reads "everything" there, so
|
|
17
|
+
* the profiler could not tell a late island's data or point at the line that ships it all. This
|
|
18
|
+
* puts the same analysis behind a global the profiler (same process) asks: the island id's
|
|
19
|
+
* component and the app modules it imports (the SSR graph, eight deep), each read by the build's
|
|
20
|
+
* own `page_data_keys_answer`, a helper handed the page followed one level like the build does.
|
|
21
|
+
* Only what the report says changes: the dev seed itself still ships whole.
|
|
22
|
+
*/
|
|
23
|
+
export declare function install_dev_page_keys(server: ViteDevServer, component_of: (iid: string) => string | null | undefined, root: string): void;
|
|
24
|
+
/**
|
|
25
|
+
* THE BROWSER'S MODULES, TOO: a CPU trace from the browser names a frame by the URL the dev server
|
|
26
|
+
* served (`/src/lib/Save.svelte?t=…`) at the SERVED code's lines — a `.svelte` file's compiled output,
|
|
27
|
+
* not its source. The client module graph holds each served module's map (the browser runs the code
|
|
28
|
+
* as served: no header to shift by). Looked up by the URL's path, then with its query minus Vite's
|
|
29
|
+
* `t=` / `v=` stamps (a virtual island id keeps its own query).
|
|
30
|
+
*/
|
|
31
|
+
export declare const DEV_CLIENT_MAPS: unique symbol;
|
|
32
|
+
export declare function install_dev_client_maps(server: ViteDevServer): void;
|
|
33
|
+
export declare function install_dev_maps(server: ViteDevServer): void;
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { page_data_keys_answer, summarize_export } from "../compiler/link/page-keys.js";
|
|
2
|
+
import fs from "node:fs";
|
|
3
|
+
// src/vite/dev-maps.ts
|
|
4
|
+
/**
|
|
5
|
+
* THE DEV SERVER'S SOURCE MAPS, FOR THE PROFILER: Vite's module runner evaluates each server module's
|
|
6
|
+
* transformed code inside an `AsyncFunction` (`"use strict";\n` first), with `//# sourceURL=<id>`, so a
|
|
7
|
+
* CPU profile names the module by its id and its lines are the transformed code's, shifted by the
|
|
8
|
+
* function's own header. The map from that code back to the source is in the SSR module graph. This
|
|
9
|
+
* puts a lookup on a global the profiler (loaded by the same process) reads: module id → the map,
|
|
10
|
+
* shifted to the lines V8 reports.
|
|
11
|
+
*/
|
|
12
|
+
const DEV_MAPS = Symbol.for("ogygia.profiler.dev-maps");
|
|
13
|
+
const DEV_PAGE_KEYS = Symbol.for("ogygia.profiler.dev-page-keys");
|
|
14
|
+
/**
|
|
15
|
+
* THE BUILD'S SEED ANSWER, ON THE DEV SERVER: the build pins which `page.data` keys each island's
|
|
16
|
+
* code reads (seed shaping); the dev server does not — every island reads "everything" there, so
|
|
17
|
+
* the profiler could not tell a late island's data or point at the line that ships it all. This
|
|
18
|
+
* puts the same analysis behind a global the profiler (same process) asks: the island id's
|
|
19
|
+
* component and the app modules it imports (the SSR graph, eight deep), each read by the build's
|
|
20
|
+
* own `page_data_keys_answer`, a helper handed the page followed one level like the build does.
|
|
21
|
+
* Only what the report says changes: the dev seed itself still ships whole.
|
|
22
|
+
*/
|
|
23
|
+
function install_dev_page_keys(server, component_of, root) {
|
|
24
|
+
const ssr = () => server.environments?.ssr?.moduleGraph;
|
|
25
|
+
const app_file = (f) => !!f && f.startsWith(root) && !f.includes("/node_modules/");
|
|
26
|
+
const kind = (f) => f.endsWith(".svelte") ? "svelte" : "script";
|
|
27
|
+
const read = (f) => {
|
|
28
|
+
try {
|
|
29
|
+
return fs.readFileSync(f, "utf8");
|
|
30
|
+
} catch {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
globalThis[DEV_PAGE_KEYS] = async (iid) => {
|
|
35
|
+
const component = component_of(iid)?.split("?")[0];
|
|
36
|
+
const graph = ssr();
|
|
37
|
+
if (!component || !graph) return void 0;
|
|
38
|
+
const files = [];
|
|
39
|
+
const seen = /* @__PURE__ */ new Set();
|
|
40
|
+
let level = [component];
|
|
41
|
+
for (let depth = 0; depth < 8 && level.length; depth++) {
|
|
42
|
+
const next = [];
|
|
43
|
+
for (const f of level) {
|
|
44
|
+
if (seen.has(f)) continue;
|
|
45
|
+
seen.add(f);
|
|
46
|
+
files.push(f);
|
|
47
|
+
for (const node of graph.getModulesByFile(f) ?? []) for (const dep of node.importedModules ?? []) {
|
|
48
|
+
const df = dep.file?.split("?")[0];
|
|
49
|
+
if (app_file(df) && !seen.has(df)) next.push(df);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
level = next;
|
|
53
|
+
}
|
|
54
|
+
const read_keys = /* @__PURE__ */ new Set();
|
|
55
|
+
let all = false;
|
|
56
|
+
let any = false;
|
|
57
|
+
const why = [];
|
|
58
|
+
const add = (k) => {
|
|
59
|
+
if (k === null) return;
|
|
60
|
+
any = true;
|
|
61
|
+
if (k === "all") all = true;
|
|
62
|
+
else for (const x of k) read_keys.add(x);
|
|
63
|
+
};
|
|
64
|
+
for (const f of files) {
|
|
65
|
+
const code = read(f);
|
|
66
|
+
if (!code) continue;
|
|
67
|
+
const a = page_data_keys_answer(code, f, kind(f));
|
|
68
|
+
if (a.keys === "all" && a.reason) why.push({
|
|
69
|
+
file: f,
|
|
70
|
+
line: a.reason.line,
|
|
71
|
+
why: a.reason.why
|
|
72
|
+
});
|
|
73
|
+
add(a.keys);
|
|
74
|
+
for (const p of a.pending) {
|
|
75
|
+
const target = (await server.pluginContainer.resolveId(p.specifier, f, { ssr: true }).catch(() => null))?.id?.split("?")[0];
|
|
76
|
+
const tcode = target && app_file(target) ? read(target) : void 0;
|
|
77
|
+
const s = tcode ? summarize_export(tcode, target, kind(target), p.imported, p.arg) : "all";
|
|
78
|
+
if (s === "all" || !(s instanceof Set)) {
|
|
79
|
+
why.push({
|
|
80
|
+
file: f,
|
|
81
|
+
line: p.line,
|
|
82
|
+
why: `the page is handed to ${p.imported}(), which the analysis cannot follow`
|
|
83
|
+
});
|
|
84
|
+
add("all");
|
|
85
|
+
} else add(s);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return {
|
|
89
|
+
keys: !any ? null : all ? "all" : [...read_keys],
|
|
90
|
+
why
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
/** lines V8 counts before a module's first line: the `AsyncFunction` header, and `"use strict";` */
|
|
95
|
+
function runner_offset() {
|
|
96
|
+
const AsyncFunction = async function() {}.constructor;
|
|
97
|
+
const src = new AsyncFunction("a", "b", "/*code*/").toString();
|
|
98
|
+
return src.slice(0, src.indexOf("/*code*/")).split("\n").length - 1 + 1;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* THE BROWSER'S MODULES, TOO: a CPU trace from the browser names a frame by the URL the dev server
|
|
102
|
+
* served (`/src/lib/Save.svelte?t=…`) at the SERVED code's lines — a `.svelte` file's compiled output,
|
|
103
|
+
* not its source. The client module graph holds each served module's map (the browser runs the code
|
|
104
|
+
* as served: no header to shift by). Looked up by the URL's path, then with its query minus Vite's
|
|
105
|
+
* `t=` / `v=` stamps (a virtual island id keeps its own query).
|
|
106
|
+
*/
|
|
107
|
+
const DEV_CLIENT_MAPS = Symbol.for("ogygia.profiler.dev-client-maps");
|
|
108
|
+
function install_dev_client_maps(server) {
|
|
109
|
+
const graph = () => server.environments?.client?.moduleGraph;
|
|
110
|
+
globalThis[DEV_CLIENT_MAPS] = (url) => {
|
|
111
|
+
const by_url = graph()?.urlToModuleMap;
|
|
112
|
+
if (!by_url) return void 0;
|
|
113
|
+
const q = url.indexOf("?");
|
|
114
|
+
const path = q === -1 ? url : url.slice(0, q);
|
|
115
|
+
const keys = [path];
|
|
116
|
+
if (q !== -1) {
|
|
117
|
+
const kept = url.slice(q + 1).split("&").filter((p) => !p.startsWith("t=") && !p.startsWith("v="));
|
|
118
|
+
if (kept.length) keys.unshift(`${path}?${kept.join("&")}`);
|
|
119
|
+
}
|
|
120
|
+
for (const k of keys) {
|
|
121
|
+
const map = by_url.get(k)?.transformResult?.map;
|
|
122
|
+
if (map && typeof map.mappings === "string") return JSON.stringify(map);
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
function install_dev_maps(server) {
|
|
127
|
+
const offset = runner_offset();
|
|
128
|
+
const graph = () => {
|
|
129
|
+
return server.environments?.ssr?.moduleGraph;
|
|
130
|
+
};
|
|
131
|
+
globalThis[DEV_MAPS] = (id) => {
|
|
132
|
+
const map = graph()?.getModuleById(id)?.transformResult?.map;
|
|
133
|
+
if (!map || typeof map.mappings !== "string") return void 0;
|
|
134
|
+
return JSON.stringify({
|
|
135
|
+
...map,
|
|
136
|
+
mappings: ";".repeat(offset) + map.mappings
|
|
137
|
+
});
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
export { DEV_CLIENT_MAPS, DEV_MAPS, DEV_PAGE_KEYS, install_dev_client_maps, install_dev_maps, install_dev_page_keys };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { regionId, regionIdentity, strategyKey } from "../compiler/region/identity.js";
|
|
2
|
+
import { CLIENT_BINDING_STUB, DEFAULT_IMPORT_KEYS, ImportKeys, import_keys_hint, islandChunkFileName, islandId, islandPublicUrl, normalize_import_keys, wrapperVirtualId } from "../compiler/region/transform.js";
|
|
3
|
+
import { rewrite_lake_import_to_placeholder } from "../compiler/region/emit.js";
|
|
4
|
+
import { debarrel } from "../compiler/debarrel/plugin.js";
|
|
5
|
+
import { BuildContext, MacroContext, MacroHandler, MarkupRegions, MarkupSource, OgygiaPlugin, PluginDefinition, definePlugin } from "./plugin-api.js";
|
|
6
|
+
import { DebarrelOptions, Matcher } from "../compiler/debarrel/options.js";
|
|
7
|
+
import { OgygiaOptions, OgygiaPreset, OgygiaRateLimit } from "./options.js";
|
|
8
|
+
import { Plugin } from "vite";
|
|
9
|
+
/**
|
|
10
|
+
* Vite plugin: transforms `with { hydrate | defer | preset }` imports into islands,
|
|
11
|
+
* serves virtual island modules, and wires signed region endpoints for deferred HTML.
|
|
12
|
+
*
|
|
13
|
+
* Place **before** `sveltekit()` in `vite.config`.
|
|
14
|
+
*
|
|
15
|
+
* @param options - Plugin configuration. See {@link OgygiaOptions}.
|
|
16
|
+
* @returns Vite plugins (`ogygia` pre + island sourcemap fix post). Vite flattens the array.
|
|
17
|
+
*/
|
|
18
|
+
export declare function ogygia(options?: OgygiaOptions): Plugin[];
|
|
19
|
+
export { type BuildContext, CLIENT_BINDING_STUB, DEFAULT_IMPORT_KEYS, type Matcher as DebarrelMatcher, type DebarrelOptions, type ImportKeys, type MacroContext, type MacroHandler, type MarkupRegions, type MarkupSource, type OgygiaOptions, type OgygiaPlugin, type OgygiaPreset, type OgygiaRateLimit, type PluginDefinition, debarrel, definePlugin, import_keys_hint, islandChunkFileName, islandId, islandPublicUrl, normalize_import_keys, regionId, regionIdentity, rewrite_lake_import_to_placeholder, strategyKey, wrapperVirtualId };
|