@rangojs/router 0.4.2 → 0.5.0
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/dist/types/browser/prefetch/cache.d.ts +11 -8
- package/dist/types/cache/cf/cf-cache-store.d.ts +2 -0
- package/dist/types/cache/read-through-swr.d.ts +7 -6
- package/dist/types/cache/types.d.ts +39 -6
- package/dist/types/cloudflare/tracing.d.ts +16 -12
- package/dist/types/router/instrument.d.ts +45 -15
- package/dist/types/router/telemetry-otel.d.ts +4 -4
- package/dist/types/router/timeout.d.ts +12 -1
- package/dist/types/router/tracing.d.ts +31 -17
- package/dist/types/rsc/capture-queue.d.ts +41 -4
- package/dist/types/rsc/shell-build-manifest.d.ts +2 -2
- package/dist/types/rsc/shell-capture.d.ts +28 -2
- package/dist/types/rsc/shell-serve.d.ts +18 -12
- package/dist/types/rsc/stream-idle.d.ts +60 -0
- package/dist/types/server/request-context.d.ts +7 -1
- package/dist/types/vercel/tracing.d.ts +9 -8
- package/dist/vite/index.js +1 -1
- package/package.json +1 -1
- package/skills/observability/SKILL.md +33 -4
- package/skills/ppr/SKILL.md +44 -3
- package/src/browser/prefetch/cache.ts +22 -10
- package/src/cache/cache-runtime.ts +39 -25
- package/src/cache/cf/cf-cache-store.ts +27 -8
- package/src/cache/document-cache.ts +39 -23
- package/src/cache/read-through-swr.ts +22 -16
- package/src/cache/types.ts +41 -6
- package/src/cache/vercel/vercel-cache-store.ts +24 -10
- package/src/cloudflare/tracing.ts +16 -12
- package/src/router/instrument.ts +61 -15
- package/src/router/segment-resolution/loader-cache.ts +12 -1
- package/src/router/segment-resolution/revalidation.ts +16 -1
- package/src/router/telemetry-otel.ts +4 -4
- package/src/router/timeout.ts +12 -1
- package/src/router/tracing.ts +37 -17
- package/src/rsc/capture-queue.ts +150 -22
- package/src/rsc/handler.ts +171 -73
- package/src/rsc/rsc-rendering.ts +11 -3
- package/src/rsc/shell-build-manifest.ts +20 -7
- package/src/rsc/shell-capture.ts +222 -18
- package/src/rsc/shell-serve.ts +27 -12
- package/src/rsc/stream-idle.ts +137 -0
- package/src/server/request-context.ts +8 -0
- package/src/testing/dispatch.ts +55 -1
- package/src/vercel/tracing.ts +9 -8
- package/dist/__internal.d.ts +0 -83
- package/dist/__internal.d.ts.map +0 -1
- package/dist/__internal.js +0 -19
- package/dist/__internal.js.map +0 -1
- package/dist/__mocks__/version.d.ts +0 -7
- package/dist/__mocks__/version.d.ts.map +0 -1
- package/dist/__mocks__/version.js +0 -7
- package/dist/__mocks__/version.js.map +0 -1
- package/dist/__tests__/client-href.test.d.ts +0 -2
- package/dist/__tests__/client-href.test.d.ts.map +0 -1
- package/dist/__tests__/client-href.test.js +0 -74
- package/dist/__tests__/client-href.test.js.map +0 -1
- package/dist/__tests__/component-utils.test.d.ts +0 -2
- package/dist/__tests__/component-utils.test.d.ts.map +0 -1
- package/dist/__tests__/component-utils.test.js +0 -51
- package/dist/__tests__/component-utils.test.js.map +0 -1
- package/dist/__tests__/event-controller.test.d.ts +0 -2
- package/dist/__tests__/event-controller.test.d.ts.map +0 -1
- package/dist/__tests__/event-controller.test.js +0 -538
- package/dist/__tests__/event-controller.test.js.map +0 -1
- package/dist/__tests__/helpers/route-tree.d.ts +0 -118
- package/dist/__tests__/helpers/route-tree.d.ts.map +0 -1
- package/dist/__tests__/helpers/route-tree.js +0 -374
- package/dist/__tests__/helpers/route-tree.js.map +0 -1
- package/dist/__tests__/match-result.test.d.ts +0 -2
- package/dist/__tests__/match-result.test.d.ts.map +0 -1
- package/dist/__tests__/match-result.test.js +0 -154
- package/dist/__tests__/match-result.test.js.map +0 -1
- package/dist/__tests__/navigation-store.test.d.ts +0 -2
- package/dist/__tests__/navigation-store.test.d.ts.map +0 -1
- package/dist/__tests__/navigation-store.test.js +0 -440
- package/dist/__tests__/navigation-store.test.js.map +0 -1
- package/dist/__tests__/partial-update.test.d.ts +0 -2
- package/dist/__tests__/partial-update.test.d.ts.map +0 -1
- package/dist/__tests__/partial-update.test.js +0 -1009
- package/dist/__tests__/partial-update.test.js.map +0 -1
- package/dist/__tests__/reverse-types.test.d.ts +0 -8
- package/dist/__tests__/reverse-types.test.d.ts.map +0 -1
- package/dist/__tests__/reverse-types.test.js +0 -656
- package/dist/__tests__/reverse-types.test.js.map +0 -1
- package/dist/__tests__/route-definition.test.d.ts +0 -2
- package/dist/__tests__/route-definition.test.d.ts.map +0 -1
- package/dist/__tests__/route-definition.test.js +0 -55
- package/dist/__tests__/route-definition.test.js.map +0 -1
- package/dist/__tests__/router-helpers.test.d.ts +0 -2
- package/dist/__tests__/router-helpers.test.d.ts.map +0 -1
- package/dist/__tests__/router-helpers.test.js +0 -377
- package/dist/__tests__/router-helpers.test.js.map +0 -1
- package/dist/__tests__/router-integration-2.test.d.ts +0 -2
- package/dist/__tests__/router-integration-2.test.d.ts.map +0 -1
- package/dist/__tests__/router-integration-2.test.js +0 -426
- package/dist/__tests__/router-integration-2.test.js.map +0 -1
- package/dist/__tests__/router-integration.test.d.ts +0 -2
- package/dist/__tests__/router-integration.test.d.ts.map +0 -1
- package/dist/__tests__/router-integration.test.js +0 -1051
- package/dist/__tests__/router-integration.test.js.map +0 -1
- package/dist/__tests__/search-params.test.d.ts +0 -5
- package/dist/__tests__/search-params.test.d.ts.map +0 -1
- package/dist/__tests__/search-params.test.js +0 -306
- package/dist/__tests__/search-params.test.js.map +0 -1
- package/dist/__tests__/segment-system.test.d.ts +0 -2
- package/dist/__tests__/segment-system.test.d.ts.map +0 -1
- package/dist/__tests__/segment-system.test.js +0 -627
- package/dist/__tests__/segment-system.test.js.map +0 -1
- package/dist/__tests__/static-handler-types.test.d.ts +0 -8
- package/dist/__tests__/static-handler-types.test.d.ts.map +0 -1
- package/dist/__tests__/static-handler-types.test.js +0 -63
- package/dist/__tests__/static-handler-types.test.js.map +0 -1
- package/dist/__tests__/urls.test.d.ts +0 -2
- package/dist/__tests__/urls.test.d.ts.map +0 -1
- package/dist/__tests__/urls.test.js +0 -421
- package/dist/__tests__/urls.test.js.map +0 -1
- package/dist/__tests__/use-mount.test.d.ts +0 -2
- package/dist/__tests__/use-mount.test.d.ts.map +0 -1
- package/dist/__tests__/use-mount.test.js +0 -35
- package/dist/__tests__/use-mount.test.js.map +0 -1
- package/dist/bin/rango.d.ts +0 -2
- package/dist/bin/rango.d.ts.map +0 -1
- package/dist/bin/rango.js.map +0 -1
- package/dist/browser/event-controller.d.ts +0 -191
- package/dist/browser/event-controller.d.ts.map +0 -1
- package/dist/browser/event-controller.js +0 -559
- package/dist/browser/event-controller.js.map +0 -1
- package/dist/browser/index.d.ts +0 -2
- package/dist/browser/index.d.ts.map +0 -1
- package/dist/browser/index.js +0 -14
- package/dist/browser/index.js.map +0 -1
- package/dist/browser/link-interceptor.d.ts +0 -38
- package/dist/browser/link-interceptor.d.ts.map +0 -1
- package/dist/browser/link-interceptor.js +0 -99
- package/dist/browser/link-interceptor.js.map +0 -1
- package/dist/browser/logging.d.ts +0 -10
- package/dist/browser/logging.d.ts.map +0 -1
- package/dist/browser/logging.js +0 -29
- package/dist/browser/logging.js.map +0 -1
- package/dist/browser/lru-cache.d.ts +0 -17
- package/dist/browser/lru-cache.d.ts.map +0 -1
- package/dist/browser/lru-cache.js +0 -50
- package/dist/browser/lru-cache.js.map +0 -1
- package/dist/browser/merge-segment-loaders.d.ts +0 -39
- package/dist/browser/merge-segment-loaders.d.ts.map +0 -1
- package/dist/browser/merge-segment-loaders.js +0 -102
- package/dist/browser/merge-segment-loaders.js.map +0 -1
- package/dist/browser/navigation-bridge.d.ts +0 -102
- package/dist/browser/navigation-bridge.d.ts.map +0 -1
- package/dist/browser/navigation-bridge.js +0 -708
- package/dist/browser/navigation-bridge.js.map +0 -1
- package/dist/browser/navigation-client.d.ts +0 -25
- package/dist/browser/navigation-client.d.ts.map +0 -1
- package/dist/browser/navigation-client.js +0 -157
- package/dist/browser/navigation-client.js.map +0 -1
- package/dist/browser/navigation-store.d.ts +0 -101
- package/dist/browser/navigation-store.d.ts.map +0 -1
- package/dist/browser/navigation-store.js +0 -625
- package/dist/browser/navigation-store.js.map +0 -1
- package/dist/browser/partial-update.d.ts +0 -75
- package/dist/browser/partial-update.d.ts.map +0 -1
- package/dist/browser/partial-update.js +0 -426
- package/dist/browser/partial-update.js.map +0 -1
- package/dist/browser/react/Link.d.ts +0 -86
- package/dist/browser/react/Link.d.ts.map +0 -1
- package/dist/browser/react/Link.js +0 -128
- package/dist/browser/react/Link.js.map +0 -1
- package/dist/browser/react/NavigationProvider.d.ts +0 -63
- package/dist/browser/react/NavigationProvider.d.ts.map +0 -1
- package/dist/browser/react/NavigationProvider.js +0 -216
- package/dist/browser/react/NavigationProvider.js.map +0 -1
- package/dist/browser/react/ScrollRestoration.d.ts +0 -75
- package/dist/browser/react/ScrollRestoration.d.ts.map +0 -1
- package/dist/browser/react/ScrollRestoration.js +0 -57
- package/dist/browser/react/ScrollRestoration.js.map +0 -1
- package/dist/browser/react/context.d.ts +0 -46
- package/dist/browser/react/context.d.ts.map +0 -1
- package/dist/browser/react/context.js +0 -10
- package/dist/browser/react/context.js.map +0 -1
- package/dist/browser/react/index.d.ts +0 -11
- package/dist/browser/react/index.d.ts.map +0 -1
- package/dist/browser/react/index.js +0 -22
- package/dist/browser/react/index.js.map +0 -1
- package/dist/browser/react/location-state-shared.d.ts +0 -63
- package/dist/browser/react/location-state-shared.d.ts.map +0 -1
- package/dist/browser/react/location-state-shared.js +0 -81
- package/dist/browser/react/location-state-shared.js.map +0 -1
- package/dist/browser/react/location-state.d.ts +0 -23
- package/dist/browser/react/location-state.d.ts.map +0 -1
- package/dist/browser/react/location-state.js +0 -29
- package/dist/browser/react/location-state.js.map +0 -1
- package/dist/browser/react/mount-context.d.ts +0 -24
- package/dist/browser/react/mount-context.d.ts.map +0 -1
- package/dist/browser/react/mount-context.js +0 -24
- package/dist/browser/react/mount-context.js.map +0 -1
- package/dist/browser/react/use-action.d.ts +0 -64
- package/dist/browser/react/use-action.d.ts.map +0 -1
- package/dist/browser/react/use-action.js +0 -134
- package/dist/browser/react/use-action.js.map +0 -1
- package/dist/browser/react/use-client-cache.d.ts +0 -41
- package/dist/browser/react/use-client-cache.d.ts.map +0 -1
- package/dist/browser/react/use-client-cache.js +0 -39
- package/dist/browser/react/use-client-cache.js.map +0 -1
- package/dist/browser/react/use-handle.d.ts +0 -31
- package/dist/browser/react/use-handle.d.ts.map +0 -1
- package/dist/browser/react/use-handle.js +0 -144
- package/dist/browser/react/use-handle.js.map +0 -1
- package/dist/browser/react/use-href.d.ts +0 -33
- package/dist/browser/react/use-href.d.ts.map +0 -1
- package/dist/browser/react/use-href.js +0 -39
- package/dist/browser/react/use-href.js.map +0 -1
- package/dist/browser/react/use-link-status.d.ts +0 -37
- package/dist/browser/react/use-link-status.d.ts.map +0 -1
- package/dist/browser/react/use-link-status.js +0 -99
- package/dist/browser/react/use-link-status.js.map +0 -1
- package/dist/browser/react/use-mount.d.ts +0 -25
- package/dist/browser/react/use-mount.d.ts.map +0 -1
- package/dist/browser/react/use-mount.js +0 -30
- package/dist/browser/react/use-mount.js.map +0 -1
- package/dist/browser/react/use-navigation.d.ts +0 -27
- package/dist/browser/react/use-navigation.d.ts.map +0 -1
- package/dist/browser/react/use-navigation.js +0 -87
- package/dist/browser/react/use-navigation.js.map +0 -1
- package/dist/browser/react/use-segments.d.ts +0 -38
- package/dist/browser/react/use-segments.d.ts.map +0 -1
- package/dist/browser/react/use-segments.js +0 -130
- package/dist/browser/react/use-segments.js.map +0 -1
- package/dist/browser/request-controller.d.ts +0 -26
- package/dist/browser/request-controller.d.ts.map +0 -1
- package/dist/browser/request-controller.js +0 -147
- package/dist/browser/request-controller.js.map +0 -1
- package/dist/browser/rsc-router.d.ts +0 -129
- package/dist/browser/rsc-router.d.ts.map +0 -1
- package/dist/browser/rsc-router.js +0 -195
- package/dist/browser/rsc-router.js.map +0 -1
- package/dist/browser/scroll-restoration.d.ts +0 -93
- package/dist/browser/scroll-restoration.d.ts.map +0 -1
- package/dist/browser/scroll-restoration.js +0 -321
- package/dist/browser/scroll-restoration.js.map +0 -1
- package/dist/browser/segment-structure-assert.d.ts +0 -17
- package/dist/browser/segment-structure-assert.d.ts.map +0 -1
- package/dist/browser/segment-structure-assert.js +0 -59
- package/dist/browser/segment-structure-assert.js.map +0 -1
- package/dist/browser/server-action-bridge.d.ts +0 -26
- package/dist/browser/server-action-bridge.d.ts.map +0 -1
- package/dist/browser/server-action-bridge.js +0 -668
- package/dist/browser/server-action-bridge.js.map +0 -1
- package/dist/browser/shallow.d.ts +0 -12
- package/dist/browser/shallow.d.ts.map +0 -1
- package/dist/browser/shallow.js +0 -34
- package/dist/browser/shallow.js.map +0 -1
- package/dist/browser/types.d.ts +0 -369
- package/dist/browser/types.d.ts.map +0 -1
- package/dist/browser/types.js +0 -2
- package/dist/browser/types.js.map +0 -1
- package/dist/build/__tests__/generate-cli.test.d.ts +0 -2
- package/dist/build/__tests__/generate-cli.test.d.ts.map +0 -1
- package/dist/build/__tests__/generate-cli.test.js +0 -237
- package/dist/build/__tests__/generate-cli.test.js.map +0 -1
- package/dist/build/__tests__/generate-manifest.test.d.ts +0 -2
- package/dist/build/__tests__/generate-manifest.test.d.ts.map +0 -1
- package/dist/build/__tests__/generate-manifest.test.js +0 -119
- package/dist/build/__tests__/generate-manifest.test.js.map +0 -1
- package/dist/build/__tests__/generate-route-types.test.d.ts +0 -2
- package/dist/build/__tests__/generate-route-types.test.d.ts.map +0 -1
- package/dist/build/__tests__/generate-route-types.test.js +0 -620
- package/dist/build/__tests__/generate-route-types.test.js.map +0 -1
- package/dist/build/__tests__/per-router-manifest.test.d.ts +0 -2
- package/dist/build/__tests__/per-router-manifest.test.d.ts.map +0 -1
- package/dist/build/__tests__/per-router-manifest.test.js +0 -308
- package/dist/build/__tests__/per-router-manifest.test.js.map +0 -1
- package/dist/build/generate-manifest.d.ts +0 -81
- package/dist/build/generate-manifest.d.ts.map +0 -1
- package/dist/build/generate-manifest.js +0 -276
- package/dist/build/generate-manifest.js.map +0 -1
- package/dist/build/generate-route-types.d.ts +0 -115
- package/dist/build/generate-route-types.d.ts.map +0 -1
- package/dist/build/generate-route-types.js +0 -740
- package/dist/build/generate-route-types.js.map +0 -1
- package/dist/build/index.d.ts +0 -21
- package/dist/build/index.d.ts.map +0 -1
- package/dist/build/index.js +0 -21
- package/dist/build/index.js.map +0 -1
- package/dist/build/route-trie.d.ts +0 -71
- package/dist/build/route-trie.d.ts.map +0 -1
- package/dist/build/route-trie.js +0 -175
- package/dist/build/route-trie.js.map +0 -1
- package/dist/cache/__tests__/cache-scope.test.d.ts +0 -2
- package/dist/cache/__tests__/cache-scope.test.d.ts.map +0 -1
- package/dist/cache/__tests__/cache-scope.test.js +0 -208
- package/dist/cache/__tests__/cache-scope.test.js.map +0 -1
- package/dist/cache/__tests__/document-cache.test.d.ts +0 -2
- package/dist/cache/__tests__/document-cache.test.d.ts.map +0 -1
- package/dist/cache/__tests__/document-cache.test.js +0 -345
- package/dist/cache/__tests__/document-cache.test.js.map +0 -1
- package/dist/cache/__tests__/memory-segment-store.test.d.ts +0 -2
- package/dist/cache/__tests__/memory-segment-store.test.d.ts.map +0 -1
- package/dist/cache/__tests__/memory-segment-store.test.js +0 -425
- package/dist/cache/__tests__/memory-segment-store.test.js.map +0 -1
- package/dist/cache/__tests__/memory-store.test.d.ts +0 -2
- package/dist/cache/__tests__/memory-store.test.d.ts.map +0 -1
- package/dist/cache/__tests__/memory-store.test.js +0 -367
- package/dist/cache/__tests__/memory-store.test.js.map +0 -1
- package/dist/cache/cache-scope.d.ts +0 -102
- package/dist/cache/cache-scope.d.ts.map +0 -1
- package/dist/cache/cache-scope.js +0 -440
- package/dist/cache/cache-scope.js.map +0 -1
- package/dist/cache/cf/__tests__/cf-cache-store.test.d.ts +0 -2
- package/dist/cache/cf/__tests__/cf-cache-store.test.d.ts.map +0 -1
- package/dist/cache/cf/__tests__/cf-cache-store.test.js +0 -330
- package/dist/cache/cf/__tests__/cf-cache-store.test.js.map +0 -1
- package/dist/cache/cf/cf-cache-store.d.ts +0 -165
- package/dist/cache/cf/cf-cache-store.d.ts.map +0 -1
- package/dist/cache/cf/cf-cache-store.js +0 -242
- package/dist/cache/cf/cf-cache-store.js.map +0 -1
- package/dist/cache/cf/index.d.ts +0 -14
- package/dist/cache/cf/index.d.ts.map +0 -1
- package/dist/cache/cf/index.js +0 -17
- package/dist/cache/cf/index.js.map +0 -1
- package/dist/cache/document-cache.d.ts +0 -64
- package/dist/cache/document-cache.d.ts.map +0 -1
- package/dist/cache/document-cache.js +0 -228
- package/dist/cache/document-cache.js.map +0 -1
- package/dist/cache/index.d.ts +0 -19
- package/dist/cache/index.d.ts.map +0 -1
- package/dist/cache/index.js +0 -21
- package/dist/cache/index.js.map +0 -1
- package/dist/cache/memory-segment-store.d.ts +0 -110
- package/dist/cache/memory-segment-store.d.ts.map +0 -1
- package/dist/cache/memory-segment-store.js +0 -117
- package/dist/cache/memory-segment-store.js.map +0 -1
- package/dist/cache/memory-store.d.ts +0 -41
- package/dist/cache/memory-store.d.ts.map +0 -1
- package/dist/cache/memory-store.js +0 -191
- package/dist/cache/memory-store.js.map +0 -1
- package/dist/cache/types.d.ts +0 -317
- package/dist/cache/types.d.ts.map +0 -1
- package/dist/cache/types.js +0 -12
- package/dist/cache/types.js.map +0 -1
- package/dist/client.d.ts +0 -248
- package/dist/client.d.ts.map +0 -1
- package/dist/client.js +0 -367
- package/dist/client.js.map +0 -1
- package/dist/client.rsc.d.ts +0 -26
- package/dist/client.rsc.d.ts.map +0 -1
- package/dist/client.rsc.js +0 -46
- package/dist/client.rsc.js.map +0 -1
- package/dist/component-utils.d.ts +0 -36
- package/dist/component-utils.d.ts.map +0 -1
- package/dist/component-utils.js +0 -61
- package/dist/component-utils.js.map +0 -1
- package/dist/components/DefaultDocument.d.ts +0 -13
- package/dist/components/DefaultDocument.d.ts.map +0 -1
- package/dist/components/DefaultDocument.js +0 -15
- package/dist/components/DefaultDocument.js.map +0 -1
- package/dist/debug.d.ts +0 -58
- package/dist/debug.d.ts.map +0 -1
- package/dist/debug.js +0 -157
- package/dist/debug.js.map +0 -1
- package/dist/default-error-boundary.d.ts +0 -11
- package/dist/default-error-boundary.d.ts.map +0 -1
- package/dist/default-error-boundary.js +0 -45
- package/dist/default-error-boundary.js.map +0 -1
- package/dist/deps/browser.d.ts +0 -2
- package/dist/deps/browser.d.ts.map +0 -1
- package/dist/deps/browser.js +0 -3
- package/dist/deps/browser.js.map +0 -1
- package/dist/deps/html-stream-client.d.ts +0 -2
- package/dist/deps/html-stream-client.d.ts.map +0 -1
- package/dist/deps/html-stream-client.js +0 -3
- package/dist/deps/html-stream-client.js.map +0 -1
- package/dist/deps/html-stream-server.d.ts +0 -2
- package/dist/deps/html-stream-server.d.ts.map +0 -1
- package/dist/deps/html-stream-server.js +0 -3
- package/dist/deps/html-stream-server.js.map +0 -1
- package/dist/deps/rsc.d.ts +0 -2
- package/dist/deps/rsc.d.ts.map +0 -1
- package/dist/deps/rsc.js +0 -4
- package/dist/deps/rsc.js.map +0 -1
- package/dist/deps/ssr.d.ts +0 -2
- package/dist/deps/ssr.d.ts.map +0 -1
- package/dist/deps/ssr.js +0 -3
- package/dist/deps/ssr.js.map +0 -1
- package/dist/errors.d.ts +0 -174
- package/dist/errors.d.ts.map +0 -1
- package/dist/errors.js +0 -241
- package/dist/errors.js.map +0 -1
- package/dist/handle.d.ts +0 -78
- package/dist/handle.d.ts.map +0 -1
- package/dist/handle.js +0 -82
- package/dist/handle.js.map +0 -1
- package/dist/handles/MetaTags.d.ts +0 -14
- package/dist/handles/MetaTags.d.ts.map +0 -1
- package/dist/handles/MetaTags.js +0 -136
- package/dist/handles/MetaTags.js.map +0 -1
- package/dist/handles/index.d.ts +0 -6
- package/dist/handles/index.d.ts.map +0 -1
- package/dist/handles/index.js +0 -6
- package/dist/handles/index.js.map +0 -1
- package/dist/handles/meta.d.ts +0 -39
- package/dist/handles/meta.d.ts.map +0 -1
- package/dist/handles/meta.js +0 -202
- package/dist/handles/meta.js.map +0 -1
- package/dist/host/__tests__/errors.test.d.ts +0 -2
- package/dist/host/__tests__/errors.test.d.ts.map +0 -1
- package/dist/host/__tests__/errors.test.js +0 -76
- package/dist/host/__tests__/errors.test.js.map +0 -1
- package/dist/host/__tests__/pattern-comprehensive.test.d.ts +0 -2
- package/dist/host/__tests__/pattern-comprehensive.test.d.ts.map +0 -1
- package/dist/host/__tests__/pattern-comprehensive.test.js +0 -732
- package/dist/host/__tests__/pattern-comprehensive.test.js.map +0 -1
- package/dist/host/__tests__/pattern-matcher.test.d.ts +0 -2
- package/dist/host/__tests__/pattern-matcher.test.d.ts.map +0 -1
- package/dist/host/__tests__/pattern-matcher.test.js +0 -251
- package/dist/host/__tests__/pattern-matcher.test.js.map +0 -1
- package/dist/host/__tests__/router.test.d.ts +0 -2
- package/dist/host/__tests__/router.test.d.ts.map +0 -1
- package/dist/host/__tests__/router.test.js +0 -241
- package/dist/host/__tests__/router.test.js.map +0 -1
- package/dist/host/__tests__/testing.test.d.ts +0 -2
- package/dist/host/__tests__/testing.test.d.ts.map +0 -1
- package/dist/host/__tests__/testing.test.js +0 -64
- package/dist/host/__tests__/testing.test.js.map +0 -1
- package/dist/host/__tests__/utils.test.d.ts +0 -2
- package/dist/host/__tests__/utils.test.d.ts.map +0 -1
- package/dist/host/__tests__/utils.test.js +0 -29
- package/dist/host/__tests__/utils.test.js.map +0 -1
- package/dist/host/cookie-handler.d.ts +0 -34
- package/dist/host/cookie-handler.d.ts.map +0 -1
- package/dist/host/cookie-handler.js +0 -124
- package/dist/host/cookie-handler.js.map +0 -1
- package/dist/host/errors.d.ts +0 -56
- package/dist/host/errors.d.ts.map +0 -1
- package/dist/host/errors.js +0 -79
- package/dist/host/errors.js.map +0 -1
- package/dist/host/index.d.ts +0 -29
- package/dist/host/index.d.ts.map +0 -1
- package/dist/host/index.js +0 -32
- package/dist/host/index.js.map +0 -1
- package/dist/host/pattern-matcher.d.ts +0 -36
- package/dist/host/pattern-matcher.d.ts.map +0 -1
- package/dist/host/pattern-matcher.js +0 -172
- package/dist/host/pattern-matcher.js.map +0 -1
- package/dist/host/router.d.ts +0 -26
- package/dist/host/router.d.ts.map +0 -1
- package/dist/host/router.js +0 -218
- package/dist/host/router.js.map +0 -1
- package/dist/host/testing.d.ts +0 -36
- package/dist/host/testing.d.ts.map +0 -1
- package/dist/host/testing.js +0 -55
- package/dist/host/testing.js.map +0 -1
- package/dist/host/types.d.ts +0 -115
- package/dist/host/types.d.ts.map +0 -1
- package/dist/host/types.js +0 -7
- package/dist/host/types.js.map +0 -1
- package/dist/host/utils.d.ts +0 -21
- package/dist/host/utils.d.ts.map +0 -1
- package/dist/host/utils.js +0 -23
- package/dist/host/utils.js.map +0 -1
- package/dist/href-client.d.ts +0 -131
- package/dist/href-client.d.ts.map +0 -1
- package/dist/href-client.js +0 -64
- package/dist/href-client.js.map +0 -1
- package/dist/href-context.d.ts +0 -29
- package/dist/href-context.d.ts.map +0 -1
- package/dist/href-context.js +0 -21
- package/dist/href-context.js.map +0 -1
- package/dist/index.d.ts +0 -73
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -91
- package/dist/index.js.map +0 -1
- package/dist/index.rsc.d.ts +0 -32
- package/dist/index.rsc.d.ts.map +0 -1
- package/dist/index.rsc.js +0 -40
- package/dist/index.rsc.js.map +0 -1
- package/dist/internal-debug.d.ts +0 -2
- package/dist/internal-debug.d.ts.map +0 -1
- package/dist/internal-debug.js +0 -5
- package/dist/internal-debug.js.map +0 -1
- package/dist/loader.d.ts +0 -14
- package/dist/loader.d.ts.map +0 -1
- package/dist/loader.js +0 -20
- package/dist/loader.js.map +0 -1
- package/dist/loader.rsc.d.ts +0 -19
- package/dist/loader.rsc.d.ts.map +0 -1
- package/dist/loader.rsc.js +0 -99
- package/dist/loader.rsc.js.map +0 -1
- package/dist/network-error-thrower.d.ts +0 -17
- package/dist/network-error-thrower.d.ts.map +0 -1
- package/dist/network-error-thrower.js +0 -14
- package/dist/network-error-thrower.js.map +0 -1
- package/dist/outlet-context.d.ts +0 -13
- package/dist/outlet-context.d.ts.map +0 -1
- package/dist/outlet-context.js +0 -3
- package/dist/outlet-context.js.map +0 -1
- package/dist/prerender/__tests__/param-hash.test.d.ts +0 -2
- package/dist/prerender/__tests__/param-hash.test.d.ts.map +0 -1
- package/dist/prerender/__tests__/param-hash.test.js +0 -148
- package/dist/prerender/__tests__/param-hash.test.js.map +0 -1
- package/dist/prerender/param-hash.d.ts +0 -16
- package/dist/prerender/param-hash.d.ts.map +0 -1
- package/dist/prerender/param-hash.js +0 -36
- package/dist/prerender/param-hash.js.map +0 -1
- package/dist/prerender/store.d.ts +0 -38
- package/dist/prerender/store.d.ts.map +0 -1
- package/dist/prerender/store.js +0 -61
- package/dist/prerender/store.js.map +0 -1
- package/dist/prerender.d.ts +0 -66
- package/dist/prerender.d.ts.map +0 -1
- package/dist/prerender.js +0 -57
- package/dist/prerender.js.map +0 -1
- package/dist/reverse.d.ts +0 -196
- package/dist/reverse.d.ts.map +0 -1
- package/dist/reverse.js +0 -78
- package/dist/reverse.js.map +0 -1
- package/dist/root-error-boundary.d.ts +0 -33
- package/dist/root-error-boundary.d.ts.map +0 -1
- package/dist/root-error-boundary.js +0 -165
- package/dist/root-error-boundary.js.map +0 -1
- package/dist/route-content-wrapper.d.ts +0 -46
- package/dist/route-content-wrapper.d.ts.map +0 -1
- package/dist/route-content-wrapper.js +0 -77
- package/dist/route-content-wrapper.js.map +0 -1
- package/dist/route-definition.d.ts +0 -421
- package/dist/route-definition.d.ts.map +0 -1
- package/dist/route-definition.js +0 -868
- package/dist/route-definition.js.map +0 -1
- package/dist/route-map-builder.d.ts +0 -155
- package/dist/route-map-builder.d.ts.map +0 -1
- package/dist/route-map-builder.js +0 -237
- package/dist/route-map-builder.js.map +0 -1
- package/dist/route-types.d.ts +0 -165
- package/dist/route-types.d.ts.map +0 -1
- package/dist/route-types.js +0 -7
- package/dist/route-types.js.map +0 -1
- package/dist/router/__tests__/handler-context.test.d.ts +0 -2
- package/dist/router/__tests__/handler-context.test.d.ts.map +0 -1
- package/dist/router/__tests__/handler-context.test.js +0 -65
- package/dist/router/__tests__/handler-context.test.js.map +0 -1
- package/dist/router/__tests__/loader-cycle-detection.test.d.ts +0 -2
- package/dist/router/__tests__/loader-cycle-detection.test.d.ts.map +0 -1
- package/dist/router/__tests__/loader-cycle-detection.test.js +0 -221
- package/dist/router/__tests__/loader-cycle-detection.test.js.map +0 -1
- package/dist/router/__tests__/match-context.test.d.ts +0 -2
- package/dist/router/__tests__/match-context.test.d.ts.map +0 -1
- package/dist/router/__tests__/match-context.test.js +0 -92
- package/dist/router/__tests__/match-context.test.js.map +0 -1
- package/dist/router/__tests__/match-pipelines.test.d.ts +0 -2
- package/dist/router/__tests__/match-pipelines.test.d.ts.map +0 -1
- package/dist/router/__tests__/match-pipelines.test.js +0 -417
- package/dist/router/__tests__/match-pipelines.test.js.map +0 -1
- package/dist/router/__tests__/match-result.test.d.ts +0 -2
- package/dist/router/__tests__/match-result.test.d.ts.map +0 -1
- package/dist/router/__tests__/match-result.test.js +0 -457
- package/dist/router/__tests__/match-result.test.js.map +0 -1
- package/dist/router/__tests__/on-error.test.d.ts +0 -2
- package/dist/router/__tests__/on-error.test.d.ts.map +0 -1
- package/dist/router/__tests__/on-error.test.js +0 -678
- package/dist/router/__tests__/on-error.test.js.map +0 -1
- package/dist/router/__tests__/pattern-matching.test.d.ts +0 -2
- package/dist/router/__tests__/pattern-matching.test.d.ts.map +0 -1
- package/dist/router/__tests__/pattern-matching.test.js +0 -629
- package/dist/router/__tests__/pattern-matching.test.js.map +0 -1
- package/dist/router/__tests__/segment-resolution-parallel-loading.test.d.ts +0 -2
- package/dist/router/__tests__/segment-resolution-parallel-loading.test.d.ts.map +0 -1
- package/dist/router/__tests__/segment-resolution-parallel-loading.test.js +0 -155
- package/dist/router/__tests__/segment-resolution-parallel-loading.test.js.map +0 -1
- package/dist/router/error-handling.d.ts +0 -77
- package/dist/router/error-handling.d.ts.map +0 -1
- package/dist/router/error-handling.js +0 -202
- package/dist/router/error-handling.js.map +0 -1
- package/dist/router/handler-context.d.ts +0 -20
- package/dist/router/handler-context.d.ts.map +0 -1
- package/dist/router/handler-context.js +0 -198
- package/dist/router/handler-context.js.map +0 -1
- package/dist/router/intercept-resolution.d.ts +0 -66
- package/dist/router/intercept-resolution.d.ts.map +0 -1
- package/dist/router/intercept-resolution.js +0 -246
- package/dist/router/intercept-resolution.js.map +0 -1
- package/dist/router/loader-resolution.d.ts +0 -64
- package/dist/router/loader-resolution.d.ts.map +0 -1
- package/dist/router/loader-resolution.js +0 -284
- package/dist/router/loader-resolution.js.map +0 -1
- package/dist/router/logging.d.ts +0 -15
- package/dist/router/logging.d.ts.map +0 -1
- package/dist/router/logging.js +0 -99
- package/dist/router/logging.js.map +0 -1
- package/dist/router/manifest.d.ts +0 -22
- package/dist/router/manifest.d.ts.map +0 -1
- package/dist/router/manifest.js +0 -181
- package/dist/router/manifest.js.map +0 -1
- package/dist/router/match-api.d.ts +0 -35
- package/dist/router/match-api.d.ts.map +0 -1
- package/dist/router/match-api.js +0 -406
- package/dist/router/match-api.js.map +0 -1
- package/dist/router/match-context.d.ts +0 -206
- package/dist/router/match-context.d.ts.map +0 -1
- package/dist/router/match-context.js +0 -17
- package/dist/router/match-context.js.map +0 -1
- package/dist/router/match-middleware/background-revalidation.d.ts +0 -127
- package/dist/router/match-middleware/background-revalidation.d.ts.map +0 -1
- package/dist/router/match-middleware/background-revalidation.js +0 -75
- package/dist/router/match-middleware/background-revalidation.js.map +0 -1
- package/dist/router/match-middleware/cache-lookup.d.ts +0 -112
- package/dist/router/match-middleware/cache-lookup.d.ts.map +0 -1
- package/dist/router/match-middleware/cache-lookup.js +0 -257
- package/dist/router/match-middleware/cache-lookup.js.map +0 -1
- package/dist/router/match-middleware/cache-store.d.ts +0 -113
- package/dist/router/match-middleware/cache-store.d.ts.map +0 -1
- package/dist/router/match-middleware/cache-store.js +0 -108
- package/dist/router/match-middleware/cache-store.js.map +0 -1
- package/dist/router/match-middleware/index.d.ts +0 -81
- package/dist/router/match-middleware/index.d.ts.map +0 -1
- package/dist/router/match-middleware/index.js +0 -80
- package/dist/router/match-middleware/index.js.map +0 -1
- package/dist/router/match-middleware/intercept-resolution.d.ts +0 -117
- package/dist/router/match-middleware/intercept-resolution.d.ts.map +0 -1
- package/dist/router/match-middleware/intercept-resolution.js +0 -134
- package/dist/router/match-middleware/intercept-resolution.js.map +0 -1
- package/dist/router/match-middleware/segment-resolution.d.ts +0 -99
- package/dist/router/match-middleware/segment-resolution.d.ts.map +0 -1
- package/dist/router/match-middleware/segment-resolution.js +0 -53
- package/dist/router/match-middleware/segment-resolution.js.map +0 -1
- package/dist/router/match-pipelines.d.ts +0 -147
- package/dist/router/match-pipelines.d.ts.map +0 -1
- package/dist/router/match-pipelines.js +0 -82
- package/dist/router/match-pipelines.js.map +0 -1
- package/dist/router/match-result.d.ts +0 -126
- package/dist/router/match-result.d.ts.map +0 -1
- package/dist/router/match-result.js +0 -93
- package/dist/router/match-result.js.map +0 -1
- package/dist/router/metrics.d.ts +0 -20
- package/dist/router/metrics.d.ts.map +0 -1
- package/dist/router/metrics.js +0 -47
- package/dist/router/metrics.js.map +0 -1
- package/dist/router/middleware.d.ts +0 -249
- package/dist/router/middleware.d.ts.map +0 -1
- package/dist/router/middleware.js +0 -434
- package/dist/router/middleware.js.map +0 -1
- package/dist/router/middleware.test.d.ts +0 -2
- package/dist/router/middleware.test.d.ts.map +0 -1
- package/dist/router/middleware.test.js +0 -816
- package/dist/router/middleware.test.js.map +0 -1
- package/dist/router/pattern-matching.d.ts +0 -149
- package/dist/router/pattern-matching.d.ts.map +0 -1
- package/dist/router/pattern-matching.js +0 -349
- package/dist/router/pattern-matching.js.map +0 -1
- package/dist/router/revalidation.d.ts +0 -44
- package/dist/router/revalidation.d.ts.map +0 -1
- package/dist/router/revalidation.js +0 -147
- package/dist/router/revalidation.js.map +0 -1
- package/dist/router/router-context.d.ts +0 -135
- package/dist/router/router-context.d.ts.map +0 -1
- package/dist/router/router-context.js +0 -36
- package/dist/router/router-context.js.map +0 -1
- package/dist/router/segment-resolution.d.ts +0 -127
- package/dist/router/segment-resolution.d.ts.map +0 -1
- package/dist/router/segment-resolution.js +0 -919
- package/dist/router/segment-resolution.js.map +0 -1
- package/dist/router/trie-matching.d.ts +0 -40
- package/dist/router/trie-matching.d.ts.map +0 -1
- package/dist/router/trie-matching.js +0 -127
- package/dist/router/trie-matching.js.map +0 -1
- package/dist/router/types.d.ts +0 -136
- package/dist/router/types.d.ts.map +0 -1
- package/dist/router/types.js +0 -7
- package/dist/router/types.js.map +0 -1
- package/dist/router.d.ts +0 -753
- package/dist/router.d.ts.map +0 -1
- package/dist/router.gen.d.ts +0 -6
- package/dist/router.gen.d.ts.map +0 -1
- package/dist/router.gen.js +0 -6
- package/dist/router.gen.js.map +0 -1
- package/dist/router.js +0 -1304
- package/dist/router.js.map +0 -1
- package/dist/rsc/__tests__/helpers.test.d.ts +0 -2
- package/dist/rsc/__tests__/helpers.test.d.ts.map +0 -1
- package/dist/rsc/__tests__/helpers.test.js +0 -140
- package/dist/rsc/__tests__/helpers.test.js.map +0 -1
- package/dist/rsc/handler.d.ts +0 -45
- package/dist/rsc/handler.d.ts.map +0 -1
- package/dist/rsc/handler.js +0 -1172
- package/dist/rsc/handler.js.map +0 -1
- package/dist/rsc/helpers.d.ts +0 -16
- package/dist/rsc/helpers.d.ts.map +0 -1
- package/dist/rsc/helpers.js +0 -55
- package/dist/rsc/helpers.js.map +0 -1
- package/dist/rsc/index.d.ts +0 -22
- package/dist/rsc/index.d.ts.map +0 -1
- package/dist/rsc/index.js +0 -23
- package/dist/rsc/index.js.map +0 -1
- package/dist/rsc/nonce.d.ts +0 -9
- package/dist/rsc/nonce.d.ts.map +0 -1
- package/dist/rsc/nonce.js +0 -18
- package/dist/rsc/nonce.js.map +0 -1
- package/dist/rsc/types.d.ts +0 -206
- package/dist/rsc/types.d.ts.map +0 -1
- package/dist/rsc/types.js +0 -8
- package/dist/rsc/types.js.map +0 -1
- package/dist/search-params.d.ts +0 -103
- package/dist/search-params.d.ts.map +0 -1
- package/dist/search-params.js +0 -74
- package/dist/search-params.js.map +0 -1
- package/dist/segment-system.d.ts +0 -75
- package/dist/segment-system.d.ts.map +0 -1
- package/dist/segment-system.js +0 -336
- package/dist/segment-system.js.map +0 -1
- package/dist/server/context.d.ts +0 -245
- package/dist/server/context.d.ts.map +0 -1
- package/dist/server/context.js +0 -197
- package/dist/server/context.js.map +0 -1
- package/dist/server/fetchable-loader-store.d.ts +0 -18
- package/dist/server/fetchable-loader-store.d.ts.map +0 -1
- package/dist/server/fetchable-loader-store.js +0 -18
- package/dist/server/fetchable-loader-store.js.map +0 -1
- package/dist/server/handle-store.d.ts +0 -85
- package/dist/server/handle-store.d.ts.map +0 -1
- package/dist/server/handle-store.js +0 -142
- package/dist/server/handle-store.js.map +0 -1
- package/dist/server/loader-registry.d.ts +0 -55
- package/dist/server/loader-registry.d.ts.map +0 -1
- package/dist/server/loader-registry.js +0 -132
- package/dist/server/loader-registry.js.map +0 -1
- package/dist/server/request-context.d.ts +0 -226
- package/dist/server/request-context.d.ts.map +0 -1
- package/dist/server/request-context.js +0 -290
- package/dist/server/request-context.js.map +0 -1
- package/dist/server/root-layout.d.ts +0 -4
- package/dist/server/root-layout.d.ts.map +0 -1
- package/dist/server/root-layout.js +0 -5
- package/dist/server/root-layout.js.map +0 -1
- package/dist/server.d.ts +0 -15
- package/dist/server.d.ts.map +0 -1
- package/dist/server.js +0 -20
- package/dist/server.js.map +0 -1
- package/dist/ssr/__tests__/ssr-handler.test.d.ts +0 -2
- package/dist/ssr/__tests__/ssr-handler.test.d.ts.map +0 -1
- package/dist/ssr/__tests__/ssr-handler.test.js +0 -132
- package/dist/ssr/__tests__/ssr-handler.test.js.map +0 -1
- package/dist/ssr/index.d.ts +0 -98
- package/dist/ssr/index.d.ts.map +0 -1
- package/dist/ssr/index.js +0 -158
- package/dist/ssr/index.js.map +0 -1
- package/dist/static-handler.d.ts +0 -50
- package/dist/static-handler.d.ts.map +0 -1
- package/dist/static-handler.gen.d.ts +0 -5
- package/dist/static-handler.gen.d.ts.map +0 -1
- package/dist/static-handler.gen.js +0 -5
- package/dist/static-handler.gen.js.map +0 -1
- package/dist/static-handler.js +0 -29
- package/dist/static-handler.js.map +0 -1
- package/dist/theme/ThemeProvider.d.ts +0 -20
- package/dist/theme/ThemeProvider.d.ts.map +0 -1
- package/dist/theme/ThemeProvider.js +0 -240
- package/dist/theme/ThemeProvider.js.map +0 -1
- package/dist/theme/ThemeScript.d.ts +0 -48
- package/dist/theme/ThemeScript.d.ts.map +0 -1
- package/dist/theme/ThemeScript.js +0 -13
- package/dist/theme/ThemeScript.js.map +0 -1
- package/dist/theme/__tests__/theme.test.d.ts +0 -2
- package/dist/theme/__tests__/theme.test.d.ts.map +0 -1
- package/dist/theme/__tests__/theme.test.js +0 -103
- package/dist/theme/__tests__/theme.test.js.map +0 -1
- package/dist/theme/constants.d.ts +0 -29
- package/dist/theme/constants.d.ts.map +0 -1
- package/dist/theme/constants.js +0 -48
- package/dist/theme/constants.js.map +0 -1
- package/dist/theme/index.d.ts +0 -31
- package/dist/theme/index.d.ts.map +0 -1
- package/dist/theme/index.js +0 -36
- package/dist/theme/index.js.map +0 -1
- package/dist/theme/theme-context.d.ts +0 -40
- package/dist/theme/theme-context.d.ts.map +0 -1
- package/dist/theme/theme-context.js +0 -60
- package/dist/theme/theme-context.js.map +0 -1
- package/dist/theme/theme-script.d.ts +0 -27
- package/dist/theme/theme-script.d.ts.map +0 -1
- package/dist/theme/theme-script.js +0 -147
- package/dist/theme/theme-script.js.map +0 -1
- package/dist/theme/types.d.ts +0 -163
- package/dist/theme/types.d.ts.map +0 -1
- package/dist/theme/types.js +0 -11
- package/dist/theme/types.js.map +0 -1
- package/dist/theme/use-theme.d.ts +0 -12
- package/dist/theme/use-theme.d.ts.map +0 -1
- package/dist/theme/use-theme.js +0 -40
- package/dist/theme/use-theme.js.map +0 -1
- package/dist/types.d.ts +0 -1479
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -10
- package/dist/types.js.map +0 -1
- package/dist/urls.d.ts +0 -441
- package/dist/urls.d.ts.map +0 -1
- package/dist/urls.gen.d.ts +0 -8
- package/dist/urls.gen.d.ts.map +0 -1
- package/dist/urls.gen.js +0 -8
- package/dist/urls.gen.js.map +0 -1
- package/dist/urls.js +0 -443
- package/dist/urls.js.map +0 -1
- package/dist/use-loader.d.ts +0 -127
- package/dist/use-loader.d.ts.map +0 -1
- package/dist/use-loader.js +0 -237
- package/dist/use-loader.js.map +0 -1
- package/dist/vite/__tests__/ast-handler-extract.test.d.ts +0 -2
- package/dist/vite/__tests__/ast-handler-extract.test.d.ts.map +0 -1
- package/dist/vite/__tests__/ast-handler-extract.test.js +0 -294
- package/dist/vite/__tests__/ast-handler-extract.test.js.map +0 -1
- package/dist/vite/__tests__/expose-id-utils.test.d.ts +0 -2
- package/dist/vite/__tests__/expose-id-utils.test.d.ts.map +0 -1
- package/dist/vite/__tests__/expose-id-utils.test.js +0 -224
- package/dist/vite/__tests__/expose-id-utils.test.js.map +0 -1
- package/dist/vite/__tests__/expose-internal-ids.test.d.ts +0 -2
- package/dist/vite/__tests__/expose-internal-ids.test.d.ts.map +0 -1
- package/dist/vite/__tests__/expose-internal-ids.test.js +0 -647
- package/dist/vite/__tests__/expose-internal-ids.test.js.map +0 -1
- package/dist/vite/__tests__/expose-router-id.test.d.ts +0 -2
- package/dist/vite/__tests__/expose-router-id.test.d.ts.map +0 -1
- package/dist/vite/__tests__/expose-router-id.test.js +0 -39
- package/dist/vite/__tests__/expose-router-id.test.js.map +0 -1
- package/dist/vite/ast-handler-extract.d.ts +0 -49
- package/dist/vite/ast-handler-extract.d.ts.map +0 -1
- package/dist/vite/ast-handler-extract.js +0 -249
- package/dist/vite/ast-handler-extract.js.map +0 -1
- package/dist/vite/expose-action-id.d.ts +0 -19
- package/dist/vite/expose-action-id.d.ts.map +0 -1
- package/dist/vite/expose-action-id.js +0 -250
- package/dist/vite/expose-action-id.js.map +0 -1
- package/dist/vite/expose-id-utils.d.ts +0 -69
- package/dist/vite/expose-id-utils.d.ts.map +0 -1
- package/dist/vite/expose-id-utils.js +0 -289
- package/dist/vite/expose-id-utils.js.map +0 -1
- package/dist/vite/expose-internal-ids.d.ts +0 -22
- package/dist/vite/expose-internal-ids.d.ts.map +0 -1
- package/dist/vite/expose-internal-ids.js +0 -886
- package/dist/vite/expose-internal-ids.js.map +0 -1
- package/dist/vite/index.d.ts +0 -149
- package/dist/vite/index.d.ts.map +0 -1
- package/dist/vite/index.js.bak +0 -5448
- package/dist/vite/index.js.map +0 -1
- package/dist/vite/index.named-routes.gen.ts +0 -103
- package/dist/vite/package-resolution.d.ts +0 -43
- package/dist/vite/package-resolution.d.ts.map +0 -1
- package/dist/vite/package-resolution.js +0 -112
- package/dist/vite/package-resolution.js.map +0 -1
- package/dist/vite/virtual-entries.d.ts +0 -25
- package/dist/vite/virtual-entries.d.ts.map +0 -1
- package/dist/vite/virtual-entries.js +0 -110
- package/dist/vite/virtual-entries.js.map +0 -1
package/src/rsc/shell-capture.ts
CHANGED
|
@@ -22,11 +22,14 @@ import { reportCacheError } from "../cache/cache-error.js";
|
|
|
22
22
|
import { runBackground } from "../cache/background-task.js";
|
|
23
23
|
import {
|
|
24
24
|
CaptureQueueFullError,
|
|
25
|
+
CaptureQueueWaitTimeoutError,
|
|
26
|
+
captureQueueDepths,
|
|
25
27
|
enqueueSerializedCapture,
|
|
26
28
|
} from "./capture-queue.js";
|
|
27
29
|
import { SHELL_CAPTURE_MAX_WAIT_MS } from "./shell-capture-constants.js";
|
|
28
30
|
import { INTERNAL_RANGO_DEBUG } from "../internal-debug.js";
|
|
29
31
|
import { observePhase, PHASES } from "../router/instrument.js";
|
|
32
|
+
import type { TraceSpan } from "../router/tracing.js";
|
|
30
33
|
import {
|
|
31
34
|
runWithRequestContext,
|
|
32
35
|
setRequestContextParams,
|
|
@@ -395,6 +398,43 @@ function warnSnapshotOverCapOnce(
|
|
|
395
398
|
);
|
|
396
399
|
}
|
|
397
400
|
|
|
401
|
+
/**
|
|
402
|
+
* Dev warning threshold (ms) for the slowest bake-source settlement wait. Bake
|
|
403
|
+
* time is by-design shell latency (top-level pushed handle promises and
|
|
404
|
+
* bake-lane loader containers settle before the freeze), but it recurs on
|
|
405
|
+
* EVERY capture of the route and occupies the per-isolate serialized capture
|
|
406
|
+
* queue — silently: the served response's own timing never shows it (a route
|
|
407
|
+
* can read 13ms TTFB while each of its captures holds the queue for seconds).
|
|
408
|
+
* Past this threshold the source gets named once per key with the remedy
|
|
409
|
+
* ladder.
|
|
410
|
+
*/
|
|
411
|
+
const SHELL_CAPTURE_BAKE_WARN_MS = 2_000;
|
|
412
|
+
|
|
413
|
+
/** Keys already warned about an expensive bake source (once per key). */
|
|
414
|
+
const warnedBakeCosts = new Set<string>();
|
|
415
|
+
|
|
416
|
+
/**
|
|
417
|
+
* Dev-only, once per key: name the slowest bake source and the three remedies
|
|
418
|
+
* in preference order. The doctrine ("nesting = liveness") makes the cost
|
|
419
|
+
* legitimate, so this is a cost report with an exit, not a deprecation.
|
|
420
|
+
*/
|
|
421
|
+
function warnBakeCostOnce(key: string, source: string, ms: number): void {
|
|
422
|
+
if (warnedBakeCosts.has(key)) return;
|
|
423
|
+
warnedBakeCosts.add(key);
|
|
424
|
+
console.warn(
|
|
425
|
+
`[rango] Shell capture for "${key}" waited ${ms}ms for ${source} to ` +
|
|
426
|
+
"settle before the shell could freeze. This cost recurs on every capture " +
|
|
427
|
+
"of the route and occupies the per-isolate capture queue; the served " +
|
|
428
|
+
"response never shows it. Top-level promises BAKE by design (the " +
|
|
429
|
+
"container settles; nested promises stay live). To make the value " +
|
|
430
|
+
"per-request instead, nest it ({ data: promise }) and read it with use() " +
|
|
431
|
+
"under Suspense; to keep it baked but cheap, wrap the work in cache() " +
|
|
432
|
+
"(the capture replays the cached value); for a segment loader, add a " +
|
|
433
|
+
"loading() boundary to its entry (live lane, masked at capture). See the " +
|
|
434
|
+
"/ppr skill (node_modules/@rangojs/router/skills/ppr/SKILL.md).",
|
|
435
|
+
);
|
|
436
|
+
}
|
|
437
|
+
|
|
398
438
|
/**
|
|
399
439
|
* One structured event from the background capture pipeline, mirroring the
|
|
400
440
|
* CFCacheReadDebugEvent pattern (cache/cf/cf-cache-types.ts): typed fields an
|
|
@@ -416,6 +456,14 @@ export interface ShellCaptureDebugEvent {
|
|
|
416
456
|
* - skip-backoff: the key is inside its refused-capture backoff window and
|
|
417
457
|
* the capture was not attempted
|
|
418
458
|
* - skip-capacity: the isolate capture queue is full; a later request may retry
|
|
459
|
+
* - skip-inert-store: the resolved store's shell family is missing or
|
|
460
|
+
* declared inert (SegmentCacheStore.shellFamilyInert — a CFCacheStore
|
|
461
|
+
* without a KV namespace); nothing could store the result, so the
|
|
462
|
+
* background render was not scheduled at all
|
|
463
|
+
* - skip-queue-timeout: the capture waited past CAPTURE_QUEUE_WAIT_BUDGET_MS
|
|
464
|
+
* behind other captures and was dropped unrun (no backoff — the route is
|
|
465
|
+
* not doomed, the isolate was busy; a later request re-probes). Carries
|
|
466
|
+
* queueWaitMs.
|
|
419
467
|
* - backoff: the key entered (or escalated) backoff after a terminal
|
|
420
468
|
* no-shell — carries the new backoff state
|
|
421
469
|
*/
|
|
@@ -428,6 +476,8 @@ export interface ShellCaptureDebugEvent {
|
|
|
428
476
|
| "skip-in-flight"
|
|
429
477
|
| "skip-backoff"
|
|
430
478
|
| "skip-capacity"
|
|
479
|
+
| "skip-inert-store"
|
|
480
|
+
| "skip-queue-timeout"
|
|
431
481
|
| "backoff";
|
|
432
482
|
/** Attempt number (1 = first, 2 = in-place retry). Absent on skips. */
|
|
433
483
|
attempt?: number;
|
|
@@ -457,6 +507,24 @@ export interface ShellCaptureDebugEvent {
|
|
|
457
507
|
backoffFailures?: number;
|
|
458
508
|
/** Ms remaining in the key's backoff window, when one exists. */
|
|
459
509
|
backoffRemainingMs?: number;
|
|
510
|
+
/** Ms the capture waited in the serialized queue (skip-queue-timeout). */
|
|
511
|
+
queueWaitMs?: number;
|
|
512
|
+
/** Queue priority class at enqueue: document outranks queued navigation. */
|
|
513
|
+
queuePriority?: "document" | "navigation";
|
|
514
|
+
/**
|
|
515
|
+
* Captures ahead at enqueue: the active one plus every waiting capture of
|
|
516
|
+
* same-or-higher priority. 0 = this capture starts immediately.
|
|
517
|
+
*/
|
|
518
|
+
queueAhead?: number;
|
|
519
|
+
/**
|
|
520
|
+
* Ms the capture gate was HELD waiting for the slowest bake source — a
|
|
521
|
+
* top-level pushed handle promise or a bake-lane loader container — to
|
|
522
|
+
* settle, measured from capture start. Bake time is by-design shell latency
|
|
523
|
+
* (the hole doctrine: top-level promises bake), but it recurs on EVERY
|
|
524
|
+
* capture of the route and occupies the serialized queue; this field makes
|
|
525
|
+
* it attributable. Absent when nothing held the gate.
|
|
526
|
+
*/
|
|
527
|
+
bakeWaitMs?: number;
|
|
460
528
|
}
|
|
461
529
|
|
|
462
530
|
/**
|
|
@@ -503,6 +571,18 @@ export function describeShellCaptureEvent(
|
|
|
503
571
|
if (event.backoffRemainingMs !== undefined) {
|
|
504
572
|
parts.push(`backoff-remaining=${event.backoffRemainingMs}ms`);
|
|
505
573
|
}
|
|
574
|
+
if (event.queueWaitMs !== undefined) {
|
|
575
|
+
parts.push(`queue-wait=${event.queueWaitMs}ms`);
|
|
576
|
+
}
|
|
577
|
+
if (event.queuePriority !== undefined) {
|
|
578
|
+
parts.push(`queue-priority=${event.queuePriority}`);
|
|
579
|
+
}
|
|
580
|
+
if (event.queueAhead !== undefined) {
|
|
581
|
+
parts.push(`queue-ahead=${event.queueAhead}`);
|
|
582
|
+
}
|
|
583
|
+
if (event.bakeWaitMs !== undefined) {
|
|
584
|
+
parts.push(`bake=${event.bakeWaitMs}ms`);
|
|
585
|
+
}
|
|
506
586
|
return parts.join(" ");
|
|
507
587
|
}
|
|
508
588
|
|
|
@@ -852,8 +932,18 @@ export function scheduleShellCapture(
|
|
|
852
932
|
});
|
|
853
933
|
return;
|
|
854
934
|
}
|
|
935
|
+
// A capture whose write can only no-op is dead work that still occupies the
|
|
936
|
+
// serialized queue (a promise-heavy route bakes for seconds per MISS),
|
|
937
|
+
// starving captures that CAN store. Skip scheduling entirely when the
|
|
938
|
+
// resolved store (same defaulting as captureAndStoreShell) has no shell
|
|
939
|
+
// family or declared it inert (CFCacheStore without a KV namespace).
|
|
940
|
+
const scheduledStore = descriptor.store ?? reqCtx._cacheStore;
|
|
941
|
+
if (!scheduledStore?.putShell || scheduledStore.shellFamilyInert) {
|
|
942
|
+
publishCaptureDebugEvent(descriptor, { key, outcome: "skip-inert-store" });
|
|
943
|
+
return;
|
|
944
|
+
}
|
|
855
945
|
inFlightCaptures.add(key);
|
|
856
|
-
const captureTask = async () => {
|
|
946
|
+
const captureTask = async (span: TraceSpan) => {
|
|
857
947
|
try {
|
|
858
948
|
const setupUrl = descriptor.navigationOnly
|
|
859
949
|
? stripInternalParams(url)
|
|
@@ -881,6 +971,7 @@ export function scheduleShellCapture(
|
|
|
881
971
|
resolvedSsrModule,
|
|
882
972
|
descriptor,
|
|
883
973
|
);
|
|
974
|
+
span.setAttribute("rango.background.outcome", outcome);
|
|
884
975
|
// Update the negative cache off the terminal outcome. A stored shell clears
|
|
885
976
|
// any prior backoff; a `no-shell` (after the in-place retry) backs the key
|
|
886
977
|
// off so the next requests don't re-probe it. A `redirect` has no shell but
|
|
@@ -899,6 +990,7 @@ export function scheduleShellCapture(
|
|
|
899
990
|
// context is gone. A genuine failure recurs, so back it off too (re-probe
|
|
900
991
|
// once per window, not every request) and report it once.
|
|
901
992
|
markCaptureBackoff(key);
|
|
993
|
+
span.setAttribute("rango.background.outcome", "error");
|
|
902
994
|
publishCaptureDebugEvent(descriptor, {
|
|
903
995
|
key,
|
|
904
996
|
outcome: "error",
|
|
@@ -914,20 +1006,79 @@ export function scheduleShellCapture(
|
|
|
914
1006
|
// capture makes the sibling freeze a trivial prelude and store nothing
|
|
915
1007
|
// (rotating eternal-MISS victims on GH runners). The stampede guard above
|
|
916
1008
|
// stays per-key (dedupe while queued); the queue is cross-key.
|
|
1009
|
+
//
|
|
1010
|
+
// The whole serialized task — queue wait INCLUDED — is wrapped in the
|
|
1011
|
+
// rango.background span (kind=shell-capture). The span is the explanatory
|
|
1012
|
+
// parent for the capture's platform KV/fetch/cache spans (the capture's own
|
|
1013
|
+
// rango.* phase spans stay suppressed — deriveShellCaptureContext strips
|
|
1014
|
+
// _tracing), and queue_wait_ms makes a capture parked behind a slow
|
|
1015
|
+
// predecessor link visible instead of reading as an unexplained dead gap
|
|
1016
|
+
// (observed in production: ~24s of zero I/O before capture start).
|
|
1017
|
+
// observePhase reads tracing off the ALS context captured when runBackground
|
|
1018
|
+
// registered the task — the foreground request context, tracing intact.
|
|
917
1019
|
const serializedTask = async () => {
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
1020
|
+
await observePhase(PHASES.background("shell-capture"), async (span) => {
|
|
1021
|
+
span.setAttribute("rango.shell_key", key);
|
|
1022
|
+
// A production page can enqueue several navigation-only captures through
|
|
1023
|
+
// viewport prefetching. Let a later document MISS overtake that queued
|
|
1024
|
+
// speculative work so it can become a shell HIT before the 15s queue
|
|
1025
|
+
// budget expires. Never preempts the active capture. Priority and the
|
|
1026
|
+
// backlog ahead at enqueue ride the span (and the skip event below), so
|
|
1027
|
+
// a skip-queue-timeout diagnoses itself instead of needing a trace dive.
|
|
1028
|
+
const queuePriority = descriptor.navigationOnly
|
|
1029
|
+
? ("navigation" as const)
|
|
1030
|
+
: ("document" as const);
|
|
1031
|
+
const depths = captureQueueDepths();
|
|
1032
|
+
const queueAhead =
|
|
1033
|
+
(depths.running ? 1 : 0) +
|
|
1034
|
+
depths.document +
|
|
1035
|
+
(queuePriority === "navigation" ? depths.navigation : 0);
|
|
1036
|
+
span.setAttribute("rango.background.queue_priority", queuePriority);
|
|
1037
|
+
span.setAttribute("rango.background.queue_ahead", queueAhead);
|
|
1038
|
+
const queueStart = performance.now();
|
|
1039
|
+
try {
|
|
1040
|
+
await enqueueSerializedCapture(
|
|
1041
|
+
() => {
|
|
1042
|
+
span.setAttribute(
|
|
1043
|
+
"rango.background.queue_wait_ms",
|
|
1044
|
+
Math.round(performance.now() - queueStart),
|
|
1045
|
+
);
|
|
1046
|
+
return captureTask(span);
|
|
1047
|
+
},
|
|
1048
|
+
{ priority: queuePriority },
|
|
1049
|
+
);
|
|
1050
|
+
} catch (error) {
|
|
1051
|
+
if (error instanceof CaptureQueueFullError) {
|
|
1052
|
+
inFlightCaptures.delete(key);
|
|
1053
|
+
span.setAttribute("rango.background.outcome", "skip-capacity");
|
|
1054
|
+
publishCaptureDebugEvent(descriptor, {
|
|
1055
|
+
key,
|
|
1056
|
+
outcome: "skip-capacity",
|
|
1057
|
+
});
|
|
1058
|
+
return;
|
|
1059
|
+
}
|
|
1060
|
+
if (error instanceof CaptureQueueWaitTimeoutError) {
|
|
1061
|
+
// Dropped unrun after waiting past the queue budget: no backoff (the
|
|
1062
|
+
// route is not doomed, the isolate was busy) — a later request
|
|
1063
|
+
// re-probes the key.
|
|
1064
|
+
inFlightCaptures.delete(key);
|
|
1065
|
+
span.setAttribute("rango.background.outcome", "skip-queue-timeout");
|
|
1066
|
+
span.setAttribute(
|
|
1067
|
+
"rango.background.queue_wait_ms",
|
|
1068
|
+
Math.round(error.waitedMs),
|
|
1069
|
+
);
|
|
1070
|
+
publishCaptureDebugEvent(descriptor, {
|
|
1071
|
+
key,
|
|
1072
|
+
outcome: "skip-queue-timeout",
|
|
1073
|
+
queueWaitMs: Math.round(error.waitedMs),
|
|
1074
|
+
queuePriority,
|
|
1075
|
+
queueAhead,
|
|
1076
|
+
});
|
|
1077
|
+
return;
|
|
1078
|
+
}
|
|
1079
|
+
throw error;
|
|
928
1080
|
}
|
|
929
|
-
|
|
930
|
-
}
|
|
1081
|
+
});
|
|
931
1082
|
};
|
|
932
1083
|
// The capture's own task must NOT enter reqCtx._pendingBackgroundTasks: the
|
|
933
1084
|
// capture drains that list before rendering (the write-barrier ordering edge),
|
|
@@ -983,6 +1134,7 @@ type CaptureAttemptStats = Pick<
|
|
|
983
1134
|
| "snapshotSkipped"
|
|
984
1135
|
| "untaggedBake"
|
|
985
1136
|
| "storeWrite"
|
|
1137
|
+
| "bakeWaitMs"
|
|
986
1138
|
>;
|
|
987
1139
|
|
|
988
1140
|
/**
|
|
@@ -1459,6 +1611,29 @@ async function captureAndStoreShell(
|
|
|
1459
1611
|
loaderRecordsForHold && loaderRecordsForHold.size > 0
|
|
1460
1612
|
? Promise.allSettled([handlesBaked, ...loaderRecordsForHold.values()])
|
|
1461
1613
|
: handlesBaked;
|
|
1614
|
+
// Bake-cost attribution: record how long each bake source held the gate,
|
|
1615
|
+
// measured from capture start. Side-channel observers only — holdUntil and
|
|
1616
|
+
// its consumers are untouched, and a rejected source is recorded the same
|
|
1617
|
+
// (allSettled swallows it; the drain below owns the refusal). Folded into
|
|
1618
|
+
// stats.bakeWaitMs (+ a once-per-key dev warning) after a successful
|
|
1619
|
+
// capture; on a refusal the other warnings own the story.
|
|
1620
|
+
const bakeStart = performance.now();
|
|
1621
|
+
const bakeWaits: { source: string; ms: number }[] = [];
|
|
1622
|
+
const observeBake = (source: string, promise: Promise<unknown>): void => {
|
|
1623
|
+
const record = (): void => {
|
|
1624
|
+
bakeWaits.push({
|
|
1625
|
+
source,
|
|
1626
|
+
ms: Math.round(performance.now() - bakeStart),
|
|
1627
|
+
});
|
|
1628
|
+
};
|
|
1629
|
+
promise.then(record, record);
|
|
1630
|
+
};
|
|
1631
|
+
observeBake("top-level pushed handle promises", handlesBaked);
|
|
1632
|
+
if (loaderRecordsForHold) {
|
|
1633
|
+
for (const [loaderId, promise] of loaderRecordsForHold) {
|
|
1634
|
+
observeBake(`bake-lane segment loader "${loaderId}"`, promise);
|
|
1635
|
+
}
|
|
1636
|
+
}
|
|
1462
1637
|
const gate = gateFlightForCapture(rscStream, undefined, holdUntil);
|
|
1463
1638
|
// Quiesce = handles settled AND the Flight shell rows went task-quiet. Either
|
|
1464
1639
|
// half stalling is bounded by captureShellHTML's maxWaitMs.
|
|
@@ -1538,6 +1713,23 @@ async function captureAndStoreShell(
|
|
|
1538
1713
|
}
|
|
1539
1714
|
if (stats) stats.preludeBytes = result.prelude.length;
|
|
1540
1715
|
|
|
1716
|
+
// Every bake source has settled by here (quiesce gates on holdUntil).
|
|
1717
|
+
// Surface the slowest one: sub-ms settles are noise, threshold-crossers
|
|
1718
|
+
// get the dev warning with the remedy ladder.
|
|
1719
|
+
let slowestBake: { source: string; ms: number } | undefined;
|
|
1720
|
+
for (const wait of bakeWaits) {
|
|
1721
|
+
if (!slowestBake || wait.ms > slowestBake.ms) slowestBake = wait;
|
|
1722
|
+
}
|
|
1723
|
+
if (slowestBake && slowestBake.ms > 0) {
|
|
1724
|
+
if (stats) stats.bakeWaitMs = slowestBake.ms;
|
|
1725
|
+
if (
|
|
1726
|
+
process.env.NODE_ENV !== "production" &&
|
|
1727
|
+
slowestBake.ms >= SHELL_CAPTURE_BAKE_WARN_MS
|
|
1728
|
+
) {
|
|
1729
|
+
warnBakeCostOnce(capture.key, slowestBake.source, slowestBake.ms);
|
|
1730
|
+
}
|
|
1731
|
+
}
|
|
1732
|
+
|
|
1541
1733
|
// Store per the flag's key/ttl/swr/tags, into the flag's store: the middleware
|
|
1542
1734
|
// threads the SAME store it resolved for its getShell read (options.store ??
|
|
1543
1735
|
// _cacheStore), so a store-attached middleware writes captures where it reads
|
|
@@ -1694,11 +1886,23 @@ async function captureAndStoreShell(
|
|
|
1694
1886
|
if (store?.putShell) {
|
|
1695
1887
|
try {
|
|
1696
1888
|
const entry: ShellCacheEntry = {
|
|
1697
|
-
//
|
|
1698
|
-
//
|
|
1699
|
-
//
|
|
1700
|
-
|
|
1701
|
-
|
|
1889
|
+
// Document half only for document captures. A navigationOnly entry's
|
|
1890
|
+
// HTML is never served (document reads skip the flag; partial replay
|
|
1891
|
+
// consumes only snapshot/docKey), so storing it would ride every KV
|
|
1892
|
+
// write/read as dead weight — the prerender still ran above as the
|
|
1893
|
+
// completeness arbiter and sanity gate, its output is dropped here.
|
|
1894
|
+
...(capture.navigationOnly
|
|
1895
|
+
? {}
|
|
1896
|
+
: {
|
|
1897
|
+
// slice() copies just this view's bytes into a fresh
|
|
1898
|
+
// ArrayBuffer, so a prelude that is a subarray of a larger
|
|
1899
|
+
// backing buffer encodes only its own region — bufferToBase64
|
|
1900
|
+
// reads the whole ArrayBuffer it is handed.
|
|
1901
|
+
prelude: bufferToBase64(
|
|
1902
|
+
result.prelude.slice().buffer as ArrayBuffer,
|
|
1903
|
+
),
|
|
1904
|
+
postponed: result.postponed,
|
|
1905
|
+
}),
|
|
1702
1906
|
reactVersion: React.version,
|
|
1703
1907
|
buildVersion: capture.buildVersion,
|
|
1704
1908
|
// The theme this capture's payload was built with (buildFullPayload
|
package/src/rsc/shell-serve.ts
CHANGED
|
@@ -20,7 +20,11 @@ import React from "react";
|
|
|
20
20
|
import { isPprEntry, type EntryData } from "../server/context.js";
|
|
21
21
|
import { sortedSearchString } from "../cache/cache-key-utils.js";
|
|
22
22
|
import type { SearchParamsFilter } from "../cache/search-params-filter.js";
|
|
23
|
-
import type {
|
|
23
|
+
import type {
|
|
24
|
+
DocumentShellCacheEntry,
|
|
25
|
+
ShellCacheEntry,
|
|
26
|
+
SegmentCacheStore,
|
|
27
|
+
} from "../cache/types.js";
|
|
24
28
|
import { SHELL_CAPTURE_MAX_WAIT_MS } from "./shell-capture-constants.js";
|
|
25
29
|
|
|
26
30
|
/** Debug/status header the browser (and e2e assertions) can read: HIT | MISS. */
|
|
@@ -150,18 +154,29 @@ export function isValidShellHit(
|
|
|
150
154
|
}
|
|
151
155
|
|
|
152
156
|
/**
|
|
153
|
-
*
|
|
154
|
-
* whose prelude is not decodable base64 or whose
|
|
155
|
-
* parseable JSON would otherwise throw AFTER the 200 +
|
|
156
|
-
* flushed (`serveShellHit` decodes at stream construction,
|
|
157
|
-
* parses in the tail) — the client gets a visually complete
|
|
158
|
-
* hydrates, re-served on every request until the entry ages
|
|
159
|
-
* path exists; failure schedules no recapture by itself).
|
|
160
|
-
* a corrupt entry (store-layer fault) into a plain MISS
|
|
161
|
-
* overwrites. Cost: one duplicate decode/parse per HIT, sub-ms
|
|
162
|
-
* prelude flush that dominates the path.
|
|
157
|
+
* DOCUMENT-half integrity gate and type narrowing, run BEFORE the HIT response
|
|
158
|
+
* commits: a stored entry whose prelude is not decodable base64 or whose
|
|
159
|
+
* postponed blob is not parseable JSON would otherwise throw AFTER the 200 +
|
|
160
|
+
* full static prelude flushed (`serveShellHit` decodes at stream construction,
|
|
161
|
+
* `resumeShellHTML` parses in the tail) — the client gets a visually complete
|
|
162
|
+
* page that never hydrates, re-served on every request until the entry ages
|
|
163
|
+
* out (no eviction path exists; failure schedules no recapture by itself).
|
|
164
|
+
* Checking here turns a corrupt entry (store-layer fault) into a plain MISS
|
|
165
|
+
* the recapture overwrites. Cost: one duplicate decode/parse per HIT, sub-ms
|
|
166
|
+
* against a prelude flush that dominates the path.
|
|
167
|
+
*
|
|
168
|
+
* navigationOnly entries store no document half (prelude/postponed absent) and
|
|
169
|
+
* therefore never pass. The partial-replay path skips this gate for them
|
|
170
|
+
* (replayableShellSnapshot) — snapshot fragment corruption is caught by the
|
|
171
|
+
* consumer-side Flight decoders instead (SegmentFragmentDecodeError → healing
|
|
172
|
+
* capture).
|
|
163
173
|
*/
|
|
164
|
-
export function hasIntactShellPayload(
|
|
174
|
+
export function hasIntactShellPayload(
|
|
175
|
+
entry: ShellCacheEntry,
|
|
176
|
+
): entry is DocumentShellCacheEntry {
|
|
177
|
+
if (typeof entry.prelude !== "string" || entry.postponed === undefined) {
|
|
178
|
+
return false;
|
|
179
|
+
}
|
|
165
180
|
try {
|
|
166
181
|
base64ToBytes(entry.prelude);
|
|
167
182
|
if (entry.postponed !== null) JSON.parse(entry.postponed);
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stream-idle timeout — the enforcement for `timeouts.streamIdleMs` (the
|
|
3
|
+
* "stream-idle" TimeoutPhase, reserved since the timeout API landed).
|
|
4
|
+
*
|
|
5
|
+
* WHY: nothing else bounds a streaming response body's lifetime.
|
|
6
|
+
* `renderStartMs` only bounds time-to-Response-construction; once the body is
|
|
7
|
+
* streaming, a single never-settling promise embedded in the payload (a
|
|
8
|
+
* deferred loader that never resolves, an orphaned ctx.rendered() barrier)
|
|
9
|
+
* holds the Flight/HTML stream — and the client's connection — open forever.
|
|
10
|
+
* Deferred HANDLES have a 10s auto-resolve net (defer.ts); loader promises
|
|
11
|
+
* and everything else have none. Field-observed as multi-second dead
|
|
12
|
+
* connections only closed by client cancellation.
|
|
13
|
+
*
|
|
14
|
+
* SEMANTICS — end-to-end idle flow, deliberately: the watchdog re-arms on
|
|
15
|
+
* every chunk that flows THROUGH to the client, so "idle" means "no bytes
|
|
16
|
+
* reached the wire for N ms". A stalled slow client counts as idle the same
|
|
17
|
+
* as a wedged producer — the two are indistinguishable here without buffering,
|
|
18
|
+
* and buffering is banned on the streaming path. Pick budgets accordingly
|
|
19
|
+
* (generous, seconds not millis); the feature is OPT-IN (unset = today's
|
|
20
|
+
* unbounded behavior, and the `timeout` shorthand deliberately does not apply
|
|
21
|
+
* to streamIdleMs — see resolveTimeouts).
|
|
22
|
+
*
|
|
23
|
+
* ON TRIP: the client-facing stream is errored with a RouterTimeoutError
|
|
24
|
+
* ("stream-idle") — the host terminates the response visibly (truncated
|
|
25
|
+
* chunked encoding), which is debuggable, unlike a silent clean close that
|
|
26
|
+
* would present a half-document as complete. Erroring the transform makes the
|
|
27
|
+
* pipe cancel its SOURCE, which aborts React's fizz/flight render — but only
|
|
28
|
+
* when the watchdog's branch is the sole consumer. When an upstream layer
|
|
29
|
+
* teed or cloned the body first (the document-cache MISS drain,
|
|
30
|
+
* response-cache clones), the watchdog holds one tee branch: tee semantics
|
|
31
|
+
* cancel the underlying source only once EVERY branch cancels, so the cache
|
|
32
|
+
* branch keeps the wedged render alive, bounded only by the platform's
|
|
33
|
+
* waitUntil budget — exactly as it was before this feature. The client-facing
|
|
34
|
+
* bound is unconditional; source teardown is best-effort. `onTimeout` does
|
|
35
|
+
* NOT apply: the response already left the handler, so no replacement
|
|
36
|
+
* Response can be served — the trip is reported via onError + the
|
|
37
|
+
* request.timeout telemetry event instead.
|
|
38
|
+
*
|
|
39
|
+
* COST: one identity TransformStream hop per chunk, only when the timeout is
|
|
40
|
+
* enabled. Never buffers, never reads ahead, adds no work when disabled.
|
|
41
|
+
*/
|
|
42
|
+
|
|
43
|
+
import { RouterTimeoutError } from "../router/timeout.js";
|
|
44
|
+
|
|
45
|
+
/** What the watchdog observed when it tripped. */
|
|
46
|
+
export interface StreamIdleTrip {
|
|
47
|
+
/** ms since the watchdog armed (response handoff) — the stream's lifetime. */
|
|
48
|
+
totalMs: number;
|
|
49
|
+
/** Chunks forwarded before the trip. */
|
|
50
|
+
chunks: number;
|
|
51
|
+
/** The error the client-facing stream was terminated with. */
|
|
52
|
+
error: RouterTimeoutError;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Wrap `response`'s body in an idle watchdog. Returns a NEW Response with the
|
|
57
|
+
* same status/headers whose body errors (and cancels the source) once no chunk
|
|
58
|
+
* has flowed for `idleMs`. Callers gate on isTimeoutEnabled + body presence +
|
|
59
|
+
* NOT a websocket upgrade (a 101/webSocket response must never be
|
|
60
|
+
* reconstructed); this function assumes those checks were made. `onTrip` fires
|
|
61
|
+
* at most once, after the client-facing stream has been errored.
|
|
62
|
+
*/
|
|
63
|
+
export function applyStreamIdleTimeout(
|
|
64
|
+
response: Response,
|
|
65
|
+
idleMs: number,
|
|
66
|
+
onTrip: (trip: StreamIdleTrip) => void,
|
|
67
|
+
): Response {
|
|
68
|
+
const source = response.body;
|
|
69
|
+
if (!source) return response;
|
|
70
|
+
|
|
71
|
+
const start = performance.now();
|
|
72
|
+
let timer: ReturnType<typeof setTimeout> | undefined;
|
|
73
|
+
let chunks = 0;
|
|
74
|
+
let settled = false;
|
|
75
|
+
let controllerRef!: TransformStreamDefaultController<unknown>;
|
|
76
|
+
|
|
77
|
+
const disarm = () => {
|
|
78
|
+
settled = true;
|
|
79
|
+
if (timer) clearTimeout(timer);
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
const trip = () => {
|
|
83
|
+
if (settled) return;
|
|
84
|
+
const error = new RouterTimeoutError(
|
|
85
|
+
"stream-idle",
|
|
86
|
+
performance.now() - start,
|
|
87
|
+
);
|
|
88
|
+
try {
|
|
89
|
+
controllerRef.error(error);
|
|
90
|
+
} catch {
|
|
91
|
+
// The stream already terminated (raced a close/cancel) — nothing was
|
|
92
|
+
// interrupted, so do not report a timeout.
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
// Erroring the transform makes the pipe abort and CANCEL the source
|
|
96
|
+
// stream (React aborts the wedged render). Mark settled AFTER the error
|
|
97
|
+
// took, then report.
|
|
98
|
+
disarm();
|
|
99
|
+
onTrip({ totalMs: error.durationMs, chunks, error });
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
const arm = () => {
|
|
103
|
+
if (settled) return;
|
|
104
|
+
if (timer) clearTimeout(timer);
|
|
105
|
+
timer = setTimeout(trip, idleMs);
|
|
106
|
+
(timer as { unref?: () => void }).unref?.();
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
// `cancel` is the spec's newer transformer hook (client-side cancellation);
|
|
110
|
+
// TS's lib.dom Transformer type lags it, hence the intersection. Runtimes
|
|
111
|
+
// without it fall back to the settled/try-catch guards in trip().
|
|
112
|
+
const transformer: Transformer<unknown, unknown> & { cancel?: () => void } = {
|
|
113
|
+
start(controller) {
|
|
114
|
+
controllerRef = controller;
|
|
115
|
+
arm();
|
|
116
|
+
},
|
|
117
|
+
transform(chunk, controller) {
|
|
118
|
+
controller.enqueue(chunk);
|
|
119
|
+
chunks++;
|
|
120
|
+
arm();
|
|
121
|
+
},
|
|
122
|
+
flush() {
|
|
123
|
+
// Natural end of the source stream.
|
|
124
|
+
disarm();
|
|
125
|
+
},
|
|
126
|
+
cancel() {
|
|
127
|
+
disarm();
|
|
128
|
+
},
|
|
129
|
+
};
|
|
130
|
+
const watchdog = new TransformStream<unknown, unknown>(transformer);
|
|
131
|
+
|
|
132
|
+
return new Response(source.pipeThrough(watchdog) as ReadableStream, {
|
|
133
|
+
status: response.status,
|
|
134
|
+
statusText: response.statusText,
|
|
135
|
+
headers: response.headers,
|
|
136
|
+
});
|
|
137
|
+
}
|
|
@@ -691,6 +691,13 @@ export interface RequestContext<
|
|
|
691
691
|
*/
|
|
692
692
|
_classifiedRoute?: import("../router/route-snapshot.js").RouteSnapshot;
|
|
693
693
|
|
|
694
|
+
/**
|
|
695
|
+
* @internal Classified request mode from classifyRequest, read by the
|
|
696
|
+
* rango.response span tail (rsc/handler.ts) for the rango.response.mode
|
|
697
|
+
* attribute. Unset when middleware short-circuits before core execution.
|
|
698
|
+
*/
|
|
699
|
+
_requestMode?: import("../router/request-classification.js").RequestPlan["mode"];
|
|
700
|
+
|
|
694
701
|
/**
|
|
695
702
|
* @internal Coarse route-level cache signal for the X-Rango-Cache debug
|
|
696
703
|
* header. Populated by match/matchPartial only when the debug cache signal
|
|
@@ -770,6 +777,7 @@ export type PublicRequestContext<
|
|
|
770
777
|
| "_setKeepCacheDirective"
|
|
771
778
|
| "_variables"
|
|
772
779
|
| "_classifiedRoute"
|
|
780
|
+
| "_requestMode"
|
|
773
781
|
| "_cacheSignal"
|
|
774
782
|
| "_dynamic"
|
|
775
783
|
| "res"
|
package/src/testing/dispatch.ts
CHANGED
|
@@ -151,9 +151,11 @@ import type { TelemetrySink } from "../router/telemetry.js";
|
|
|
151
151
|
import {
|
|
152
152
|
RouterTimeoutError,
|
|
153
153
|
createDefaultTimeoutResponse,
|
|
154
|
+
isTimeoutEnabled,
|
|
154
155
|
withTimeout,
|
|
155
156
|
} from "../router/timeout.js";
|
|
156
157
|
import type { OnTimeoutCallback, ResolvedTimeouts } from "../router/timeout.js";
|
|
158
|
+
import { applyStreamIdleTimeout } from "../rsc/stream-idle.js";
|
|
157
159
|
|
|
158
160
|
/**
|
|
159
161
|
* The internal subset of the router surface dispatch depends on. The public
|
|
@@ -854,7 +856,59 @@ export async function dispatch<TEnv = any>(
|
|
|
854
856
|
// it leaves -- a cross-origin Location is rewritten to the basename root
|
|
855
857
|
// unless redirect(url, { external: true }) opted out. Soft partial/action
|
|
856
858
|
// redirects are already resolved at createSimpleRedirectResponse time.
|
|
857
|
-
|
|
859
|
+
const guardedResponse = guardOutgoingRedirect(
|
|
860
|
+
finalResponse,
|
|
861
|
+
url.origin,
|
|
862
|
+
router.basename,
|
|
863
|
+
);
|
|
864
|
+
|
|
865
|
+
// Mirror production's stream-idle watchdog (handler.ts response tail),
|
|
866
|
+
// same gating and reporting — dispatch is the userland dogfood surface
|
|
867
|
+
// for timeouts.streamIdleMs, so the primitive carries the real wiring,
|
|
868
|
+
// not a stub. Websocket check FIRST (an upgrade response's body getter
|
|
869
|
+
// must never be poked); onTimeout does not apply mid-stream.
|
|
870
|
+
const streamIdleMs = router.timeouts?.streamIdleMs;
|
|
871
|
+
if (
|
|
872
|
+
isTimeoutEnabled(streamIdleMs) &&
|
|
873
|
+
!isWebSocketUpgradeResponse(guardedResponse) &&
|
|
874
|
+
guardedResponse.body
|
|
875
|
+
) {
|
|
876
|
+
return applyStreamIdleTimeout(
|
|
877
|
+
guardedResponse,
|
|
878
|
+
streamIdleMs!,
|
|
879
|
+
(trip) => {
|
|
880
|
+
invokeOnError(
|
|
881
|
+
router.onError,
|
|
882
|
+
trip.error,
|
|
883
|
+
"handler",
|
|
884
|
+
{
|
|
885
|
+
request: req,
|
|
886
|
+
url,
|
|
887
|
+
env,
|
|
888
|
+
handledByBoundary: false,
|
|
889
|
+
metadata: {
|
|
890
|
+
timeout: true,
|
|
891
|
+
phase: "stream-idle",
|
|
892
|
+
durationMs: trip.totalMs,
|
|
893
|
+
},
|
|
894
|
+
},
|
|
895
|
+
"RSC",
|
|
896
|
+
);
|
|
897
|
+
if (sink) {
|
|
898
|
+
safeEmit(resolveSink(sink), {
|
|
899
|
+
type: "request.timeout",
|
|
900
|
+
timestamp: performance.now(),
|
|
901
|
+
requestId: telemetryRequestId,
|
|
902
|
+
phase: "stream-idle",
|
|
903
|
+
pathname: url.pathname,
|
|
904
|
+
durationMs: trip.totalMs,
|
|
905
|
+
customHandler: false,
|
|
906
|
+
});
|
|
907
|
+
}
|
|
908
|
+
},
|
|
909
|
+
);
|
|
910
|
+
}
|
|
911
|
+
return guardedResponse;
|
|
858
912
|
} catch (error) {
|
|
859
913
|
if (sink) {
|
|
860
914
|
if (error instanceof Response) {
|
package/src/vercel/tracing.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Vercel OpenTelemetry tracing integration.
|
|
3
3
|
*
|
|
4
|
-
* Bridges the router's
|
|
5
|
-
*
|
|
6
|
-
* Vercel's trace waterfall next to the platform's automatic spans,
|
|
7
|
-
* nesting. Vercel exposes tracing through OpenTelemetry (not a
|
|
8
|
-
* API like Cloudflare), so this is a thin convenience over
|
|
9
|
-
* it reads the global OTel tracer that `@vercel/otel`'s
|
|
4
|
+
* Bridges the router's observable phases (request, middleware, action, loaders,
|
|
5
|
+
* handler, render, ssr, response, background) onto OpenTelemetry spans so they
|
|
6
|
+
* show up in Vercel's trace waterfall next to the platform's automatic spans,
|
|
7
|
+
* with correct nesting. Vercel exposes tracing through OpenTelemetry (not a
|
|
8
|
+
* native import-free API like Cloudflare), so this is a thin convenience over
|
|
9
|
+
* `createOTelTracing`: it reads the global OTel tracer that `@vercel/otel`'s
|
|
10
|
+
* `registerOTel()` installs.
|
|
10
11
|
*
|
|
11
12
|
* Usage (vercel preset). A Rango/Vite app does NOT auto-load `instrumentation.ts`
|
|
12
13
|
* the way Next.js does, so export the tracing config from there and import it —
|
|
@@ -69,8 +70,8 @@ export interface VercelTracingOptions extends TracingToggleOptions {
|
|
|
69
70
|
/**
|
|
70
71
|
* Create the tracing config for a Vercel router. Pass the result to
|
|
71
72
|
* `createRouter({ tracing })`. Spans are emitted for the request, middleware,
|
|
72
|
-
* action, loaders, handler, render, and
|
|
73
|
-
* individual phases off.
|
|
73
|
+
* action, loaders, handler, render, ssr, response, and background phases; pass
|
|
74
|
+
* `spans` to turn individual phases off.
|
|
74
75
|
*
|
|
75
76
|
* @see createOTelTracing (`@rangojs/router`) for the underlying adapter on any
|
|
76
77
|
* platform with an OpenTelemetry SDK.
|