@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,157 @@
|
|
|
1
|
+
// src/insights/html-diff.ts
|
|
2
|
+
/** Tags and text runs; comments out; whitespace inside text folded to one space. */
|
|
3
|
+
function tokenize(html) {
|
|
4
|
+
const out = [];
|
|
5
|
+
let i = 0;
|
|
6
|
+
while (i < html.length) {
|
|
7
|
+
if (html.startsWith("<!--", i)) {
|
|
8
|
+
const end = html.indexOf("-->", i + 4);
|
|
9
|
+
i = end === -1 ? html.length : end + 3;
|
|
10
|
+
continue;
|
|
11
|
+
}
|
|
12
|
+
if (html[i] === "<") {
|
|
13
|
+
const end = html.indexOf(">", i);
|
|
14
|
+
const stop = end === -1 ? html.length : end + 1;
|
|
15
|
+
out.push(html.slice(i, stop));
|
|
16
|
+
i = stop;
|
|
17
|
+
continue;
|
|
18
|
+
}
|
|
19
|
+
const next = html.indexOf("<", i);
|
|
20
|
+
const stop = next === -1 ? html.length : next;
|
|
21
|
+
let text = "";
|
|
22
|
+
let space = false;
|
|
23
|
+
for (let k = i; k < stop; k++) {
|
|
24
|
+
const c = html.charCodeAt(k);
|
|
25
|
+
if (c === 32 || c === 9 || c === 10 || c === 13) space = true;
|
|
26
|
+
else {
|
|
27
|
+
if (space && text) text += " ";
|
|
28
|
+
space = false;
|
|
29
|
+
text += html[k];
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
if (text) out.push(text);
|
|
33
|
+
i = stop;
|
|
34
|
+
}
|
|
35
|
+
return out;
|
|
36
|
+
}
|
|
37
|
+
/** Myers diff over token arrays; null when the edit distance passes `max_d`. */
|
|
38
|
+
function myers(a, b, max_d) {
|
|
39
|
+
const n = a.length;
|
|
40
|
+
const m = b.length;
|
|
41
|
+
const max = Math.min(n + m, max_d);
|
|
42
|
+
const off = max + 1;
|
|
43
|
+
const v = new Int32Array(2 * max + 3);
|
|
44
|
+
const trace = [];
|
|
45
|
+
for (let d = 0; d <= max; d++) {
|
|
46
|
+
trace.push(v.slice());
|
|
47
|
+
for (let k = -d; k <= d; k += 2) {
|
|
48
|
+
let x = k === -d || k !== d && v[off + k - 1] < v[off + k + 1] ? v[off + k + 1] : v[off + k - 1] + 1;
|
|
49
|
+
let y = x - k;
|
|
50
|
+
while (x < n && y < m && a[x] === b[y]) {
|
|
51
|
+
x++;
|
|
52
|
+
y++;
|
|
53
|
+
}
|
|
54
|
+
v[off + k] = x;
|
|
55
|
+
if (x >= n && y >= m) {
|
|
56
|
+
const ops = [];
|
|
57
|
+
let cx = n;
|
|
58
|
+
let cy = m;
|
|
59
|
+
for (let dd = d; dd > 0; dd--) {
|
|
60
|
+
const pv = trace[dd];
|
|
61
|
+
const kk = cx - cy;
|
|
62
|
+
const prev_k = kk === -dd || kk !== dd && pv[off + kk - 1] < pv[off + kk + 1] ? kk + 1 : kk - 1;
|
|
63
|
+
const px = pv[off + prev_k];
|
|
64
|
+
const py = px - prev_k;
|
|
65
|
+
while (cx > px && cy > py) {
|
|
66
|
+
ops.push({
|
|
67
|
+
op: "same",
|
|
68
|
+
text: a[--cx]
|
|
69
|
+
});
|
|
70
|
+
cy--;
|
|
71
|
+
}
|
|
72
|
+
if (cx === px) ops.push({
|
|
73
|
+
op: "add",
|
|
74
|
+
text: b[--cy]
|
|
75
|
+
});
|
|
76
|
+
else ops.push({
|
|
77
|
+
op: "del",
|
|
78
|
+
text: a[--cx]
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
while (cx > 0 && cy > 0) {
|
|
82
|
+
ops.push({
|
|
83
|
+
op: "same",
|
|
84
|
+
text: a[--cx]
|
|
85
|
+
});
|
|
86
|
+
cy--;
|
|
87
|
+
}
|
|
88
|
+
return ops.reverse();
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
94
|
+
function html_diff(server, browser, context = 3, max_d = 800) {
|
|
95
|
+
const a = tokenize(server);
|
|
96
|
+
const b = tokenize(browser);
|
|
97
|
+
let head = 0;
|
|
98
|
+
while (head < a.length && head < b.length && a[head] === b[head]) head++;
|
|
99
|
+
let tail = 0;
|
|
100
|
+
while (tail < a.length - head && tail < b.length - head && a[a.length - 1 - tail] === b[b.length - 1 - tail]) tail++;
|
|
101
|
+
const mid_a = a.slice(head, a.length - tail);
|
|
102
|
+
const mid_b = b.slice(head, b.length - tail);
|
|
103
|
+
let ops = myers(mid_a, mid_b, max_d);
|
|
104
|
+
let partial = false;
|
|
105
|
+
if (!ops) {
|
|
106
|
+
partial = true;
|
|
107
|
+
ops = [...mid_a.slice(0, 20).map((text) => ({
|
|
108
|
+
op: "del",
|
|
109
|
+
text
|
|
110
|
+
})), ...mid_b.slice(0, 20).map((text) => ({
|
|
111
|
+
op: "add",
|
|
112
|
+
text
|
|
113
|
+
}))];
|
|
114
|
+
}
|
|
115
|
+
const all = [
|
|
116
|
+
...a.slice(Math.max(0, head - context), head).map((text) => ({
|
|
117
|
+
op: "same",
|
|
118
|
+
text
|
|
119
|
+
})),
|
|
120
|
+
...ops,
|
|
121
|
+
...a.slice(a.length - tail, a.length - tail + context).map((text) => ({
|
|
122
|
+
op: "same",
|
|
123
|
+
text
|
|
124
|
+
}))
|
|
125
|
+
];
|
|
126
|
+
const hunks = [];
|
|
127
|
+
let cur = null;
|
|
128
|
+
let same_run = 0;
|
|
129
|
+
for (let i = 0; i < all.length; i++) {
|
|
130
|
+
const o = all[i];
|
|
131
|
+
if (o.op === "same") {
|
|
132
|
+
if (cur) {
|
|
133
|
+
same_run++;
|
|
134
|
+
if (same_run <= context) cur.push(o);
|
|
135
|
+
else {
|
|
136
|
+
hunks.push({ ops: cur });
|
|
137
|
+
cur = null;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
continue;
|
|
141
|
+
}
|
|
142
|
+
if (!cur) {
|
|
143
|
+
cur = [];
|
|
144
|
+
for (let k = Math.max(0, i - context); k < i; k++) if (all[k].op === "same") cur.push(all[k]);
|
|
145
|
+
}
|
|
146
|
+
same_run = 0;
|
|
147
|
+
cur.push(o);
|
|
148
|
+
}
|
|
149
|
+
if (cur) hunks.push({ ops: cur });
|
|
150
|
+
return {
|
|
151
|
+
hunks: hunks.slice(0, 20),
|
|
152
|
+
removed: ops.filter((o) => o.op === "del").length,
|
|
153
|
+
added: ops.filter((o) => o.op === "add").length,
|
|
154
|
+
partial
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
export { html_diff, tokenize };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WHAT DRAWS DIFFERENTLY IN THE BROWSER: the lines of a `.svelte` component that make its first
|
|
3
|
+
* browser render differ from the server's — the cause a hydration mismatch (Svelte threw the server
|
|
4
|
+
* DOM away) or a markup change on wake most often has, named by line:
|
|
5
|
+
*
|
|
6
|
+
* - `await`: an `await` at the top level of the instance script (an async component: the browser
|
|
7
|
+
* awaits again, and another answer — or a fetch the browser cannot make — draws another tree);
|
|
8
|
+
* - `browser`: a value only the browser has, read while rendering — `typeof window`, `window.` /
|
|
9
|
+
* `document.` / `navigator.` / `localStorage` / `sessionStorage`, `Date.now()`, `new Date()`,
|
|
10
|
+
* `Math.random()`, `matchMedia(` — in the markup, or at the top level of the script (a `$derived`,
|
|
11
|
+
* a `const`), never inside a function, an effect or an event handler (those run after the wake).
|
|
12
|
+
*
|
|
13
|
+
* String scanning, line by line (no regex, no parser): brace depth tells the top level of the
|
|
14
|
+
* script; a markup line's handler attributes (`onclick={…}`) are left out.
|
|
15
|
+
*/
|
|
16
|
+
export interface Hazard {
|
|
17
|
+
line: number;
|
|
18
|
+
/** the line, trimmed */
|
|
19
|
+
code: string;
|
|
20
|
+
kind: "await" | "browser";
|
|
21
|
+
/** what it reads (`window.location`, `Date.now()`), for `browser` */
|
|
22
|
+
reads?: string;
|
|
23
|
+
/** an `if (…)` at the script's top level: a guard around browser-only work, which may draw the
|
|
24
|
+
* same markup both sides — a lead for a mismatch seen, not a prediction of one */
|
|
25
|
+
guard?: true;
|
|
26
|
+
}
|
|
27
|
+
/** a hazard with the file it is in (the profiler's island chunks, the dev server's module graph) */
|
|
28
|
+
export type IslandHazard = Hazard & {
|
|
29
|
+
file: string;
|
|
30
|
+
};
|
|
31
|
+
/** "In its own code, the likeliest: X.svelte:4 (`…`) awaits …; Y.svelte:8 reads Date.now( while rendering …" —
|
|
32
|
+
* said the same by the profiler's report and the devtools' Page tab */
|
|
33
|
+
export declare function hazard_words(lines: readonly IslandHazard[]): string;
|
|
34
|
+
/** The fix for those lines: what to do with each kind. */
|
|
35
|
+
export declare function hazard_fix(lines: readonly IslandHazard[]): string;
|
|
36
|
+
export declare function hydration_hazards(source: string): Hazard[];
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
// src/insights/hydration-hazards.ts
|
|
2
|
+
/** "In its own code, the likeliest: X.svelte:4 (`…`) awaits …; Y.svelte:8 reads Date.now( while rendering …" —
|
|
3
|
+
* said the same by the profiler's report and the devtools' Page tab */
|
|
4
|
+
function hazard_words(lines) {
|
|
5
|
+
const one = (h) => {
|
|
6
|
+
const code = h.code.length > 70 ? h.code.slice(0, 69) + "…" : h.code;
|
|
7
|
+
const where = `${h.file.split("/").pop()}:${h.line} (\`${code}\`)`;
|
|
8
|
+
return h.kind === "await" ? `${where} awaits at the top of its script: the browser runs it again, and another answer draws another tree` : `${where} reads ${h.reads ?? "a browser-only value"} while rendering, a value the server does not have`;
|
|
9
|
+
};
|
|
10
|
+
return `In its own code, the likeliest: ${lines.slice(0, 2).map(one).join("; ")}.`;
|
|
11
|
+
}
|
|
12
|
+
/** The fix for those lines: what to do with each kind. */
|
|
13
|
+
function hazard_fix(lines) {
|
|
14
|
+
const kinds = new Set(lines.map((h) => h.kind));
|
|
15
|
+
return [...kinds.has("await") ? ["Give both sides the same answer: pass the data in from the server (a load, a prop) rather than awaiting it again in the browser."] : [], ...kinds.has("browser") ? ["Read the browser-only value after the wake (in `$effect` or `onMount`), or take it from what both sides have (the page's URL from `$app/state`, a time passed in as a prop)."] : []].join(" ");
|
|
16
|
+
}
|
|
17
|
+
const BROWSER_READS = [
|
|
18
|
+
"typeof window",
|
|
19
|
+
"window.",
|
|
20
|
+
"document.",
|
|
21
|
+
"navigator.",
|
|
22
|
+
"localStorage",
|
|
23
|
+
"sessionStorage",
|
|
24
|
+
"Date.now(",
|
|
25
|
+
"new Date()",
|
|
26
|
+
"Math.random(",
|
|
27
|
+
"matchMedia("
|
|
28
|
+
];
|
|
29
|
+
const is_ident = (c) => c >= 48 && c <= 57 || c >= 65 && c <= 90 || c >= 97 && c <= 122 || c === 95 || c === 36;
|
|
30
|
+
/** The first browser-only read on a stretch of code, or undefined. */
|
|
31
|
+
function browser_read(code) {
|
|
32
|
+
for (const r of BROWSER_READS) {
|
|
33
|
+
const at = code.indexOf(r);
|
|
34
|
+
if (at === -1) continue;
|
|
35
|
+
if (at > 0 && is_ident(code.charCodeAt(at - 1))) continue;
|
|
36
|
+
if (r === "typeof window" || r.endsWith("(") || r === "localStorage" || r === "sessionStorage") return r;
|
|
37
|
+
let end = at + r.length;
|
|
38
|
+
while (end < code.length && is_ident(code.charCodeAt(end))) end++;
|
|
39
|
+
return code.slice(at, end);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
/** A markup line without its event-handler attributes (`onclick={() => window.scrollTo(0, 0)}`). */
|
|
43
|
+
function without_handlers(line) {
|
|
44
|
+
let out = "";
|
|
45
|
+
let i = 0;
|
|
46
|
+
while (i < line.length) {
|
|
47
|
+
const at = line.indexOf("on", i);
|
|
48
|
+
if (at === -1) break;
|
|
49
|
+
const prev = at > 0 ? line[at - 1] : " ";
|
|
50
|
+
let j = at + 2;
|
|
51
|
+
while (j < line.length && (line[j] >= "a" && line[j] <= "z" || line[j] === ":")) j++;
|
|
52
|
+
if ((prev === " " || prev === " ") && j > at + 2 && line[j] === "=" && line[j + 1] === "{") {
|
|
53
|
+
out += line.slice(i, at);
|
|
54
|
+
let depth = 0;
|
|
55
|
+
let k = j + 1;
|
|
56
|
+
for (; k < line.length; k++) if (line[k] === "{") depth++;
|
|
57
|
+
else if (line[k] === "}" && --depth === 0) break;
|
|
58
|
+
i = k + 1;
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
out += line.slice(i, at + 2);
|
|
62
|
+
i = at + 2;
|
|
63
|
+
}
|
|
64
|
+
return out + line.slice(i);
|
|
65
|
+
}
|
|
66
|
+
function hydration_hazards(source) {
|
|
67
|
+
const out = [];
|
|
68
|
+
const lines = source.split("\n");
|
|
69
|
+
let in_script = false;
|
|
70
|
+
let module_script = false;
|
|
71
|
+
let in_style = false;
|
|
72
|
+
let depth = 0;
|
|
73
|
+
let deferred_depth = -1;
|
|
74
|
+
let arrow_body = false;
|
|
75
|
+
for (let n = 0; n < lines.length; n++) {
|
|
76
|
+
const line = lines[n].trim();
|
|
77
|
+
if (!in_script && !in_style && line.startsWith("<script")) {
|
|
78
|
+
in_script = !line.includes("<\/script>");
|
|
79
|
+
module_script = line.includes("module");
|
|
80
|
+
depth = 0;
|
|
81
|
+
deferred_depth = -1;
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
if (in_script && line.startsWith("<\/script")) {
|
|
85
|
+
in_script = false;
|
|
86
|
+
continue;
|
|
87
|
+
}
|
|
88
|
+
if (!in_script && line.startsWith("<style")) {
|
|
89
|
+
in_style = !line.includes("</style>");
|
|
90
|
+
continue;
|
|
91
|
+
}
|
|
92
|
+
if (in_style) {
|
|
93
|
+
if (line.startsWith("</style")) in_style = false;
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
if (in_script) {
|
|
97
|
+
const in_arrow_body = arrow_body;
|
|
98
|
+
if (arrow_body && (line.endsWith(";") || line === "")) arrow_body = false;
|
|
99
|
+
if (!in_arrow_body && line.endsWith("=>")) arrow_body = true;
|
|
100
|
+
if (depth === 0 && deferred_depth === -1 && !module_script && !in_arrow_body && !line.startsWith("//") && !line.startsWith("*") && !line.startsWith("/*")) {
|
|
101
|
+
const aw = line.indexOf("await ");
|
|
102
|
+
if (aw !== -1 && (aw === 0 || !is_ident(line.charCodeAt(aw - 1)))) out.push({
|
|
103
|
+
line: n + 1,
|
|
104
|
+
code: line,
|
|
105
|
+
kind: "await"
|
|
106
|
+
});
|
|
107
|
+
else if (!line.startsWith("import ") && !line.startsWith("function ") && !line.startsWith("export function ")) {
|
|
108
|
+
const reads = browser_read(line);
|
|
109
|
+
if (reads) out.push({
|
|
110
|
+
line: n + 1,
|
|
111
|
+
code: line,
|
|
112
|
+
kind: "browser",
|
|
113
|
+
reads,
|
|
114
|
+
...line.startsWith("if (") || line.startsWith("if(") ? { guard: true } : {}
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
if (deferred_depth === -1 && (line.includes("onMount(") || line.includes("$effect(") || line.includes("function") || line.includes("=>")) && !line.startsWith("const ") && !line.startsWith("let ")) deferred_depth = depth;
|
|
119
|
+
else if (deferred_depth === -1 && (line.startsWith("const ") || line.startsWith("let ")) && line.includes("=>") && line.includes("{")) deferred_depth = depth;
|
|
120
|
+
for (const ch of line) if (ch === "{") depth++;
|
|
121
|
+
else if (ch === "}") depth--;
|
|
122
|
+
if (deferred_depth !== -1 && depth <= deferred_depth) deferred_depth = -1;
|
|
123
|
+
continue;
|
|
124
|
+
}
|
|
125
|
+
if (!line.includes("{")) continue;
|
|
126
|
+
const reads = browser_read(without_handlers(line));
|
|
127
|
+
if (reads) out.push({
|
|
128
|
+
line: n + 1,
|
|
129
|
+
code: line,
|
|
130
|
+
kind: "browser",
|
|
131
|
+
reads
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
return out;
|
|
135
|
+
}
|
|
136
|
+
export { hazard_fix, hazard_words, hydration_hazards };
|
|
File without changes
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { DOM_LARGE, Failure, HeldOpen, HoleBatch, HoleFailure, HoleWait, InteractionCpuInput, IslandCode, IslandRow, NavPhases, PageFinding, PageInput, PageInteraction, PageNav, PageReport, PartedVital, RatedVital, RegionFact, RestoreEvent, ServerProfileBrief, VitalMove, VitalPart, analyze_page, browser_of, defer_keys, dev_compile_ms, engine_of, explain_held_open, first_difference, inline_threshold_tune, late_found, lcp_font, lcp_rivals, prebundled_names, rate, vital_parts, vitals_moved } from "./page-insights.js";
|
|
2
|
+
import { Ref, SessionFinding, SessionReport, TimelineItem, TimelineLane, analyze_session, session_timeline } from "./session-insights.js";
|
|
3
|
+
import { SessionClick, SessionData, SessionFrame, SessionInteraction, SessionNav, SessionRequest, SessionShift } from "./session-data.js";
|
|
4
|
+
import { HydrationStatus } from "./hydration-status.js";
|
|
5
|
+
import { HtmlDiff, html_diff } from "./html-diff.js";
|
|
6
|
+
import { AssetKind, AssetRef, AssetsDiff, PageAssets, RuntimeScripts, Weight, assets_diff, dynamic_imports, runtime_scripts, static_imports, weigh_assets } from "./page-assets.js";
|
|
7
|
+
import { CodeKind, CpuFn, CpuSummary, analyze_cpu, is_trace } from "./cpu.js";
|
|
8
|
+
import { FpDrift, KeptIsland, compare } from "./fp-drift.js";
|
|
9
|
+
import { HOLE_SEG_LABEL, hole_segments } from "./hole-segments.js";
|
|
10
|
+
import { IslandHazard, hazard_fix, hazard_words, hydration_hazards } from "./hydration-hazards.js";
|
|
11
|
+
import { AttrRule, apply_attr_rules } from "./attr-rules.js";
|
|
12
|
+
import { DEVTOOLS_COOKIE, DEVTOOLS_ON, DEVTOOLS_PARAM, TESTING_COOKIE, TESTING_LEAN, TESTING_PARAM, devtools_switched_on, switch_in_url, testing_lean, without_switch, write_switch } from "./switch.js";
|
|
13
|
+
import { TESTING_ENGINE_VERSION } from "./testing-version.js";
|
|
14
|
+
export { type AssetKind, type AssetRef, type AssetsDiff, type AttrRule, type CodeKind, type CpuFn, type CpuSummary, DEVTOOLS_COOKIE, DEVTOOLS_ON, DEVTOOLS_PARAM, DOM_LARGE, type Failure, type FpDrift, HOLE_SEG_LABEL, type HeldOpen, type HoleBatch, type HoleFailure, type HoleWait, type HtmlDiff, type HydrationStatus, type InteractionCpuInput, type IslandCode, type IslandHazard, type IslandRow, type KeptIsland, type NavPhases, type PageAssets, type PageFinding, type PageInput, type PageInteraction, type PageNav, type PageReport, type PartedVital, type RatedVital, type Ref, type RegionFact, type RestoreEvent, type RuntimeScripts, type ServerProfileBrief, type SessionClick, type SessionData, type SessionFinding, type SessionFrame, type SessionInteraction, type SessionNav, type SessionReport, type SessionRequest, type SessionShift, TESTING_COOKIE, TESTING_ENGINE_VERSION, TESTING_LEAN, TESTING_PARAM, type TimelineItem, type TimelineLane, type VitalMove, type VitalPart, type Weight, analyze_cpu, analyze_page, analyze_session, apply_attr_rules, assets_diff, browser_of, defer_keys, dev_compile_ms, devtools_switched_on, dynamic_imports, engine_of, explain_held_open, first_difference, compare as fp_compare, hazard_fix, hazard_words, hole_segments, html_diff, hydration_hazards, inline_threshold_tune, is_trace, late_found, lcp_font, lcp_rivals, prebundled_names, rate, runtime_scripts, session_timeline, static_imports, switch_in_url, testing_lean, vital_parts, vitals_moved, weigh_assets, without_switch, write_switch };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DOM_LARGE, analyze_page, browser_of, defer_keys, dev_compile_ms, engine_of, explain_held_open, first_difference, inline_threshold_tune, late_found, lcp_font, lcp_rivals, prebundled_names, rate, vital_parts, vitals_moved } from "./page-insights.js";
|
|
2
|
+
import { analyze_session, session_timeline } from "./session-insights.js";
|
|
3
|
+
import { html_diff } from "./html-diff.js";
|
|
4
|
+
import { assets_diff, dynamic_imports, runtime_scripts, static_imports, weigh_assets } from "./page-assets.js";
|
|
5
|
+
import { analyze_cpu, is_trace } from "./cpu.js";
|
|
6
|
+
import { compare } from "./fp-drift.js";
|
|
7
|
+
import { HOLE_SEG_LABEL, hole_segments } from "./hole-segments.js";
|
|
8
|
+
import { hazard_fix, hazard_words, hydration_hazards } from "./hydration-hazards.js";
|
|
9
|
+
import { apply_attr_rules } from "./attr-rules.js";
|
|
10
|
+
import { DEVTOOLS_COOKIE, DEVTOOLS_ON, DEVTOOLS_PARAM, TESTING_COOKIE, TESTING_LEAN, TESTING_PARAM, devtools_switched_on, switch_in_url, testing_lean, without_switch, write_switch } from "./switch.js";
|
|
11
|
+
import { TESTING_ENGINE_VERSION } from "./testing-version.js";
|
|
12
|
+
export { DEVTOOLS_COOKIE, DEVTOOLS_ON, DEVTOOLS_PARAM, DOM_LARGE, HOLE_SEG_LABEL, TESTING_COOKIE, TESTING_ENGINE_VERSION, TESTING_LEAN, TESTING_PARAM, analyze_cpu, analyze_page, analyze_session, apply_attr_rules, assets_diff, browser_of, defer_keys, dev_compile_ms, devtools_switched_on, dynamic_imports, engine_of, explain_held_open, first_difference, compare as fp_compare, hazard_fix, hazard_words, hole_segments, html_diff, hydration_hazards, inline_threshold_tune, is_trace, late_found, lcp_font, lcp_rivals, prebundled_names, rate, runtime_scripts, session_timeline, static_imports, switch_in_url, testing_lean, vital_parts, vitals_moved, weigh_assets, without_switch, write_switch };
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import { UnscopedStyles } from "../unscoped-css.js";
|
|
2
|
+
export type AssetKind = "script" | "style" | "font" | "image" | "other";
|
|
3
|
+
export interface AssetRef {
|
|
4
|
+
url: string;
|
|
5
|
+
kind: AssetKind;
|
|
6
|
+
/** the browser must have it before the first paint (a head stylesheet, a classic sync script) */
|
|
7
|
+
blocking: boolean;
|
|
8
|
+
/** how the document asks for it (`island`: the runtime loads it to wake an island) */
|
|
9
|
+
via: "script" | "modulepreload" | "preload" | "stylesheet" | "inline-import" | "img" | "static-import" | "island" | "route-node" | "runtime-phase";
|
|
10
|
+
/** loads later, on demand (an island that wakes when visible / on interaction), not at start */
|
|
11
|
+
lazy?: boolean;
|
|
12
|
+
/** the ogygia runtime's own script (`data-ogygia-runtime`): the parts it loads itself are its own */
|
|
13
|
+
runtime?: true;
|
|
14
|
+
/** a part of the ogygia runtime it loads on demand as islands wake (and what that part imports) */
|
|
15
|
+
phase?: true;
|
|
16
|
+
}
|
|
17
|
+
export interface WeighedAsset extends AssetRef {
|
|
18
|
+
/** decoded bytes (what the browser parses) */
|
|
19
|
+
bytes: number;
|
|
20
|
+
/** bytes on the wire: the response's own when it was compressed, else a gzip estimate */
|
|
21
|
+
wire: number;
|
|
22
|
+
/** what the build put in it (its source files and packages, readable), when the build said */
|
|
23
|
+
contains?: string[];
|
|
24
|
+
/** a font's `Vary` header, as the server answered it */
|
|
25
|
+
vary?: string;
|
|
26
|
+
}
|
|
27
|
+
export interface PageAssets {
|
|
28
|
+
assets: WeighedAsset[];
|
|
29
|
+
/** components whose styles shipped WITHOUT their scope (the build's fallback marker, in a
|
|
30
|
+
* stylesheet or an inline `<style>`): their rules apply to the whole page */
|
|
31
|
+
unscoped?: (UnscopedStyles & {
|
|
32
|
+
in: string;
|
|
33
|
+
})[];
|
|
34
|
+
/** references that could not be weighed (a 404, a timeout, the budget ran out) */
|
|
35
|
+
missed: string[];
|
|
36
|
+
/** each of those, and why: `budget` (time ran out before it), `timeout`, `status 404`, `file cap`,
|
|
37
|
+
* `error: …` — a total with only `status` misses can be trusted; `budget` / `timeout` ones vary */
|
|
38
|
+
missed_why?: {
|
|
39
|
+
url: string;
|
|
40
|
+
why: string;
|
|
41
|
+
}[];
|
|
42
|
+
/** the HTML itself */
|
|
43
|
+
html: {
|
|
44
|
+
bytes: number;
|
|
45
|
+
wire: number;
|
|
46
|
+
};
|
|
47
|
+
/** inline `<script>` / `<style>` text in the document, decoded bytes */
|
|
48
|
+
inline: {
|
|
49
|
+
script: number;
|
|
50
|
+
style: number;
|
|
51
|
+
};
|
|
52
|
+
totals: {
|
|
53
|
+
js: number;
|
|
54
|
+
js_wire: number;
|
|
55
|
+
css: number;
|
|
56
|
+
css_wire: number;
|
|
57
|
+
font: number;
|
|
58
|
+
image: number;
|
|
59
|
+
/** every byte at start, on the wire (HTML included) */
|
|
60
|
+
wire: number;
|
|
61
|
+
/** JS that loads later, on demand (lazy islands), decoded — not in `js` */
|
|
62
|
+
lazy_js: number;
|
|
63
|
+
/** blocking the first paint: stylesheets + classic sync scripts, decoded */
|
|
64
|
+
blocking: number;
|
|
65
|
+
blocking_count: number;
|
|
66
|
+
js_files: number;
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
/** Attributes of one start tag (`<tag a="1" b c='2'>`), names lower-cased; valueless → ''. */
|
|
70
|
+
export declare function tag_attrs(tag: string): Map<string, string>;
|
|
71
|
+
/** `import("x")` / `import('x')` specifiers in a script's text (Kit's inline start). */
|
|
72
|
+
export declare function dynamic_imports(text: string): string[];
|
|
73
|
+
/**
|
|
74
|
+
* The STATIC imports of a bundled module (`import{a}from"./x.js"`, `import"./y.js"`,
|
|
75
|
+
* `export*from"./z.js"`): specifiers after `from` / a bare `import` that look like module paths
|
|
76
|
+
* (relative or absolute, ending in .js/.mjs). Bundler output writes them plainly; a string that
|
|
77
|
+
* merely contains such text inflates nothing that does not exist — every hit is fetched, and a
|
|
78
|
+
* miss is dropped.
|
|
79
|
+
*/
|
|
80
|
+
export declare function static_imports(code: string): string[];
|
|
81
|
+
/**
|
|
82
|
+
* A Kit-hydrated page's route nodes: its inline start script passes `node_ids: [0, 5]` to
|
|
83
|
+
* `kit.start`, and `app.js` imports each node on demand (`import("../nodes/5.<hash>.js")`) — the
|
|
84
|
+
* page's OWN code, the heaviest part, reachable only through that dynamic import. Empty when the
|
|
85
|
+
* page is not Kit-hydrated.
|
|
86
|
+
*/
|
|
87
|
+
export declare function kit_node_ids(script: string): number[];
|
|
88
|
+
/** Every file the document asks for at start, in document order, deduped by URL (the first,
|
|
89
|
+
* strongest ask wins: a blocking stylesheet stays blocking). Inline script/style bytes counted. */
|
|
90
|
+
export declare function scan_assets(html: string): {
|
|
91
|
+
refs: AssetRef[];
|
|
92
|
+
inline: {
|
|
93
|
+
script: number;
|
|
94
|
+
style: number;
|
|
95
|
+
};
|
|
96
|
+
kit_nodes: number[];
|
|
97
|
+
};
|
|
98
|
+
export interface Weight {
|
|
99
|
+
bytes: number;
|
|
100
|
+
wire: number;
|
|
101
|
+
/** a module's static imports (resolved to absolute paths), for the walk */
|
|
102
|
+
imports?: string[];
|
|
103
|
+
/** its dynamic imports (resolved) — followed only where the page names them (Kit's route nodes) */
|
|
104
|
+
dynamic?: string[];
|
|
105
|
+
/** a stylesheet's unscoped fallbacks (see unscoped-css.ts) */
|
|
106
|
+
unscoped?: UnscopedStyles[];
|
|
107
|
+
/** a font's `Vary` header (Safari refetches a font preload that varies by Origin when its
|
|
108
|
+
* @font-face comes late) */
|
|
109
|
+
vary?: string;
|
|
110
|
+
}
|
|
111
|
+
/** Resolve a reference against the page (and a module's import against its module). */
|
|
112
|
+
export declare function resolve_ref(ref: string, base: string): string | null;
|
|
113
|
+
export interface WeighOptions {
|
|
114
|
+
/** the page URL references resolve against */
|
|
115
|
+
page_url: string;
|
|
116
|
+
fetch_url: (url: string) => Promise<Response>;
|
|
117
|
+
/** per-URL cache across reports (a hashed asset never changes) */
|
|
118
|
+
cache: Map<string, Weight | null>;
|
|
119
|
+
/** gzip a body to estimate its wire size (node:zlib in the profiler; absent = decoded size) */
|
|
120
|
+
gzip?: (bytes: Uint8Array) => number;
|
|
121
|
+
budget_ms?: number;
|
|
122
|
+
max_files?: number;
|
|
123
|
+
/** the document the refs came from */
|
|
124
|
+
html: string;
|
|
125
|
+
/** files the HTML does not name but the page loads: islands' modules (lazy ones marked) */
|
|
126
|
+
extra?: AssetRef[];
|
|
127
|
+
/** what the build put in a file (by its absolute URL), for naming a hashed chunk */
|
|
128
|
+
contents_of?: (url: string) => string[] | null;
|
|
129
|
+
}
|
|
130
|
+
export declare function weigh_assets(opts: WeighOptions): Promise<PageAssets>;
|
|
131
|
+
export interface AssetChange {
|
|
132
|
+
/** the file's name now (or then, for one that is gone) */
|
|
133
|
+
name: string;
|
|
134
|
+
/** what the build put in it — the identity across builds (hashed names change every build) */
|
|
135
|
+
contains?: string[];
|
|
136
|
+
a: number;
|
|
137
|
+
b: number;
|
|
138
|
+
lazy?: boolean;
|
|
139
|
+
}
|
|
140
|
+
export interface AssetsDiff {
|
|
141
|
+
/** JS at start, decoded, then → now */
|
|
142
|
+
js: {
|
|
143
|
+
a: number;
|
|
144
|
+
b: number;
|
|
145
|
+
};
|
|
146
|
+
lazy_js: {
|
|
147
|
+
a: number;
|
|
148
|
+
b: number;
|
|
149
|
+
};
|
|
150
|
+
added: AssetChange[];
|
|
151
|
+
removed: AssetChange[];
|
|
152
|
+
grew: AssetChange[];
|
|
153
|
+
shrank: AssetChange[];
|
|
154
|
+
/** the same file, now loaded at start (it loaded later before: an island's wake changed) */
|
|
155
|
+
to_start: AssetChange[];
|
|
156
|
+
/** the same file, now loaded later (it loaded at start before) */
|
|
157
|
+
to_later: AssetChange[];
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* WHAT CHANGED IN THE PAGE'S JS between two weighings (two builds): the files new, gone, grown and
|
|
161
|
+
* shrunk. Hashed names change every build, so a file is known by what the build put in it (its
|
|
162
|
+
* source files and packages, `contains`), and by its URL only when the build said nothing. Changes
|
|
163
|
+
* under 5 KB are left out; each list is heaviest first.
|
|
164
|
+
*/
|
|
165
|
+
/** What a diff needs of a weighing: the report's JSON carries this much too (a CI compare). */
|
|
166
|
+
export interface WeighedLike {
|
|
167
|
+
assets: {
|
|
168
|
+
url: string;
|
|
169
|
+
kind: string;
|
|
170
|
+
bytes: number;
|
|
171
|
+
contains?: string[];
|
|
172
|
+
lazy?: boolean;
|
|
173
|
+
}[];
|
|
174
|
+
totals: {
|
|
175
|
+
js: number;
|
|
176
|
+
lazy_js: number;
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
export declare function assets_diff(a: WeighedLike, b: WeighedLike): AssetsDiff;
|
|
180
|
+
export interface RuntimeScripts {
|
|
181
|
+
files: number;
|
|
182
|
+
/** decoded */
|
|
183
|
+
bytes: number;
|
|
184
|
+
/** on the wire (a third of decoded where the browser saw none: a cached file) */
|
|
185
|
+
wire: number;
|
|
186
|
+
/** by who serves them: `this app`, or a CDN package / host */
|
|
187
|
+
by: {
|
|
188
|
+
who: string;
|
|
189
|
+
files: number;
|
|
190
|
+
bytes: number;
|
|
191
|
+
}[];
|
|
192
|
+
/** of this app's, the island entry files (`og-region.<id>.…js`): islands no HTML named — the ones
|
|
193
|
+
* a hole's answer brought */
|
|
194
|
+
island_entries?: number;
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* SCRIPTS LOADED AT RUNTIME — what the browser fetched that neither the HTML nor any module's
|
|
198
|
+
* imports name: a script that loads more scripts (a CDN component library fetching its parts, a tag
|
|
199
|
+
* manager, a runtime's on-demand chunk). The server cannot see them coming; the profiler user's own
|
|
200
|
+
* visit saw them. `until`: the end of "at start" on the visit's clock (a lazy island woken by a
|
|
201
|
+
* scroll later does not count). Null when there are none.
|
|
202
|
+
*/
|
|
203
|
+
export declare function runtime_scripts(assets: readonly {
|
|
204
|
+
url: string;
|
|
205
|
+
}[], resources: readonly {
|
|
206
|
+
url: string;
|
|
207
|
+
type: string;
|
|
208
|
+
start: number;
|
|
209
|
+
size?: number;
|
|
210
|
+
transfer?: number;
|
|
211
|
+
}[], origin: string, until: number): RuntimeScripts | null;
|