@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,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The report shape the page's testing engine answers (`window.__ogygia_testing.version`). The engine
|
|
3
|
+
* ships with the SITE's build and `@ogygia/testing` with the TEST's package, so the two can differ: the
|
|
4
|
+
* test side reads this from the page, fills in what it can for an older engine, and warns once.
|
|
5
|
+
*
|
|
6
|
+
* Each version, and what it DETECTS differently (results across two versions compare only where
|
|
7
|
+
* nothing below changed):
|
|
8
|
+
*
|
|
9
|
+
* 1 — 0.8.2.
|
|
10
|
+
* 2 — hydration `key`, session `navigations` (with what started each), finding `names`, `counts.cls`,
|
|
11
|
+
* `engine` on every report, hydration `t0` / `done`. Detection: a router navigation that never
|
|
12
|
+
* swapped the page no longer starts a new page for `page()`. Hydration status: unchanged from 1 (an
|
|
13
|
+
* island that reads `clean` on one and `changed` on the other differed in that run — input landing
|
|
14
|
+
* while it hydrated is the usual cause; 3 flags it as `input`).
|
|
15
|
+
* 3 — hydration `change` (`attributes` / `markup`), `attributes`, `input`, `ignoreAttributes`; page
|
|
16
|
+
* `ogygia` (what measuring cost). Detection: unchanged — `changed` means what it meant in 2; the new
|
|
17
|
+
* fields only say what kind of change it was.
|
|
18
|
+
*/
|
|
19
|
+
export declare const TESTING_ENGINE_VERSION = 3;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// src/insights/testing-version.ts
|
|
2
|
+
/**
|
|
3
|
+
* The report shape the page's testing engine answers (`window.__ogygia_testing.version`). The engine
|
|
4
|
+
* ships with the SITE's build and `@ogygia/testing` with the TEST's package, so the two can differ: the
|
|
5
|
+
* test side reads this from the page, fills in what it can for an older engine, and warns once.
|
|
6
|
+
*
|
|
7
|
+
* Each version, and what it DETECTS differently (results across two versions compare only where
|
|
8
|
+
* nothing below changed):
|
|
9
|
+
*
|
|
10
|
+
* 1 — 0.8.2.
|
|
11
|
+
* 2 — hydration `key`, session `navigations` (with what started each), finding `names`, `counts.cls`,
|
|
12
|
+
* `engine` on every report, hydration `t0` / `done`. Detection: a router navigation that never
|
|
13
|
+
* swapped the page no longer starts a new page for `page()`. Hydration status: unchanged from 1 (an
|
|
14
|
+
* island that reads `clean` on one and `changed` on the other differed in that run — input landing
|
|
15
|
+
* while it hydrated is the usual cause; 3 flags it as `input`).
|
|
16
|
+
* 3 — hydration `change` (`attributes` / `markup`), `attributes`, `input`, `ignoreAttributes`; page
|
|
17
|
+
* `ogygia` (what measuring cost). Detection: unchanged — `changed` means what it meant in 2; the new
|
|
18
|
+
* fields only say what kind of change it was.
|
|
19
|
+
*/
|
|
20
|
+
const TESTING_ENGINE_VERSION = 3;
|
|
21
|
+
export { TESTING_ENGINE_VERSION };
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* THIRD PARTIES — what other origins cost this page, from what the browser measured: their files and
|
|
3
|
+
* bytes (resource timing), the ones that held the first paint, the scripts that loaded more scripts
|
|
4
|
+
* at runtime (a tag manager's shape), and their main-thread time when there is a CPU trace. Pure, so
|
|
5
|
+
* the devtools Page tab and the profiler report run the same analysis on the same visit.
|
|
6
|
+
*
|
|
7
|
+
* Detection is by behavior (another origin; blocking; CPU; a script whose arrival is followed by
|
|
8
|
+
* scripts nothing in the page names). The host table only puts a readable label on well-known
|
|
9
|
+
* public services — a host it does not know is still measured, as "other".
|
|
10
|
+
*/
|
|
11
|
+
export type ThirdPartyKind = "tag manager" | "analytics" | "ads" | "session replay" | "chat" | "a/b testing" | "consent" | "fonts" | "library cdn" | "other";
|
|
12
|
+
export declare function kind_of_host(host: string): ThirdPartyKind;
|
|
13
|
+
export interface ThirdPartyOrigin {
|
|
14
|
+
host: string;
|
|
15
|
+
kind: ThirdPartyKind;
|
|
16
|
+
files: number;
|
|
17
|
+
scripts: number;
|
|
18
|
+
/** decoded bytes of its scripts */
|
|
19
|
+
script_bytes: number;
|
|
20
|
+
/** its scripts the browser gave no size for (some engines hide every other origin's sizes,
|
|
21
|
+
* even with Timing-Allow-Origin): `script_bytes` leaves them out */
|
|
22
|
+
unsized: number;
|
|
23
|
+
/** every byte on the wire */
|
|
24
|
+
wire: number;
|
|
25
|
+
/** files that held the first paint */
|
|
26
|
+
blocking: number;
|
|
27
|
+
/** when its first file started (ms from navigation) */
|
|
28
|
+
first: number;
|
|
29
|
+
/** main-thread ms in its scripts (a CPU trace), else null */
|
|
30
|
+
cpu_ms: number | null;
|
|
31
|
+
}
|
|
32
|
+
export interface ThirdParty {
|
|
33
|
+
origins: ThirdPartyOrigin[];
|
|
34
|
+
script_bytes: number;
|
|
35
|
+
unsized: number;
|
|
36
|
+
/** scripts whose size the browser hid and that were weighed apart from the visit */
|
|
37
|
+
weighed: number;
|
|
38
|
+
wire: number;
|
|
39
|
+
blocking: number;
|
|
40
|
+
cpu_ms: number | null;
|
|
41
|
+
/** third-party scripts that started after another third-party script arrived and that no
|
|
42
|
+
* document ref names: loaded at runtime (by a tag manager, a loader) */
|
|
43
|
+
runtime_loaded: number;
|
|
44
|
+
}
|
|
45
|
+
interface Res {
|
|
46
|
+
url: string;
|
|
47
|
+
type: string;
|
|
48
|
+
start: number;
|
|
49
|
+
end: number;
|
|
50
|
+
transfer?: number;
|
|
51
|
+
size?: number;
|
|
52
|
+
blocking?: boolean;
|
|
53
|
+
/** a size the browser hid, weighed apart from the visit */
|
|
54
|
+
weighed?: true;
|
|
55
|
+
}
|
|
56
|
+
/** `named`: URLs the server's HTML references (its scripts, preloads, their imports) — another
|
|
57
|
+
* origin's script not among them came at runtime. Without it (the live page already holds the
|
|
58
|
+
* injected script elements), `parsed`: when the HTML was parsed (domInteractive) — a script that
|
|
59
|
+
* starts after that and after another origin's script ran was loaded by a script. `in_page`: the
|
|
60
|
+
* URLs the live document holds — a script no element names came by an import or a fetch (a
|
|
61
|
+
* self-loading library's parts), whenever it started. */
|
|
62
|
+
export declare function third_party(resources: readonly Res[], page_origin: string, cpu_by_host: ReadonlyMap<string, number> | null, named?: ReadonlySet<string>, parsed?: number, in_page?: ReadonlySet<string>): ThirdParty | null;
|
|
63
|
+
export interface ThirdPartyFinding {
|
|
64
|
+
code: string;
|
|
65
|
+
severity: "warn" | "info";
|
|
66
|
+
message: string;
|
|
67
|
+
fix?: string;
|
|
68
|
+
}
|
|
69
|
+
/** `edited`: islands that did not wake from the server's markup on this visit (changed, recovered,
|
|
70
|
+
* healed, failed), with when they woke (ms; Infinity when unknown or never). */
|
|
71
|
+
export declare function third_party_findings(tp: ThirdParty | null, edited?: readonly {
|
|
72
|
+
name: string;
|
|
73
|
+
done: number;
|
|
74
|
+
}[]): ThirdPartyFinding[];
|
|
75
|
+
export {};
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
// src/insights/third-party.ts
|
|
2
|
+
/** host suffix → what that kind of service is (labels only; detection does not need them) */
|
|
3
|
+
const KNOWN = [
|
|
4
|
+
["googletagmanager.com", "tag manager"],
|
|
5
|
+
["tiqcdn.com", "tag manager"],
|
|
6
|
+
["tealiumiq.com", "tag manager"],
|
|
7
|
+
["adobedtm.com", "tag manager"],
|
|
8
|
+
["segment.com", "tag manager"],
|
|
9
|
+
["google-analytics.com", "analytics"],
|
|
10
|
+
["analytics.google.com", "analytics"],
|
|
11
|
+
["plausible.io", "analytics"],
|
|
12
|
+
["mxpnl.com", "analytics"],
|
|
13
|
+
["amplitude.com", "analytics"],
|
|
14
|
+
["heapanalytics.com", "analytics"],
|
|
15
|
+
["hotjar.com", "session replay"],
|
|
16
|
+
["fullstory.com", "session replay"],
|
|
17
|
+
["clarity.ms", "session replay"],
|
|
18
|
+
["mouseflow.com", "session replay"],
|
|
19
|
+
["doubleclick.net", "ads"],
|
|
20
|
+
["googlesyndication.com", "ads"],
|
|
21
|
+
["googleadservices.com", "ads"],
|
|
22
|
+
["facebook.net", "ads"],
|
|
23
|
+
["licdn.com", "ads"],
|
|
24
|
+
["bing.com", "ads"],
|
|
25
|
+
["ads-twitter.com", "ads"],
|
|
26
|
+
["intercom.io", "chat"],
|
|
27
|
+
["intercomcdn.com", "chat"],
|
|
28
|
+
["zdassets.com", "chat"],
|
|
29
|
+
["crisp.chat", "chat"],
|
|
30
|
+
["optimizely.com", "a/b testing"],
|
|
31
|
+
["visualwebsiteoptimizer.com", "a/b testing"],
|
|
32
|
+
["abtasty.com", "a/b testing"],
|
|
33
|
+
["cookielaw.org", "consent"],
|
|
34
|
+
["onetrust.com", "consent"],
|
|
35
|
+
["cookiebot.com", "consent"],
|
|
36
|
+
["usercentrics.eu", "consent"],
|
|
37
|
+
["fonts.googleapis.com", "fonts"],
|
|
38
|
+
["fonts.gstatic.com", "fonts"],
|
|
39
|
+
["typekit.net", "fonts"],
|
|
40
|
+
["jsdelivr.net", "library cdn"],
|
|
41
|
+
["unpkg.com", "library cdn"],
|
|
42
|
+
["cdnjs.cloudflare.com", "library cdn"],
|
|
43
|
+
["esm.sh", "library cdn"]
|
|
44
|
+
];
|
|
45
|
+
function kind_of_host(host) {
|
|
46
|
+
for (const [suffix, kind] of KNOWN) if (host === suffix || host.endsWith("." + suffix)) return kind;
|
|
47
|
+
return "other";
|
|
48
|
+
}
|
|
49
|
+
function host_of(url) {
|
|
50
|
+
try {
|
|
51
|
+
return new URL(url).host;
|
|
52
|
+
} catch {
|
|
53
|
+
return "";
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
/** `named`: URLs the server's HTML references (its scripts, preloads, their imports) — another
|
|
57
|
+
* origin's script not among them came at runtime. Without it (the live page already holds the
|
|
58
|
+
* injected script elements), `parsed`: when the HTML was parsed (domInteractive) — a script that
|
|
59
|
+
* starts after that and after another origin's script ran was loaded by a script. `in_page`: the
|
|
60
|
+
* URLs the live document holds — a script no element names came by an import or a fetch (a
|
|
61
|
+
* self-loading library's parts), whenever it started. */
|
|
62
|
+
function third_party(resources, page_origin, cpu_by_host, named, parsed, in_page) {
|
|
63
|
+
const page_host = host_of(page_origin);
|
|
64
|
+
const by = /* @__PURE__ */ new Map();
|
|
65
|
+
let first_third_script_end = Infinity;
|
|
66
|
+
let runtime_loaded = 0;
|
|
67
|
+
let weighed = 0;
|
|
68
|
+
const sorted = [...resources].sort((a, b) => a.start - b.start);
|
|
69
|
+
for (const r of sorted) {
|
|
70
|
+
const host = host_of(r.url);
|
|
71
|
+
if (!host || host === page_host) continue;
|
|
72
|
+
const o = by.get(host) ?? {
|
|
73
|
+
host,
|
|
74
|
+
kind: kind_of_host(host),
|
|
75
|
+
files: 0,
|
|
76
|
+
scripts: 0,
|
|
77
|
+
script_bytes: 0,
|
|
78
|
+
unsized: 0,
|
|
79
|
+
wire: 0,
|
|
80
|
+
blocking: 0,
|
|
81
|
+
first: r.start,
|
|
82
|
+
cpu_ms: cpu_by_host ? cpu_by_host.get(host) ?? 0 : null
|
|
83
|
+
};
|
|
84
|
+
o.files++;
|
|
85
|
+
o.wire += r.transfer ?? 0;
|
|
86
|
+
if (r.blocking) o.blocking++;
|
|
87
|
+
if (r.type === "script") {
|
|
88
|
+
o.scripts++;
|
|
89
|
+
o.script_bytes += r.size ?? 0;
|
|
90
|
+
if (!r.size) o.unsized++;
|
|
91
|
+
else if (r.weighed) weighed++;
|
|
92
|
+
if (r.start >= first_third_script_end && (named ? !named.has(r.url) : in_page !== void 0 && !in_page.has(r.url) || parsed !== void 0 && r.start > parsed)) runtime_loaded++;
|
|
93
|
+
first_third_script_end = Math.min(first_third_script_end, r.end);
|
|
94
|
+
}
|
|
95
|
+
by.set(host, o);
|
|
96
|
+
}
|
|
97
|
+
if (!by.size) return null;
|
|
98
|
+
const origins = [...by.values()].sort((a, b) => (b.cpu_ms ?? 0) - (a.cpu_ms ?? 0) || b.script_bytes - a.script_bytes || b.wire - a.wire);
|
|
99
|
+
const sum = (k) => origins.reduce((s, o) => s + o[k], 0);
|
|
100
|
+
return {
|
|
101
|
+
origins,
|
|
102
|
+
script_bytes: sum("script_bytes"),
|
|
103
|
+
unsized: sum("unsized"),
|
|
104
|
+
weighed,
|
|
105
|
+
wire: sum("wire"),
|
|
106
|
+
blocking: sum("blocking"),
|
|
107
|
+
cpu_ms: cpu_by_host ? origins.reduce((s, o) => s + (o.cpu_ms ?? 0), 0) : null,
|
|
108
|
+
runtime_loaded
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
/** What to do about each kind, in one line (Partytown only where it tends to work). */
|
|
112
|
+
const ADVICE = {
|
|
113
|
+
"tag manager": "audit its tags (each one is a script it adds at runtime), fire them after the page is interactive or on consent, or move them to server-side tagging",
|
|
114
|
+
analytics: "load it after the page is interactive (idle or first interaction); a pure beacon tag is the kind that runs well off the main thread in a worker (Partytown), worth trying there",
|
|
115
|
+
ads: "reserve the slots at their final size and load the ad code after the main content; conversion pixels can wait for idle",
|
|
116
|
+
"session replay": "start it after the first interaction, or sample it (record a share of visits): it watches every DOM change",
|
|
117
|
+
chat: "show a plain button that looks like the widget and load the widget on its first click (a facade)",
|
|
118
|
+
"a/b testing": "it edits the page before or as islands wake: run the experiment on the server (render the variant) so islands hydrate clean",
|
|
119
|
+
consent: "keep it small and async, and let it gate the other tags rather than load beside them",
|
|
120
|
+
fonts: "self-host the fonts (one origin fewer on the critical path) and preload the one the first screen uses",
|
|
121
|
+
"library cdn": "bundle the library with the app (one origin fewer, cached with your code, no runtime fetches of its parts)",
|
|
122
|
+
other: "load it async, after the first paint, or where it is used"
|
|
123
|
+
};
|
|
124
|
+
const kb = (n) => n >= 1048576 ? `${(n / 1048576).toFixed(1)} MB` : n > 0 && n < 1024 ? `${n} B` : `${Math.round(n / 1024)} KB`;
|
|
125
|
+
/** `edited`: islands that did not wake from the server's markup on this visit (changed, recovered,
|
|
126
|
+
* healed, failed), with when they woke (ms; Infinity when unknown or never). */
|
|
127
|
+
function third_party_findings(tp, edited = []) {
|
|
128
|
+
if (!tp) return [];
|
|
129
|
+
const out = [];
|
|
130
|
+
const MANY = 5;
|
|
131
|
+
const heavy = tp.origins.filter((o) => (o.cpu_ms ?? 0) >= 50 || o.script_bytes >= 51200 || o.unsized >= MANY || o.blocking);
|
|
132
|
+
const size = (bytes, scripts, unsized) => !unsized ? kb(bytes) : unsized === scripts ? `${scripts} script${scripts === 1 ? "" : "s"}, sizes hidden` : `at least ${kb(bytes)}`;
|
|
133
|
+
const label = (o) => `${o.host}${o.kind !== "other" ? ` (${o.kind})` : ""} ${size(o.script_bytes, o.scripts, o.unsized)}${o.cpu_ms ? `, ${Math.round(o.cpu_ms)} ms CPU` : ""}${o.blocking ? `, ${o.blocking} blocking` : ""}`;
|
|
134
|
+
const scripts = tp.origins.reduce((s, o) => s + o.scripts, 0);
|
|
135
|
+
const weighed = tp.weighed ? ` (this browser hid the size of ${tp.weighed === scripts ? scripts === 1 ? "it" : "each" : `${tp.weighed} of them`}; weighed from the files themselves)` : "";
|
|
136
|
+
const served = !tp.unsized ? `${kb(tp.script_bytes)} of JS${weighed}` : tp.unsized === scripts ? `${scripts} script${scripts === 1 ? "" : "s"} (this browser hides other origins' file sizes; a Chromium visit shows them)` : `at least ${kb(tp.script_bytes)} of JS (${tp.unsized} of the ${scripts} scripts had their size hidden by this browser${tp.weighed ? `; ${tp.weighed} more it hid were weighed from the files themselves` : ""})`;
|
|
137
|
+
if (tp.script_bytes >= 30720 || tp.unsized >= MANY || (tp.cpu_ms ?? 0) >= 50 || tp.blocking > 0) out.push({
|
|
138
|
+
code: "third-party",
|
|
139
|
+
severity: (tp.cpu_ms ?? 0) >= 200 || tp.blocking > 0 || tp.script_bytes >= 204800 ? "warn" : "info",
|
|
140
|
+
message: `${tp.origins.length} other origin${tp.origins.length === 1 ? "" : "s"} served ${served}${tp.cpu_ms !== null ? ` and ran ${Math.round(tp.cpu_ms)} ms on the main thread` : ""}${tp.runtime_loaded ? `; ${tp.runtime_loaded} of their scripts the page never names, loaded by other scripts (how a tag manager or a self-loading library adds code)` : ""}. The heaviest: ${(heavy.length ? heavy : tp.origins).slice(0, 3).map(label).join("; ")}.`,
|
|
141
|
+
fix: [...new Set((heavy.length ? heavy : tp.origins).slice(0, 3).map((o) => `${o.kind === "other" ? o.host : o.kind}: ${ADVICE[o.kind]}`))].join(" · ")
|
|
142
|
+
});
|
|
143
|
+
const blocking = tp.origins.filter((o) => o.blocking);
|
|
144
|
+
if (blocking.length) out.push({
|
|
145
|
+
code: "third-party-blocking",
|
|
146
|
+
severity: "warn",
|
|
147
|
+
message: `${blocking.map((o) => o.host).join(", ")} held the first paint: the page waited on another origin's server before showing anything.`,
|
|
148
|
+
fix: "Load its scripts with async or defer, self-host a stylesheet or font it serves, or at least preconnect to it."
|
|
149
|
+
});
|
|
150
|
+
const last_woke = edited.reduce((m, e) => Math.max(m, e.done), -Infinity);
|
|
151
|
+
const editors = tp.origins.filter((o) => o.scripts > 0 && o.first < last_woke && o.kind !== "fonts" && o.kind !== "library cdn");
|
|
152
|
+
if (edited.length && editors.length) out.push({
|
|
153
|
+
code: "third-party-edits",
|
|
154
|
+
severity: "warn",
|
|
155
|
+
message: `${[...new Set(edited.map((e) => e.name))].slice(0, 3).join(", ")} did not wake from the server's markup, and ${editors.slice(0, 3).map((o) => `${o.host}${o.kind !== "other" ? ` (${o.kind})` : ""}`).join(", ")} ran scripts before ${edited.length === 1 ? "it" : "they"} woke: a script from another origin that edits the DOM is the usual cause.`,
|
|
156
|
+
fix: "Keep third-party edits out of island subtrees (target the markup around them), or render the variant on the server so the island hydrates what it was sent."
|
|
157
|
+
});
|
|
158
|
+
return out;
|
|
159
|
+
}
|
|
160
|
+
export { kind_of_host, third_party, third_party_findings };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AttrChange, BeaconPage, beacon_page, beacon_record_cpu, hole_request_times, is_headless } from "./runtime/beacon.js";
|
|
2
|
+
import { props_sidecar_of } from "./runtime/sidecar.js";
|
|
3
|
+
import { PAGE_SEED_SELECTOR } from "./runtime/seeds.js";
|
|
4
|
+
import { paint_blocker } from "./runtime/render-blocking.js";
|
|
5
|
+
import { RegionRefusal } from "./runtime/region-endpoint-url.js";
|
|
6
|
+
import { charge, own_cost } from "./runtime/own-cost.js";
|
|
7
|
+
import { nearest_attr } from "./runtime/nearest-attr.js";
|
|
8
|
+
import { REGION_RENDER_CONCURRENCY } from "./runtime/concurrency.js";
|
|
9
|
+
import { tool_fetch, tool_made } from "./tool-fetches.js";
|
|
10
|
+
import { PAGE_DEFER_GLOBAL, PAGE_DEFER_KEY, PAGE_DEFER_REGISTRY_KEY } from "./page-defer.js";
|
|
11
|
+
import { ISLAND_GRAPH_ATTR, decode_island_graph } from "./island-graph.js";
|
|
12
|
+
import { UnscopedStyles, find_unscoped, unscoped_finding, unscoped_marker } from "./unscoped-css.js";
|
|
13
|
+
export { type AttrChange, type BeaconPage, ISLAND_GRAPH_ATTR, PAGE_DEFER_GLOBAL, PAGE_DEFER_KEY, PAGE_DEFER_REGISTRY_KEY, PAGE_SEED_SELECTOR, REGION_RENDER_CONCURRENCY, type RegionRefusal, type UnscopedStyles, beacon_page, beacon_record_cpu, charge, decode_island_graph, find_unscoped, hole_request_times, is_headless, nearest_attr, own_cost, paint_blocker, props_sidecar_of, tool_fetch, tool_made, unscoped_finding, unscoped_marker };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { beacon_page, beacon_record_cpu, hole_request_times, is_headless } from "./runtime/beacon.js";
|
|
2
|
+
import { props_sidecar_of } from "./runtime/sidecar.js";
|
|
3
|
+
import { PAGE_SEED_SELECTOR } from "./runtime/seeds.js";
|
|
4
|
+
import { paint_blocker } from "./runtime/render-blocking.js";
|
|
5
|
+
import { charge, own_cost } from "./runtime/own-cost.js";
|
|
6
|
+
import { nearest_attr } from "./runtime/nearest-attr.js";
|
|
7
|
+
import { REGION_RENDER_CONCURRENCY } from "./runtime/concurrency.js";
|
|
8
|
+
import { tool_fetch, tool_made } from "./tool-fetches.js";
|
|
9
|
+
import { PAGE_DEFER_GLOBAL, PAGE_DEFER_KEY, PAGE_DEFER_REGISTRY_KEY } from "./page-defer.js";
|
|
10
|
+
import { ISLAND_GRAPH_ATTR, decode_island_graph } from "./island-graph.js";
|
|
11
|
+
import { find_unscoped, unscoped_finding, unscoped_marker } from "./unscoped-css.js";
|
|
12
|
+
export { ISLAND_GRAPH_ATTR, PAGE_DEFER_GLOBAL, PAGE_DEFER_KEY, PAGE_DEFER_REGISTRY_KEY, PAGE_SEED_SELECTOR, REGION_RENDER_CONCURRENCY, beacon_page, beacon_record_cpu, charge, decode_island_graph, find_unscoped, hole_request_times, is_headless, nearest_attr, own_cost, paint_blocker, props_sidecar_of, tool_fetch, tool_made, unscoped_finding, unscoped_marker };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { __register_transportable } from "./live-transport.js";
|
|
2
|
+
import { __tag_context } from "./context-bridge.js";
|
|
3
|
+
import { register_router_css, register_router_css_paths } from "./router-css.js";
|
|
4
|
+
import { __og_$ } from "./fn-transport.js";
|
|
5
|
+
import { __og_store } from "./store-transport.js";
|
|
6
|
+
import { __og_boundary } from "./boundary.js";
|
|
7
|
+
export { __og_$, __og_boundary, __og_store, __register_transportable, __tag_context, register_router_css, register_router_css_paths };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { __register_transportable } from "./live-transport.js";
|
|
2
|
+
import { __tag_context } from "./context-bridge.js";
|
|
3
|
+
import { register_router_css, register_router_css_paths } from "./router-css.js";
|
|
4
|
+
import { __og_$ } from "./fn-transport.js";
|
|
5
|
+
import { __og_store } from "./store-transport.js";
|
|
6
|
+
import { __og_boundary } from "./boundary.js";
|
|
7
|
+
export { __og_$, __og_boundary, __og_store, __register_transportable, __tag_context, register_router_css, register_router_css_paths };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { makeRegionEndpoint } from "./server/region-endpoint.js";
|
|
2
|
+
import { render_region_html } from "./server/render-region-html.js";
|
|
3
|
+
import { BatchHoleStats, HoleRequestStats, HoleStat, IslandInteractivity, IslandStat, OgygiaRequestStats, SeedKeyStat, hole_stats_of, record_request_stats, request_stats_of, set_batch_hole_listener, set_request_stats_detail, want_request_stats } from "./server/request-stats.js";
|
|
4
|
+
import { mark_personal } from "./server/personal-response.js";
|
|
5
|
+
import { islands_endpoint } from "./server/endpoint.js";
|
|
6
|
+
import { scanRegions } from "./server/split-regions.js";
|
|
7
|
+
export { type BatchHoleStats, type HoleRequestStats, type HoleStat, type IslandInteractivity, type IslandStat, type OgygiaRequestStats, type SeedKeyStat, hole_stats_of, islands_endpoint, makeRegionEndpoint, mark_personal, record_request_stats, render_region_html, request_stats_of, scanRegions, set_batch_hole_listener, set_request_stats_detail, want_request_stats };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { makeRegionEndpoint } from "./server/region-endpoint.js";
|
|
2
|
+
import { render_region_html } from "./server/render-region-html.js";
|
|
3
|
+
import { hole_stats_of, record_request_stats, request_stats_of, set_batch_hole_listener, set_request_stats_detail, want_request_stats } from "./server/request-stats.js";
|
|
4
|
+
import { mark_personal } from "./server/personal-response.js";
|
|
5
|
+
import { islands_endpoint } from "./server/endpoint.js";
|
|
6
|
+
import { scanRegions } from "./server/split-regions.js";
|
|
7
|
+
export { hole_stats_of, islands_endpoint, makeRegionEndpoint, mark_personal, record_request_stats, render_region_html, request_stats_of, scanRegions, set_batch_hole_listener, set_request_stats_detail, want_request_stats };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { og_entry_hydrate, og_entry_unmount } from "./entry-hydrate.js";
|
|
2
|
+
import { documentIsCsrTrue, isNested, setNested } from "./context.js";
|
|
3
|
+
import { __register_transportable } from "./live-transport.js";
|
|
4
|
+
import { __og_$, __register_fn } from "./fn-transport.js";
|
|
5
|
+
import { __og_store, __register_store_factory, mark_store } from "./store-transport.js";
|
|
6
|
+
import { __og_boundary, configure_boundary } from "./boundary.js";
|
|
7
|
+
import { __og_source } from "./source.js";
|
|
8
|
+
import { __tag_context } from "./context-bridge.js";
|
|
9
|
+
import { og_portable } from "./region-snippet.js";
|
|
10
|
+
import { og_html_region, prebaked_region } from "./region.js";
|
|
11
|
+
import Region from "./Region.svelte";
|
|
12
|
+
import NestedProvider from "./NestedProvider.svelte";
|
|
13
|
+
export { NestedProvider, Region, __og_$, __og_boundary, __og_source, __og_store, __register_fn, __register_store_factory, __register_transportable, __tag_context, configure_boundary, documentIsCsrTrue, isNested, mark_store, og_entry_hydrate, og_entry_unmount, og_html_region, og_portable, prebaked_region, setNested };
|
package/dist/internal.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { og_entry_hydrate, og_entry_unmount } from "./entry-hydrate.js";
|
|
2
|
+
import { documentIsCsrTrue, isNested, setNested } from "./context.js";
|
|
3
|
+
import { __register_transportable } from "./live-transport.js";
|
|
4
|
+
import { __og_$, __register_fn } from "./fn-transport.js";
|
|
5
|
+
import { __og_store, __register_store_factory, mark_store } from "./store-transport.js";
|
|
6
|
+
import { __og_boundary, configure_boundary } from "./boundary.js";
|
|
7
|
+
import { __og_source } from "./source.js";
|
|
8
|
+
import { __tag_context } from "./context-bridge.js";
|
|
9
|
+
import { og_portable } from "./region-snippet.js";
|
|
10
|
+
import { og_html_region, prebaked_region } from "./region.js";
|
|
11
|
+
import Region from "./Region.svelte";
|
|
12
|
+
import NestedProvider from "./NestedProvider.svelte";
|
|
13
|
+
export { NestedProvider, Region, __og_$, __og_boundary, __og_source, __og_store, __register_fn, __register_store_factory, __register_transportable, __tag_context, configure_boundary, documentIsCsrTrue, isNested, mark_store, og_entry_hydrate, og_entry_unmount, og_html_region, og_portable, prebaked_region, setNested };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* THE ISLAND GRAPH — which chunks each island's code needs, as DATA the page carries, never as
|
|
3
|
+
* `<link rel="modulepreload">` tags.
|
|
4
|
+
*
|
|
5
|
+
* An island entry's own `import()` finds its chunks only after it downloads and parses: a waterfall.
|
|
6
|
+
* A modulepreload per chunk removes the waterfall, but a hint in the HTML fetches the moment the
|
|
7
|
+
* parser meets it — before the page has painted, and for islands that may never wake. So the server
|
|
8
|
+
* writes the graph as data (this format), and the runtime inserts the preload links itself when an
|
|
9
|
+
* island WAKES (runtime/island-graph-preload.ts): after the wake gate, for exactly that island, beside
|
|
10
|
+
* its `import()`. Its whole graph downloads in parallel the moment it may start; nothing lands in
|
|
11
|
+
* the paint window; an island that never wakes downloads nothing.
|
|
12
|
+
*
|
|
13
|
+
* Wire shape (one inert JSON script): `{"h":[href,…],"e":{"<entry>":[i,…]},"s":{"<entry>":src}}` —
|
|
14
|
+
* every chunk href once, each entry (the region's `entry` attribute, as emitted: its IDENTITY)
|
|
15
|
+
* listing the indexes of the chunks it needs. Twenty islands sharing Svelte's client runtime name
|
|
16
|
+
* its chunk once. `s` (optional): the LOCATION of an entry no element on the page carries — a
|
|
17
|
+
* portable snippet's live entry, imported by its identity — so the runtime loads the content-hashed
|
|
18
|
+
* file (runtime/region-endpoint-url.ts `note_entry_location`); an element carries its own (`src`).
|
|
19
|
+
*
|
|
20
|
+
* Universal leaf: the server encodes (server/document-tail.ts), the boot decodes.
|
|
21
|
+
*/
|
|
22
|
+
/** The attribute that marks a graph script (the runtime finds every one on the page by it). */
|
|
23
|
+
export declare const ISLAND_GRAPH_ATTR = "data-ogygia-graph";
|
|
24
|
+
/** The JSON shape a graph script carries. */
|
|
25
|
+
export interface IslandGraphWire {
|
|
26
|
+
h: string[];
|
|
27
|
+
e: Record<string, number[]>;
|
|
28
|
+
s?: Record<string, string>;
|
|
29
|
+
}
|
|
30
|
+
/** Encode entry → chunk hrefs (and identity → location, when any) as the wire shape (JSON text,
|
|
31
|
+
* not yet script-escaped). */
|
|
32
|
+
export declare function encode_island_graph(graph: ReadonlyMap<string, readonly string[]>, locations?: ReadonlyMap<string, string>): string;
|
|
33
|
+
/** Decode a graph script's `s`: entry identity → location, as written (unresolved). */
|
|
34
|
+
export declare function decode_island_locations(text: string): Map<string, string>;
|
|
35
|
+
/** Decode a graph script's text: entry → chunk hrefs, as written (unresolved). Malformed → empty. */
|
|
36
|
+
export declare function decode_island_graph(text: string): Map<string, string[]>;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
// src/island-graph.ts
|
|
2
|
+
/**
|
|
3
|
+
* THE ISLAND GRAPH — which chunks each island's code needs, as DATA the page carries, never as
|
|
4
|
+
* `<link rel="modulepreload">` tags.
|
|
5
|
+
*
|
|
6
|
+
* An island entry's own `import()` finds its chunks only after it downloads and parses: a waterfall.
|
|
7
|
+
* A modulepreload per chunk removes the waterfall, but a hint in the HTML fetches the moment the
|
|
8
|
+
* parser meets it — before the page has painted, and for islands that may never wake. So the server
|
|
9
|
+
* writes the graph as data (this format), and the runtime inserts the preload links itself when an
|
|
10
|
+
* island WAKES (runtime/island-graph-preload.ts): after the wake gate, for exactly that island, beside
|
|
11
|
+
* its `import()`. Its whole graph downloads in parallel the moment it may start; nothing lands in
|
|
12
|
+
* the paint window; an island that never wakes downloads nothing.
|
|
13
|
+
*
|
|
14
|
+
* Wire shape (one inert JSON script): `{"h":[href,…],"e":{"<entry>":[i,…]},"s":{"<entry>":src}}` —
|
|
15
|
+
* every chunk href once, each entry (the region's `entry` attribute, as emitted: its IDENTITY)
|
|
16
|
+
* listing the indexes of the chunks it needs. Twenty islands sharing Svelte's client runtime name
|
|
17
|
+
* its chunk once. `s` (optional): the LOCATION of an entry no element on the page carries — a
|
|
18
|
+
* portable snippet's live entry, imported by its identity — so the runtime loads the content-hashed
|
|
19
|
+
* file (runtime/region-endpoint-url.ts `note_entry_location`); an element carries its own (`src`).
|
|
20
|
+
*
|
|
21
|
+
* Universal leaf: the server encodes (server/document-tail.ts), the boot decodes.
|
|
22
|
+
*/
|
|
23
|
+
/** The attribute that marks a graph script (the runtime finds every one on the page by it). */
|
|
24
|
+
const ISLAND_GRAPH_ATTR = "data-ogygia-graph";
|
|
25
|
+
/** Encode entry → chunk hrefs (and identity → location, when any) as the wire shape (JSON text,
|
|
26
|
+
* not yet script-escaped). */
|
|
27
|
+
function encode_island_graph(graph, locations) {
|
|
28
|
+
const h = [];
|
|
29
|
+
const index = /* @__PURE__ */ new Map();
|
|
30
|
+
const e = {};
|
|
31
|
+
for (const [entry, hrefs] of graph) {
|
|
32
|
+
const ids = [];
|
|
33
|
+
for (const href of hrefs) {
|
|
34
|
+
let i = index.get(href);
|
|
35
|
+
if (i === void 0) {
|
|
36
|
+
i = h.length;
|
|
37
|
+
h.push(href);
|
|
38
|
+
index.set(href, i);
|
|
39
|
+
}
|
|
40
|
+
ids.push(i);
|
|
41
|
+
}
|
|
42
|
+
e[entry] = ids;
|
|
43
|
+
}
|
|
44
|
+
if (!locations?.size) return JSON.stringify({
|
|
45
|
+
h,
|
|
46
|
+
e
|
|
47
|
+
});
|
|
48
|
+
return JSON.stringify({
|
|
49
|
+
h,
|
|
50
|
+
e,
|
|
51
|
+
s: Object.fromEntries(locations)
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
/** Decode a graph script's `s`: entry identity → location, as written (unresolved). */
|
|
55
|
+
function decode_island_locations(text) {
|
|
56
|
+
const out = /* @__PURE__ */ new Map();
|
|
57
|
+
let wire;
|
|
58
|
+
try {
|
|
59
|
+
wire = JSON.parse(text);
|
|
60
|
+
} catch {
|
|
61
|
+
return out;
|
|
62
|
+
}
|
|
63
|
+
if (!wire || !wire.s || typeof wire.s !== "object") return out;
|
|
64
|
+
for (const [entry, src] of Object.entries(wire.s)) if (typeof src === "string") out.set(entry, src);
|
|
65
|
+
return out;
|
|
66
|
+
}
|
|
67
|
+
/** Decode a graph script's text: entry → chunk hrefs, as written (unresolved). Malformed → empty. */
|
|
68
|
+
function decode_island_graph(text) {
|
|
69
|
+
const out = /* @__PURE__ */ new Map();
|
|
70
|
+
let wire;
|
|
71
|
+
try {
|
|
72
|
+
wire = JSON.parse(text);
|
|
73
|
+
} catch {
|
|
74
|
+
return out;
|
|
75
|
+
}
|
|
76
|
+
if (!wire || !Array.isArray(wire.h) || !wire.e || typeof wire.e !== "object") return out;
|
|
77
|
+
for (const entry of Object.keys(wire.e)) {
|
|
78
|
+
const ids = wire.e[entry];
|
|
79
|
+
if (!Array.isArray(ids)) continue;
|
|
80
|
+
const hrefs = [];
|
|
81
|
+
for (const i of ids) {
|
|
82
|
+
const href = wire.h[i];
|
|
83
|
+
if (typeof href === "string") hrefs.push(href);
|
|
84
|
+
}
|
|
85
|
+
out.set(entry, hrefs);
|
|
86
|
+
}
|
|
87
|
+
return out;
|
|
88
|
+
}
|
|
89
|
+
export { ISLAND_GRAPH_ATTR, decode_island_graph, decode_island_locations, encode_island_graph };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The parcel/store stand-in for "keep the fallback" (see ./keep-fallback.ts) — never applied to the
|
|
3
|
+
* DOM. A dependency-free leaf: the browser runtime's boot compares a hole's answer against it, and
|
|
4
|
+
* `keep-fallback.ts` itself imports the server-side context module (which reaches Svelte), which must
|
|
5
|
+
* never enter the boot's static graph.
|
|
6
|
+
*/
|
|
7
|
+
export declare const KEEP_FALLBACK_HTML = "<!--ogygia:keep-fallback-->";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// src/keep-fallback-marker.ts
|
|
2
|
+
/**
|
|
3
|
+
* The parcel/store stand-in for "keep the fallback" (see ./keep-fallback.ts) — never applied to the
|
|
4
|
+
* DOM. A dependency-free leaf: the browser runtime's boot compares a hole's answer against it, and
|
|
5
|
+
* `keep-fallback.ts` itself imports the server-side context module (which reaches Svelte), which must
|
|
6
|
+
* never enter the boot's static graph.
|
|
7
|
+
*/
|
|
8
|
+
const KEEP_FALLBACK_HTML = "<!--ogygia:keep-fallback-->";
|
|
9
|
+
export { KEEP_FALLBACK_HTML };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { KEEP_FALLBACK_HTML } from "./keep-fallback-marker.js";
|
|
2
|
+
/** The message a misplaced `keepFallback()` fails with (a real error, not the signal). */
|
|
3
|
+
export declare const KEEP_FALLBACK_INLINE_MESSAGE: string;
|
|
4
|
+
export declare class KeepFallbackSignal extends Error {
|
|
5
|
+
constructor();
|
|
6
|
+
}
|
|
7
|
+
/** End this server island's render: the page's fallback is the right content for this visitor.
|
|
8
|
+
* Called from a server island rendering INLINE (nested in an island — the deferred mark is
|
|
9
|
+
* ignored there), the signal would escape to Kit's error page: fail with the reason instead. */
|
|
10
|
+
export declare function keepFallback(): never;
|
|
11
|
+
/** Did a hole render end with {@link keepFallback}? (the handle's catch reads this) */
|
|
12
|
+
export declare function is_keep_fallback(e: unknown): boolean;
|
|
13
|
+
export { KEEP_FALLBACK_HTML };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { isHoleInline } from "./context.js";
|
|
2
|
+
import { KEEP_FALLBACK_HTML } from "./keep-fallback-marker.js";
|
|
3
|
+
// src/keep-fallback.ts
|
|
4
|
+
/**
|
|
5
|
+
* `keepFallback()` — a server island's way to say "what the page already shows is right".
|
|
6
|
+
*
|
|
7
|
+
* A hole's `ogygiaFallback` is often the common case rendered in the page (an anonymous visitor's
|
|
8
|
+
* actions slot, an eyebrow with no session); the hole exists for the other visitors. Calling
|
|
9
|
+
* `keepFallback()` during the hole's server render ends it with no HTML: the endpoint answers
|
|
10
|
+
* `204 No Content` (a batch parcel carries {@link KEEP_FALLBACK_HTML}), the runtime keeps the
|
|
11
|
+
* fallback DOM as it is and marks the region done — no swap, no stylesheet wait, no bytes. Server
|
|
12
|
+
* only: it throws a branded signal the handle recognises; in the browser a hole never renders.
|
|
13
|
+
*/
|
|
14
|
+
const KEEP = Symbol.for("ogygia.keep-fallback");
|
|
15
|
+
/** The message a misplaced `keepFallback()` fails with (a real error, not the signal). */
|
|
16
|
+
const KEEP_FALLBACK_INLINE_MESSAGE = "[ogygia] keepFallback() ran inside the PAGE render: this server island is nested inside a `wake` island, where `render: \"deferred\"` is ignored and its component renders inline — nothing catches the signal there and its fallback never shows. Move the island out of the enclosing island (into the page, a layout, or a lake), or drop keepFallback() from a component that can render inline.";
|
|
17
|
+
var KeepFallbackSignal = class extends Error {
|
|
18
|
+
constructor() {
|
|
19
|
+
super("[ogygia] keepFallback(): the page fallback stands");
|
|
20
|
+
this.name = "KeepFallback";
|
|
21
|
+
Object.defineProperty(this, KEEP, { value: true });
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
/** End this server island's render: the page's fallback is the right content for this visitor.
|
|
25
|
+
* Called from a server island rendering INLINE (nested in an island — the deferred mark is
|
|
26
|
+
* ignored there), the signal would escape to Kit's error page: fail with the reason instead. */
|
|
27
|
+
function keepFallback() {
|
|
28
|
+
let inline = false;
|
|
29
|
+
try {
|
|
30
|
+
inline = isHoleInline();
|
|
31
|
+
} catch {}
|
|
32
|
+
if (inline) throw new Error(KEEP_FALLBACK_INLINE_MESSAGE);
|
|
33
|
+
throw new KeepFallbackSignal();
|
|
34
|
+
}
|
|
35
|
+
/** Did a hole render end with {@link keepFallback}? (the handle's catch reads this) */
|
|
36
|
+
function is_keep_fallback(e) {
|
|
37
|
+
return !!e && typeof e === "object" && e[KEEP] === true;
|
|
38
|
+
}
|
|
39
|
+
export { KEEP_FALLBACK_HTML, KEEP_FALLBACK_INLINE_MESSAGE, KeepFallbackSignal, is_keep_fallback, keepFallback };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { asset } from "$app/paths";
|
|
2
|
+
// src/kit-paths.ts
|
|
3
|
+
/**
|
|
4
|
+
* KIT'S `asset()` FOR OGYGIA'S URLS. ogygia bakes every URL base-less with a leading slash
|
|
5
|
+
* (`/_app/immutable/…`, `/@id/…`) and runs it through Kit's `asset()` at render — the one authority on
|
|
6
|
+
* the base, the assets CDN and page-relative paths. Kit 2 takes the path with its leading slash; Kit 3
|
|
7
|
+
* takes it without (and warns on every call with it, in dev — one warning per island render).
|
|
8
|
+
*
|
|
9
|
+
* WHICH KIT is a build-time fact: the plugin reads the app's Kit and defines `__OGYGIA_KIT_MAJOR__`. It
|
|
10
|
+
* used to be probed (try the path without its slash; a refusal means Kit 2) — but Kit 2 refuses only in
|
|
11
|
+
* DEV: in a build it accepted the slash-less path and returned it page-relative (`_app/immutable/x.js`),
|
|
12
|
+
* so on a page below the root every island entry resolved against the page (`/account/_app/…`) and 404'd.
|
|
13
|
+
* Without the define (a plain node import of dist/), the probe stands in, its answer checked: a result
|
|
14
|
+
* that is neither root-absolute, page-relative with a dot, nor a full URL is Kit 2's slash-less mistake.
|
|
15
|
+
*/
|
|
16
|
+
const KIT_MAJOR = typeof __OGYGIA_KIT_MAJOR__ !== "undefined" ? __OGYGIA_KIT_MAJOR__ : null;
|
|
17
|
+
/** this Kit wants the leading slash (it refused the path without one); null until the first call */
|
|
18
|
+
let wants_slash = KIT_MAJOR === null ? null : KIT_MAJOR < 3;
|
|
19
|
+
/** A URL `asset()` may legitimately return: root-absolute, `./` / `../` relative, or a full URL. */
|
|
20
|
+
function well_formed(url) {
|
|
21
|
+
return url.startsWith("/") || url.startsWith(".") || url.includes("://");
|
|
22
|
+
}
|
|
23
|
+
/** Kit's `asset()` for a base-less URL ogygia baked (`/_app/immutable/x.js`). */
|
|
24
|
+
function kit_asset(file) {
|
|
25
|
+
const call = asset;
|
|
26
|
+
if (!file.startsWith("/")) return call(file);
|
|
27
|
+
if (wants_slash === null) {
|
|
28
|
+
try {
|
|
29
|
+
const out = call(file.slice(1));
|
|
30
|
+
if (well_formed(out)) {
|
|
31
|
+
wants_slash = false;
|
|
32
|
+
return out;
|
|
33
|
+
}
|
|
34
|
+
} catch {}
|
|
35
|
+
wants_slash = true;
|
|
36
|
+
}
|
|
37
|
+
return call(wants_slash ? file : file.slice(1));
|
|
38
|
+
}
|
|
39
|
+
export { kit_asset };
|