@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 @@
|
|
|
1
|
+
export declare function hydratedBy(): string | null;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// src/hydration-info.ts
|
|
2
|
+
/**
|
|
3
|
+
* `hydratedBy()` — which schedule woke the hydration root this component is mounting under.
|
|
4
|
+
*
|
|
5
|
+
* Call during component SETUP (like `getContext`): the runtime marks the region it is hydrating
|
|
6
|
+
* (the same anchor cross-island context uses), and this reads that region's `hydrate` attribute.
|
|
7
|
+
*
|
|
8
|
+
* Why you'd care: when a visitor's input woke the island, its first event is a REPLAY — real
|
|
9
|
+
* interaction, but not a trusted browser gesture (`event.isTrusted === false`), so gesture-gated APIs
|
|
10
|
+
* (`window.open`, clipboard, fullscreen) will be blocked for it, and a guard that ignores untrusted
|
|
11
|
+
* clicks ignores it. A component that needs those can check `hydratedBy() === 'interaction'` and
|
|
12
|
+
* adapt (e.g. render the popup as a link the SECOND click uses, or skip an entrance animation that
|
|
13
|
+
* assumes a fresh load).
|
|
14
|
+
*
|
|
15
|
+
* Returns:
|
|
16
|
+
* - `'interaction'` when a visitor's input woke it — an `interaction` island, and a scheduled one
|
|
17
|
+
* pressed before its schedule made it live (its click is replayed too)
|
|
18
|
+
* - else `'load' | 'idle' | 'visible'` or a media-query string — the region's schedule
|
|
19
|
+
* - `null` on the server (SSR pass), and on csr=true pages where Kit (not ogygia) hydrates.
|
|
20
|
+
*
|
|
21
|
+
* A nested island hydrates with its parent, so it reports the PARENT region's schedule — correct:
|
|
22
|
+
* that is the wake that ran its code.
|
|
23
|
+
*/
|
|
24
|
+
const CURRENT_REGION = Symbol.for("ogygia.context.current-region");
|
|
25
|
+
function hydratedBy() {
|
|
26
|
+
if (typeof window === "undefined") return null;
|
|
27
|
+
const region = globalThis[CURRENT_REGION];
|
|
28
|
+
if (!region) return null;
|
|
29
|
+
return region.getAttribute("data-og-woke") || region.getAttribute("wake") || "load";
|
|
30
|
+
}
|
|
31
|
+
export { hydratedBy };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { AwaitableRegion, DeferredRegion, DualRegion, InlineRegion, RegionOptions, RegionSchedule, RegionValue, isRegion, region } from "./region.js";
|
|
2
|
+
import { og_derived } from "./store-transport.js";
|
|
3
|
+
import { preload } from "./preload.js";
|
|
4
|
+
import { script } from "./script.js";
|
|
5
|
+
import { requestEvent } from "./request-event.js";
|
|
6
|
+
import { keepFallback } from "./keep-fallback.js";
|
|
7
|
+
import { Preference, PreferenceSpec, preference } from "./preference.js";
|
|
8
|
+
import { TransportCodec } from "./live-transport.js";
|
|
9
|
+
import { __tag_context, createContext, setContext } from "./context-bridge.js";
|
|
10
|
+
import { hydratedBy } from "./hydration-info.js";
|
|
11
|
+
import { isOgygiaPage } from "./context.js";
|
|
12
|
+
import { SharedState } from "./shared-state.js";
|
|
13
|
+
import { getContext } from "svelte";
|
|
14
|
+
import Region from "./Region.svelte";
|
|
15
|
+
import Boundary from "./OgygiaBoundary.svelte";
|
|
16
|
+
import { transport } from "virtual:ogygia/kit-transport";
|
|
17
|
+
import Provide from "./Provide.svelte";
|
|
18
|
+
export type Fallback<P = unknown> = P & {
|
|
19
|
+
ogygiaFallback?: import("svelte").Snippet;
|
|
20
|
+
};
|
|
21
|
+
export { type AwaitableRegion, Boundary, type DeferredRegion, type DualRegion, type InlineRegion, type Preference, type PreferenceSpec, Provide, Region, type RegionOptions, type RegionSchedule, type RegionValue, SharedState, type TransportCodec, __tag_context, createContext, getContext, hydratedBy, isOgygiaPage, isRegion, keepFallback, og_derived, preference, preload, region, requestEvent, script, setContext, transport };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { isRegion, region } from "./region.js";
|
|
2
|
+
import { og_derived } from "./store-transport.js";
|
|
3
|
+
import { preload } from "./preload.js";
|
|
4
|
+
import { script } from "./script.js";
|
|
5
|
+
import { requestEvent } from "./request-event.js";
|
|
6
|
+
import { keepFallback } from "./keep-fallback.js";
|
|
7
|
+
import { preference } from "./preference.js";
|
|
8
|
+
import { __tag_context, createContext, setContext } from "./context-bridge.js";
|
|
9
|
+
import { hydratedBy } from "./hydration-info.js";
|
|
10
|
+
import { isOgygiaPage } from "./context.js";
|
|
11
|
+
import { SharedState } from "./shared-state.js";
|
|
12
|
+
import { getContext } from "svelte";
|
|
13
|
+
import Region from "./Region.svelte";
|
|
14
|
+
import Boundary from "./OgygiaBoundary.svelte";
|
|
15
|
+
import { transport } from "virtual:ogygia/kit-transport";
|
|
16
|
+
import Provide from "./Provide.svelte";
|
|
17
|
+
export { Boundary, Provide, Region, SharedState, __tag_context, createContext, getContext, hydratedBy, isOgygiaPage, isRegion, keepFallback, og_derived, preference, preload, region, requestEvent, script, setContext, transport };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { AttrChange } from "../runtime/beacon.js";
|
|
2
|
+
export type Pat = string | {
|
|
3
|
+
re: string;
|
|
4
|
+
flags?: string;
|
|
5
|
+
};
|
|
6
|
+
export interface AttrRule {
|
|
7
|
+
tag?: Pat;
|
|
8
|
+
name: Pat;
|
|
9
|
+
value?: Pat;
|
|
10
|
+
}
|
|
11
|
+
/** Split `changes` into those `rules` ignore and those left. */
|
|
12
|
+
export declare function apply_attr_rules(changes: AttrChange[], rules: AttrRule[]): {
|
|
13
|
+
left: AttrChange[];
|
|
14
|
+
ignored: AttrChange[];
|
|
15
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// src/insights/attr-rules.ts
|
|
2
|
+
function matcher(p) {
|
|
3
|
+
if (p === void 0) return () => true;
|
|
4
|
+
if (typeof p === "string") return (s) => s === p;
|
|
5
|
+
const re = new RegExp(p.re, p.flags);
|
|
6
|
+
return (s) => s !== null && re.test(s);
|
|
7
|
+
}
|
|
8
|
+
/** Split `changes` into those `rules` ignore and those left. */
|
|
9
|
+
function apply_attr_rules(changes, rules) {
|
|
10
|
+
if (!rules.length) return {
|
|
11
|
+
left: changes,
|
|
12
|
+
ignored: []
|
|
13
|
+
};
|
|
14
|
+
const ms = rules.map((r) => ({
|
|
15
|
+
tag: matcher(r.tag),
|
|
16
|
+
name: matcher(r.name),
|
|
17
|
+
value: matcher(r.value)
|
|
18
|
+
}));
|
|
19
|
+
const left = [];
|
|
20
|
+
const ignored = [];
|
|
21
|
+
for (const c of changes) (ms.some((m) => m.tag(c.tag) && m.name(c.name) && m.value(c.to ?? c.from)) ? ignored : left).push(c);
|
|
22
|
+
return {
|
|
23
|
+
left,
|
|
24
|
+
ignored
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export { apply_attr_rules };
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The main thread, from the browser's own sampler (the JS Self-Profiling API; runtime/beacon.ts keeps
|
|
3
|
+
* the trace in the page on a devtools build). Pure: a trace + the islands' hydrate windows in, out:
|
|
4
|
+
* busy time by kind of code (the app, ogygia, Svelte, packages, a page script, the browser itself),
|
|
5
|
+
* the functions and files that ran, the CPU inside each island's hydrate window and what it was,
|
|
6
|
+
* and what ran in long tasks outside any island. The Page tab shows it; the findings quote it.
|
|
7
|
+
*
|
|
8
|
+
* The trace's timestamps share `performance.now()`'s clock, so the windows line up with the
|
|
9
|
+
* beacon's island timings without conversion.
|
|
10
|
+
*/
|
|
11
|
+
export interface SelfProfileTrace {
|
|
12
|
+
frames: {
|
|
13
|
+
name?: string;
|
|
14
|
+
resourceId?: number;
|
|
15
|
+
line?: number;
|
|
16
|
+
column?: number;
|
|
17
|
+
}[];
|
|
18
|
+
resources: string[];
|
|
19
|
+
samples: {
|
|
20
|
+
timestamp: number;
|
|
21
|
+
stackId?: number;
|
|
22
|
+
}[];
|
|
23
|
+
stacks: {
|
|
24
|
+
frameId: number;
|
|
25
|
+
parentId?: number;
|
|
26
|
+
}[];
|
|
27
|
+
}
|
|
28
|
+
export type CodeKind = "app" | "ogygia" | "svelte" | "dependency" | "page script" | "browser" | "devtools";
|
|
29
|
+
export interface CpuFn {
|
|
30
|
+
name: string;
|
|
31
|
+
file: string;
|
|
32
|
+
line: number | null;
|
|
33
|
+
kind: CodeKind;
|
|
34
|
+
self_ms: number;
|
|
35
|
+
total_ms: number;
|
|
36
|
+
}
|
|
37
|
+
export interface CpuSummary {
|
|
38
|
+
/** sampled span (first to last sample) */
|
|
39
|
+
window_ms: number;
|
|
40
|
+
busy_ms: number;
|
|
41
|
+
by_kind: {
|
|
42
|
+
kind: CodeKind;
|
|
43
|
+
ms: number;
|
|
44
|
+
}[];
|
|
45
|
+
fns: CpuFn[];
|
|
46
|
+
files: {
|
|
47
|
+
file: string;
|
|
48
|
+
kind: CodeKind;
|
|
49
|
+
ms: number;
|
|
50
|
+
}[];
|
|
51
|
+
/** per island fingerprint: CPU inside its hydrate window and the functions that took it */
|
|
52
|
+
islands: Record<string, {
|
|
53
|
+
ms: number;
|
|
54
|
+
top: CpuFn[];
|
|
55
|
+
}>;
|
|
56
|
+
/** long tasks outside every island's hydrate window */
|
|
57
|
+
outside: {
|
|
58
|
+
ms: number;
|
|
59
|
+
top: CpuFn[];
|
|
60
|
+
};
|
|
61
|
+
/** the sampling interval seen (ms) */
|
|
62
|
+
interval_ms: number;
|
|
63
|
+
/** main-thread ms per other origin (the nearest frame with a script URL decides) */
|
|
64
|
+
by_host?: Record<string, number>;
|
|
65
|
+
}
|
|
66
|
+
export interface IslandWindow {
|
|
67
|
+
fp: string;
|
|
68
|
+
from: number;
|
|
69
|
+
to: number;
|
|
70
|
+
}
|
|
71
|
+
/** A frame's script, readable: origin, Vite's `/@fs` / `/@id/` prefixes and `?v=` queries off. */
|
|
72
|
+
export declare function clean_file(url: string, page_origin?: string): string;
|
|
73
|
+
/** What kind of code a frame is, from its script URL (and name, for the browser's own). */
|
|
74
|
+
export declare function kind_of(url: string, page_url: string): CodeKind;
|
|
75
|
+
export declare function analyze_cpu(trace: SelfProfileTrace, windows: IslandWindow[], longtasks: {
|
|
76
|
+
t: number;
|
|
77
|
+
ms: number;
|
|
78
|
+
}[], page_url: string): CpuSummary;
|
|
79
|
+
/** `name (file:line)` for a finding. */
|
|
80
|
+
export declare function fn_label(f: CpuFn): string;
|
|
81
|
+
/** Is this a trace the analyzer can read. */
|
|
82
|
+
export declare function is_trace(x: unknown): x is SelfProfileTrace;
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
// src/insights/cpu.ts
|
|
2
|
+
/** A frame's script, readable: origin, Vite's `/@fs` / `/@id/` prefixes and `?v=` queries off. */
|
|
3
|
+
function clean_file(url, page_origin = "") {
|
|
4
|
+
let u = url;
|
|
5
|
+
if (page_origin && u.startsWith(page_origin)) u = u.slice(page_origin.length);
|
|
6
|
+
const q = u.indexOf("?");
|
|
7
|
+
if (q !== -1) u = u.slice(0, q);
|
|
8
|
+
if (u.startsWith("/@fs")) u = u.slice(4);
|
|
9
|
+
if (u.startsWith("/@id/")) u = u.slice(5);
|
|
10
|
+
if (u.startsWith("__x00__")) u = u.slice(7);
|
|
11
|
+
for (const mark of [
|
|
12
|
+
"/node_modules/.vite/deps/",
|
|
13
|
+
"/node_modules/",
|
|
14
|
+
"/packages/",
|
|
15
|
+
"/src/"
|
|
16
|
+
]) {
|
|
17
|
+
const at = u.lastIndexOf(mark);
|
|
18
|
+
if (at !== -1) return mark === "/src/" ? u.slice(at + 1) : u.slice(at + (mark === "/packages/" ? 10 : mark.length));
|
|
19
|
+
}
|
|
20
|
+
return u;
|
|
21
|
+
}
|
|
22
|
+
/** ogygia's own instruments: the devtools dock, the event layer, the analysis engine */
|
|
23
|
+
const OWN_INSTRUMENT_RE = /\/(?:ogygia|@ogygia\/core|packages\/core)\/(?:src|dist)\/(?:devtools|events|insights)\//;
|
|
24
|
+
/** What kind of code a frame is, from its script URL (and name, for the browser's own). */
|
|
25
|
+
function kind_of(url, page_url) {
|
|
26
|
+
if (!url) return "browser";
|
|
27
|
+
const path = url.split("?")[0];
|
|
28
|
+
if (page_url && path === page_url.split("?")[0].split("#")[0]) return "page script";
|
|
29
|
+
if (path.includes("/.vite/deps/")) return path.slice(path.lastIndexOf("/") + 1).startsWith("svelte") ? "svelte" : "dependency";
|
|
30
|
+
if (path.includes("/svelte/src/") || path.includes("/node_modules/svelte/")) return "svelte";
|
|
31
|
+
if (OWN_INSTRUMENT_RE.test(path) || path.endsWith("/runtime/beacon.ts") || path.endsWith("/runtime/beacon.js")) return "devtools";
|
|
32
|
+
if (path.includes("/packages/ogygia/") || path.includes("/packages/core/") || path.includes("/node_modules/ogygia/") || path.includes("/node_modules/@ogygia/core/") || path.includes("virtual:ogygia")) return "ogygia";
|
|
33
|
+
if (path.includes("/node_modules/")) return "dependency";
|
|
34
|
+
if (path.includes("/src/")) return "app";
|
|
35
|
+
return "dependency";
|
|
36
|
+
}
|
|
37
|
+
const round1 = (n) => Math.round(n * 10) / 10;
|
|
38
|
+
function analyze_cpu(trace, windows, longtasks, page_url) {
|
|
39
|
+
const { frames, resources, samples, stacks } = trace;
|
|
40
|
+
const origin = page_url ? new URL(page_url).origin : "";
|
|
41
|
+
const gaps = [];
|
|
42
|
+
for (let i = 1; i < samples.length; i++) gaps.push(samples[i].timestamp - samples[i - 1].timestamp);
|
|
43
|
+
gaps.sort((a, b) => a - b);
|
|
44
|
+
const interval = gaps.length ? Math.max(1, gaps[gaps.length >> 1]) : 10;
|
|
45
|
+
const cap = interval * 3;
|
|
46
|
+
const fn_self = /* @__PURE__ */ new Map();
|
|
47
|
+
const fn_total = /* @__PURE__ */ new Map();
|
|
48
|
+
const kind_ms = /* @__PURE__ */ new Map();
|
|
49
|
+
const file_ms = /* @__PURE__ */ new Map();
|
|
50
|
+
const host_ms = /* @__PURE__ */ new Map();
|
|
51
|
+
const page_host = host_of(page_url);
|
|
52
|
+
const win_self = windows.map(() => /* @__PURE__ */ new Map());
|
|
53
|
+
const win_ms = windows.map(() => 0);
|
|
54
|
+
const out_self = /* @__PURE__ */ new Map();
|
|
55
|
+
let out_ms = 0;
|
|
56
|
+
let busy = 0;
|
|
57
|
+
const frame_kind = (fid) => {
|
|
58
|
+
const f = frames[fid];
|
|
59
|
+
return kind_of(f?.resourceId !== void 0 ? resources[f.resourceId] ?? "" : "", page_url);
|
|
60
|
+
};
|
|
61
|
+
for (let i = 0; i < samples.length; i++) {
|
|
62
|
+
const s = samples[i];
|
|
63
|
+
if (s.stackId === void 0) continue;
|
|
64
|
+
const next = samples[i + 1];
|
|
65
|
+
const dt = next ? Math.min(cap, Math.max(0, next.timestamp - s.timestamp)) : interval;
|
|
66
|
+
if (dt <= 0) continue;
|
|
67
|
+
busy += dt;
|
|
68
|
+
const leaf = stacks[s.stackId]?.frameId;
|
|
69
|
+
if (leaf === void 0) continue;
|
|
70
|
+
fn_self.set(leaf, (fn_self.get(leaf) ?? 0) + dt);
|
|
71
|
+
const k = frame_kind(leaf);
|
|
72
|
+
kind_ms.set(k, (kind_ms.get(k) ?? 0) + dt);
|
|
73
|
+
const lf = frames[leaf];
|
|
74
|
+
if (lf?.resourceId !== void 0) {
|
|
75
|
+
const file = clean_file(resources[lf.resourceId] ?? "", origin);
|
|
76
|
+
const e = file_ms.get(file) ?? {
|
|
77
|
+
kind: k,
|
|
78
|
+
ms: 0
|
|
79
|
+
};
|
|
80
|
+
e.ms += dt;
|
|
81
|
+
file_ms.set(file, e);
|
|
82
|
+
}
|
|
83
|
+
for (let sid = s.stackId, guard = 0; sid !== void 0 && guard < 512; guard++) {
|
|
84
|
+
const st = stacks[sid];
|
|
85
|
+
if (!st) break;
|
|
86
|
+
const rid = frames[st.frameId]?.resourceId;
|
|
87
|
+
if (rid !== void 0) {
|
|
88
|
+
const host = host_of(resources[rid] ?? "");
|
|
89
|
+
if (host && host !== page_host) host_ms.set(host, (host_ms.get(host) ?? 0) + dt);
|
|
90
|
+
break;
|
|
91
|
+
}
|
|
92
|
+
sid = st.parentId;
|
|
93
|
+
}
|
|
94
|
+
const seen = /* @__PURE__ */ new Set();
|
|
95
|
+
for (let sid = s.stackId, guard = 0; sid !== void 0 && guard < 512; guard++) {
|
|
96
|
+
const st = stacks[sid];
|
|
97
|
+
if (!st) break;
|
|
98
|
+
if (!seen.has(st.frameId)) {
|
|
99
|
+
seen.add(st.frameId);
|
|
100
|
+
fn_total.set(st.frameId, (fn_total.get(st.frameId) ?? 0) + dt);
|
|
101
|
+
}
|
|
102
|
+
sid = st.parentId;
|
|
103
|
+
}
|
|
104
|
+
let hit = false;
|
|
105
|
+
for (let w = 0; w < windows.length; w++) if (s.timestamp >= windows[w].from && s.timestamp <= windows[w].to) {
|
|
106
|
+
win_ms[w] += dt;
|
|
107
|
+
win_self[w].set(leaf, (win_self[w].get(leaf) ?? 0) + dt);
|
|
108
|
+
hit = true;
|
|
109
|
+
break;
|
|
110
|
+
}
|
|
111
|
+
if (!hit && longtasks.some((t) => s.timestamp >= t.t && s.timestamp <= t.t + t.ms)) {
|
|
112
|
+
out_ms += dt;
|
|
113
|
+
out_self.set(leaf, (out_self.get(leaf) ?? 0) + dt);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
const fn_of = (fid, self, total) => {
|
|
117
|
+
const f = frames[fid] ?? {};
|
|
118
|
+
const url = f.resourceId !== void 0 ? resources[f.resourceId] ?? "" : "";
|
|
119
|
+
const path = url.split("?")[0];
|
|
120
|
+
const stem = path.endsWith(".svelte") ? path.slice(path.lastIndexOf("/") + 1, -7) : "";
|
|
121
|
+
return {
|
|
122
|
+
name: f.name || stem || (url ? "(anonymous)" : "(browser)"),
|
|
123
|
+
file: url ? clean_file(url, origin) : "",
|
|
124
|
+
line: typeof f.line === "number" ? f.line : null,
|
|
125
|
+
kind: frame_kind(fid),
|
|
126
|
+
self_ms: round1(self),
|
|
127
|
+
total_ms: round1(total)
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
const top = (m, n) => [...m].sort((a, b) => b[1] - a[1]).slice(0, n).map(([fid, ms]) => fn_of(fid, ms, fn_total.get(fid) ?? ms));
|
|
131
|
+
const islands = {};
|
|
132
|
+
windows.forEach((w, i) => {
|
|
133
|
+
if (win_ms[i] > 0) islands[w.fp] = {
|
|
134
|
+
ms: round1(win_ms[i]),
|
|
135
|
+
top: top(win_self[i], 3)
|
|
136
|
+
};
|
|
137
|
+
});
|
|
138
|
+
return {
|
|
139
|
+
window_ms: samples.length ? round1(samples[samples.length - 1].timestamp - samples[0].timestamp) : 0,
|
|
140
|
+
busy_ms: round1(busy),
|
|
141
|
+
by_kind: [...kind_ms].map(([kind, ms]) => ({
|
|
142
|
+
kind,
|
|
143
|
+
ms: round1(ms)
|
|
144
|
+
})).sort((a, b) => b.ms - a.ms),
|
|
145
|
+
fns: top(new Map([...fn_self].filter(([fid]) => frame_kind(fid) !== "devtools")), 25),
|
|
146
|
+
files: [...file_ms].map(([file, e]) => ({
|
|
147
|
+
file,
|
|
148
|
+
kind: e.kind,
|
|
149
|
+
ms: round1(e.ms)
|
|
150
|
+
})).sort((a, b) => b.ms - a.ms).slice(0, 15),
|
|
151
|
+
islands,
|
|
152
|
+
outside: {
|
|
153
|
+
ms: round1(out_ms),
|
|
154
|
+
top: top(out_self, 3)
|
|
155
|
+
},
|
|
156
|
+
interval_ms: round1(interval),
|
|
157
|
+
by_host: Object.fromEntries([...host_ms].map(([h, ms]) => [h, round1(ms)]))
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
function host_of(url) {
|
|
161
|
+
try {
|
|
162
|
+
return url ? new URL(url).host : "";
|
|
163
|
+
} catch {
|
|
164
|
+
return "";
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
/** `name (file:line)` for a finding. */
|
|
168
|
+
function fn_label(f) {
|
|
169
|
+
const where = f.file ? ` (${f.file.slice(f.file.lastIndexOf("/") + 1)}${f.line !== null ? `:${f.line}` : ""})` : "";
|
|
170
|
+
return `${f.name}${where}`;
|
|
171
|
+
}
|
|
172
|
+
/** Is this a trace the analyzer can read. */
|
|
173
|
+
function is_trace(x) {
|
|
174
|
+
const t = x;
|
|
175
|
+
return !!t && Array.isArray(t.frames) && Array.isArray(t.samples) && Array.isArray(t.stacks) && Array.isArray(t.resources);
|
|
176
|
+
}
|
|
177
|
+
export { analyze_cpu, clean_file, fn_label, is_trace, kind_of };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export interface FpDrift {
|
|
2
|
+
entry: string;
|
|
3
|
+
fp_was: string;
|
|
4
|
+
fp_now: string;
|
|
5
|
+
/** the first differing path in the props (`stamp`, `items[2].id`), when the props parse */
|
|
6
|
+
path?: string;
|
|
7
|
+
/** the values there, clipped (or the text around the first difference) */
|
|
8
|
+
was?: string;
|
|
9
|
+
now?: string;
|
|
10
|
+
}
|
|
11
|
+
/** One island as one load (or render) had it. */
|
|
12
|
+
export interface KeptIsland {
|
|
13
|
+
entry: string;
|
|
14
|
+
fp: string;
|
|
15
|
+
props?: string;
|
|
16
|
+
}
|
|
17
|
+
type Kept = KeptIsland;
|
|
18
|
+
/** Islands matched by entry and their place among its copies; a moved fingerprint, explained. */
|
|
19
|
+
export declare function compare(was: Kept[], now: Kept[]): FpDrift[];
|
|
20
|
+
/** Where two props texts differ: the first differing path when both parse as JSON, else the text
|
|
21
|
+
* around the first differing character — ogygia's own ids (a store's, a class instance's: random
|
|
22
|
+
* per render by design) left out. `null` when those ids are all that differs. */
|
|
23
|
+
export declare function props_diff(a: string, b: string): {
|
|
24
|
+
path?: string;
|
|
25
|
+
was?: string;
|
|
26
|
+
now?: string;
|
|
27
|
+
} | null;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { unflatten } from "devalue";
|
|
2
|
+
// src/insights/fp-drift.ts
|
|
3
|
+
/**
|
|
4
|
+
* ISLANDS WHOSE FINGERPRINT MOVES BETWEEN TWO LOADS OF THE SAME PAGE. An island's `data-og-fp` is
|
|
5
|
+
* the hash of its props: what the router compares to keep a live island across a navigation, and
|
|
6
|
+
* part of the page's bytes (a host's post-render cache, a postrender store, an ETag key on them). A prop
|
|
7
|
+
* made fresh on every render — a time, a random id — moves it every time, so the island is patched on
|
|
8
|
+
* every navigation and every such cache misses. ogygia's own ids are stable now; this finds the
|
|
9
|
+
* app's.
|
|
10
|
+
*
|
|
11
|
+
* Per tab (sessionStorage): each page's islands as last loaded — entry, fingerprint, props text.
|
|
12
|
+
* On the next load of the same page (or an in-app navigation back to it), each island is matched by
|
|
13
|
+
* its entry and its place among copies of it; a moved fingerprint is named with the prop that
|
|
14
|
+
* differs (the first differing path on the JSON lane, else the first differing text).
|
|
15
|
+
*
|
|
16
|
+
* PURE (no DOM): the devtools record each load (page.ts `fp_drift`), the profiler compares its own
|
|
17
|
+
* renders of a page (report.ts) — one comparison, one rule.
|
|
18
|
+
*/
|
|
19
|
+
/** Islands matched by entry and their place among its copies; a moved fingerprint, explained. */
|
|
20
|
+
function compare(was, now) {
|
|
21
|
+
const nth = (list) => {
|
|
22
|
+
const seen = /* @__PURE__ */ new Map();
|
|
23
|
+
return list.map((k) => {
|
|
24
|
+
const n = seen.get(k.entry) ?? 0;
|
|
25
|
+
seen.set(k.entry, n + 1);
|
|
26
|
+
return `${k.entry}#${n}`;
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
const before = new Map(nth(was).map((key, i) => [key, was[i]]));
|
|
30
|
+
const out = [];
|
|
31
|
+
const keys = nth(now);
|
|
32
|
+
for (let i = 0; i < now.length; i++) {
|
|
33
|
+
const a = before.get(keys[i]);
|
|
34
|
+
const b = now[i];
|
|
35
|
+
if (!a || a.fp === b.fp) continue;
|
|
36
|
+
if (a.props !== void 0 && b.props !== void 0) {
|
|
37
|
+
const d = props_diff(a.props, b.props);
|
|
38
|
+
if (!d) continue;
|
|
39
|
+
out.push({
|
|
40
|
+
entry: b.entry,
|
|
41
|
+
fp_was: a.fp,
|
|
42
|
+
fp_now: b.fp,
|
|
43
|
+
...d
|
|
44
|
+
});
|
|
45
|
+
} else out.push({
|
|
46
|
+
entry: b.entry,
|
|
47
|
+
fp_was: a.fp,
|
|
48
|
+
fp_now: b.fp
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
return out;
|
|
52
|
+
}
|
|
53
|
+
/** Where two props texts differ: the first differing path when both parse as JSON, else the text
|
|
54
|
+
* around the first differing character — ogygia's own ids (a store's, a class instance's: random
|
|
55
|
+
* per render by design) left out. `null` when those ids are all that differs. */
|
|
56
|
+
function props_diff(a, b) {
|
|
57
|
+
if (a === b) return null;
|
|
58
|
+
try {
|
|
59
|
+
return first_path(revive(JSON.parse(a)), revive(JSON.parse(b)), "");
|
|
60
|
+
} catch {}
|
|
61
|
+
const ma = mask_ids(a);
|
|
62
|
+
const mb = mask_ids(b);
|
|
63
|
+
if (ma === mb) return null;
|
|
64
|
+
let i = 0;
|
|
65
|
+
while (i < ma.length && i < mb.length && ma.charCodeAt(i) === mb.charCodeAt(i)) i++;
|
|
66
|
+
const from = Math.max(0, i - 20);
|
|
67
|
+
return {
|
|
68
|
+
was: ma.slice(from, i + 40),
|
|
69
|
+
now: mb.slice(from, i + 40)
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* The props as values, for naming a path. Props are an object, so a parsed ARRAY is the devalue
|
|
74
|
+
* lane's flat table — `[7]` would name a slot, not a prop: unflattened back into the props, every
|
|
75
|
+
* custom type (a transportable, a ref) kept as `{ "<type>": value }` (any reviver, so none throws).
|
|
76
|
+
*/
|
|
77
|
+
function revive(parsed) {
|
|
78
|
+
return Array.isArray(parsed) ? unflatten(parsed, ANY_REVIVER) : parsed;
|
|
79
|
+
}
|
|
80
|
+
const keep_typed = (type) => (value) => ({ [`<${type}>`]: value });
|
|
81
|
+
/** A revivers table that has every type (devalue asks `Object.hasOwn`, then calls it). */
|
|
82
|
+
const ANY_REVIVER = new Proxy({}, {
|
|
83
|
+
getOwnPropertyDescriptor: (_, k) => ({
|
|
84
|
+
value: keep_typed(String(k)),
|
|
85
|
+
configurable: true,
|
|
86
|
+
enumerable: true,
|
|
87
|
+
writable: false
|
|
88
|
+
}),
|
|
89
|
+
get: (_, k) => keep_typed(String(k))
|
|
90
|
+
});
|
|
91
|
+
/** ogygia's mint id: a UUID (`8-4-4-4-12` hex). */
|
|
92
|
+
function is_mint_id(v) {
|
|
93
|
+
if (typeof v !== "string" || v.length !== 36) return false;
|
|
94
|
+
for (let i = 0; i < 36; i++) {
|
|
95
|
+
const c = v.charCodeAt(i);
|
|
96
|
+
if (i === 8 || i === 13 || i === 18 || i === 23) {
|
|
97
|
+
if (c !== 45) return false;
|
|
98
|
+
} else if (!(c >= 48 && c <= 57 || c >= 97 && c <= 102)) return false;
|
|
99
|
+
}
|
|
100
|
+
return true;
|
|
101
|
+
}
|
|
102
|
+
/** The text with every UUID replaced by a fixed one (for the non-JSON compare). */
|
|
103
|
+
function mask_ids(s) {
|
|
104
|
+
let out = "";
|
|
105
|
+
let last = 0;
|
|
106
|
+
for (let i = 0; i + 36 <= s.length; i++) {
|
|
107
|
+
if (s.charCodeAt(i + 8) !== 45 || !is_mint_id(s.slice(i, i + 36))) continue;
|
|
108
|
+
out += s.slice(last, i) + "<id>";
|
|
109
|
+
last = i + 36;
|
|
110
|
+
i += 35;
|
|
111
|
+
}
|
|
112
|
+
return last === 0 ? s : out + s.slice(last);
|
|
113
|
+
}
|
|
114
|
+
function first_path(a, b, path) {
|
|
115
|
+
if (a === b) return null;
|
|
116
|
+
if (is_mint_id(a) && is_mint_id(b)) return null;
|
|
117
|
+
const clip = (v) => {
|
|
118
|
+
const s = JSON.stringify(v) ?? String(v);
|
|
119
|
+
return s.length > 60 ? s.slice(0, 60) + "…" : s;
|
|
120
|
+
};
|
|
121
|
+
if (a && b && typeof a === "object" && typeof b === "object" && Array.isArray(a) === Array.isArray(b)) {
|
|
122
|
+
if (Array.isArray(a)) {
|
|
123
|
+
const bb = b;
|
|
124
|
+
for (let i = 0; i < Math.max(a.length, bb.length); i++) {
|
|
125
|
+
const d = first_path(a[i], bb[i], `${path}[${i}]`);
|
|
126
|
+
if (d) return d;
|
|
127
|
+
}
|
|
128
|
+
return null;
|
|
129
|
+
}
|
|
130
|
+
const keys = /* @__PURE__ */ new Set([...Object.keys(a), ...Object.keys(b)]);
|
|
131
|
+
for (const k of keys) {
|
|
132
|
+
const d = first_path(a[k], b[k], path ? `${path}.${k}` : k);
|
|
133
|
+
if (d) return d;
|
|
134
|
+
}
|
|
135
|
+
return null;
|
|
136
|
+
}
|
|
137
|
+
return {
|
|
138
|
+
path: tidy_path(path) || "(the props)",
|
|
139
|
+
was: clip(a),
|
|
140
|
+
now: clip(b)
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
/** A path as the author wrote the props: ogygia's own ref wrapper (a store, a shared class — the
|
|
144
|
+
* value inside it is `.d`) left out, so `cart.<OgygiaRef>.d.serverStamp` reads `cart.serverStamp`. */
|
|
145
|
+
function tidy_path(path) {
|
|
146
|
+
return path.split(".<OgygiaRef>.d").join("").split(".<OgygiaRef>").join("");
|
|
147
|
+
}
|
|
148
|
+
export { compare, props_diff };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A HOLE'S ANSWER, CUT INTO ITS PARTS — the one cut the devtools Page tab's waterfall and the
|
|
3
|
+
* profiler report's One clock both draw. Where the browser (Resource Timing) and the server
|
|
4
|
+
* (Server-Timing `og-queue`, `og-render`) timed it: before its request left (a busy page, the
|
|
5
|
+
* runtime's queue), the server's wait for a render slot, the server render (or, untimed, the wait
|
|
6
|
+
* for the first byte), then the rest (network, the body, the swap). Page times, ms.
|
|
7
|
+
*/
|
|
8
|
+
export interface HoleTimes {
|
|
9
|
+
/** when its fallback began to count (the first paint, or the hole's own start) */
|
|
10
|
+
shown_at?: number;
|
|
11
|
+
/** how long its fallback stood: from `shown_at` to the swap */
|
|
12
|
+
wait_ms: number;
|
|
13
|
+
left_at?: number;
|
|
14
|
+
first_at?: number;
|
|
15
|
+
server_queue_ms?: number;
|
|
16
|
+
server_ms?: number;
|
|
17
|
+
}
|
|
18
|
+
export type HoleSegKind = "wait" | "before" | "slot" | "render" | "server" | "rest";
|
|
19
|
+
export declare const HOLE_SEG_LABEL: Record<HoleSegKind, string>;
|
|
20
|
+
/** The segments, in order. Without a timing, one: the wait. A request the document preloaded
|
|
21
|
+
* starts before the fallback counts: its segments start where it left. */
|
|
22
|
+
export declare function hole_segments(h: HoleTimes): {
|
|
23
|
+
k: HoleSegKind;
|
|
24
|
+
a: number;
|
|
25
|
+
b: number;
|
|
26
|
+
}[];
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// src/insights/hole-segments.ts
|
|
2
|
+
const HOLE_SEG_LABEL = {
|
|
3
|
+
wait: "waiting for its answer",
|
|
4
|
+
before: "before its request left",
|
|
5
|
+
slot: "waiting for a render slot on the server",
|
|
6
|
+
render: "the server render",
|
|
7
|
+
server: "waiting on the server",
|
|
8
|
+
rest: "network, the body and the swap"
|
|
9
|
+
};
|
|
10
|
+
/** The segments, in order. Without a timing, one: the wait. A request the document preloaded
|
|
11
|
+
* starts before the fallback counts: its segments start where it left. */
|
|
12
|
+
function hole_segments(h) {
|
|
13
|
+
const shown = h.shown_at ?? 0;
|
|
14
|
+
const at = shown + h.wait_ms;
|
|
15
|
+
if (h.left_at === void 0) return [{
|
|
16
|
+
k: "wait",
|
|
17
|
+
a: shown,
|
|
18
|
+
b: at
|
|
19
|
+
}];
|
|
20
|
+
const out = [];
|
|
21
|
+
const left = h.left_at;
|
|
22
|
+
if (left > shown) out.push({
|
|
23
|
+
k: "before",
|
|
24
|
+
a: shown,
|
|
25
|
+
b: left
|
|
26
|
+
});
|
|
27
|
+
let t = left;
|
|
28
|
+
if (h.server_queue_ms) out.push({
|
|
29
|
+
k: "slot",
|
|
30
|
+
a: t,
|
|
31
|
+
b: t += h.server_queue_ms
|
|
32
|
+
});
|
|
33
|
+
if (h.server_ms !== void 0) out.push({
|
|
34
|
+
k: "render",
|
|
35
|
+
a: t,
|
|
36
|
+
b: t += h.server_ms
|
|
37
|
+
});
|
|
38
|
+
else if (h.first_at !== void 0) out.push({
|
|
39
|
+
k: "server",
|
|
40
|
+
a: t,
|
|
41
|
+
b: t = h.first_at
|
|
42
|
+
});
|
|
43
|
+
if (at > t) out.push({
|
|
44
|
+
k: "rest",
|
|
45
|
+
a: t,
|
|
46
|
+
b: at
|
|
47
|
+
});
|
|
48
|
+
return out;
|
|
49
|
+
}
|
|
50
|
+
export { HOLE_SEG_LABEL, hole_segments };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A readable diff of two HTML strings — the server's markup and what the browser ended up with —
|
|
3
|
+
* for the Hydration tab. HTML is cut into tokens (a tag, or the text between tags; comments dropped,
|
|
4
|
+
* whitespace runs folded), the token lists are diffed (Myers, O(ND)), and the result is grouped into
|
|
5
|
+
* hunks with a little context. No regex. A diff too large to compute (edit distance past `max_d`)
|
|
6
|
+
* falls back to the first difference.
|
|
7
|
+
*/
|
|
8
|
+
export type DiffOp = {
|
|
9
|
+
op: "same" | "del" | "add";
|
|
10
|
+
text: string;
|
|
11
|
+
};
|
|
12
|
+
export interface DiffHunk {
|
|
13
|
+
ops: DiffOp[];
|
|
14
|
+
}
|
|
15
|
+
export interface HtmlDiff {
|
|
16
|
+
hunks: DiffHunk[];
|
|
17
|
+
/** tokens removed / added */
|
|
18
|
+
removed: number;
|
|
19
|
+
added: number;
|
|
20
|
+
/** the diff gave up (too many changes) and shows only where they start */
|
|
21
|
+
partial: boolean;
|
|
22
|
+
}
|
|
23
|
+
/** Tags and text runs; comments out; whitespace inside text folded to one space. */
|
|
24
|
+
export declare function tokenize(html: string): string[];
|
|
25
|
+
export declare function html_diff(server: string, browser: string, context?: number, max_d?: number): HtmlDiff;
|