@rangojs/router 0.0.0-experimental.f2d1a2f1 → 0.0.0-experimental.f4a8e8de
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/AGENTS.md +8 -4
- package/README.md +318 -821
- package/dist/bin/rango.js +925 -271
- package/dist/testing/vitest.js +82 -0
- package/dist/types/__internal.d.ts +127 -0
- package/dist/types/bin/rango.d.ts +1 -0
- package/dist/types/browser/action-coordinator.d.ts +57 -0
- package/dist/types/browser/action-fence.d.ts +33 -0
- package/dist/types/browser/app-shell.d.ts +34 -0
- package/dist/types/browser/app-version.d.ts +6 -0
- package/dist/types/browser/connection-warmup.d.ts +31 -0
- package/dist/types/browser/cookie-name.d.ts +66 -0
- package/dist/types/browser/dev-discovery.d.ts +11 -0
- package/dist/types/browser/event-controller.d.ts +231 -0
- package/dist/types/browser/history-state.d.ts +26 -0
- package/dist/types/browser/index.d.ts +1 -0
- package/dist/types/browser/intercept-utils.d.ts +30 -0
- package/dist/types/browser/invalidate-client-cache.d.ts +17 -0
- package/dist/types/browser/link-interceptor.d.ts +53 -0
- package/dist/types/browser/logging.d.ts +33 -0
- package/dist/types/browser/merge-segment-loaders.d.ts +38 -0
- package/dist/types/browser/navigation-bridge.d.ts +39 -0
- package/dist/types/browser/navigation-client.d.ts +17 -0
- package/dist/types/browser/navigation-store-handle.d.ts +25 -0
- package/dist/types/browser/navigation-store.d.ts +85 -0
- package/dist/types/browser/navigation-transaction.d.ts +75 -0
- package/dist/types/browser/network-error-handler.d.ts +35 -0
- package/dist/types/browser/notify-listeners.d.ts +2 -0
- package/dist/types/browser/partial-update.d.ts +61 -0
- package/dist/types/browser/prefetch/cache.d.ts +224 -0
- package/dist/types/browser/prefetch/default-strategy.d.ts +31 -0
- package/dist/types/browser/prefetch/fetch.d.ts +52 -0
- package/dist/types/browser/prefetch/invalidation.d.ts +6 -0
- package/dist/types/browser/prefetch/loader.d.ts +12 -0
- package/dist/types/browser/prefetch/observer.d.ts +24 -0
- package/dist/types/browser/prefetch/policy.d.ts +13 -0
- package/dist/types/browser/prefetch/queue.d.ts +48 -0
- package/dist/types/browser/prefetch/resource-ready.d.ts +28 -0
- package/dist/types/browser/prefetch/runtime.d.ts +2 -0
- package/dist/types/browser/rango-state.d.ts +56 -0
- package/dist/types/browser/react/Link.d.ts +132 -0
- package/dist/types/browser/react/NavigationProvider.d.ts +88 -0
- package/dist/types/browser/react/ScrollRestoration.d.ts +78 -0
- package/dist/types/browser/react/context.d.ts +57 -0
- package/dist/types/browser/react/filter-segment-order.d.ts +35 -0
- package/dist/types/browser/react/index.d.ts +1 -0
- package/dist/types/browser/react/location-state-shared.d.ts +162 -0
- package/dist/types/browser/react/location-state.d.ts +29 -0
- package/dist/types/browser/react/mount-context.d.ts +23 -0
- package/dist/types/browser/react/nonce-context.d.ts +14 -0
- package/dist/types/browser/react/shallow-equal.d.ts +5 -0
- package/dist/types/browser/react/use-action.d.ts +61 -0
- package/dist/types/browser/react/use-handle.d.ts +21 -0
- package/dist/types/browser/react/use-href.d.ts +32 -0
- package/dist/types/browser/react/use-link-status.d.ts +36 -0
- package/dist/types/browser/react/use-mount.d.ts +24 -0
- package/dist/types/browser/react/use-navigation.d.ts +15 -0
- package/dist/types/browser/react/use-params.d.ts +21 -0
- package/dist/types/browser/react/use-pathname.d.ts +13 -0
- package/dist/types/browser/react/use-reverse.d.ts +40 -0
- package/dist/types/browser/react/use-router.d.ts +23 -0
- package/dist/types/browser/react/use-search-params.d.ts +19 -0
- package/dist/types/browser/react/use-segments.d.ts +29 -0
- package/dist/types/browser/response-adapter.d.ts +58 -0
- package/dist/types/browser/rsc-router.d.ts +146 -0
- package/dist/types/browser/scroll-restoration.d.ts +103 -0
- package/dist/types/browser/segment-reconciler.d.ts +74 -0
- package/dist/types/browser/segment-structure-assert.d.ts +16 -0
- package/dist/types/browser/server-action-bridge.d.ts +29 -0
- package/dist/types/browser/types.d.ts +546 -0
- package/dist/types/browser/validate-redirect-origin.d.ts +28 -0
- package/dist/types/build/collect-fallback-refs.d.ts +5 -0
- package/dist/types/build/generate-manifest.d.ts +106 -0
- package/dist/types/build/generate-route-types.d.ts +8 -0
- package/dist/types/build/index.d.ts +21 -0
- package/dist/types/build/merge-full-manifests.d.ts +3 -0
- package/dist/types/build/prefix-tree-utils.d.ts +56 -0
- package/dist/types/build/route-trie.d.ts +20 -0
- package/dist/types/build/route-types/ast-helpers.d.ts +3 -0
- package/dist/types/build/route-types/ast-route-extraction.d.ts +13 -0
- package/dist/types/build/route-types/codegen.d.ts +16 -0
- package/dist/types/build/route-types/include-resolution.d.ts +74 -0
- package/dist/types/build/route-types/param-extraction.d.ts +13 -0
- package/dist/types/build/route-types/per-module-writer.d.ts +20 -0
- package/dist/types/build/route-types/router-processing.d.ts +81 -0
- package/dist/types/build/route-types/scan-filter.d.ts +17 -0
- package/dist/types/build/route-types/source-scan.d.ts +13 -0
- package/dist/types/build/runtime-discovery.d.ts +24 -0
- package/dist/types/cache/background-task.d.ts +21 -0
- package/dist/types/cache/cache-error.d.ts +71 -0
- package/dist/types/cache/cache-exec-scope.d.ts +31 -0
- package/dist/types/cache/cache-key-utils.d.ts +43 -0
- package/dist/types/cache/cache-policy.d.ts +59 -0
- package/dist/types/cache/cache-runtime.d.ts +51 -0
- package/dist/types/cache/cache-scope.d.ts +215 -0
- package/dist/types/cache/cache-tag.d.ts +79 -0
- package/dist/types/cache/cf/cf-base64.d.ts +4 -0
- package/dist/types/cache/cf/cf-cache-constants.d.ts +112 -0
- package/dist/types/cache/cf/cf-cache-store.d.ts +616 -0
- package/dist/types/cache/cf/cf-cache-types.d.ts +365 -0
- package/dist/types/cache/cf/cf-kv-utils.d.ts +43 -0
- package/dist/types/cache/cf/cf-tag-marker-memo.d.ts +15 -0
- package/dist/types/cache/cf/cf-zone-purge.d.ts +31 -0
- package/dist/types/cache/cf/index.d.ts +4 -0
- package/dist/types/cache/document-cache.d.ts +71 -0
- package/dist/types/cache/handle-capture.d.ts +23 -0
- package/dist/types/cache/handle-snapshot.d.ts +39 -0
- package/dist/types/cache/index.d.ts +9 -0
- package/dist/types/cache/memory-segment-store.d.ts +163 -0
- package/dist/types/cache/profile-registry.d.ts +40 -0
- package/dist/types/cache/read-through-swr.d.ts +61 -0
- package/dist/types/cache/search-params-filter.d.ts +64 -0
- package/dist/types/cache/segment-codec.d.ts +78 -0
- package/dist/types/cache/shell-snapshot.d.ts +186 -0
- package/dist/types/cache/tag-invalidation.d.ts +74 -0
- package/dist/types/cache/taint.d.ts +77 -0
- package/dist/types/cache/types.d.ts +503 -0
- package/dist/types/cache/vercel/index.d.ts +1 -0
- package/dist/types/cache/vercel/vercel-cache-store.d.ts +268 -0
- package/dist/types/client-urls/client-root.d.ts +38 -0
- package/dist/types/client-urls/client-urls.d.ts +5 -0
- package/dist/types/client-urls/navigation.d.ts +38 -0
- package/dist/types/client-urls/revalidation-protocol.d.ts +25 -0
- package/dist/types/client-urls/server-projection.d.ts +57 -0
- package/dist/types/client-urls/types.d.ts +132 -0
- package/dist/types/client.d.ts +191 -0
- package/dist/types/client.rsc.d.ts +41 -0
- package/dist/types/cloudflare/index.d.ts +7 -0
- package/dist/types/cloudflare/tracing.d.ts +57 -0
- package/dist/types/component-utils.d.ts +46 -0
- package/dist/types/components/DefaultDocument.d.ts +13 -0
- package/dist/types/context-var.d.ts +84 -0
- package/dist/types/debug.d.ts +57 -0
- package/dist/types/decode-loader-results.d.ts +42 -0
- package/dist/types/default-error-boundary.d.ts +10 -0
- package/dist/types/defer.d.ts +89 -0
- package/dist/types/deps/browser.d.ts +1 -0
- package/dist/types/deps/html-stream-client.d.ts +1 -0
- package/dist/types/deps/html-stream-server.d.ts +1 -0
- package/dist/types/deps/rsc.d.ts +1 -0
- package/dist/types/deps/ssr.d.ts +1 -0
- package/dist/types/dev-discovery-protocol.d.ts +5 -0
- package/dist/types/encode-kv.d.ts +35 -0
- package/dist/types/errors.d.ts +227 -0
- package/dist/types/escape-script.d.ts +44 -0
- package/dist/types/handle.d.ts +93 -0
- package/dist/types/handles/MetaTags.d.ts +17 -0
- package/dist/types/handles/Scripts.d.ts +38 -0
- package/dist/types/handles/breadcrumbs.d.ts +43 -0
- package/dist/types/handles/deferred-resolution.d.ts +53 -0
- package/dist/types/handles/is-thenable.d.ts +10 -0
- package/dist/types/handles/meta.d.ts +43 -0
- package/dist/types/handles/script.d.ts +139 -0
- package/dist/types/host/cookie-handler.d.ts +8 -0
- package/dist/types/host/errors.d.ts +40 -0
- package/dist/types/host/index.d.ts +33 -0
- package/dist/types/host/pattern-matcher.d.ts +30 -0
- package/dist/types/host/router.d.ts +12 -0
- package/dist/types/host/testing.d.ts +41 -0
- package/dist/types/host/types.d.ts +148 -0
- package/dist/types/host/utils.d.ts +20 -0
- package/dist/types/href-client.d.ts +214 -0
- package/dist/types/index.d.ts +113 -0
- package/dist/types/index.rsc.d.ts +52 -0
- package/dist/types/internal-debug.d.ts +1 -0
- package/dist/types/loader-redirect.d.ts +18 -0
- package/dist/types/loader-store.d.ts +193 -0
- package/dist/types/loader.d.ts +18 -0
- package/dist/types/loader.rsc.d.ts +18 -0
- package/dist/types/missing-id-error.d.ts +1 -0
- package/dist/types/outlet-context.d.ts +24 -0
- package/dist/types/outlet-provider.d.ts +14 -0
- package/dist/types/prerender/build-shell-capture.d.ts +104 -0
- package/dist/types/prerender/param-hash.d.ts +6 -0
- package/dist/types/prerender/shell-manifest-key.d.ts +18 -0
- package/dist/types/prerender/store.d.ts +63 -0
- package/dist/types/prerender.d.ts +292 -0
- package/dist/types/redirect-origin.d.ts +67 -0
- package/dist/types/regex-escape.d.ts +6 -0
- package/dist/types/render-error-thrower.d.ts +13 -0
- package/dist/types/response-utils.d.ts +35 -0
- package/dist/types/reverse.d.ts +206 -0
- package/dist/types/root-error-boundary.d.ts +32 -0
- package/dist/types/route-content-wrapper.d.ts +81 -0
- package/dist/types/route-definition/dsl-helpers.d.ts +130 -0
- package/dist/types/route-definition/helper-factories.d.ts +22 -0
- package/dist/types/route-definition/helpers-types.d.ts +393 -0
- package/dist/types/route-definition/index.d.ts +7 -0
- package/dist/types/route-definition/redirect.d.ts +48 -0
- package/dist/types/route-definition/resolve-handler-use.d.ts +19 -0
- package/dist/types/route-definition/use-item-types.d.ts +1 -0
- package/dist/types/route-definition.d.ts +1 -0
- package/dist/types/route-map-builder.d.ts +102 -0
- package/dist/types/route-name.d.ts +27 -0
- package/dist/types/route-types.d.ts +172 -0
- package/dist/types/router/basename.d.ts +10 -0
- package/dist/types/router/content-negotiation.d.ts +91 -0
- package/dist/types/router/debug-manifest.d.ts +7 -0
- package/dist/types/router/error-handling.d.ts +110 -0
- package/dist/types/router/find-match.d.ts +19 -0
- package/dist/types/router/handler-context.d.ts +41 -0
- package/dist/types/router/instrument.d.ts +191 -0
- package/dist/types/router/intercept-resolution.d.ts +91 -0
- package/dist/types/router/lazy-includes.d.ts +26 -0
- package/dist/types/router/loader-resolution.d.ts +85 -0
- package/dist/types/router/logging.d.ts +41 -0
- package/dist/types/router/manifest.d.ts +8 -0
- package/dist/types/router/match-api.d.ts +19 -0
- package/dist/types/router/match-context.d.ts +184 -0
- package/dist/types/router/match-handlers.d.ts +48 -0
- package/dist/types/router/match-middleware/background-revalidation.d.ts +113 -0
- package/dist/types/router/match-middleware/cache-lookup.d.ts +126 -0
- package/dist/types/router/match-middleware/cache-store.d.ts +112 -0
- package/dist/types/router/match-middleware/index.d.ts +80 -0
- package/dist/types/router/match-middleware/intercept-resolution.d.ts +116 -0
- package/dist/types/router/match-middleware/segment-resolution.d.ts +94 -0
- package/dist/types/router/match-pipelines.d.ts +103 -0
- package/dist/types/router/match-result.d.ts +114 -0
- package/dist/types/router/metrics.d.ts +6 -0
- package/dist/types/router/middleware-types.d.ts +74 -0
- package/dist/types/router/middleware.d.ts +116 -0
- package/dist/types/router/navigation-snapshot.d.ts +51 -0
- package/dist/types/router/params-util.d.ts +8 -0
- package/dist/types/router/parse-pattern.d.ts +38 -0
- package/dist/types/router/pattern-matching.d.ts +169 -0
- package/dist/types/router/prefetch-cache-ttl.d.ts +27 -0
- package/dist/types/router/prefetch-default.d.ts +28 -0
- package/dist/types/router/prefetch-limits.d.ts +20 -0
- package/dist/types/router/prerender-match.d.ts +53 -0
- package/dist/types/router/preview-match.d.ts +22 -0
- package/dist/types/router/request-classification.d.ts +104 -0
- package/dist/types/router/revalidation.d.ts +64 -0
- package/dist/types/router/route-snapshot.d.ts +112 -0
- package/dist/types/router/route-trie-builder.d.ts +77 -0
- package/dist/types/router/router-context.d.ts +137 -0
- package/dist/types/router/router-interfaces.d.ts +461 -0
- package/dist/types/router/router-options.d.ts +792 -0
- package/dist/types/router/router-registry.d.ts +15 -0
- package/dist/types/router/segment-resolution/fresh.d.ts +55 -0
- package/dist/types/router/segment-resolution/helpers.d.ts +93 -0
- package/dist/types/router/segment-resolution/loader-cache.d.ts +33 -0
- package/dist/types/router/segment-resolution/loader-mask.d.ts +44 -0
- package/dist/types/router/segment-resolution/loader-snapshot.d.ts +90 -0
- package/dist/types/router/segment-resolution/mask-nested.d.ts +53 -0
- package/dist/types/router/segment-resolution/revalidation.d.ts +85 -0
- package/dist/types/router/segment-resolution/static-store.d.ts +17 -0
- package/dist/types/router/segment-resolution/streamed-handler-telemetry.d.ts +16 -0
- package/dist/types/router/segment-resolution/view-transition-default.d.ts +27 -0
- package/dist/types/router/segment-resolution.d.ts +3 -0
- package/dist/types/router/segment-wrappers.d.ts +53 -0
- package/dist/types/router/state-cookie-name.d.ts +1 -0
- package/dist/types/router/substitute-pattern-params.d.ts +23 -0
- package/dist/types/router/telemetry-otel.d.ts +113 -0
- package/dist/types/router/telemetry.d.ts +216 -0
- package/dist/types/router/timeout.d.ts +107 -0
- package/dist/types/router/tracing.d.ts +139 -0
- package/dist/types/router/transition-when.d.ts +13 -0
- package/dist/types/router/trie-matching.d.ts +32 -0
- package/dist/types/router/types.d.ts +98 -0
- package/dist/types/router/url-params.d.ts +26 -0
- package/dist/types/router.d.ts +7 -0
- package/dist/types/rsc/capture-queue.d.ts +49 -0
- package/dist/types/rsc/full-payload.d.ts +22 -0
- package/dist/types/rsc/handler-context.d.ts +32 -0
- package/dist/types/rsc/handler.d.ts +9 -0
- package/dist/types/rsc/helpers.d.ts +127 -0
- package/dist/types/rsc/index.d.ts +17 -0
- package/dist/types/rsc/json-route-result.d.ts +20 -0
- package/dist/types/rsc/loader-fetch.d.ts +14 -0
- package/dist/types/rsc/manifest-init.d.ts +18 -0
- package/dist/types/rsc/nonce.d.ts +28 -0
- package/dist/types/rsc/origin-guard.d.ts +50 -0
- package/dist/types/rsc/progressive-enhancement.d.ts +19 -0
- package/dist/types/rsc/redirect-guard.d.ts +37 -0
- package/dist/types/rsc/render-pipeline.d.ts +148 -0
- package/dist/types/rsc/response-cache-serve.d.ts +46 -0
- package/dist/types/rsc/response-error.d.ts +19 -0
- package/dist/types/rsc/response-route-handler.d.ts +29 -0
- package/dist/types/rsc/routine-plan.d.ts +124 -0
- package/dist/types/rsc/rsc-rendering.d.ts +18 -0
- package/dist/types/rsc/runtime-warnings.d.ts +22 -0
- package/dist/types/rsc/server-action.d.ts +68 -0
- package/dist/types/rsc/shell-build-manifest.d.ts +90 -0
- package/dist/types/rsc/shell-capture-constants.d.ts +44 -0
- package/dist/types/rsc/shell-capture.d.ts +406 -0
- package/dist/types/rsc/shell-serve.d.ts +189 -0
- package/dist/types/rsc/ssr-setup.d.ts +73 -0
- package/dist/types/rsc/stream-idle.d.ts +60 -0
- package/dist/types/rsc/transition-gate.d.ts +23 -0
- package/dist/types/rsc/types.d.ts +328 -0
- package/dist/types/runtime-env.d.ts +1 -0
- package/dist/types/search-params.d.ts +125 -0
- package/dist/types/segment-content-promise.d.ts +13 -0
- package/dist/types/segment-fragments.d.ts +79 -0
- package/dist/types/segment-loader-promise.d.ts +22 -0
- package/dist/types/segment-system.d.ts +86 -0
- package/dist/types/serialize.d.ts +164 -0
- package/dist/types/server/context.d.ts +510 -0
- package/dist/types/server/cookie-parse.d.ts +10 -0
- package/dist/types/server/cookie-store.d.ts +107 -0
- package/dist/types/server/fetchable-loader-store.d.ts +20 -0
- package/dist/types/server/handle-store.d.ts +131 -0
- package/dist/types/server/loader-registry.d.ts +32 -0
- package/dist/types/server/request-context.d.ts +707 -0
- package/dist/types/server/root-layout.d.ts +3 -0
- package/dist/types/server.d.ts +16 -0
- package/dist/types/ssr/index.d.ts +233 -0
- package/dist/types/ssr/inject-rsc-eager.d.ts +3 -0
- package/dist/types/ssr/preinit-client-references.d.ts +71 -0
- package/dist/types/ssr/ssr-root.d.ts +69 -0
- package/dist/types/static-handler.d.ts +71 -0
- package/dist/types/testing/cache-status.d.ts +63 -0
- package/dist/types/testing/collect-handle.d.ts +20 -0
- package/dist/types/testing/dispatch.d.ts +127 -0
- package/dist/types/testing/dom.entry.d.ts +15 -0
- package/dist/types/testing/e2e/fixture.d.ts +37 -0
- package/dist/types/testing/e2e/index.d.ts +31 -0
- package/dist/types/testing/e2e/matchers.d.ts +17 -0
- package/dist/types/testing/e2e/page-helpers.d.ts +86 -0
- package/dist/types/testing/e2e/parity.d.ts +111 -0
- package/dist/types/testing/e2e/server.d.ts +35 -0
- package/dist/types/testing/flight-matchers.d.ts +55 -0
- package/dist/types/testing/flight-normalize.d.ts +1 -0
- package/dist/types/testing/flight-tree.d.ts +192 -0
- package/dist/types/testing/flight.d.ts +115 -0
- package/dist/types/testing/flight.entry.d.ts +27 -0
- package/dist/types/testing/generated-routes.d.ts +66 -0
- package/dist/types/testing/index.d.ts +54 -0
- package/dist/types/testing/internal/context.d.ts +225 -0
- package/dist/types/testing/internal/flight-client-globals.d.ts +1 -0
- package/dist/types/testing/internal/seed-vars.d.ts +30 -0
- package/dist/types/testing/render-handler.d.ts +160 -0
- package/dist/types/testing/render-route.d.ts +265 -0
- package/dist/types/testing/run-loader.d.ts +195 -0
- package/dist/types/testing/run-middleware.d.ts +132 -0
- package/dist/types/testing/run-transition-when.d.ts +78 -0
- package/dist/types/testing/shell-status.d.ts +81 -0
- package/dist/types/testing/vitest-stubs/cloudflare-email.d.ts +6 -0
- package/dist/types/testing/vitest-stubs/cloudflare-workers.d.ts +13 -0
- package/dist/types/testing/vitest-stubs/plugin-rsc.d.ts +7 -0
- package/dist/types/testing/vitest-stubs/version.d.ts +1 -0
- package/dist/types/testing/vitest.d.ts +205 -0
- package/dist/types/theme/ThemeProvider.d.ts +13 -0
- package/dist/types/theme/ThemeScript.d.ts +45 -0
- package/dist/types/theme/constants.d.ts +39 -0
- package/dist/types/theme/index.d.ts +29 -0
- package/dist/types/theme/theme-context.d.ts +21 -0
- package/dist/types/theme/theme-script.d.ts +26 -0
- package/dist/types/theme/types.d.ts +162 -0
- package/dist/types/theme/use-theme.d.ts +8 -0
- package/dist/types/types/boundaries.d.ts +110 -0
- package/dist/types/types/cache-types.d.ts +191 -0
- package/dist/types/types/error-types.d.ts +114 -0
- package/dist/types/types/global-namespace.d.ts +90 -0
- package/dist/types/types/handler-context.d.ts +658 -0
- package/dist/types/types/index.d.ts +11 -0
- package/dist/types/types/loader-types.d.ts +208 -0
- package/dist/types/types/request-scope.d.ts +93 -0
- package/dist/types/types/route-config.d.ts +105 -0
- package/dist/types/types/route-entry.d.ts +98 -0
- package/dist/types/types/segments.d.ts +246 -0
- package/dist/types/types.d.ts +1 -0
- package/dist/types/urls/include-helper.d.ts +17 -0
- package/dist/types/urls/include-provider.d.ts +27 -0
- package/dist/types/urls/index.d.ts +6 -0
- package/dist/types/urls/path-helper-types.d.ts +198 -0
- package/dist/types/urls/path-helper.d.ts +12 -0
- package/dist/types/urls/pattern-types.d.ts +166 -0
- package/dist/types/urls/response-types.d.ts +67 -0
- package/dist/types/urls/type-extraction.d.ts +157 -0
- package/dist/types/urls/urls-function.d.ts +24 -0
- package/dist/types/urls.d.ts +1 -0
- package/dist/types/use-loader.d.ts +150 -0
- package/dist/types/vercel/index.d.ts +10 -0
- package/dist/types/vercel/tracing.d.ts +71 -0
- package/dist/types/vite/debug.d.ts +80 -0
- package/dist/types/vite/discovery/bundle-postprocess.d.ts +12 -0
- package/dist/types/vite/discovery/client-urls-projection.d.ts +53 -0
- package/dist/types/vite/discovery/dev-prerender-cache.d.ts +65 -0
- package/dist/types/vite/discovery/discover-routers.d.ts +17 -0
- package/dist/types/vite/discovery/discovery-errors.d.ts +113 -0
- package/dist/types/vite/discovery/gate-state.d.ts +79 -0
- package/dist/types/vite/discovery/prerender-collection.d.ts +24 -0
- package/dist/types/vite/discovery/route-types-writer.d.ts +32 -0
- package/dist/types/vite/discovery/self-gen-tracking.d.ts +22 -0
- package/dist/types/vite/discovery/shell-prerender-phase.d.ts +40 -0
- package/dist/types/vite/discovery/state.d.ts +170 -0
- package/dist/types/vite/discovery/virtual-module-codegen.d.ts +15 -0
- package/dist/types/vite/encryption-key.d.ts +2 -0
- package/dist/types/vite/index.d.ts +11 -0
- package/dist/types/vite/inject-client-debug.d.ts +56 -0
- package/dist/types/vite/plugin-types.d.ts +298 -0
- package/dist/types/vite/plugins/cjs-to-esm.d.ts +6 -0
- package/dist/types/vite/plugins/client-ref-dedup.d.ts +40 -0
- package/dist/types/vite/plugins/client-ref-hashing.d.ts +35 -0
- package/dist/types/vite/plugins/cloudflare-protocol-stub.d.ts +64 -0
- package/dist/types/vite/plugins/expose-action-id.d.ts +18 -0
- package/dist/types/vite/plugins/expose-id-utils.d.ts +37 -0
- package/dist/types/vite/plugins/expose-ids/export-analysis.d.ts +19 -0
- package/dist/types/vite/plugins/expose-ids/handler-transform.d.ts +10 -0
- package/dist/types/vite/plugins/expose-ids/loader-transform.d.ts +8 -0
- package/dist/types/vite/plugins/expose-ids/router-transform.d.ts +13 -0
- package/dist/types/vite/plugins/expose-ids/types.d.ts +29 -0
- package/dist/types/vite/plugins/expose-internal-ids.d.ts +16 -0
- package/dist/types/vite/plugins/performance-tracks.d.ts +25 -0
- package/dist/types/vite/plugins/refresh-cmd.d.ts +20 -0
- package/dist/types/vite/plugins/server-ref-hashing.d.ts +24 -0
- package/dist/types/vite/plugins/server-reference-pattern.d.ts +1 -0
- package/dist/types/vite/plugins/use-cache-transform.d.ts +20 -0
- package/dist/types/vite/plugins/vercel-output.d.ts +85 -0
- package/dist/types/vite/plugins/version-injector.d.ts +21 -0
- package/dist/types/vite/plugins/version-plugin.d.ts +19 -0
- package/dist/types/vite/plugins/virtual-entries.d.ts +36 -0
- package/dist/types/vite/plugins/virtual-stub-plugin.d.ts +7 -0
- package/dist/types/vite/rango.d.ts +29 -0
- package/dist/types/vite/router-discovery.d.ts +23 -0
- package/dist/types/vite/utils/ast-handler-extract.d.ts +64 -0
- package/dist/types/vite/utils/banner.d.ts +2 -0
- package/dist/types/vite/utils/bundle-analysis.d.ts +28 -0
- package/dist/types/vite/utils/client-chunks.d.ts +55 -0
- package/dist/types/vite/utils/directive-prologue.d.ts +16 -0
- package/dist/types/vite/utils/forward-user-plugins.d.ts +37 -0
- package/dist/types/vite/utils/manifest-utils.d.ts +7 -0
- package/dist/types/vite/utils/package-resolution.d.ts +6 -0
- package/dist/types/vite/utils/prerender-utils.d.ts +32 -0
- package/dist/types/vite/utils/shared-utils.d.ts +67 -0
- package/dist/types.backup/__internal.d.ts +127 -0
- package/dist/types.backup/bin/rango.d.ts +1 -0
- package/dist/types.backup/browser/action-coordinator.d.ts +57 -0
- package/dist/types.backup/browser/action-fence.d.ts +33 -0
- package/dist/types.backup/browser/app-shell.d.ts +34 -0
- package/dist/types.backup/browser/app-version.d.ts +6 -0
- package/dist/types.backup/browser/connection-warmup.d.ts +31 -0
- package/dist/types.backup/browser/cookie-name.d.ts +66 -0
- package/dist/types.backup/browser/event-controller.d.ts +221 -0
- package/dist/types.backup/browser/history-state.d.ts +26 -0
- package/dist/types.backup/browser/index.d.ts +1 -0
- package/dist/types.backup/browser/intercept-utils.d.ts +30 -0
- package/dist/types.backup/browser/invalidate-client-cache.d.ts +17 -0
- package/dist/types.backup/browser/link-interceptor.d.ts +43 -0
- package/dist/types.backup/browser/logging.d.ts +33 -0
- package/dist/types.backup/browser/merge-segment-loaders.d.ts +38 -0
- package/dist/types.backup/browser/navigation-bridge.d.ts +27 -0
- package/dist/types.backup/browser/navigation-client.d.ts +17 -0
- package/dist/types.backup/browser/navigation-store-handle.d.ts +25 -0
- package/dist/types.backup/browser/navigation-store.d.ts +95 -0
- package/dist/types.backup/browser/navigation-transaction.d.ts +75 -0
- package/dist/types.backup/browser/network-error-handler.d.ts +35 -0
- package/dist/types.backup/browser/partial-update.d.ts +61 -0
- package/dist/types.backup/browser/prefetch/cache.d.ts +183 -0
- package/dist/types.backup/browser/prefetch/fetch.d.ts +52 -0
- package/dist/types.backup/browser/prefetch/observer.d.ts +27 -0
- package/dist/types.backup/browser/prefetch/policy.d.ts +13 -0
- package/dist/types.backup/browser/prefetch/queue.d.ts +48 -0
- package/dist/types.backup/browser/prefetch/resource-ready.d.ts +28 -0
- package/dist/types.backup/browser/rango-state.d.ts +52 -0
- package/dist/types.backup/browser/react/Link.d.ts +140 -0
- package/dist/types.backup/browser/react/NavigationProvider.d.ts +88 -0
- package/dist/types.backup/browser/react/ScrollRestoration.d.ts +78 -0
- package/dist/types.backup/browser/react/context.d.ts +54 -0
- package/dist/types.backup/browser/react/filter-segment-order.d.ts +35 -0
- package/dist/types.backup/browser/react/index.d.ts +1 -0
- package/dist/types.backup/browser/react/location-state-shared.d.ts +162 -0
- package/dist/types.backup/browser/react/location-state.d.ts +29 -0
- package/dist/types.backup/browser/react/mount-context.d.ts +23 -0
- package/dist/types.backup/browser/react/nonce-context.d.ts +14 -0
- package/dist/types.backup/browser/react/shallow-equal.d.ts +5 -0
- package/dist/types.backup/browser/react/use-action.d.ts +61 -0
- package/dist/types.backup/browser/react/use-handle.d.ts +21 -0
- package/dist/types.backup/browser/react/use-href.d.ts +32 -0
- package/dist/types.backup/browser/react/use-link-status.d.ts +36 -0
- package/dist/types.backup/browser/react/use-mount.d.ts +24 -0
- package/dist/types.backup/browser/react/use-navigation.d.ts +15 -0
- package/dist/types.backup/browser/react/use-params.d.ts +21 -0
- package/dist/types.backup/browser/react/use-pathname.d.ts +13 -0
- package/dist/types.backup/browser/react/use-reverse.d.ts +40 -0
- package/dist/types.backup/browser/react/use-router.d.ts +23 -0
- package/dist/types.backup/browser/react/use-search-params.d.ts +19 -0
- package/dist/types.backup/browser/react/use-segments.d.ts +29 -0
- package/dist/types.backup/browser/response-adapter.d.ts +58 -0
- package/dist/types.backup/browser/rsc-router.d.ts +141 -0
- package/dist/types.backup/browser/scroll-restoration.d.ts +103 -0
- package/dist/types.backup/browser/segment-reconciler.d.ts +74 -0
- package/dist/types.backup/browser/segment-structure-assert.d.ts +16 -0
- package/dist/types.backup/browser/server-action-bridge.d.ts +29 -0
- package/dist/types.backup/browser/types.d.ts +530 -0
- package/dist/types.backup/browser/validate-redirect-origin.d.ts +28 -0
- package/dist/types.backup/build/collect-fallback-refs.d.ts +5 -0
- package/dist/types.backup/build/generate-manifest.d.ts +100 -0
- package/dist/types.backup/build/generate-route-types.d.ts +8 -0
- package/dist/types.backup/build/index.d.ts +21 -0
- package/dist/types.backup/build/prefix-tree-utils.d.ts +56 -0
- package/dist/types.backup/build/route-trie.d.ts +89 -0
- package/dist/types.backup/build/route-types/ast-helpers.d.ts +3 -0
- package/dist/types.backup/build/route-types/ast-route-extraction.d.ts +13 -0
- package/dist/types.backup/build/route-types/codegen.d.ts +16 -0
- package/dist/types.backup/build/route-types/include-resolution.d.ts +74 -0
- package/dist/types.backup/build/route-types/param-extraction.d.ts +13 -0
- package/dist/types.backup/build/route-types/per-module-writer.d.ts +18 -0
- package/dist/types.backup/build/route-types/router-processing.d.ts +82 -0
- package/dist/types.backup/build/route-types/scan-filter.d.ts +17 -0
- package/dist/types.backup/build/route-types/source-scan.d.ts +13 -0
- package/dist/types.backup/build/runtime-discovery.d.ts +24 -0
- package/dist/types.backup/cache/background-task.d.ts +21 -0
- package/dist/types.backup/cache/cache-error.d.ts +71 -0
- package/dist/types.backup/cache/cache-key-utils.d.ts +35 -0
- package/dist/types.backup/cache/cache-policy.d.ts +59 -0
- package/dist/types.backup/cache/cache-runtime.d.ts +51 -0
- package/dist/types.backup/cache/cache-scope.d.ts +134 -0
- package/dist/types.backup/cache/cache-tag.d.ts +79 -0
- package/dist/types.backup/cache/cf/cf-base64.d.ts +4 -0
- package/dist/types.backup/cache/cf/cf-cache-constants.d.ts +105 -0
- package/dist/types.backup/cache/cf/cf-cache-store.d.ts +481 -0
- package/dist/types.backup/cache/cf/cf-cache-types.d.ts +300 -0
- package/dist/types.backup/cache/cf/cf-kv-utils.d.ts +22 -0
- package/dist/types.backup/cache/cf/cf-tag-marker-memo.d.ts +15 -0
- package/dist/types.backup/cache/cf/index.d.ts +3 -0
- package/dist/types.backup/cache/document-cache.d.ts +69 -0
- package/dist/types.backup/cache/handle-capture.d.ts +23 -0
- package/dist/types.backup/cache/handle-snapshot.d.ts +39 -0
- package/dist/types.backup/cache/index.d.ts +7 -0
- package/dist/types.backup/cache/memory-segment-store.d.ts +163 -0
- package/dist/types.backup/cache/profile-registry.d.ts +40 -0
- package/dist/types.backup/cache/read-through-swr.d.ts +60 -0
- package/dist/types.backup/cache/segment-codec.d.ts +78 -0
- package/dist/types.backup/cache/shell-snapshot.d.ts +162 -0
- package/dist/types.backup/cache/tag-invalidation.d.ts +74 -0
- package/dist/types.backup/cache/taint.d.ts +71 -0
- package/dist/types.backup/cache/types.d.ts +407 -0
- package/dist/types.backup/cache/vercel/index.d.ts +1 -0
- package/dist/types.backup/cache/vercel/vercel-cache-store.d.ts +267 -0
- package/dist/types.backup/client.d.ts +184 -0
- package/dist/types.backup/client.rsc.d.ts +39 -0
- package/dist/types.backup/cloudflare/index.d.ts +7 -0
- package/dist/types.backup/cloudflare/tracing.d.ts +53 -0
- package/dist/types.backup/component-utils.d.ts +46 -0
- package/dist/types.backup/components/DefaultDocument.d.ts +13 -0
- package/dist/types.backup/context-var.d.ts +84 -0
- package/dist/types.backup/debug.d.ts +57 -0
- package/dist/types.backup/decode-loader-results.d.ts +5 -0
- package/dist/types.backup/default-error-boundary.d.ts +10 -0
- package/dist/types.backup/defer.d.ts +89 -0
- package/dist/types.backup/deps/browser.d.ts +1 -0
- package/dist/types.backup/deps/html-stream-client.d.ts +1 -0
- package/dist/types.backup/deps/html-stream-server.d.ts +1 -0
- package/dist/types.backup/deps/rsc.d.ts +1 -0
- package/dist/types.backup/deps/ssr.d.ts +1 -0
- package/dist/types.backup/encode-kv.d.ts +35 -0
- package/dist/types.backup/errors.d.ts +226 -0
- package/dist/types.backup/escape-script.d.ts +44 -0
- package/dist/types.backup/handle.d.ts +93 -0
- package/dist/types.backup/handles/MetaTags.d.ts +17 -0
- package/dist/types.backup/handles/Scripts.d.ts +38 -0
- package/dist/types.backup/handles/breadcrumbs.d.ts +43 -0
- package/dist/types.backup/handles/deferred-resolution.d.ts +53 -0
- package/dist/types.backup/handles/is-thenable.d.ts +12 -0
- package/dist/types.backup/handles/meta.d.ts +43 -0
- package/dist/types.backup/handles/script.d.ts +139 -0
- package/dist/types.backup/host/cookie-handler.d.ts +8 -0
- package/dist/types.backup/host/errors.d.ts +40 -0
- package/dist/types.backup/host/index.d.ts +33 -0
- package/dist/types.backup/host/pattern-matcher.d.ts +30 -0
- package/dist/types.backup/host/router.d.ts +12 -0
- package/dist/types.backup/host/testing.d.ts +41 -0
- package/dist/types.backup/host/types.d.ts +148 -0
- package/dist/types.backup/host/utils.d.ts +20 -0
- package/dist/types.backup/href-client.d.ts +214 -0
- package/dist/types.backup/index.d.ts +112 -0
- package/dist/types.backup/index.rsc.d.ts +51 -0
- package/dist/types.backup/internal-debug.d.ts +1 -0
- package/dist/types.backup/loader-store.d.ts +193 -0
- package/dist/types.backup/loader.d.ts +18 -0
- package/dist/types.backup/loader.rsc.d.ts +18 -0
- package/dist/types.backup/missing-id-error.d.ts +1 -0
- package/dist/types.backup/outlet-context.d.ts +12 -0
- package/dist/types.backup/outlet-provider.d.ts +12 -0
- package/dist/types.backup/prerender/build-shell-capture.d.ts +104 -0
- package/dist/types.backup/prerender/param-hash.d.ts +6 -0
- package/dist/types.backup/prerender/shell-manifest-key.d.ts +18 -0
- package/dist/types.backup/prerender/store.d.ts +62 -0
- package/dist/types.backup/prerender.d.ts +292 -0
- package/dist/types.backup/redirect-origin.d.ts +55 -0
- package/dist/types.backup/regex-escape.d.ts +6 -0
- package/dist/types.backup/render-error-thrower.d.ts +13 -0
- package/dist/types.backup/response-utils.d.ts +35 -0
- package/dist/types.backup/reverse.d.ts +206 -0
- package/dist/types.backup/root-error-boundary.d.ts +32 -0
- package/dist/types.backup/route-content-wrapper.d.ts +40 -0
- package/dist/types.backup/route-definition/dsl-helpers.d.ts +130 -0
- package/dist/types.backup/route-definition/helper-factories.d.ts +22 -0
- package/dist/types.backup/route-definition/helpers-types.d.ts +392 -0
- package/dist/types.backup/route-definition/index.d.ts +7 -0
- package/dist/types.backup/route-definition/redirect.d.ts +48 -0
- package/dist/types.backup/route-definition/resolve-handler-use.d.ts +19 -0
- package/dist/types.backup/route-definition/use-item-types.d.ts +1 -0
- package/dist/types.backup/route-definition.d.ts +1 -0
- package/dist/types.backup/route-map-builder.d.ts +127 -0
- package/dist/types.backup/route-name.d.ts +27 -0
- package/dist/types.backup/route-types.d.ts +172 -0
- package/dist/types.backup/router/basename.d.ts +10 -0
- package/dist/types.backup/router/content-negotiation.d.ts +91 -0
- package/dist/types.backup/router/debug-manifest.d.ts +7 -0
- package/dist/types.backup/router/error-handling.d.ts +76 -0
- package/dist/types.backup/router/find-match.d.ts +19 -0
- package/dist/types.backup/router/handler-context.d.ts +41 -0
- package/dist/types.backup/router/instrument.d.ts +161 -0
- package/dist/types.backup/router/intercept-resolution.d.ts +79 -0
- package/dist/types.backup/router/lazy-includes.d.ts +26 -0
- package/dist/types.backup/router/loader-resolution.d.ts +63 -0
- package/dist/types.backup/router/logging.d.ts +41 -0
- package/dist/types.backup/router/manifest.d.ts +8 -0
- package/dist/types.backup/router/match-api.d.ts +19 -0
- package/dist/types.backup/router/match-context.d.ts +184 -0
- package/dist/types.backup/router/match-handlers.d.ts +49 -0
- package/dist/types.backup/router/match-middleware/background-revalidation.d.ts +113 -0
- package/dist/types.backup/router/match-middleware/cache-lookup.d.ts +113 -0
- package/dist/types.backup/router/match-middleware/cache-store.d.ts +112 -0
- package/dist/types.backup/router/match-middleware/index.d.ts +80 -0
- package/dist/types.backup/router/match-middleware/intercept-resolution.d.ts +116 -0
- package/dist/types.backup/router/match-middleware/segment-resolution.d.ts +94 -0
- package/dist/types.backup/router/match-pipelines.d.ts +103 -0
- package/dist/types.backup/router/match-result.d.ts +114 -0
- package/dist/types.backup/router/metrics.d.ts +6 -0
- package/dist/types.backup/router/middleware-types.d.ts +74 -0
- package/dist/types.backup/router/middleware.d.ts +116 -0
- package/dist/types.backup/router/navigation-snapshot.d.ts +22 -0
- package/dist/types.backup/router/params-util.d.ts +8 -0
- package/dist/types.backup/router/parse-pattern.d.ts +38 -0
- package/dist/types.backup/router/pattern-matching.d.ts +169 -0
- package/dist/types.backup/router/prefetch-cache-ttl.d.ts +27 -0
- package/dist/types.backup/router/prefetch-limits.d.ts +20 -0
- package/dist/types.backup/router/prerender-match.d.ts +50 -0
- package/dist/types.backup/router/preview-match.d.ts +22 -0
- package/dist/types.backup/router/request-classification.d.ts +104 -0
- package/dist/types.backup/router/revalidation.d.ts +57 -0
- package/dist/types.backup/router/route-snapshot.d.ts +112 -0
- package/dist/types.backup/router/router-context.d.ts +137 -0
- package/dist/types.backup/router/router-interfaces.d.ts +432 -0
- package/dist/types.backup/router/router-options.d.ts +738 -0
- package/dist/types.backup/router/router-registry.d.ts +15 -0
- package/dist/types.backup/router/segment-resolution/fresh.d.ts +55 -0
- package/dist/types.backup/router/segment-resolution/helpers.d.ts +93 -0
- package/dist/types.backup/router/segment-resolution/loader-cache.d.ts +33 -0
- package/dist/types.backup/router/segment-resolution/loader-mask.d.ts +44 -0
- package/dist/types.backup/router/segment-resolution/loader-snapshot.d.ts +90 -0
- package/dist/types.backup/router/segment-resolution/mask-nested.d.ts +53 -0
- package/dist/types.backup/router/segment-resolution/revalidation.d.ts +85 -0
- package/dist/types.backup/router/segment-resolution/static-store.d.ts +17 -0
- package/dist/types.backup/router/segment-resolution/streamed-handler-telemetry.d.ts +16 -0
- package/dist/types.backup/router/segment-resolution/view-transition-default.d.ts +28 -0
- package/dist/types.backup/router/segment-resolution.d.ts +3 -0
- package/dist/types.backup/router/segment-wrappers.d.ts +53 -0
- package/dist/types.backup/router/state-cookie-name.d.ts +1 -0
- package/dist/types.backup/router/substitute-pattern-params.d.ts +23 -0
- package/dist/types.backup/router/telemetry-otel.d.ts +113 -0
- package/dist/types.backup/router/telemetry.d.ts +215 -0
- package/dist/types.backup/router/timeout.d.ts +68 -0
- package/dist/types.backup/router/tracing.d.ts +125 -0
- package/dist/types.backup/router/trie-matching.d.ts +32 -0
- package/dist/types.backup/router/types.d.ts +98 -0
- package/dist/types.backup/router/url-params.d.ts +26 -0
- package/dist/types.backup/router.d.ts +7 -0
- package/dist/types.backup/rsc/capture-queue.d.ts +6 -0
- package/dist/types.backup/rsc/full-payload.d.ts +22 -0
- package/dist/types.backup/rsc/handler-context.d.ts +31 -0
- package/dist/types.backup/rsc/handler.d.ts +9 -0
- package/dist/types.backup/rsc/helpers.d.ts +213 -0
- package/dist/types.backup/rsc/index.d.ts +17 -0
- package/dist/types.backup/rsc/json-route-result.d.ts +20 -0
- package/dist/types.backup/rsc/loader-fetch.d.ts +14 -0
- package/dist/types.backup/rsc/manifest-init.d.ts +18 -0
- package/dist/types.backup/rsc/nonce.d.ts +28 -0
- package/dist/types.backup/rsc/origin-guard.d.ts +50 -0
- package/dist/types.backup/rsc/progressive-enhancement.d.ts +19 -0
- package/dist/types.backup/rsc/redirect-guard.d.ts +35 -0
- package/dist/types.backup/rsc/response-cache-serve.d.ts +46 -0
- package/dist/types.backup/rsc/response-error.d.ts +19 -0
- package/dist/types.backup/rsc/response-route-handler.d.ts +29 -0
- package/dist/types.backup/rsc/rsc-rendering.d.ts +23 -0
- package/dist/types.backup/rsc/runtime-warnings.d.ts +22 -0
- package/dist/types.backup/rsc/server-action.d.ts +68 -0
- package/dist/types.backup/rsc/shell-build-manifest.d.ts +84 -0
- package/dist/types.backup/rsc/shell-capture-constants.d.ts +27 -0
- package/dist/types.backup/rsc/shell-capture.d.ts +374 -0
- package/dist/types.backup/rsc/shell-serve.d.ts +136 -0
- package/dist/types.backup/rsc/ssr-setup.d.ts +48 -0
- package/dist/types.backup/rsc/transition-gate.d.ts +27 -0
- package/dist/types.backup/rsc/types.d.ts +290 -0
- package/dist/types.backup/runtime-env.d.ts +1 -0
- package/dist/types.backup/search-params.d.ts +125 -0
- package/dist/types.backup/segment-content-promise.d.ts +13 -0
- package/dist/types.backup/segment-fragments.d.ts +56 -0
- package/dist/types.backup/segment-loader-promise.d.ts +22 -0
- package/dist/types.backup/segment-system.d.ts +84 -0
- package/dist/types.backup/serialize.d.ts +164 -0
- package/dist/types.backup/server/context.d.ts +494 -0
- package/dist/types.backup/server/cookie-parse.d.ts +10 -0
- package/dist/types.backup/server/cookie-store.d.ts +107 -0
- package/dist/types.backup/server/fetchable-loader-store.d.ts +20 -0
- package/dist/types.backup/server/handle-store.d.ts +100 -0
- package/dist/types.backup/server/loader-registry.d.ts +32 -0
- package/dist/types.backup/server/request-context.d.ts +596 -0
- package/dist/types.backup/server/root-layout.d.ts +3 -0
- package/dist/types.backup/server.d.ts +15 -0
- package/dist/types.backup/ssr/index.d.ts +233 -0
- package/dist/types.backup/ssr/inject-rsc-eager.d.ts +3 -0
- package/dist/types.backup/ssr/preinit-client-references.d.ts +71 -0
- package/dist/types.backup/ssr/ssr-root.d.ts +69 -0
- package/dist/types.backup/static-handler.d.ts +57 -0
- package/dist/types.backup/testing/cache-status.d.ts +63 -0
- package/dist/types.backup/testing/collect-handle.d.ts +20 -0
- package/dist/types.backup/testing/dispatch.d.ts +123 -0
- package/dist/types.backup/testing/dom.entry.d.ts +15 -0
- package/dist/types.backup/testing/e2e/fixture.d.ts +37 -0
- package/dist/types.backup/testing/e2e/index.d.ts +30 -0
- package/dist/types.backup/testing/e2e/matchers.d.ts +17 -0
- package/dist/types.backup/testing/e2e/page-helpers.d.ts +62 -0
- package/dist/types.backup/testing/e2e/parity.d.ts +111 -0
- package/dist/types.backup/testing/e2e/server.d.ts +35 -0
- package/dist/types.backup/testing/flight-matchers.d.ts +55 -0
- package/dist/types.backup/testing/flight-normalize.d.ts +1 -0
- package/dist/types.backup/testing/flight-tree.d.ts +192 -0
- package/dist/types.backup/testing/flight.d.ts +115 -0
- package/dist/types.backup/testing/flight.entry.d.ts +27 -0
- package/dist/types.backup/testing/generated-routes.d.ts +66 -0
- package/dist/types.backup/testing/index.d.ts +52 -0
- package/dist/types.backup/testing/internal/context.d.ts +225 -0
- package/dist/types.backup/testing/internal/flight-client-globals.d.ts +1 -0
- package/dist/types.backup/testing/internal/seed-vars.d.ts +30 -0
- package/dist/types.backup/testing/render-handler.d.ts +160 -0
- package/dist/types.backup/testing/render-route.d.ts +246 -0
- package/dist/types.backup/testing/run-loader.d.ts +186 -0
- package/dist/types.backup/testing/run-middleware.d.ts +132 -0
- package/dist/types.backup/testing/run-transition-when.d.ts +77 -0
- package/dist/types.backup/testing/vitest-stubs/cloudflare-email.d.ts +6 -0
- package/dist/types.backup/testing/vitest-stubs/cloudflare-workers.d.ts +13 -0
- package/dist/types.backup/testing/vitest-stubs/plugin-rsc.d.ts +7 -0
- package/dist/types.backup/testing/vitest-stubs/version.d.ts +1 -0
- package/dist/types.backup/testing/vitest.d.ts +205 -0
- package/dist/types.backup/theme/ThemeProvider.d.ts +13 -0
- package/dist/types.backup/theme/ThemeScript.d.ts +45 -0
- package/dist/types.backup/theme/constants.d.ts +39 -0
- package/dist/types.backup/theme/index.d.ts +29 -0
- package/dist/types.backup/theme/theme-context.d.ts +21 -0
- package/dist/types.backup/theme/theme-script.d.ts +26 -0
- package/dist/types.backup/theme/types.d.ts +162 -0
- package/dist/types.backup/theme/use-theme.d.ts +8 -0
- package/dist/types.backup/types/boundaries.d.ts +93 -0
- package/dist/types.backup/types/cache-types.d.ts +191 -0
- package/dist/types.backup/types/error-types.d.ts +114 -0
- package/dist/types.backup/types/global-namespace.d.ts +90 -0
- package/dist/types.backup/types/handler-context.d.ts +658 -0
- package/dist/types.backup/types/index.d.ts +11 -0
- package/dist/types.backup/types/loader-types.d.ts +182 -0
- package/dist/types.backup/types/request-scope.d.ts +93 -0
- package/dist/types.backup/types/route-config.d.ts +105 -0
- package/dist/types.backup/types/route-entry.d.ts +95 -0
- package/dist/types.backup/types/segments.d.ts +234 -0
- package/dist/types.backup/types.d.ts +1 -0
- package/dist/types.backup/urls/include-helper.d.ts +17 -0
- package/dist/types.backup/urls/include-provider.d.ts +27 -0
- package/dist/types.backup/urls/index.d.ts +6 -0
- package/dist/types.backup/urls/path-helper-types.d.ts +197 -0
- package/dist/types.backup/urls/path-helper.d.ts +12 -0
- package/dist/types.backup/urls/pattern-types.d.ts +166 -0
- package/dist/types.backup/urls/response-types.d.ts +67 -0
- package/dist/types.backup/urls/type-extraction.d.ts +157 -0
- package/dist/types.backup/urls/urls-function.d.ts +24 -0
- package/dist/types.backup/urls.d.ts +1 -0
- package/dist/types.backup/use-loader.d.ts +150 -0
- package/dist/types.backup/vercel/index.d.ts +10 -0
- package/dist/types.backup/vercel/tracing.d.ts +70 -0
- package/dist/types.backup/vite/debug.d.ts +80 -0
- package/dist/types.backup/vite/discovery/bundle-postprocess.d.ts +12 -0
- package/dist/types.backup/vite/discovery/dev-prerender-cache.d.ts +65 -0
- package/dist/types.backup/vite/discovery/discover-routers.d.ts +17 -0
- package/dist/types.backup/vite/discovery/discovery-errors.d.ts +113 -0
- package/dist/types.backup/vite/discovery/gate-state.d.ts +79 -0
- package/dist/types.backup/vite/discovery/prerender-collection.d.ts +24 -0
- package/dist/types.backup/vite/discovery/route-types-writer.d.ts +32 -0
- package/dist/types.backup/vite/discovery/self-gen-tracking.d.ts +22 -0
- package/dist/types.backup/vite/discovery/shell-prerender-phase.d.ts +40 -0
- package/dist/types.backup/vite/discovery/state.d.ts +162 -0
- package/dist/types.backup/vite/discovery/virtual-module-codegen.d.ts +15 -0
- package/dist/types.backup/vite/index.d.ts +11 -0
- package/dist/types.backup/vite/inject-client-debug.d.ts +56 -0
- package/dist/types.backup/vite/plugin-types.d.ts +298 -0
- package/dist/types.backup/vite/plugins/cjs-to-esm.d.ts +6 -0
- package/dist/types.backup/vite/plugins/client-ref-dedup.d.ts +40 -0
- package/dist/types.backup/vite/plugins/client-ref-hashing.d.ts +35 -0
- package/dist/types.backup/vite/plugins/cloudflare-protocol-stub.d.ts +64 -0
- package/dist/types.backup/vite/plugins/expose-action-id.d.ts +18 -0
- package/dist/types.backup/vite/plugins/expose-id-utils.d.ts +37 -0
- package/dist/types.backup/vite/plugins/expose-ids/export-analysis.d.ts +19 -0
- package/dist/types.backup/vite/plugins/expose-ids/handler-transform.d.ts +10 -0
- package/dist/types.backup/vite/plugins/expose-ids/loader-transform.d.ts +8 -0
- package/dist/types.backup/vite/plugins/expose-ids/router-transform.d.ts +13 -0
- package/dist/types.backup/vite/plugins/expose-ids/types.d.ts +29 -0
- package/dist/types.backup/vite/plugins/expose-internal-ids.d.ts +6 -0
- package/dist/types.backup/vite/plugins/performance-tracks.d.ts +25 -0
- package/dist/types.backup/vite/plugins/refresh-cmd.d.ts +20 -0
- package/dist/types.backup/vite/plugins/use-cache-transform.d.ts +20 -0
- package/dist/types.backup/vite/plugins/vercel-output.d.ts +85 -0
- package/dist/types.backup/vite/plugins/version-injector.d.ts +21 -0
- package/dist/types.backup/vite/plugins/version-plugin.d.ts +19 -0
- package/dist/types.backup/vite/plugins/virtual-entries.d.ts +36 -0
- package/dist/types.backup/vite/plugins/virtual-stub-plugin.d.ts +7 -0
- package/dist/types.backup/vite/rango.d.ts +29 -0
- package/dist/types.backup/vite/router-discovery.d.ts +23 -0
- package/dist/types.backup/vite/utils/ast-handler-extract.d.ts +64 -0
- package/dist/types.backup/vite/utils/banner.d.ts +2 -0
- package/dist/types.backup/vite/utils/bundle-analysis.d.ts +28 -0
- package/dist/types.backup/vite/utils/client-chunks.d.ts +55 -0
- package/dist/types.backup/vite/utils/directive-prologue.d.ts +16 -0
- package/dist/types.backup/vite/utils/forward-user-plugins.d.ts +37 -0
- package/dist/types.backup/vite/utils/manifest-utils.d.ts +7 -0
- package/dist/types.backup/vite/utils/package-resolution.d.ts +6 -0
- package/dist/types.backup/vite/utils/prerender-utils.d.ts +32 -0
- package/dist/types.backup/vite/utils/shared-utils.d.ts +55 -0
- package/dist/vite/index.js +9695 -3592
- package/package.json +119 -39
- package/skills/api-client/SKILL.md +211 -0
- package/skills/breadcrumbs/SKILL.md +82 -5
- package/skills/bundle-analysis/SKILL.md +159 -0
- package/skills/cache-guide/SKILL.md +232 -34
- package/skills/caching/SKILL.md +375 -19
- package/skills/catalog.json +283 -0
- package/skills/cloudflare/SKILL.md +151 -0
- package/skills/cloudflare/agents/openai.yaml +4 -0
- package/skills/cloudflare/references/d1-and-local-dev.md +131 -0
- package/skills/cloudflare/references/streaming-and-deploy.md +107 -0
- package/skills/cloudflare/references/webhooks-and-crypto.md +147 -0
- package/skills/comparison/SKILL.md +50 -0
- package/skills/comparison/agents/openai.yaml +4 -0
- package/skills/comparison/references/framework-comparison.md +844 -0
- package/skills/composability/SKILL.md +124 -4
- package/skills/css/SKILL.md +76 -0
- package/skills/debug-manifest/SKILL.md +5 -11
- package/skills/defer-hydration/SKILL.md +235 -0
- package/skills/deployment-caching/SKILL.md +176 -0
- package/skills/document-cache/SKILL.md +116 -58
- package/skills/fonts/SKILL.md +1 -1
- package/skills/handler-use/SKILL.md +12 -10
- package/skills/hooks/SKILL.md +73 -699
- package/skills/hooks/data.md +273 -0
- package/skills/hooks/handle-and-actions.md +103 -0
- package/skills/hooks/navigation.md +110 -0
- package/skills/hooks/outlets.md +62 -0
- package/skills/hooks/state.md +228 -0
- package/skills/hooks/urls.md +135 -0
- package/skills/host-router/SKILL.md +129 -27
- package/skills/i18n/SKILL.md +276 -0
- package/skills/intercept/SKILL.md +75 -19
- package/skills/layout/SKILL.md +40 -19
- package/skills/links/SKILL.md +211 -17
- package/skills/loader/SKILL.md +230 -25
- package/skills/middleware/SKILL.md +58 -13
- package/skills/migrate-nextjs/SKILL.md +267 -33
- package/skills/migrate-nextjs/backend-host-swap.md +120 -0
- package/skills/migrate-react-router/SKILL.md +59 -671
- package/skills/migrate-react-router/component-migration.md +196 -0
- package/skills/migrate-react-router/data-and-actions.md +225 -0
- package/skills/migrate-react-router/route-mapping.md +271 -0
- package/skills/mime-routes/SKILL.md +55 -18
- package/skills/observability/SKILL.md +231 -0
- package/skills/parallel/SKILL.md +50 -10
- package/skills/ppr/SKILL.md +904 -0
- package/skills/prerender/SKILL.md +130 -68
- package/skills/rango/SKILL.md +321 -26
- package/skills/react-compiler/SKILL.md +168 -0
- package/skills/response-routes/SKILL.md +172 -52
- package/skills/route/SKILL.md +123 -9
- package/skills/router-setup/SKILL.md +53 -9
- package/skills/scripts/SKILL.md +179 -0
- package/skills/server-actions/SKILL.md +776 -0
- package/skills/shell-manifest/SKILL.md +185 -0
- package/skills/streams-and-websockets/SKILL.md +1 -1
- package/skills/tailwind/SKILL.md +28 -4
- package/skills/testing/SKILL.md +131 -0
- package/skills/testing/bindings.md +103 -0
- package/skills/testing/cache-prerender.md +172 -0
- package/skills/testing/client-components.md +131 -0
- package/skills/testing/e2e-parity.md +125 -0
- package/skills/testing/flight.md +91 -0
- package/skills/testing/handles.md +131 -0
- package/skills/testing/loader.md +128 -0
- package/skills/testing/middleware.md +99 -0
- package/skills/testing/render-handler.md +122 -0
- package/skills/testing/response-routes.md +95 -0
- package/skills/testing/reverse-and-types.md +85 -0
- package/skills/testing/server-actions.md +107 -0
- package/skills/testing/server-tree.md +128 -0
- package/skills/testing/setup.md +123 -0
- package/skills/theme/SKILL.md +1 -1
- package/skills/typesafety/SKILL.md +45 -628
- package/skills/typesafety/env-and-bindings.md +254 -0
- package/skills/typesafety/generated-files-and-cli.md +342 -0
- package/skills/typesafety/params-and-search.md +153 -0
- package/skills/typesafety/route-types.md +213 -0
- package/skills/use-cache/SKILL.md +121 -15
- package/skills/vercel/SKILL.md +149 -0
- package/skills/view-transitions/SKILL.md +341 -0
- package/src/__augment-tests__/augment.ts +81 -0
- package/src/__augment-tests__/augmented.check.ts +116 -0
- package/src/__internal.ts +0 -65
- package/src/browser/action-coordinator.ts +53 -36
- package/src/browser/action-fence.ts +47 -0
- package/src/browser/app-shell.ts +14 -27
- package/src/browser/connection-warmup.ts +134 -0
- package/src/browser/cookie-name.ts +140 -0
- package/src/browser/dev-discovery.ts +66 -0
- package/src/browser/event-controller.ts +400 -168
- package/src/browser/history-state.ts +21 -0
- package/src/browser/index.ts +3 -3
- package/src/browser/invalidate-client-cache.ts +52 -0
- package/src/browser/link-interceptor.ts +469 -20
- package/src/browser/logging.ts +28 -0
- package/src/browser/merge-segment-loaders.ts +6 -4
- package/src/browser/navigation-bridge.ts +164 -69
- package/src/browser/navigation-client.ts +199 -96
- package/src/browser/navigation-store-handle.ts +38 -0
- package/src/browser/navigation-store.ts +165 -345
- package/src/browser/navigation-transaction.ts +9 -59
- package/src/browser/network-error-handler.ts +34 -7
- package/src/browser/notify-listeners.ts +22 -0
- package/src/browser/partial-update.ts +219 -163
- package/src/browser/prefetch/cache.ts +240 -97
- package/src/browser/prefetch/default-strategy.ts +74 -0
- package/src/browser/prefetch/fetch.ts +317 -51
- package/src/browser/prefetch/invalidation.ts +30 -0
- package/src/browser/prefetch/loader.ts +111 -0
- package/src/browser/prefetch/observer.ts +50 -22
- package/src/browser/prefetch/queue.ts +25 -7
- package/src/browser/prefetch/runtime.ts +6 -0
- package/src/browser/rango-state.ts +177 -114
- package/src/browser/react/Link.tsx +115 -75
- package/src/browser/react/NavigationProvider.tsx +194 -143
- package/src/browser/react/ScrollRestoration.tsx +10 -6
- package/src/browser/react/context.ts +4 -0
- package/src/browser/react/filter-segment-order.ts +66 -7
- package/src/browser/react/index.ts +0 -48
- package/src/browser/react/location-state-shared.ts +178 -8
- package/src/browser/react/location-state.ts +39 -14
- package/src/browser/react/use-action.ts +6 -15
- package/src/browser/react/use-handle.ts +17 -14
- package/src/browser/react/use-href.tsx +8 -1
- package/src/browser/react/use-link-status.ts +33 -8
- package/src/browser/react/use-navigation.ts +10 -5
- package/src/browser/react/use-params.ts +11 -11
- package/src/browser/react/use-reverse.ts +106 -0
- package/src/browser/react/use-router.ts +21 -6
- package/src/browser/react/use-search-params.ts +0 -5
- package/src/browser/react/use-segments.ts +11 -21
- package/src/browser/response-adapter.ts +99 -8
- package/src/browser/rsc-router.tsx +230 -42
- package/src/browser/scroll-restoration.ts +37 -22
- package/src/browser/segment-reconciler.ts +31 -21
- package/src/browser/segment-structure-assert.ts +2 -2
- package/src/browser/server-action-bridge.ts +262 -65
- package/src/browser/types.ts +132 -47
- package/src/browser/validate-redirect-origin.ts +43 -16
- package/src/build/collect-fallback-refs.ts +107 -0
- package/src/build/generate-manifest.ts +213 -184
- package/src/build/generate-route-types.ts +3 -1
- package/src/build/index.ts +11 -3
- package/src/build/merge-full-manifests.ts +161 -0
- package/src/build/prefix-tree-utils.ts +123 -0
- package/src/build/route-trie.ts +43 -280
- package/src/build/route-types/ast-route-extraction.ts +15 -8
- package/src/build/route-types/codegen.ts +16 -5
- package/src/build/route-types/include-resolution.ts +513 -64
- package/src/build/route-types/param-extraction.ts +6 -3
- package/src/build/route-types/per-module-writer.ts +33 -12
- package/src/build/route-types/router-processing.ts +312 -204
- package/src/build/route-types/scan-filter.ts +1 -1
- package/src/build/route-types/source-scan.ts +216 -0
- package/src/build/runtime-discovery.ts +32 -29
- package/src/cache/cache-error.ts +104 -0
- package/src/cache/cache-exec-scope.ts +47 -0
- package/src/cache/cache-key-utils.ts +73 -15
- package/src/cache/cache-policy.ts +108 -34
- package/src/cache/cache-runtime.ts +566 -121
- package/src/cache/cache-scope.ts +383 -105
- package/src/cache/cache-tag.ts +149 -0
- package/src/cache/cf/cf-base64.ts +33 -0
- package/src/cache/cf/cf-cache-constants.ts +134 -0
- package/src/cache/cf/cf-cache-store.ts +3028 -391
- package/src/cache/cf/cf-cache-types.ts +417 -0
- package/src/cache/cf/cf-kv-utils.ts +84 -0
- package/src/cache/cf/cf-tag-marker-memo.ts +108 -0
- package/src/cache/cf/cf-zone-purge.ts +101 -0
- package/src/cache/cf/index.ts +11 -16
- package/src/cache/document-cache.ts +184 -53
- package/src/cache/handle-snapshot.ts +92 -1
- package/src/cache/index.ts +32 -20
- package/src/cache/memory-segment-store.ts +286 -37
- package/src/cache/profile-registry.ts +46 -31
- package/src/cache/read-through-swr.ts +66 -16
- package/src/cache/search-params-filter.ts +118 -0
- package/src/cache/segment-codec.ts +80 -25
- package/src/cache/shell-snapshot.ts +516 -0
- package/src/cache/tag-invalidation.ts +230 -0
- package/src/cache/taint.ts +28 -9
- package/src/cache/types.ts +323 -100
- package/src/cache/vercel/index.ts +11 -0
- package/src/cache/vercel/vercel-cache-store.ts +1264 -0
- package/src/client-urls/client-root.tsx +161 -0
- package/src/client-urls/client-urls.ts +665 -0
- package/src/client-urls/navigation.ts +237 -0
- package/src/client-urls/revalidation-protocol.ts +56 -0
- package/src/client-urls/server-projection.ts +563 -0
- package/src/client-urls/types.ts +178 -0
- package/src/client.rsc.tsx +48 -21
- package/src/client.tsx +77 -67
- package/src/cloudflare/index.ts +11 -0
- package/src/cloudflare/tracing.ts +112 -0
- package/src/component-utils.ts +19 -0
- package/src/components/DefaultDocument.tsx +8 -2
- package/src/context-var.ts +18 -6
- package/src/decode-loader-results.ts +160 -0
- package/src/defer.ts +185 -0
- package/src/deps/ssr.ts +4 -2
- package/src/dev-discovery-protocol.ts +11 -0
- package/src/encode-kv.ts +49 -0
- package/src/errors.ts +44 -4
- package/src/escape-script.ts +52 -0
- package/src/handle.ts +67 -37
- package/src/handles/MetaTags.tsx +24 -53
- package/src/handles/Scripts.tsx +183 -0
- package/src/handles/breadcrumbs.ts +35 -8
- package/src/handles/deferred-resolution.ts +134 -0
- package/src/handles/is-thenable.ts +16 -0
- package/src/handles/meta.ts +14 -40
- package/src/handles/script.ts +244 -0
- package/src/host/cookie-handler.ts +9 -60
- package/src/host/errors.ts +13 -22
- package/src/host/index.ts +9 -2
- package/src/host/pattern-matcher.ts +23 -52
- package/src/host/router.ts +107 -99
- package/src/host/testing.ts +40 -27
- package/src/host/types.ts +37 -4
- package/src/host/utils.ts +1 -1
- package/src/href-client.ts +137 -22
- package/src/index.rsc.ts +105 -12
- package/src/index.ts +102 -14
- package/src/internal-debug.ts +11 -10
- package/src/loader-redirect.tsx +47 -0
- package/src/loader-store.ts +500 -0
- package/src/loader.rsc.ts +20 -13
- package/src/loader.ts +12 -11
- package/src/missing-id-error.ts +68 -0
- package/src/outlet-context.ts +12 -0
- package/src/outlet-provider.tsx +16 -6
- package/src/prerender/build-shell-capture.ts +453 -0
- package/src/prerender/param-hash.ts +16 -16
- package/src/prerender/shell-manifest-key.ts +20 -0
- package/src/prerender/store.ts +47 -38
- package/src/prerender.ts +81 -13
- package/src/redirect-origin.ts +143 -0
- package/src/regex-escape.ts +8 -0
- package/src/render-error-thrower.tsx +20 -0
- package/src/response-utils.ts +34 -0
- package/src/reverse.ts +65 -40
- package/src/root-error-boundary.tsx +1 -19
- package/src/route-content-wrapper.tsx +112 -78
- package/src/route-definition/dsl-helpers.ts +300 -313
- package/src/route-definition/helper-factories.ts +28 -140
- package/src/route-definition/helpers-types.ts +92 -62
- package/src/route-definition/index.ts +1 -2
- package/src/route-definition/redirect.ts +44 -11
- package/src/route-definition/resolve-handler-use.ts +6 -1
- package/src/route-definition/use-item-types.ts +29 -0
- package/src/route-map-builder.ts +102 -74
- package/src/route-types.ts +19 -46
- package/src/router/basename.ts +14 -0
- package/src/router/content-negotiation.ts +120 -30
- package/src/router/error-handling.ts +110 -29
- package/src/router/find-match.ts +129 -30
- package/src/router/handler-context.ts +41 -57
- package/src/router/instrument.ts +401 -0
- package/src/router/intercept-resolution.ts +98 -21
- package/src/router/lazy-includes.ts +82 -58
- package/src/router/loader-resolution.ts +401 -85
- package/src/router/logging.ts +0 -6
- package/src/router/manifest.ts +74 -40
- package/src/router/match-api.ts +91 -55
- package/src/router/match-context.ts +0 -22
- package/src/router/match-handlers.ts +268 -171
- package/src/router/match-middleware/background-revalidation.ts +40 -24
- package/src/router/match-middleware/cache-lookup.ts +316 -302
- package/src/router/match-middleware/cache-store.ts +134 -52
- package/src/router/match-middleware/intercept-resolution.ts +0 -22
- package/src/router/match-middleware/segment-resolution.ts +0 -22
- package/src/router/match-pipelines.ts +1 -42
- package/src/router/match-result.ts +76 -79
- package/src/router/metrics.ts +17 -36
- package/src/router/middleware-types.ts +20 -110
- package/src/router/middleware.ts +275 -173
- package/src/router/navigation-snapshot.ts +51 -60
- package/src/router/params-util.ts +23 -0
- package/src/router/parse-pattern.ts +115 -0
- package/src/router/pattern-matching.ts +134 -154
- package/src/router/prefetch-cache-ttl.ts +51 -0
- package/src/router/prefetch-default.ts +59 -0
- package/src/router/prefetch-limits.ts +37 -0
- package/src/router/prerender-match.ts +159 -69
- package/src/router/preview-match.ts +6 -2
- package/src/router/request-classification.ts +50 -69
- package/src/router/revalidation.ts +146 -83
- package/src/router/route-snapshot.ts +14 -3
- package/src/router/route-trie-builder.ts +334 -0
- package/src/router/router-context.ts +6 -29
- package/src/router/router-interfaces.ts +168 -38
- package/src/router/router-options.ts +235 -11
- package/src/router/router-registry.ts +2 -5
- package/src/router/segment-resolution/fresh.ts +163 -88
- package/src/router/segment-resolution/helpers.ts +96 -18
- package/src/router/segment-resolution/loader-cache.ts +187 -39
- package/src/router/segment-resolution/loader-mask.ts +60 -0
- package/src/router/segment-resolution/loader-snapshot.ts +259 -0
- package/src/router/segment-resolution/mask-nested.ts +99 -0
- package/src/router/segment-resolution/revalidation.ts +316 -321
- package/src/router/segment-resolution/static-store.ts +55 -15
- package/src/router/segment-resolution/streamed-handler-telemetry.ts +52 -0
- package/src/router/segment-resolution/view-transition-default.ts +60 -0
- package/src/router/segment-resolution.ts +5 -1
- package/src/router/segment-wrappers.ts +6 -5
- package/src/router/state-cookie-name.ts +33 -0
- package/src/router/substitute-pattern-params.ts +75 -0
- package/src/router/telemetry-otel.ts +171 -200
- package/src/router/telemetry.ts +106 -20
- package/src/router/timeout.ts +53 -22
- package/src/router/tracing.ts +235 -0
- package/src/router/transition-when.ts +76 -0
- package/src/router/trie-matching.ts +170 -64
- package/src/router/types.ts +9 -63
- package/src/router/url-params.ts +13 -5
- package/src/router.ts +248 -77
- package/src/rsc/capture-queue.ts +218 -0
- package/src/rsc/full-payload.ts +77 -0
- package/src/rsc/handler-context.ts +4 -2
- package/src/rsc/handler.ts +562 -284
- package/src/rsc/helpers.ts +179 -9
- package/src/rsc/index.ts +2 -5
- package/src/rsc/json-route-result.ts +38 -0
- package/src/rsc/loader-fetch.ts +116 -40
- package/src/rsc/manifest-init.ts +55 -56
- package/src/rsc/nonce.ts +10 -1
- package/src/rsc/origin-guard.ts +39 -25
- package/src/rsc/progressive-enhancement.ts +377 -84
- package/src/rsc/redirect-guard.ts +102 -0
- package/src/rsc/render-pipeline.ts +611 -0
- package/src/rsc/response-cache-serve.ts +259 -0
- package/src/rsc/response-error.ts +79 -12
- package/src/rsc/response-route-handler.ts +73 -212
- package/src/rsc/routine-plan.ts +359 -0
- package/src/rsc/rsc-rendering.ts +1624 -171
- package/src/rsc/runtime-warnings.ts +23 -10
- package/src/rsc/server-action.ts +420 -139
- package/src/rsc/shell-build-manifest.ts +336 -0
- package/src/rsc/shell-capture-constants.ts +45 -0
- package/src/rsc/shell-capture.ts +2063 -0
- package/src/rsc/shell-serve.ts +337 -0
- package/src/rsc/ssr-setup.ts +111 -16
- package/src/rsc/stream-idle.ts +137 -0
- package/src/rsc/transition-gate.ts +86 -0
- package/src/rsc/types.ts +91 -5
- package/src/runtime-env.ts +18 -0
- package/src/search-params.ts +35 -30
- package/src/segment-fragments.ts +165 -0
- package/src/segment-loader-promise.ts +49 -4
- package/src/segment-system.tsx +441 -153
- package/src/serialize.ts +243 -0
- package/src/server/context.ts +416 -55
- package/src/server/cookie-parse.ts +32 -0
- package/src/server/cookie-store.ts +162 -15
- package/src/server/handle-store.ts +190 -70
- package/src/server/loader-registry.ts +33 -42
- package/src/server/request-context.ts +805 -177
- package/src/server.ts +7 -2
- package/src/ssr/index.tsx +631 -183
- package/src/ssr/inject-rsc-eager.ts +167 -0
- package/src/ssr/preinit-client-references.ts +106 -0
- package/src/ssr/ssr-root.tsx +262 -0
- package/src/static-handler.ts +28 -15
- package/src/testing/cache-status.ts +162 -0
- package/src/testing/collect-handle.ts +46 -0
- package/src/testing/dispatch.ts +951 -0
- package/src/testing/dom.entry.ts +22 -0
- package/src/testing/e2e/fixture.ts +188 -0
- package/src/testing/e2e/index.ts +147 -0
- package/src/testing/e2e/matchers.ts +35 -0
- package/src/testing/e2e/page-helpers.ts +319 -0
- package/src/testing/e2e/parity.ts +400 -0
- package/src/testing/e2e/server.ts +195 -0
- package/src/testing/flight-matchers.ts +97 -0
- package/src/testing/flight-normalize.ts +11 -0
- package/src/testing/flight-runtime.d.ts +57 -0
- package/src/testing/flight-tree.ts +682 -0
- package/src/testing/flight.entry.ts +52 -0
- package/src/testing/flight.ts +257 -0
- package/src/testing/generated-routes.ts +199 -0
- package/src/testing/index.ts +121 -0
- package/src/testing/internal/context.ts +380 -0
- package/src/testing/internal/flight-client-globals.ts +30 -0
- package/src/testing/internal/seed-vars.ts +54 -0
- package/src/testing/render-handler.ts +371 -0
- package/src/testing/render-route.tsx +667 -0
- package/src/testing/run-loader.ts +423 -0
- package/src/testing/run-middleware.ts +219 -0
- package/src/testing/run-transition-when.ts +197 -0
- package/src/testing/shell-status.ts +206 -0
- package/src/testing/vitest-stubs/cloudflare-email.ts +9 -0
- package/src/testing/vitest-stubs/cloudflare-workers.ts +21 -0
- package/src/testing/vitest-stubs/plugin-rsc.ts +16 -0
- package/src/testing/vitest-stubs/version.ts +5 -0
- package/src/testing/vitest.ts +305 -0
- package/src/theme/ThemeProvider.tsx +56 -84
- package/src/theme/ThemeScript.tsx +7 -9
- package/src/theme/constants.ts +52 -13
- package/src/theme/index.ts +0 -7
- package/src/theme/theme-context.ts +1 -5
- package/src/theme/theme-script.ts +22 -21
- package/src/theme/use-theme.ts +0 -3
- package/src/types/boundaries.ts +15 -35
- package/src/types/cache-types.ts +13 -4
- package/src/types/error-types.ts +30 -90
- package/src/types/global-namespace.ts +54 -41
- package/src/types/handler-context.ts +121 -30
- package/src/types/index.ts +3 -10
- package/src/types/loader-types.ts +38 -7
- package/src/types/request-scope.ts +8 -22
- package/src/types/route-config.ts +20 -52
- package/src/types/route-entry.ts +3 -6
- package/src/types/segments.ts +147 -14
- package/src/urls/include-helper.ts +38 -64
- package/src/urls/include-provider.ts +71 -0
- package/src/urls/index.ts +2 -11
- package/src/urls/path-helper-types.ts +76 -24
- package/src/urls/path-helper.ts +30 -110
- package/src/urls/pattern-types.ts +101 -19
- package/src/urls/response-types.ts +20 -19
- package/src/urls/type-extraction.ts +98 -154
- package/src/urls/urls-function.ts +1 -19
- package/src/use-loader.tsx +355 -109
- package/src/vercel/index.ts +11 -0
- package/src/vercel/tracing.ts +89 -0
- package/src/vite/debug.ts +102 -3
- package/src/vite/discovery/bundle-postprocess.ts +18 -14
- package/src/vite/discovery/client-urls-projection.ts +322 -0
- package/src/vite/discovery/dev-prerender-cache.ts +117 -0
- package/src/vite/discovery/discover-routers.ts +178 -151
- package/src/vite/discovery/discovery-errors.ts +255 -0
- package/src/vite/discovery/gate-state.ts +171 -0
- package/src/vite/discovery/prerender-collection.ts +125 -70
- package/src/vite/discovery/route-types-writer.ts +40 -84
- package/src/vite/discovery/self-gen-tracking.ts +27 -1
- package/src/vite/discovery/shell-prerender-phase.ts +397 -0
- package/src/vite/discovery/state.ts +104 -6
- package/src/vite/discovery/virtual-module-codegen.ts +226 -87
- package/src/vite/encryption-key.ts +29 -0
- package/src/vite/index.ts +12 -0
- package/src/vite/inject-client-debug.ts +88 -0
- package/src/vite/plugin-types.ts +243 -10
- package/src/vite/plugins/cjs-to-esm.ts +16 -19
- package/src/vite/plugins/client-ref-dedup.ts +16 -11
- package/src/vite/plugins/client-ref-hashing.ts +28 -15
- package/src/vite/plugins/cloudflare-protocol-stub.ts +1 -21
- package/src/vite/plugins/expose-action-id.ts +50 -97
- package/src/vite/plugins/expose-id-utils.ts +88 -55
- package/src/vite/plugins/expose-ids/export-analysis.ts +101 -34
- package/src/vite/plugins/expose-ids/handler-transform.ts +11 -90
- package/src/vite/plugins/expose-ids/loader-transform.ts +14 -24
- package/src/vite/plugins/expose-ids/router-transform.ts +118 -29
- package/src/vite/plugins/expose-internal-ids.ts +551 -486
- package/src/vite/plugins/performance-tracks.ts +25 -22
- package/src/vite/plugins/refresh-cmd.ts +1 -1
- package/src/vite/plugins/server-ref-hashing.ts +74 -0
- package/src/vite/plugins/server-reference-pattern.ts +10 -0
- package/src/vite/plugins/use-cache-transform.ts +73 -83
- package/src/vite/plugins/vercel-output.ts +384 -0
- package/src/vite/plugins/version-injector.ts +39 -29
- package/src/vite/plugins/version-plugin.ts +45 -40
- package/src/vite/plugins/virtual-entries.ts +193 -30
- package/src/vite/rango.ts +240 -128
- package/src/vite/router-discovery.ts +1518 -174
- package/src/vite/utils/ast-handler-extract.ts +26 -35
- package/src/vite/utils/bundle-analysis.ts +10 -15
- package/src/vite/utils/client-chunks.ts +184 -0
- package/src/vite/utils/directive-prologue.ts +40 -0
- package/src/vite/utils/forward-user-plugins.ts +171 -0
- package/src/vite/utils/manifest-utils.ts +1 -59
- package/src/vite/utils/package-resolution.ts +2 -73
- package/src/vite/utils/prerender-utils.ts +96 -49
- package/src/vite/utils/shared-utils.ts +156 -43
- package/src/browser/action-response-classifier.ts +0 -99
- package/src/browser/react/use-client-cache.ts +0 -58
- package/src/browser/shallow.ts +0 -40
- package/src/handles/index.ts +0 -7
- package/src/network-error-thrower.tsx +0 -23
- package/src/router/middleware-cookies.ts +0 -55
package/src/cache/cache-scope.ts
CHANGED
|
@@ -11,19 +11,44 @@
|
|
|
11
11
|
import type { PartialCacheOptions } from "../types.js";
|
|
12
12
|
import type { ResolvedSegment } from "../types.js";
|
|
13
13
|
import type { SegmentCacheStore, CachedEntryData } from "./types.js";
|
|
14
|
+
import { CACHE_READ_ERROR } from "./types.js";
|
|
14
15
|
import { INTERNAL_RANGO_DEBUG } from "../internal-debug.js";
|
|
15
16
|
import {
|
|
16
17
|
getRequestContext,
|
|
17
18
|
_getRequestContext,
|
|
18
19
|
} from "../server/request-context.js";
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
|
|
20
|
+
import { recordRequestTags } from "./cache-tag.js";
|
|
21
|
+
import { reportCacheError } from "./cache-error.js";
|
|
22
|
+
// segment-codec is the only module on cache-scope's import graph that eagerly
|
|
23
|
+
// pulls @vitejs/plugin-rsc (a virtual: module the plain node/vitest runner cannot
|
|
24
|
+
// resolve). It is imported LAZILY at the two call sites below (deserializeSegments
|
|
25
|
+
// in lookupRoute, serializeSegments in cacheRoute) so that requiring cache-scope —
|
|
26
|
+
// e.g. dispatch's lazy `import("../cache/cache-scope.js")` for the response-route
|
|
27
|
+
// cache path — does not crash a consumer test that never mocks plugin-rsc. Behavior
|
|
28
|
+
// is unchanged: both methods are async and already awaited the codec.
|
|
29
|
+
import {
|
|
30
|
+
captureHandles,
|
|
31
|
+
restoreHandles,
|
|
32
|
+
encodeHandles,
|
|
33
|
+
decodeHandles,
|
|
34
|
+
} from "./handle-snapshot.js";
|
|
35
|
+
import { cacheKeyBase } from "./cache-key-utils.js";
|
|
22
36
|
import {
|
|
23
37
|
DEFAULT_ROUTE_TTL,
|
|
38
|
+
isFiniteNonNegativeSeconds,
|
|
24
39
|
resolveCacheKey,
|
|
25
40
|
resolveCacheStore,
|
|
41
|
+
resolveTagsOption,
|
|
26
42
|
} from "./cache-policy.js";
|
|
43
|
+
import type { RequestContext } from "../server/request-context.js";
|
|
44
|
+
|
|
45
|
+
export function resolveCacheTags(
|
|
46
|
+
config: PartialCacheOptions | false,
|
|
47
|
+
ctx: RequestContext | undefined,
|
|
48
|
+
): string[] | undefined {
|
|
49
|
+
if (config === false) return undefined;
|
|
50
|
+
return resolveTagsOption(config.tags, ctx, "CacheScope");
|
|
51
|
+
}
|
|
27
52
|
|
|
28
53
|
function debugCacheLog(message: string): void {
|
|
29
54
|
if (INTERNAL_RANGO_DEBUG) {
|
|
@@ -31,46 +56,41 @@ function debugCacheLog(message: string): void {
|
|
|
31
56
|
}
|
|
32
57
|
}
|
|
33
58
|
|
|
34
|
-
// ============================================================================
|
|
35
|
-
// Key Generation (internal)
|
|
36
|
-
// ============================================================================
|
|
37
|
-
|
|
38
59
|
/**
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
60
|
+
* A finite, non-negative seconds value? A NaN/Infinity ttl/swr (from a bad
|
|
61
|
+
* cache() option or store defaults) flows into computeExpiration ->
|
|
62
|
+
* staleAt/expiresAt = NaN, where every `now > NaN` is false so the entry never
|
|
63
|
+
* evicts and is served fresh forever; a negative value makes every read a miss.
|
|
64
|
+
* Mirror profile-registry.ts's Number.isFinite + >= 0 check, but the callers
|
|
65
|
+
* degrade to a default (warning in dev) rather than throw — this runs on the
|
|
66
|
+
* foreground render.
|
|
44
67
|
*/
|
|
45
|
-
function
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
)
|
|
51
|
-
|
|
52
|
-
|
|
68
|
+
function isValidCacheSeconds(value: number, label: string): boolean {
|
|
69
|
+
if (isFiniteNonNegativeSeconds(value)) return true;
|
|
70
|
+
if (process.env.NODE_ENV !== "production") {
|
|
71
|
+
console.warn(
|
|
72
|
+
`[CacheScope] Invalid ${label} ${value}; falling back to default`,
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
53
77
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
78
|
+
/** Coerce a resolved ttl to a finite, non-negative number (default on invalid). */
|
|
79
|
+
function validatedTtl(value: number): number {
|
|
80
|
+
return isValidCacheSeconds(value, "ttl") ? value : DEFAULT_ROUTE_TTL;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/** Coerce a resolved swr to a finite, non-negative number, or undefined (no SWR window). */
|
|
84
|
+
function validatedSwr(value: number | undefined): number | undefined {
|
|
85
|
+
if (value === undefined) return undefined;
|
|
86
|
+
return isValidCacheSeconds(value, "swr") ? value : undefined;
|
|
58
87
|
}
|
|
59
88
|
|
|
60
|
-
/**
|
|
61
|
-
* Generate default cache key for a route request.
|
|
62
|
-
* Includes pathname, route params, and user-facing search params for
|
|
63
|
-
* correct scoping. Internal _rsc* params are excluded.
|
|
64
|
-
* Includes request type prefix since they produce different segment sets:
|
|
65
|
-
* - doc: document requests (full page load)
|
|
66
|
-
* - partial: navigation requests (client-side navigation)
|
|
67
|
-
* - intercept: intercept navigation (modal/overlay routes)
|
|
68
|
-
* @internal
|
|
69
|
-
*/
|
|
70
89
|
function getDefaultRouteCacheKey(
|
|
71
90
|
pathname: string,
|
|
72
91
|
params?: Record<string, string>,
|
|
73
92
|
isIntercept?: boolean,
|
|
93
|
+
prefixOverride?: "doc",
|
|
74
94
|
): string {
|
|
75
95
|
const ctx = getRequestContext();
|
|
76
96
|
const isPartial = ctx?.originalUrl?.searchParams.has("_rsc_partial") ?? false;
|
|
@@ -78,15 +98,30 @@ function getDefaultRouteCacheKey(
|
|
|
78
98
|
const host = ctx?.url.host ?? "localhost";
|
|
79
99
|
|
|
80
100
|
// Intercept navigations get their own cache namespace
|
|
81
|
-
const prefix = isIntercept
|
|
101
|
+
const prefix = isIntercept
|
|
102
|
+
? "intercept"
|
|
103
|
+
: (prefixOverride ?? (isPartial ? "partial" : "doc"));
|
|
82
104
|
|
|
83
|
-
return `${prefix}:${
|
|
105
|
+
return `${prefix}:${cacheKeyBase(host, pathname, searchParams, params, ctx?._searchParamsFilter)}`;
|
|
84
106
|
}
|
|
85
107
|
|
|
86
108
|
// ============================================================================
|
|
87
109
|
// CacheScope
|
|
88
110
|
// ============================================================================
|
|
89
111
|
|
|
112
|
+
const CACHE_HIT_OBSERVERS = new WeakMap<CacheScope, () => void>();
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Discriminated outcome of a route cache lookup — see
|
|
116
|
+
* {@link CacheScope.lookupRouteDetailed} for what each status licenses.
|
|
117
|
+
*/
|
|
118
|
+
export type CacheRouteLookupOutcome =
|
|
119
|
+
| {
|
|
120
|
+
status: "hit";
|
|
121
|
+
result: { segments: ResolvedSegment[]; shouldRevalidate: boolean };
|
|
122
|
+
}
|
|
123
|
+
| { status: "miss" | "bypass" | "error" };
|
|
124
|
+
|
|
90
125
|
/**
|
|
91
126
|
* CacheScope represents a cache boundary in the route tree.
|
|
92
127
|
*
|
|
@@ -113,6 +148,7 @@ export class CacheScope {
|
|
|
113
148
|
constructor(
|
|
114
149
|
config: PartialCacheOptions | false,
|
|
115
150
|
parent: CacheScope | null = null,
|
|
151
|
+
private readonly defaultKeyPrefix?: "doc",
|
|
116
152
|
) {
|
|
117
153
|
this.config = config;
|
|
118
154
|
this.parent = parent;
|
|
@@ -128,20 +164,26 @@ export class CacheScope {
|
|
|
128
164
|
}
|
|
129
165
|
|
|
130
166
|
/**
|
|
131
|
-
* Get effective TTL from config or store defaults
|
|
167
|
+
* Get effective TTL from config or store defaults.
|
|
168
|
+
*
|
|
169
|
+
* Unlike profile-registry.ts (which fails fast at config time), the render
|
|
170
|
+
* path must DEGRADE: a non-finite/negative ttl (NaN/Infinity from a bad
|
|
171
|
+
* defaults config) would make computeExpiration produce NaN deadlines so the
|
|
172
|
+
* entry never evicts, or a guaranteed miss for a negative value. Fall back to
|
|
173
|
+
* DEFAULT_ROUTE_TTL instead of throwing in the foreground render.
|
|
132
174
|
*/
|
|
133
175
|
get ttl(): number {
|
|
134
176
|
if (this.config === false) return 0;
|
|
135
177
|
|
|
136
178
|
// Explicit TTL in cache() options
|
|
137
179
|
if (this.config.ttl !== undefined) {
|
|
138
|
-
return this.config.ttl;
|
|
180
|
+
return validatedTtl(this.config.ttl);
|
|
139
181
|
}
|
|
140
182
|
|
|
141
183
|
// Fall back to store defaults (explicit store first, then app-level)
|
|
142
184
|
const store = this.getStore();
|
|
143
185
|
if (store?.defaults?.ttl !== undefined) {
|
|
144
|
-
return store.defaults.ttl;
|
|
186
|
+
return validatedTtl(store.defaults.ttl);
|
|
145
187
|
}
|
|
146
188
|
|
|
147
189
|
// Hardcoded fallback
|
|
@@ -149,19 +191,22 @@ export class CacheScope {
|
|
|
149
191
|
}
|
|
150
192
|
|
|
151
193
|
/**
|
|
152
|
-
* Get SWR window from config or store defaults
|
|
194
|
+
* Get SWR window from config or store defaults.
|
|
195
|
+
*
|
|
196
|
+
* A non-finite/negative swr is degraded to undefined (no SWR window) rather
|
|
197
|
+
* than fed into expiry math; see the ttl getter for the rationale.
|
|
153
198
|
*/
|
|
154
199
|
get swr(): number | undefined {
|
|
155
200
|
if (this.config === false) return undefined;
|
|
156
201
|
|
|
157
202
|
// Explicit SWR in cache() options
|
|
158
203
|
if (this.config.swr !== undefined) {
|
|
159
|
-
return this.config.swr;
|
|
204
|
+
return validatedSwr(this.config.swr);
|
|
160
205
|
}
|
|
161
206
|
|
|
162
207
|
// Fall back to store defaults
|
|
163
208
|
const store = this.getStore();
|
|
164
|
-
return store?.defaults?.swr;
|
|
209
|
+
return validatedSwr(store?.defaults?.swr);
|
|
165
210
|
}
|
|
166
211
|
|
|
167
212
|
/**
|
|
@@ -182,11 +227,88 @@ export class CacheScope {
|
|
|
182
227
|
params: Record<string, string>,
|
|
183
228
|
isIntercept?: boolean,
|
|
184
229
|
): Promise<string> {
|
|
185
|
-
const defaultKey = getDefaultRouteCacheKey(
|
|
230
|
+
const defaultKey = getDefaultRouteCacheKey(
|
|
231
|
+
pathname,
|
|
232
|
+
params,
|
|
233
|
+
isIntercept,
|
|
234
|
+
this.defaultKeyPrefix,
|
|
235
|
+
);
|
|
186
236
|
const keyFn = this.config !== false ? this.config.key : undefined;
|
|
187
237
|
return resolveCacheKey(keyFn, this.getStore(), defaultKey, "CacheScope");
|
|
188
238
|
}
|
|
189
239
|
|
|
240
|
+
/**
|
|
241
|
+
* @internal Whether a cache read/write is allowed for the current request:
|
|
242
|
+
* the scope is enabled AND its `condition` (if any) returns true. "read"
|
|
243
|
+
* is consulted by the PPR navigation-replay gate BEFORE any shell-store
|
|
244
|
+
* read so a cache(false)/condition-false route reports `cache-disabled`
|
|
245
|
+
* without spending getShell I/O; "write" gates the capture's snapshot-only
|
|
246
|
+
* doc record (cache-store middleware) under the same semantics as the
|
|
247
|
+
* scope's own store write. Consumer opt-outs are absolute — the seeded
|
|
248
|
+
* fallback must never serve where the consumer refused cached serves.
|
|
249
|
+
*/
|
|
250
|
+
allowsCache(op: "read" | "write"): boolean {
|
|
251
|
+
return this.enabled && this.conditionAllows(op);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* @internal True for scopes minted from the `_shellImplicitCache` marker
|
|
256
|
+
* (createShellImplicitDocScope) — the only construction path that passes
|
|
257
|
+
* the `doc` defaultKeyPrefix; route-derived scopes (createCacheScope) never
|
|
258
|
+
* do. withCacheLookup/withCacheStore use this to tell the implicit doc
|
|
259
|
+
* scope from a route-derived scope: the two compose on the replay serve
|
|
260
|
+
* path and only the route-derived kind gets the seeded fallback /
|
|
261
|
+
* doc-record treatment.
|
|
262
|
+
*/
|
|
263
|
+
get isShellImplicitDocScope(): boolean {
|
|
264
|
+
return this.defaultKeyPrefix === "doc";
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Evaluate the cache `condition` predicate. Returns false (skip the cache
|
|
269
|
+
* operation) when the predicate returns false or throws; returns true when
|
|
270
|
+
* there is no condition or no request context to evaluate it against.
|
|
271
|
+
*/
|
|
272
|
+
/**
|
|
273
|
+
* One WRITE decision per (scope, request), memoized on the request context.
|
|
274
|
+
* A capture render has TWO writers consulting the same predicate — the
|
|
275
|
+
* explicit tier's cacheRoute and the snapshot-only doc record gate
|
|
276
|
+
* (recordShellCaptureDocRecord) — and a true→false flap between the two
|
|
277
|
+
* evaluations recorded a REPLAYABLE canonical snapshot for a render whose
|
|
278
|
+
* real write was refused. The first evaluation pins the answer for the
|
|
279
|
+
* whole render (the capture's derived context during captures). READ
|
|
280
|
+
* decisions stay per-lookup by design: pre-deciding a flappable predicate
|
|
281
|
+
* at the replay gate was the round-2 regression.
|
|
282
|
+
*/
|
|
283
|
+
private readonly writeConditionMemo = new WeakMap<RequestContext, boolean>();
|
|
284
|
+
|
|
285
|
+
private conditionAllows(op: "read" | "write"): boolean {
|
|
286
|
+
if (this.config === false || !this.config.condition) return true;
|
|
287
|
+
const requestCtx = getRequestContext();
|
|
288
|
+
if (!requestCtx) return true;
|
|
289
|
+
if (op === "write") {
|
|
290
|
+
const memoized = this.writeConditionMemo.get(requestCtx);
|
|
291
|
+
if (memoized !== undefined) return memoized;
|
|
292
|
+
}
|
|
293
|
+
let allowed: boolean;
|
|
294
|
+
try {
|
|
295
|
+
allowed = !!this.config.condition(requestCtx);
|
|
296
|
+
if (!allowed) {
|
|
297
|
+
debugCacheLog(
|
|
298
|
+
`[CacheScope] condition returned false, skipping cache ${op}`,
|
|
299
|
+
);
|
|
300
|
+
}
|
|
301
|
+
} catch (error) {
|
|
302
|
+
console.error(
|
|
303
|
+
`[CacheScope] condition function threw, skipping cache ${op}:`,
|
|
304
|
+
error,
|
|
305
|
+
);
|
|
306
|
+
allowed = false;
|
|
307
|
+
}
|
|
308
|
+
if (op === "write") this.writeConditionMemo.set(requestCtx, allowed);
|
|
309
|
+
return allowed;
|
|
310
|
+
}
|
|
311
|
+
|
|
190
312
|
/**
|
|
191
313
|
* Lookup cached segments for a route (single cache entry per request).
|
|
192
314
|
* Returns { segments, shouldRevalidate } or null if cache miss.
|
|
@@ -203,52 +325,121 @@ export class CacheScope {
|
|
|
203
325
|
segments: ResolvedSegment[];
|
|
204
326
|
shouldRevalidate: boolean;
|
|
205
327
|
} | null> {
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
if (!this.config.condition(requestCtx)) {
|
|
214
|
-
debugCacheLog(
|
|
215
|
-
`[CacheScope] condition returned false, skipping cache read`,
|
|
216
|
-
);
|
|
217
|
-
return null;
|
|
218
|
-
}
|
|
219
|
-
} catch (error) {
|
|
220
|
-
console.error(
|
|
221
|
-
`[CacheScope] condition function threw, skipping cache read:`,
|
|
222
|
-
error,
|
|
223
|
-
);
|
|
224
|
-
return null;
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
const store = this.getStore();
|
|
230
|
-
if (!store) return null;
|
|
328
|
+
const outcome = await this.lookupRouteDetailed(
|
|
329
|
+
pathname,
|
|
330
|
+
params,
|
|
331
|
+
isIntercept,
|
|
332
|
+
);
|
|
333
|
+
return outcome.status === "hit" ? outcome.result : null;
|
|
334
|
+
}
|
|
231
335
|
|
|
232
|
-
|
|
233
|
-
|
|
336
|
+
/**
|
|
337
|
+
* @internal lookupRoute with a discriminated outcome. The PPR replay
|
|
338
|
+
* composition (withCacheLookup) may substitute the seeded doc record ONLY on
|
|
339
|
+
* a true `miss` — the other non-hit outcomes must not be papered over:
|
|
340
|
+
*
|
|
341
|
+
* - `bypass`: the scope refused the read — cache(false), a false
|
|
342
|
+
* `condition()`, or no resolvable store. Consumer opt-outs are absolute;
|
|
343
|
+
* a fallback here would serve cached segments to a request the consumer
|
|
344
|
+
* said must render fresh.
|
|
345
|
+
* - `error`: a throwing consumer key()/store keyGenerator/store.get. The
|
|
346
|
+
* contract on that failure is "render uncached" (see the catch below) —
|
|
347
|
+
* falling back would serve the canonical doc record across a broken key
|
|
348
|
+
* partition, exactly the collision resolveCacheKey's no-default-fallback
|
|
349
|
+
* rule exists to prevent.
|
|
350
|
+
*
|
|
351
|
+
* A corrupt entry that was evicted reads as `miss`: the store was consulted
|
|
352
|
+
* and holds nothing servable, which is the post-eviction truth.
|
|
353
|
+
*/
|
|
354
|
+
async lookupRouteDetailed(
|
|
355
|
+
pathname: string,
|
|
356
|
+
params: Record<string, string>,
|
|
357
|
+
isIntercept?: boolean,
|
|
358
|
+
): Promise<CacheRouteLookupOutcome> {
|
|
359
|
+
if (!this.enabled) return { status: "bypass" };
|
|
360
|
+
if (!this.conditionAllows("read")) return { status: "bypass" };
|
|
234
361
|
|
|
362
|
+
const store = this.getStore();
|
|
363
|
+
if (!store) return { status: "bypass" };
|
|
364
|
+
|
|
365
|
+
// Resolve cache key INSIDE the try so a throwing consumer key() (or a
|
|
366
|
+
// store.keyGenerator) degrades to a cache miss (return null -> render
|
|
367
|
+
// uncached) instead of crashing the foreground render. resolveCacheKey
|
|
368
|
+
// itself keeps its hard-fail/no-fallback-to-default contract (a throw must
|
|
369
|
+
// not silently collide onto the default slot); the graceful degradation
|
|
370
|
+
// happens here, where a miss is a safe outcome.
|
|
371
|
+
let key: string | undefined;
|
|
235
372
|
try {
|
|
373
|
+
key = await this.resolveKey(pathname, params, isIntercept);
|
|
374
|
+
|
|
236
375
|
const result = await store.get(key);
|
|
237
376
|
|
|
377
|
+
// Built-in stores swallow backend read failures internally and signal
|
|
378
|
+
// them with CACHE_READ_ERROR — classify as `error`, not `miss`, so the
|
|
379
|
+
// replay composition renders uncached instead of substituting the
|
|
380
|
+
// seeded doc record for a tier whose backend never answered.
|
|
381
|
+
if (result === CACHE_READ_ERROR) {
|
|
382
|
+
return { status: "error" };
|
|
383
|
+
}
|
|
384
|
+
|
|
238
385
|
if (!result) {
|
|
239
386
|
debugCacheLog(`[CacheScope] MISS: ${key}`);
|
|
240
|
-
return
|
|
387
|
+
return { status: "miss" };
|
|
241
388
|
}
|
|
242
389
|
|
|
243
390
|
const { data: cached, shouldRevalidate } = result;
|
|
244
391
|
|
|
245
|
-
// Deserialize segments
|
|
246
|
-
|
|
392
|
+
// Deserialize segments. A failure means the cached segments are corrupt/
|
|
393
|
+
// partial: evict the entry (self-heal - the re-render re-caches under the
|
|
394
|
+
// same key) and report it as corruption, distinct from a transient infra
|
|
395
|
+
// error (handled by the outer catch).
|
|
396
|
+
//
|
|
397
|
+
// Shell-HIT tail (_shellFragmentPayload, issue #700): skip the decode and
|
|
398
|
+
// carry the stored fragment strings verbatim — the payload consumers
|
|
399
|
+
// expand them (segment-fragments.ts). Read off the ambient context at the
|
|
400
|
+
// same point the cache key was resolved (getDefaultRouteCacheKey), so the
|
|
401
|
+
// flag shares fate with the key: a disrupted ALS already missed the
|
|
402
|
+
// seeded record and degraded to the full tail.
|
|
403
|
+
let segments: ResolvedSegment[];
|
|
404
|
+
const ambientContext = _getRequestContext();
|
|
405
|
+
try {
|
|
406
|
+
const codec = await import("./segment-codec.js");
|
|
407
|
+
segments = ambientContext?._shellFragmentPayload
|
|
408
|
+
? await codec.fragmentSegments(cached.segments)
|
|
409
|
+
: await codec.deserializeSegments(cached.segments);
|
|
410
|
+
} catch (error) {
|
|
411
|
+
reportCacheError(
|
|
412
|
+
error,
|
|
413
|
+
"cache-corrupt",
|
|
414
|
+
`[CacheScope] ${key}: corrupt cached segments, evicting`,
|
|
415
|
+
);
|
|
416
|
+
await store
|
|
417
|
+
.delete(key)
|
|
418
|
+
.catch((e) =>
|
|
419
|
+
reportCacheError(e, "cache-delete", `[CacheScope] ${key}: evict`),
|
|
420
|
+
);
|
|
421
|
+
if (this.isShellImplicitDocScope) {
|
|
422
|
+
ambientContext?._shellImplicitCache?.onCorrupt?.();
|
|
423
|
+
}
|
|
424
|
+
return { status: "miss" };
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
// A hit serves content that was tagged at write time, so the document
|
|
428
|
+
// tag union must include this entry's tags for updateTag()/revalidateTag()
|
|
429
|
+
// to invalidate any full-page entry built on top of it. The write path
|
|
430
|
+
// records via cacheRoute (resolveCacheTags); the hit path records here.
|
|
431
|
+
recordRequestTags(cached.tags);
|
|
247
432
|
|
|
248
|
-
// Replay handle data
|
|
433
|
+
// Replay handle data. An empty string means the route pushed no handles —
|
|
434
|
+
// skip the decode entirely (the common case). Otherwise decode the
|
|
435
|
+
// Flight-encoded blob; a decode failure skips handle restore but keeps the
|
|
436
|
+
// valid cached segments.
|
|
249
437
|
const handleStore = _getRequestContext()?._handleStore;
|
|
250
|
-
if (handleStore) {
|
|
251
|
-
|
|
438
|
+
if (handleStore && cached.handles) {
|
|
439
|
+
const handlesRecord = await decodeHandles(cached.handles);
|
|
440
|
+
if (handlesRecord) {
|
|
441
|
+
restoreHandles(handlesRecord, handleStore);
|
|
442
|
+
}
|
|
252
443
|
}
|
|
253
444
|
|
|
254
445
|
if (INTERNAL_RANGO_DEBUG) {
|
|
@@ -260,13 +451,42 @@ export class CacheScope {
|
|
|
260
451
|
);
|
|
261
452
|
}
|
|
262
453
|
|
|
263
|
-
|
|
454
|
+
CACHE_HIT_OBSERVERS.get(this)?.();
|
|
455
|
+
return { status: "hit", result: { segments, shouldRevalidate } };
|
|
264
456
|
} catch (error) {
|
|
265
|
-
|
|
266
|
-
|
|
457
|
+
// Covers a store.get() failure AND a throwing consumer key()/keyGenerator
|
|
458
|
+
// (resolveKey). Either way degrade to an uncached render — reported as
|
|
459
|
+
// `error`, not `miss`, so the replay composition cannot substitute the
|
|
460
|
+
// seeded doc record for a lookup that never resolved its key partition.
|
|
461
|
+
reportCacheError(
|
|
462
|
+
error,
|
|
463
|
+
"cache-read",
|
|
464
|
+
`[CacheScope] lookup ${key ?? "(key resolution failed)"}`,
|
|
465
|
+
);
|
|
466
|
+
return { status: "error" };
|
|
267
467
|
}
|
|
268
468
|
}
|
|
269
469
|
|
|
470
|
+
/**
|
|
471
|
+
* Record this scope's segment-DSL cache({ tags }) into the request tag union
|
|
472
|
+
* synchronously, under the same gate cacheRoute() uses for a write.
|
|
473
|
+
*
|
|
474
|
+
* cacheRoute() already records these tags, but it is invoked inside
|
|
475
|
+
* requestCtx.waitUntil() by the cache-store middleware (and the proactive path
|
|
476
|
+
* re-resolves the whole tree before calling it), so its recording is deferred
|
|
477
|
+
* and RACES the document cache's post-body-drain snapshot of _requestTags. On a
|
|
478
|
+
* first-write (segment-cache miss) the document tag union could miss these
|
|
479
|
+
* tags, and updateTag()/revalidateTag() would then fail to invalidate the
|
|
480
|
+
* cached document until a later write reseeded it. Calling this synchronously
|
|
481
|
+
* in the request pipeline (before the snapshot) closes that window. Idempotent
|
|
482
|
+
* (the tag union is a Set), so the duplicate record in cacheRoute is harmless.
|
|
483
|
+
*/
|
|
484
|
+
recordTags(requestCtx: RequestContext | undefined): void {
|
|
485
|
+
if (!this.enabled) return;
|
|
486
|
+
if (!this.conditionAllows("write")) return;
|
|
487
|
+
recordRequestTags(resolveCacheTags(this.config, requestCtx), requestCtx);
|
|
488
|
+
}
|
|
489
|
+
|
|
270
490
|
/**
|
|
271
491
|
* Cache all segments for a route (non-blocking via waitUntil)
|
|
272
492
|
* Single cache entry per route request.
|
|
@@ -284,27 +504,7 @@ export class CacheScope {
|
|
|
284
504
|
isIntercept?: boolean,
|
|
285
505
|
): Promise<void> {
|
|
286
506
|
if (!this.enabled || segments.length === 0) return;
|
|
287
|
-
|
|
288
|
-
// Evaluate condition — skip cache write when condition returns false
|
|
289
|
-
if (this.config !== false && this.config.condition) {
|
|
290
|
-
const conditionCtx = getRequestContext();
|
|
291
|
-
if (conditionCtx) {
|
|
292
|
-
try {
|
|
293
|
-
if (!this.config.condition(conditionCtx)) {
|
|
294
|
-
debugCacheLog(
|
|
295
|
-
`[CacheScope] condition returned false, skipping cache write`,
|
|
296
|
-
);
|
|
297
|
-
return;
|
|
298
|
-
}
|
|
299
|
-
} catch (error) {
|
|
300
|
-
console.error(
|
|
301
|
-
`[CacheScope] condition function threw, skipping cache write:`,
|
|
302
|
-
error,
|
|
303
|
-
);
|
|
304
|
-
return;
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
}
|
|
507
|
+
if (!this.conditionAllows("write")) return;
|
|
308
508
|
|
|
309
509
|
const store = this.getStore();
|
|
310
510
|
if (!store) return;
|
|
@@ -325,6 +525,19 @@ export class CacheScope {
|
|
|
325
525
|
// Resolve cache key early (while request context is available)
|
|
326
526
|
const key = await this.resolveKey(pathname, params, isIntercept);
|
|
327
527
|
|
|
528
|
+
// Doc-namespaced scopes (the shell implicit scope and the capture's
|
|
529
|
+
// composed doc scope) publish the canonical document segment key so
|
|
530
|
+
// captureAndStoreShell can stamp it onto the shell entry (`docKey`).
|
|
531
|
+
// Replay eligibility then requires this exact record — "any segment
|
|
532
|
+
// record" previously counted unusable explicit-tier-keyed records too.
|
|
533
|
+
if (this.defaultKeyPrefix === "doc" && requestCtx._shellImplicitCache) {
|
|
534
|
+
requestCtx._shellImplicitCache.docKey = key;
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
// Resolve tags early (while request context is available, before waitUntil)
|
|
538
|
+
const tags = resolveCacheTags(this.config, requestCtx);
|
|
539
|
+
recordRequestTags(tags, requestCtx);
|
|
540
|
+
|
|
328
541
|
// Check if this is a partial request (navigation) vs document request
|
|
329
542
|
const isPartial = requestCtx.originalUrl.searchParams.has("_rsc_partial");
|
|
330
543
|
|
|
@@ -372,7 +585,11 @@ export class CacheScope {
|
|
|
372
585
|
}
|
|
373
586
|
|
|
374
587
|
// Collect handle data for non-loader segments only
|
|
375
|
-
const handles = captureHandles(
|
|
588
|
+
const handles = captureHandles(
|
|
589
|
+
nonLoaderSegments,
|
|
590
|
+
handleStore,
|
|
591
|
+
requestCtx._shellCaptureLoaderHandleValues,
|
|
592
|
+
);
|
|
376
593
|
|
|
377
594
|
try {
|
|
378
595
|
if (INTERNAL_RANGO_DEBUG) {
|
|
@@ -381,13 +598,20 @@ export class CacheScope {
|
|
|
381
598
|
);
|
|
382
599
|
}
|
|
383
600
|
|
|
384
|
-
// Serialize
|
|
385
|
-
|
|
601
|
+
// Serialize segments and Flight-encode handles in parallel. Handles go
|
|
602
|
+
// through the codec (not raw into the entry) so Promise/ReactNode handle
|
|
603
|
+
// values survive a JSON-serializing store — see encodeHandles.
|
|
604
|
+
const { serializeSegments } = await import("./segment-codec.js");
|
|
605
|
+
const [serializedSegments, encodedHandles] = await Promise.all([
|
|
606
|
+
serializeSegments(nonLoaderSegments),
|
|
607
|
+
encodeHandles(handles),
|
|
608
|
+
]);
|
|
386
609
|
|
|
387
610
|
const data: CachedEntryData = {
|
|
388
611
|
segments: serializedSegments,
|
|
389
|
-
handles,
|
|
612
|
+
handles: encodedHandles,
|
|
390
613
|
expiresAt: Date.now() + ttl * 1000,
|
|
614
|
+
tags,
|
|
391
615
|
};
|
|
392
616
|
|
|
393
617
|
if (INTERNAL_RANGO_DEBUG) {
|
|
@@ -405,7 +629,11 @@ export class CacheScope {
|
|
|
405
629
|
);
|
|
406
630
|
}
|
|
407
631
|
} catch (error) {
|
|
408
|
-
|
|
632
|
+
reportCacheError(
|
|
633
|
+
error,
|
|
634
|
+
"cache-write",
|
|
635
|
+
`[CacheScope] Failed to cache ${key}`,
|
|
636
|
+
);
|
|
409
637
|
}
|
|
410
638
|
});
|
|
411
639
|
}
|
|
@@ -421,3 +649,53 @@ export function createCacheScope(
|
|
|
421
649
|
if (!config) return parent; // No config, inherit parent
|
|
422
650
|
return new CacheScope(config.options, parent);
|
|
423
651
|
}
|
|
652
|
+
|
|
653
|
+
type ShellImplicitCacheMarker = NonNullable<
|
|
654
|
+
RequestContext["_shellImplicitCache"]
|
|
655
|
+
>;
|
|
656
|
+
|
|
657
|
+
/**
|
|
658
|
+
* Mint the implicit doc-level scope for a `_shellImplicitCache` marker: key
|
|
659
|
+
* resolution under the marker's `doc` namespace against the marker's store,
|
|
660
|
+
* with the marker's onHit wired as the hit observer. Shared by
|
|
661
|
+
* {@link resolveShellImplicitCacheScope} (routes that derived no scope) and
|
|
662
|
+
* the explicit-scope composition sites (capture doc record in the cache-store
|
|
663
|
+
* middleware, seeded replay fallback in withCacheLookup) so both ends of the
|
|
664
|
+
* shell contract resolve the SAME canonical document key.
|
|
665
|
+
*/
|
|
666
|
+
export function createShellImplicitDocScope(
|
|
667
|
+
marker: ShellImplicitCacheMarker,
|
|
668
|
+
): CacheScope {
|
|
669
|
+
const implicitScope = new CacheScope(
|
|
670
|
+
{ ttl: marker.ttl, swr: marker.swr, store: marker.store },
|
|
671
|
+
null,
|
|
672
|
+
marker.keyPrefix,
|
|
673
|
+
);
|
|
674
|
+
if (marker.onHit) CACHE_HIT_OBSERVERS.set(implicitScope, marker.onHit);
|
|
675
|
+
return implicitScope;
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
/**
|
|
679
|
+
* Shell fast path: when the route tree derived NO cache scope and the current
|
|
680
|
+
* request context carries the `_shellImplicitCache` marker (a shell capture,
|
|
681
|
+
* an eligible HIT tail, or a normal partial navigation replay), substitute an
|
|
682
|
+
* implicit doc-level scope so withCacheLookup/withCacheStore treat the WHOLE
|
|
683
|
+
* matched route as a cache() boundary — the shell entry IS a cache() of the
|
|
684
|
+
* handler layer, with loaders as the live carve-outs
|
|
685
|
+
* (resolveFreshLoadersAndYield).
|
|
686
|
+
*
|
|
687
|
+
* An existing scope — including an explicit cache(false) opt-out — always
|
|
688
|
+
* wins HERE: the consumer's cache() semantics (their ttl/swr/store/condition)
|
|
689
|
+
* are never overridden, and cache(false) keeps the tail on the full handler
|
|
690
|
+
* re-run path. On the navigation-replay serve path the marker still composes
|
|
691
|
+
* with an explicit scope downstream (withCacheLookup's seeded fallback after
|
|
692
|
+
* an explicit-tier miss) — see `onExplicitHit` on `_shellImplicitCache`.
|
|
693
|
+
*/
|
|
694
|
+
export function resolveShellImplicitCacheScope(
|
|
695
|
+
scope: CacheScope | null,
|
|
696
|
+
): CacheScope | null {
|
|
697
|
+
if (scope) return scope;
|
|
698
|
+
const marker = getRequestContext()?._shellImplicitCache;
|
|
699
|
+
if (!marker) return null;
|
|
700
|
+
return createShellImplicitDocScope(marker);
|
|
701
|
+
}
|