@rangojs/router 0.0.0-experimental.35 → 0.0.0-experimental.358c376d
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 +11 -3
- package/README.md +320 -735
- package/dist/bin/rango.js +983 -241
- 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 +62 -0
- package/dist/types/client-urls/types.d.ts +144 -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 +404 -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 +520 -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 +717 -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 +234 -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 +203 -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 +10725 -3898
- package/dist/vite/plugins/cloudflare-protocol-loader-hook.mjs +76 -0
- package/package.json +129 -46
- package/skills/api-client/SKILL.md +211 -0
- package/skills/breadcrumbs/SKILL.md +117 -8
- package/skills/bundle-analysis/SKILL.md +159 -0
- package/skills/cache-guide/SKILL.md +255 -25
- package/skills/caching/SKILL.md +414 -17
- package/skills/catalog.json +289 -0
- package/skills/client-urls/SKILL.md +307 -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 +858 -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 +364 -0
- package/skills/hooks/SKILL.md +73 -691
- package/skills/hooks/data.md +282 -0
- package/skills/hooks/handle-and-actions.md +110 -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 +94 -18
- package/skills/layout/SKILL.md +62 -19
- package/skills/links/SKILL.md +285 -17
- package/skills/loader/SKILL.md +415 -55
- package/skills/middleware/SKILL.md +92 -16
- package/skills/migrate-nextjs/SKILL.md +852 -0
- package/skills/migrate-nextjs/backend-host-swap.md +120 -0
- package/skills/migrate-react-router/SKILL.md +189 -0
- package/skills/migrate-react-router/component-migration.md +201 -0
- package/skills/migrate-react-router/data-and-actions.md +236 -0
- package/skills/migrate-react-router/route-mapping.md +284 -0
- package/skills/mime-routes/SKILL.md +55 -18
- package/skills/observability/SKILL.md +231 -0
- package/skills/parallel/SKILL.md +245 -10
- package/skills/ppr/SKILL.md +914 -0
- package/skills/prerender/SKILL.md +243 -135
- package/skills/rango/SKILL.md +325 -24
- package/skills/react-compiler/SKILL.md +168 -0
- package/skills/response-routes/SKILL.md +180 -52
- package/skills/route/SKILL.md +181 -9
- package/skills/router-setup/SKILL.md +154 -11
- package/skills/scripts/SKILL.md +189 -0
- package/skills/server-actions/SKILL.md +776 -0
- package/skills/shell-manifest/SKILL.md +194 -0
- package/skills/streams-and-websockets/SKILL.md +283 -0
- 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 +153 -0
- package/skills/testing/loader.md +130 -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 +9 -6
- package/skills/typesafety/SKILL.md +45 -616
- 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 +1 -66
- package/src/browser/action-coordinator.ts +53 -36
- package/src/browser/action-fence.ts +47 -0
- package/src/browser/app-shell.ts +39 -0
- package/src/browser/app-version.ts +14 -0
- 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 +405 -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 +209 -40
- package/src/browser/navigation-client.ts +284 -73
- package/src/browser/navigation-store-handle.ts +38 -0
- package/src/browser/navigation-store.ts +208 -329
- package/src/browser/navigation-transaction.ts +18 -66
- package/src/browser/network-error-handler.ts +34 -7
- package/src/browser/notify-listeners.ts +22 -0
- package/src/browser/partial-update.ts +278 -126
- package/src/browser/prefetch/cache.ts +362 -51
- package/src/browser/prefetch/default-strategy.ts +74 -0
- package/src/browser/prefetch/fetch.ts +453 -40
- 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/policy.ts +6 -0
- package/src/browser/prefetch/queue.ts +144 -23
- package/src/browser/prefetch/resource-ready.ts +77 -0
- package/src/browser/prefetch/runtime.ts +6 -0
- package/src/browser/rango-state.ts +178 -75
- package/src/browser/react/Link.tsx +187 -75
- package/src/browser/react/NavigationProvider.tsx +249 -123
- package/src/browser/react/ScrollRestoration.tsx +10 -6
- package/src/browser/react/context.ts +11 -2
- 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 +23 -69
- 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 +32 -7
- package/src/browser/react/use-params.ts +20 -10
- package/src/browser/react/use-reverse.ts +106 -0
- package/src/browser/react/use-router.ts +47 -12
- 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 +375 -84
- package/src/browser/scroll-restoration.ts +61 -47
- package/src/browser/segment-reconciler.ts +44 -7
- package/src/browser/segment-structure-assert.ts +2 -2
- package/src/browser/server-action-bridge.ts +270 -71
- package/src/browser/types.ts +166 -37
- package/src/browser/validate-redirect-origin.ts +43 -16
- package/src/build/collect-fallback-refs.ts +107 -0
- package/src/build/generate-manifest.ts +217 -188
- package/src/build/generate-route-types.ts +6 -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 -254
- 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 +521 -65
- 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 +411 -154
- package/src/build/route-types/scan-filter.ts +9 -2
- 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 -117
- package/src/cache/cache-scope.ts +431 -112
- 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 +3250 -173
- 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 +16 -17
- package/src/cache/document-cache.ts +202 -61
- package/src/cache/handle-snapshot.ts +92 -1
- package/src/cache/index.ts +33 -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 +83 -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 +698 -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 +579 -0
- package/src/client-urls/types.ts +195 -0
- package/src/client.rsc.tsx +48 -21
- package/src/client.tsx +158 -294
- 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 +84 -2
- package/src/debug.ts +2 -2
- 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 +104 -34
- 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 +111 -13
- package/src/index.ts +151 -19
- 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 +13 -1
- 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 +52 -42
- package/src/prerender.ts +215 -86
- 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 +62 -0
- package/src/reverse.ts +65 -15
- package/src/root-error-boundary.tsx +1 -19
- package/src/route-content-wrapper.tsx +112 -78
- package/src/route-definition/dsl-helpers.ts +519 -307
- package/src/route-definition/helper-factories.ts +28 -140
- package/src/route-definition/helpers-types.ts +169 -78
- package/src/route-definition/index.ts +4 -2
- package/src/route-definition/redirect.ts +53 -12
- package/src/route-definition/resolve-handler-use.ts +160 -0
- package/src/route-definition/use-item-types.ts +29 -0
- package/src/route-map-builder.ts +102 -68
- package/src/route-types.ts +37 -46
- package/src/router/basename.ts +14 -0
- package/src/router/content-negotiation.ts +211 -22
- package/src/router/error-handling.ts +110 -29
- package/src/router/find-match.ts +130 -29
- package/src/router/handler-context.ts +105 -45
- package/src/router/instrument.ts +401 -0
- package/src/router/intercept-resolution.ts +108 -24
- package/src/router/lazy-includes.ts +90 -63
- package/src/router/loader-resolution.ts +529 -57
- package/src/router/logging.ts +5 -8
- package/src/router/manifest.ts +105 -56
- package/src/router/match-api.ts +190 -219
- package/src/router/match-context.ts +0 -22
- package/src/router/match-handlers.ts +268 -171
- package/src/router/match-middleware/background-revalidation.ts +66 -22
- package/src/router/match-middleware/cache-lookup.ts +368 -277
- package/src/router/match-middleware/cache-store.ts +175 -50
- package/src/router/match-middleware/intercept-resolution.ts +8 -28
- package/src/router/match-middleware/segment-resolution.ts +52 -18
- package/src/router/match-pipelines.ts +1 -42
- package/src/router/match-result.ts +135 -44
- package/src/router/metrics.ts +22 -36
- package/src/router/middleware-types.ts +26 -138
- package/src/router/middleware.ts +305 -177
- package/src/router/navigation-snapshot.ts +173 -0
- package/src/router/params-util.ts +23 -0
- package/src/router/parse-pattern.ts +115 -0
- package/src/router/pattern-matching.ts +181 -150
- 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 +250 -60
- package/src/router/preview-match.ts +35 -103
- package/src/router/request-classification.ts +291 -0
- package/src/router/revalidation.ts +146 -83
- package/src/router/route-snapshot.ts +256 -0
- package/src/router/route-trie-builder.ts +334 -0
- package/src/router/router-context.ts +11 -29
- package/src/router/router-interfaces.ts +199 -37
- package/src/router/router-options.ts +271 -21
- package/src/router/router-registry.ts +2 -5
- package/src/router/segment-resolution/fresh.ts +367 -78
- package/src/router/segment-resolution/helpers.ts +116 -33
- package/src/router/segment-resolution/loader-cache.ts +188 -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 +520 -385
- 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 +8 -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 +171 -59
- package/src/router/types.ts +10 -63
- package/src/router/url-params.ts +57 -0
- package/src/router.ts +301 -78
- 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 +901 -519
- package/src/rsc/helpers.ts +245 -47
- package/src/rsc/index.ts +2 -5
- package/src/rsc/json-route-result.ts +38 -0
- package/src/rsc/loader-fetch.ts +129 -33
- package/src/rsc/manifest-init.ts +55 -52
- package/src/rsc/nonce.ts +10 -1
- package/src/rsc/origin-guard.ts +39 -25
- package/src/rsc/progressive-enhancement.ts +381 -74
- 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 +80 -206
- package/src/rsc/routine-plan.ts +359 -0
- package/src/rsc/rsc-rendering.ts +1625 -156
- package/src/rsc/runtime-warnings.ts +23 -10
- package/src/rsc/server-action.ts +424 -133
- 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 +113 -18
- package/src/rsc/stream-idle.ts +137 -0
- package/src/rsc/transition-gate.ts +86 -0
- package/src/rsc/types.ts +100 -6
- package/src/runtime-env.ts +18 -0
- package/src/search-params.ts +35 -30
- package/src/segment-content-promise.ts +67 -0
- package/src/segment-fragments.ts +165 -0
- package/src/segment-loader-promise.ts +167 -0
- package/src/segment-system.tsx +507 -133
- package/src/serialize.ts +243 -0
- package/src/server/context.ts +581 -61
- package/src/server/cookie-parse.ts +32 -0
- package/src/server/cookie-store.ts +162 -15
- package/src/server/handle-store.ts +209 -70
- package/src/server/loader-registry.ts +38 -46
- package/src/server/request-context.ts +961 -186
- package/src/server.ts +7 -2
- package/src/ssr/index.tsx +631 -179
- 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 +45 -20
- 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 +17 -8
- package/src/types/error-types.ts +30 -90
- package/src/types/global-namespace.ts +54 -41
- package/src/types/handler-context.ts +244 -81
- package/src/types/index.ts +4 -10
- package/src/types/loader-types.ts +99 -15
- package/src/types/request-scope.ts +112 -0
- package/src/types/route-config.ts +20 -52
- package/src/types/route-entry.ts +22 -7
- package/src/types/segments.ts +149 -14
- package/src/urls/include-helper.ts +59 -75
- package/src/urls/include-provider.ts +71 -0
- package/src/urls/index.ts +2 -11
- package/src/urls/path-helper-types.ts +118 -26
- package/src/urls/path-helper.ts +70 -115
- package/src/urls/pattern-types.ts +113 -19
- package/src/urls/response-types.ts +25 -22
- package/src/urls/type-extraction.ts +98 -154
- package/src/urls/urls-function.ts +1 -19
- package/src/use-loader.tsx +404 -86
- package/src/vercel/index.ts +11 -0
- package/src/vercel/tracing.ts +89 -0
- package/src/vite/debug.ts +185 -0
- package/src/vite/discovery/bundle-postprocess.ts +46 -45
- 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 -147
- 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 +243 -134
- 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 +116 -11
- package/src/vite/discovery/virtual-module-codegen.ts +226 -87
- package/src/vite/encryption-key.ts +29 -0
- package/src/vite/index.ts +16 -0
- package/src/vite/inject-client-debug.ts +88 -0
- package/src/vite/plugin-types.ts +267 -62
- 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-loader-hook.d.mts +23 -0
- package/src/vite/plugins/cloudflare-protocol-loader-hook.mjs +76 -0
- package/src/vite/plugins/cloudflare-protocol-stub.ts +194 -0
- package/src/vite/plugins/expose-action-id.ts +51 -100
- package/src/vite/plugins/expose-id-utils.ts +96 -51
- package/src/vite/plugins/expose-ids/export-analysis.ts +101 -34
- package/src/vite/plugins/expose-ids/handler-transform.ts +15 -64
- 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 +599 -317
- package/src/vite/plugins/performance-tracks.ts +89 -0
- package/src/vite/plugins/refresh-cmd.ts +89 -27
- 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 +54 -37
- package/src/vite/plugins/virtual-entries.ts +193 -30
- package/src/vite/rango.ts +403 -304
- package/src/vite/router-discovery.ts +1802 -187
- package/src/vite/utils/ast-handler-extract.ts +26 -35
- package/src/vite/utils/banner.ts +4 -4
- 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 +21 -52
- package/src/vite/utils/prerender-utils.ts +123 -44
- package/src/vite/utils/shared-utils.ts +158 -44
- 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
|
@@ -10,7 +10,12 @@ import type { ReactNode } from "react";
|
|
|
10
10
|
import { invariant } from "../../errors";
|
|
11
11
|
import { revalidate } from "../loader-resolution.js";
|
|
12
12
|
import { evaluateRevalidation } from "../revalidation.js";
|
|
13
|
-
import
|
|
13
|
+
import {
|
|
14
|
+
getParallelEntries,
|
|
15
|
+
getParallelSlotEntries,
|
|
16
|
+
type EntryData,
|
|
17
|
+
type ParallelEntryData,
|
|
18
|
+
} from "../../server/context";
|
|
14
19
|
import type {
|
|
15
20
|
HandlerContext,
|
|
16
21
|
InternalHandlerContext,
|
|
@@ -28,56 +33,46 @@ import {
|
|
|
28
33
|
isTraceActive,
|
|
29
34
|
} from "../logging.js";
|
|
30
35
|
import { resolveLoaderData } from "./loader-cache.js";
|
|
36
|
+
import { entryLoadingMasksLoaders } from "./loader-mask.js";
|
|
31
37
|
import {
|
|
32
38
|
handleHandlerResult,
|
|
39
|
+
warnOnStreamedResponse,
|
|
33
40
|
tryStaticHandler,
|
|
34
41
|
tryStaticSlot,
|
|
35
42
|
resolveLayoutComponent,
|
|
36
43
|
resolveWithErrorBoundary,
|
|
44
|
+
buildLoaderErrorContext,
|
|
37
45
|
} from "./helpers.js";
|
|
46
|
+
import { applyViewTransitionDefault } from "./view-transition-default.js";
|
|
38
47
|
import { getRouterContext } from "../router-context.js";
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
48
|
+
import { observeEvent, observeHandler } from "../instrument.js";
|
|
49
|
+
import { observeStreamedHandler } from "./streamed-handler-telemetry.js";
|
|
50
|
+
import {
|
|
51
|
+
track,
|
|
52
|
+
RangoContext,
|
|
53
|
+
runInsideLoaderScope,
|
|
54
|
+
latchCachedHeaderScope,
|
|
55
|
+
latchPprHeaderScopeForEntries,
|
|
56
|
+
} from "../../server/context.js";
|
|
45
57
|
|
|
46
58
|
/**
|
|
47
|
-
*
|
|
48
|
-
*
|
|
59
|
+
* Trace a parallel slot that's being force-rendered on a full refetch (client
|
|
60
|
+
* has no cached state). User revalidate fns are bypassed in this case — see
|
|
61
|
+
* the call sites for the load-bearing rationale.
|
|
49
62
|
*/
|
|
50
|
-
function
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
segmentType: string,
|
|
54
|
-
pathname?: string,
|
|
55
|
-
routeKey?: string,
|
|
56
|
-
params?: Record<string, string>,
|
|
63
|
+
function traceFullRefetchedParallelSlot(
|
|
64
|
+
parallelId: string,
|
|
65
|
+
belongsToRoute: boolean,
|
|
57
66
|
): void {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
promise.catch((err: unknown) => {
|
|
68
|
-
const errorObj = err instanceof Error ? err : new Error(String(err));
|
|
69
|
-
safeEmit(sink, {
|
|
70
|
-
type: "handler.error",
|
|
71
|
-
timestamp: performance.now(),
|
|
72
|
-
requestId: reqId,
|
|
73
|
-
segmentId,
|
|
74
|
-
segmentType,
|
|
75
|
-
error: errorObj,
|
|
76
|
-
handledByBoundary: true,
|
|
77
|
-
pathname,
|
|
78
|
-
routeKey,
|
|
79
|
-
params,
|
|
80
|
-
});
|
|
67
|
+
if (!isTraceActive()) return;
|
|
68
|
+
pushRevalidationTraceEntry({
|
|
69
|
+
segmentId: parallelId,
|
|
70
|
+
segmentType: "parallel",
|
|
71
|
+
belongsToRoute,
|
|
72
|
+
source: "parallel",
|
|
73
|
+
defaultShouldRevalidate: true,
|
|
74
|
+
finalShouldRevalidate: true,
|
|
75
|
+
reason: "full-refetch",
|
|
81
76
|
});
|
|
82
77
|
}
|
|
83
78
|
|
|
@@ -96,23 +91,14 @@ function emitRevalidationDecision(
|
|
|
96
91
|
routeKey: string,
|
|
97
92
|
shouldRevalidate: boolean,
|
|
98
93
|
): void {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
type: "revalidation.decision",
|
|
108
|
-
timestamp: performance.now(),
|
|
109
|
-
requestId: routerCtx.requestId,
|
|
110
|
-
segmentId,
|
|
111
|
-
pathname,
|
|
112
|
-
routeKey,
|
|
113
|
-
shouldRevalidate,
|
|
114
|
-
});
|
|
115
|
-
}
|
|
94
|
+
observeEvent({
|
|
95
|
+
type: "revalidation.decision",
|
|
96
|
+
timestamp: performance.now(),
|
|
97
|
+
segmentId,
|
|
98
|
+
pathname,
|
|
99
|
+
routeKey,
|
|
100
|
+
shouldRevalidate,
|
|
101
|
+
});
|
|
116
102
|
}
|
|
117
103
|
|
|
118
104
|
// ---------------------------------------------------------------------------
|
|
@@ -143,6 +129,14 @@ export async function resolveLoadersWithRevalidation<TEnv>(
|
|
|
143
129
|
|
|
144
130
|
const shortCode = shortCodeOverride ?? entry.shortCode;
|
|
145
131
|
|
|
132
|
+
// Pin `_currentSegmentId` to the OWNING entry before the kickoffs below —
|
|
133
|
+
// createLoaderExecutor captures it synchronously for ctx.use(Handle) push
|
|
134
|
+
// attribution. Same pin as resolveLoaders (fresh.ts); this REVALIDATION
|
|
135
|
+
// funnel is the navigation/action lane's kickoff site, where nothing else
|
|
136
|
+
// assigns the id first (pushes silently vanished: an id outside
|
|
137
|
+
// matched/segmentOrder is dropped by collectHandleData).
|
|
138
|
+
(ctx as InternalHandlerContext<any, TEnv>)._currentSegmentId = shortCode;
|
|
139
|
+
|
|
146
140
|
const loaderMeta = loaderEntries.map((loaderEntry, i) => ({
|
|
147
141
|
loaderEntry,
|
|
148
142
|
loader: loaderEntry.loader,
|
|
@@ -217,6 +211,19 @@ export async function resolveLoadersWithRevalidation<TEnv>(
|
|
|
217
211
|
),
|
|
218
212
|
);
|
|
219
213
|
|
|
214
|
+
// Partial (revalidation) render path: a throwing DSL loader must still fire
|
|
215
|
+
// onError/loader.error. isPartial flags the reporting phase accordingly.
|
|
216
|
+
const errorContext = { ...buildLoaderErrorContext(ctx), isPartial: true };
|
|
217
|
+
|
|
218
|
+
// PPR lane decision, same rule as the fresh funnel (fresh.ts): an entry
|
|
219
|
+
// without renderable loading() puts its loaders on the BAKE lane. The key
|
|
220
|
+
// must thread through EVERY resolveLoaderData funnel — omitting it here made
|
|
221
|
+
// a capture-active context whole-container-mask every loader on this path
|
|
222
|
+
// (a never-settling promise for a loader that should have executed).
|
|
223
|
+
// Outside capture the key only activates the _shellLoaderSeed overlay,
|
|
224
|
+
// which document-only serveShellHit seeds — inert for partial requests.
|
|
225
|
+
const bakeLane = !entryLoadingMasksLoaders(entry.loading);
|
|
226
|
+
|
|
220
227
|
const loadersToRun = revalidationChecks.filter((c) => c.shouldRun);
|
|
221
228
|
const segments: ResolvedSegment[] = loadersToRun.map(
|
|
222
229
|
({ loaderEntry, loader, segmentId, index }) => ({
|
|
@@ -228,10 +235,18 @@ export async function resolveLoadersWithRevalidation<TEnv>(
|
|
|
228
235
|
params: ctx.params,
|
|
229
236
|
loaderId: loader.$$id,
|
|
230
237
|
loaderData: deps.wrapLoaderPromise(
|
|
231
|
-
|
|
238
|
+
runInsideLoaderScope(() =>
|
|
239
|
+
resolveLoaderData(
|
|
240
|
+
loaderEntry,
|
|
241
|
+
ctx,
|
|
242
|
+
ctx.pathname,
|
|
243
|
+
bakeLane ? segmentId : null,
|
|
244
|
+
),
|
|
245
|
+
),
|
|
232
246
|
entry,
|
|
233
247
|
segmentId,
|
|
234
248
|
ctx.pathname,
|
|
249
|
+
errorContext,
|
|
235
250
|
),
|
|
236
251
|
belongsToRoute,
|
|
237
252
|
}),
|
|
@@ -258,26 +273,98 @@ export async function resolveLoadersOnlyWithRevalidation<TEnv>(
|
|
|
258
273
|
): Promise<{ segments: ResolvedSegment[]; matchedIds: string[] }> {
|
|
259
274
|
const allLoaderSegments: ResolvedSegment[] = [];
|
|
260
275
|
const allMatchedIds: string[] = [];
|
|
276
|
+
const seenIds = new Set<string>();
|
|
277
|
+
|
|
278
|
+
// ppr header-write guard latch — see resolveAllSegments (fresh.ts).
|
|
279
|
+
latchPprHeaderScopeForEntries(entries, routeKey);
|
|
280
|
+
|
|
281
|
+
async function collectEntryLoaders(
|
|
282
|
+
entry: EntryData,
|
|
283
|
+
belongsToRoute: boolean,
|
|
284
|
+
shortCodeOverride?: string,
|
|
285
|
+
): Promise<void> {
|
|
286
|
+
// Skip if all loaders from this entry have already been resolved
|
|
287
|
+
// via a parent (e.g., cache boundary wrapping a layout with shared loaders).
|
|
288
|
+
const loaderEntries = entry.loader ?? [];
|
|
289
|
+
const sc = shortCodeOverride ?? entry.shortCode;
|
|
290
|
+
const allAlreadySeen =
|
|
291
|
+
loaderEntries.length > 0 &&
|
|
292
|
+
loaderEntries.every((le, i) =>
|
|
293
|
+
seenIds.has(`${sc}D${i}.${le.loader.$$id}`),
|
|
294
|
+
);
|
|
295
|
+
if (!allAlreadySeen) {
|
|
296
|
+
const { segments, matchedIds } = await resolveLoadersWithRevalidation(
|
|
297
|
+
entry,
|
|
298
|
+
context,
|
|
299
|
+
belongsToRoute,
|
|
300
|
+
clientSegmentIds,
|
|
301
|
+
prevParams,
|
|
302
|
+
request,
|
|
303
|
+
prevUrl,
|
|
304
|
+
nextUrl,
|
|
305
|
+
routeKey,
|
|
306
|
+
deps,
|
|
307
|
+
actionContext,
|
|
308
|
+
shortCodeOverride,
|
|
309
|
+
stale,
|
|
310
|
+
);
|
|
311
|
+
for (const seg of segments) {
|
|
312
|
+
if (!seenIds.has(seg.id)) {
|
|
313
|
+
seenIds.add(seg.id);
|
|
314
|
+
allLoaderSegments.push(seg);
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
allMatchedIds.push(...matchedIds);
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
const seenParallelEntryIds = new Set<string>();
|
|
321
|
+
for (const parallelEntry of getParallelEntries(entry.parallel)) {
|
|
322
|
+
if (seenParallelEntryIds.has(parallelEntry.id)) continue;
|
|
323
|
+
seenParallelEntryIds.add(parallelEntry.id);
|
|
324
|
+
await collectEntryLoaders(parallelEntry, belongsToRoute, entry.shortCode);
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
const childBelongsToRoute = belongsToRoute || entry.type === "route";
|
|
328
|
+
for (const layoutEntry of entry.layout) {
|
|
329
|
+
await collectEntryLoaders(layoutEntry, childBelongsToRoute);
|
|
330
|
+
// Inherit route loaders for orphan layouts with parallels.
|
|
331
|
+
// Resolve directly — do NOT re-enter collectEntryLoaders with the
|
|
332
|
+
// route entry, as that would re-iterate route.layout and loop.
|
|
333
|
+
if (
|
|
334
|
+
entry.type === "route" &&
|
|
335
|
+
entry.loader &&
|
|
336
|
+
entry.loader.length > 0 &&
|
|
337
|
+
Object.keys(layoutEntry.parallel).length > 0
|
|
338
|
+
) {
|
|
339
|
+
const inherited = await resolveLoadersWithRevalidation(
|
|
340
|
+
entry,
|
|
341
|
+
context,
|
|
342
|
+
childBelongsToRoute,
|
|
343
|
+
clientSegmentIds,
|
|
344
|
+
prevParams,
|
|
345
|
+
request,
|
|
346
|
+
prevUrl,
|
|
347
|
+
nextUrl,
|
|
348
|
+
routeKey,
|
|
349
|
+
deps,
|
|
350
|
+
actionContext,
|
|
351
|
+
layoutEntry.shortCode,
|
|
352
|
+
stale,
|
|
353
|
+
);
|
|
354
|
+
for (const seg of inherited.segments) {
|
|
355
|
+
if (!seenIds.has(seg.id)) {
|
|
356
|
+
seenIds.add(seg.id);
|
|
357
|
+
seg._inherited = true;
|
|
358
|
+
allLoaderSegments.push(seg);
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
allMatchedIds.push(...inherited.matchedIds);
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
}
|
|
261
365
|
|
|
262
366
|
for (const entry of entries) {
|
|
263
|
-
|
|
264
|
-
const { segments, matchedIds } = await resolveLoadersWithRevalidation(
|
|
265
|
-
entry,
|
|
266
|
-
context,
|
|
267
|
-
belongsToRoute,
|
|
268
|
-
clientSegmentIds,
|
|
269
|
-
prevParams,
|
|
270
|
-
request,
|
|
271
|
-
prevUrl,
|
|
272
|
-
nextUrl,
|
|
273
|
-
routeKey,
|
|
274
|
-
deps,
|
|
275
|
-
actionContext,
|
|
276
|
-
undefined, // shortCodeOverride
|
|
277
|
-
stale,
|
|
278
|
-
);
|
|
279
|
-
allLoaderSegments.push(...segments);
|
|
280
|
-
allMatchedIds.push(...matchedIds);
|
|
367
|
+
await collectEntryLoaders(entry, entry.type === "route");
|
|
281
368
|
}
|
|
282
369
|
|
|
283
370
|
return { segments: allLoaderSegments, matchedIds: allMatchedIds };
|
|
@@ -301,22 +388,20 @@ export function buildEntryRevalidateMap(
|
|
|
301
388
|
map.set(entry.shortCode, { entry, revalidate: entry.revalidate });
|
|
302
389
|
|
|
303
390
|
if (entry.type !== "parallel") {
|
|
304
|
-
for (const parallelEntry of
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
}
|
|
314
|
-
}
|
|
391
|
+
for (const { slot, entry: parallelEntry } of getParallelSlotEntries(
|
|
392
|
+
entry.parallel,
|
|
393
|
+
)) {
|
|
394
|
+
const parallelParentShortCode = parentShortCode ?? entry.shortCode;
|
|
395
|
+
const parallelId = `${parallelParentShortCode}.${slot}`;
|
|
396
|
+
map.set(parallelId, {
|
|
397
|
+
entry: parallelEntry,
|
|
398
|
+
revalidate: parallelEntry.revalidate,
|
|
399
|
+
});
|
|
315
400
|
}
|
|
316
401
|
}
|
|
317
402
|
|
|
318
403
|
for (const layoutEntry of entry.layout) {
|
|
319
|
-
processEntry(layoutEntry);
|
|
404
|
+
processEntry(layoutEntry, entry.shortCode);
|
|
320
405
|
}
|
|
321
406
|
}
|
|
322
407
|
|
|
@@ -327,6 +412,97 @@ export function buildEntryRevalidateMap(
|
|
|
327
412
|
return map;
|
|
328
413
|
}
|
|
329
414
|
|
|
415
|
+
/**
|
|
416
|
+
* Resolve the component for a single parallel slot on the revalidation path.
|
|
417
|
+
* Pure component resolution shared verbatim by
|
|
418
|
+
* resolveParallelSegmentsWithRevalidation and the orphan-inlined loop in
|
|
419
|
+
* resolveOrphanLayoutWithRevalidation: try the static slot cache, else run the
|
|
420
|
+
* slot handler (pinning _currentSegmentId to the slot id so handle pushes land
|
|
421
|
+
* in the slot's own bucket, and wrapping a streamed handler). Returns the
|
|
422
|
+
* resolved component and whether the handler actually ran. Does NOT touch the
|
|
423
|
+
* revalidate-default policy (the caller decides shouldResolve, including the
|
|
424
|
+
* orphan-vs-main defaultOverride divergence) or loader-resolution ordering.
|
|
425
|
+
*/
|
|
426
|
+
async function resolveParallelSlotComponent<TEnv>(args: {
|
|
427
|
+
shouldResolve: boolean;
|
|
428
|
+
parallelEntry: ParallelEntryData;
|
|
429
|
+
slot: string;
|
|
430
|
+
parallelId: string;
|
|
431
|
+
handler:
|
|
432
|
+
| ((ctx: HandlerContext<any, TEnv>) => ReactNode | Promise<ReactNode>)
|
|
433
|
+
| ReactNode
|
|
434
|
+
| undefined;
|
|
435
|
+
context: HandlerContext<any, TEnv>;
|
|
436
|
+
deps: SegmentResolutionDeps<TEnv>;
|
|
437
|
+
routeKey: string;
|
|
438
|
+
params: Record<string, string>;
|
|
439
|
+
}): Promise<{ component: ReactNode | undefined; handlerRan: boolean }> {
|
|
440
|
+
const {
|
|
441
|
+
shouldResolve,
|
|
442
|
+
parallelEntry,
|
|
443
|
+
slot,
|
|
444
|
+
parallelId,
|
|
445
|
+
handler,
|
|
446
|
+
context,
|
|
447
|
+
deps,
|
|
448
|
+
routeKey,
|
|
449
|
+
params,
|
|
450
|
+
} = args;
|
|
451
|
+
|
|
452
|
+
let component: ReactNode | undefined;
|
|
453
|
+
let handlerRan = false;
|
|
454
|
+
if (shouldResolve) {
|
|
455
|
+
component = await tryStaticSlot(parallelEntry, slot, parallelId);
|
|
456
|
+
// tryStaticSlot returning a value means the static cache supplied the
|
|
457
|
+
// component — handler did NOT run. handlerRan stays false.
|
|
458
|
+
}
|
|
459
|
+
if (component === undefined) {
|
|
460
|
+
const hasLoadingFallback =
|
|
461
|
+
parallelEntry.loading !== undefined && parallelEntry.loading !== false;
|
|
462
|
+
if (!shouldResolve) {
|
|
463
|
+
component = null;
|
|
464
|
+
} else if (handler === undefined) {
|
|
465
|
+
// Handler evicted (production static slot) but static lookup missed.
|
|
466
|
+
// Nothing to render — use null so the client keeps its cached version.
|
|
467
|
+
component = null;
|
|
468
|
+
} else {
|
|
469
|
+
// Slot-keyed pushes — slot owns its own bucket, parent layout owns its
|
|
470
|
+
// own. On slot-only revalidations the partial merge updates only the
|
|
471
|
+
// slot's bucket; the parent's bucket stays intact.
|
|
472
|
+
(context as InternalHandlerContext<any, TEnv>)._currentSegmentId =
|
|
473
|
+
parallelId;
|
|
474
|
+
handlerRan = true;
|
|
475
|
+
if (hasLoadingFallback) {
|
|
476
|
+
const result =
|
|
477
|
+
typeof handler === "function" ? handler(context) : handler;
|
|
478
|
+
if (result instanceof Promise) {
|
|
479
|
+
warnOnStreamedResponse(result, parallelId);
|
|
480
|
+
const tracked = deps.trackHandler(result, {
|
|
481
|
+
segmentId: parallelId,
|
|
482
|
+
segmentType: "parallel",
|
|
483
|
+
});
|
|
484
|
+
observeStreamedHandler(
|
|
485
|
+
tracked,
|
|
486
|
+
parallelId,
|
|
487
|
+
"parallel",
|
|
488
|
+
context.pathname,
|
|
489
|
+
routeKey,
|
|
490
|
+
params,
|
|
491
|
+
);
|
|
492
|
+
component = tracked as ReactNode;
|
|
493
|
+
} else {
|
|
494
|
+
component = result as ReactNode;
|
|
495
|
+
}
|
|
496
|
+
} else {
|
|
497
|
+
component =
|
|
498
|
+
typeof handler === "function" ? await handler(context) : handler;
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
return { component, handlerRan };
|
|
504
|
+
}
|
|
505
|
+
|
|
330
506
|
/**
|
|
331
507
|
* Resolve parallel segments with revalidation.
|
|
332
508
|
*/
|
|
@@ -344,11 +520,35 @@ export async function resolveParallelSegmentsWithRevalidation<TEnv>(
|
|
|
344
520
|
deps: SegmentResolutionDeps<TEnv>,
|
|
345
521
|
actionContext?: ActionContext,
|
|
346
522
|
stale?: boolean,
|
|
523
|
+
options?: {
|
|
524
|
+
/**
|
|
525
|
+
* Seed for an unknown parent-chain slot (slot not in clientSegmentIds) when
|
|
526
|
+
* there are no deciding revalidate fns. "type-derived" (default, main path):
|
|
527
|
+
* `belongsToRoute || isNewParent`. "force-render" (orphan path): always
|
|
528
|
+
* `true` — orphan parallels always belong to the route and must render
|
|
529
|
+
* unless the user opts out via revalidate(); the #482 blank-parent-chain-
|
|
530
|
+
* slot guard.
|
|
531
|
+
*/
|
|
532
|
+
parentChainDefault?: "type-derived" | "force-render";
|
|
533
|
+
/**
|
|
534
|
+
* When a slot's loaders are resolved relative to the slot segment push.
|
|
535
|
+
* "after" (default, main path) pushes the slot segment first; "before"
|
|
536
|
+
* (orphan path) resolves loaders first. This only changes the
|
|
537
|
+
* segments/matchedIds emission ORDER (the client reconciler is insensitive
|
|
538
|
+
* to it: loader sub-ids are filtered out and slots are re-grouped by parent).
|
|
539
|
+
*/
|
|
540
|
+
loaderOrder?: "after" | "before";
|
|
541
|
+
},
|
|
347
542
|
): Promise<SegmentRevalidationResult> {
|
|
348
543
|
const segments: ResolvedSegment[] = [];
|
|
349
544
|
const matchedIds: string[] = [];
|
|
545
|
+
const parentChainDefault = options?.parentChainDefault ?? "type-derived";
|
|
546
|
+
const loaderOrder = options?.loaderOrder ?? "after";
|
|
350
547
|
|
|
351
|
-
|
|
548
|
+
const resolvedParallelEntries = new Set<string>();
|
|
549
|
+
for (const { slot, entry: parallelEntry } of getParallelSlotEntries(
|
|
550
|
+
entry.parallel,
|
|
551
|
+
)) {
|
|
352
552
|
invariant(
|
|
353
553
|
parallelEntry.type === "parallel",
|
|
354
554
|
`Expected parallel entry, got: ${parallelEntry.type}`,
|
|
@@ -359,141 +559,89 @@ export async function resolveParallelSegmentsWithRevalidation<TEnv>(
|
|
|
359
559
|
| ((ctx: HandlerContext<any, TEnv>) => ReactNode | Promise<ReactNode>)
|
|
360
560
|
| ReactNode
|
|
361
561
|
>;
|
|
562
|
+
// In production, static handler bodies are evicted and the slot value
|
|
563
|
+
// may be undefined. The static store holds the pre-rendered component.
|
|
564
|
+
// We defer the handler check until after tryStaticSlot.
|
|
565
|
+
const handler = slots[slot];
|
|
362
566
|
|
|
363
|
-
|
|
364
|
-
const parallelId = `${entry.shortCode}.${slot}`;
|
|
365
|
-
|
|
366
|
-
const isFullRefetch = clientSegmentIds.size === 0;
|
|
367
|
-
// When the parent layout is new (not in client's segment set),
|
|
368
|
-
// all its parallel children must be resolved and tracked.
|
|
369
|
-
// Without this, navigating to a new layout with parallels
|
|
370
|
-
// (e.g., BlogLayout with @sidebar) from a different route
|
|
371
|
-
// would silently drop those parallel segments.
|
|
372
|
-
const isNewParent = !clientSegmentIds.has(entry.shortCode);
|
|
373
|
-
if (
|
|
374
|
-
isFullRefetch ||
|
|
375
|
-
clientSegmentIds.has(parallelId) ||
|
|
376
|
-
belongsToRoute ||
|
|
377
|
-
isNewParent
|
|
378
|
-
) {
|
|
379
|
-
matchedIds.push(parallelId);
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
const shouldResolve = await (async () => {
|
|
383
|
-
if (isFullRefetch) {
|
|
384
|
-
if (isTraceActive()) {
|
|
385
|
-
pushRevalidationTraceEntry({
|
|
386
|
-
segmentId: parallelId,
|
|
387
|
-
segmentType: "parallel",
|
|
388
|
-
belongsToRoute,
|
|
389
|
-
source: "parallel",
|
|
390
|
-
defaultShouldRevalidate: true,
|
|
391
|
-
finalShouldRevalidate: true,
|
|
392
|
-
reason: "full-refetch",
|
|
393
|
-
});
|
|
394
|
-
}
|
|
395
|
-
return true;
|
|
396
|
-
}
|
|
397
|
-
if (!clientSegmentIds.has(parallelId)) {
|
|
398
|
-
const result = belongsToRoute || isNewParent;
|
|
399
|
-
if (isTraceActive()) {
|
|
400
|
-
pushRevalidationTraceEntry({
|
|
401
|
-
segmentId: parallelId,
|
|
402
|
-
segmentType: "parallel",
|
|
403
|
-
belongsToRoute,
|
|
404
|
-
source: "parallel",
|
|
405
|
-
defaultShouldRevalidate: result,
|
|
406
|
-
finalShouldRevalidate: result,
|
|
407
|
-
reason: result ? "new-segment" : "skip-parent-chain",
|
|
408
|
-
});
|
|
409
|
-
}
|
|
410
|
-
return result;
|
|
411
|
-
}
|
|
567
|
+
const parallelId = `${entry.shortCode}.${slot}`;
|
|
412
568
|
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
namespace: parallelEntry.id,
|
|
416
|
-
type: "parallel",
|
|
417
|
-
index: 0,
|
|
418
|
-
component: null as any,
|
|
419
|
-
params,
|
|
420
|
-
slot,
|
|
421
|
-
belongsToRoute,
|
|
422
|
-
parallelName: `${parallelEntry.id}.${slot}`,
|
|
423
|
-
...(parallelEntry.mountPath
|
|
424
|
-
? { mountPath: parallelEntry.mountPath }
|
|
425
|
-
: {}),
|
|
426
|
-
};
|
|
569
|
+
const isFullRefetch = clientSegmentIds.size === 0;
|
|
570
|
+
const isNewParent = !clientSegmentIds.has(entry.shortCode);
|
|
427
571
|
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
actionContext,
|
|
442
|
-
stale,
|
|
443
|
-
traceSource: "parallel",
|
|
444
|
-
});
|
|
445
|
-
})();
|
|
446
|
-
emitRevalidationDecision(
|
|
447
|
-
parallelId,
|
|
448
|
-
context.pathname,
|
|
572
|
+
// A slot's loaders (never cached) are deduped per parallel entry and
|
|
573
|
+
// emitted either before or after the slot segment per loaderOrder.
|
|
574
|
+
const resolveSlotLoaders = async () => {
|
|
575
|
+
if (resolvedParallelEntries.has(parallelEntry.id)) return;
|
|
576
|
+
const loaderResult = await resolveLoadersWithRevalidation(
|
|
577
|
+
parallelEntry,
|
|
578
|
+
context,
|
|
579
|
+
belongsToRoute,
|
|
580
|
+
clientSegmentIds,
|
|
581
|
+
prevParams,
|
|
582
|
+
request,
|
|
583
|
+
prevUrl,
|
|
584
|
+
nextUrl,
|
|
449
585
|
routeKey,
|
|
450
|
-
|
|
586
|
+
deps,
|
|
587
|
+
actionContext,
|
|
588
|
+
entry.shortCode,
|
|
589
|
+
stale,
|
|
451
590
|
);
|
|
591
|
+
segments.push(...loaderResult.segments);
|
|
592
|
+
matchedIds.push(...loaderResult.matchedIds);
|
|
593
|
+
resolvedParallelEntries.add(parallelEntry.id);
|
|
594
|
+
};
|
|
452
595
|
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
596
|
+
if (loaderOrder === "before") {
|
|
597
|
+
await resolveSlotLoaders();
|
|
598
|
+
}
|
|
599
|
+
// Always announce the slot in matchedIds — it's unconditionally appended
|
|
600
|
+
// to `segments` below, and a segment present in segments but missing from
|
|
601
|
+
// matched lets the client prune it (then it's missing from clientSegmentIds
|
|
602
|
+
// on the next request, perpetuating the staleness).
|
|
603
|
+
matchedIds.push(parallelId);
|
|
604
|
+
|
|
605
|
+
let shouldResolve: boolean;
|
|
606
|
+
if (isFullRefetch) {
|
|
607
|
+
// Client has nothing cached — slot MUST render. User revalidate fns are
|
|
608
|
+
// bypassed here because returning false would leave the segment blank
|
|
609
|
+
// with no client-side fallback.
|
|
610
|
+
traceFullRefetchedParallelSlot(parallelId, belongsToRoute);
|
|
611
|
+
shouldResolve = true;
|
|
612
|
+
} else {
|
|
613
|
+
// For non-empty client sets, consult user revalidate fns. When the slot
|
|
614
|
+
// is unknown to the client, override the type-derived default so the
|
|
615
|
+
// soft chain seeds with the right "new segment" / "parent-chain" value.
|
|
616
|
+
//
|
|
617
|
+
// A "new segment" seed is floored: the client has no cached copy of this
|
|
618
|
+
// slot, so a user `false` would render component:null and leave it blank
|
|
619
|
+
// rather than keep anything. Sibling resolvers (loaders, layout/route
|
|
620
|
+
// entries, orphan layouts) get the same guarantee by short-circuiting
|
|
621
|
+
// without consulting user fns at all; #482 made this path consult them so
|
|
622
|
+
// a "skip-parent-chain" seed could still be raised, so floor instead of
|
|
623
|
+
// short-circuiting — user fns run, and may only raise.
|
|
624
|
+
let defaultOverride:
|
|
625
|
+
| { value: boolean; reason: string; floor?: boolean }
|
|
626
|
+
| undefined;
|
|
627
|
+
if (!clientSegmentIds.has(parallelId)) {
|
|
628
|
+
const value =
|
|
629
|
+
parentChainDefault === "force-render"
|
|
630
|
+
? true
|
|
631
|
+
: belongsToRoute || isNewParent;
|
|
632
|
+
defaultOverride = {
|
|
633
|
+
value,
|
|
634
|
+
reason: value ? "new-segment" : "skip-parent-chain",
|
|
635
|
+
floor: value,
|
|
636
|
+
};
|
|
487
637
|
}
|
|
488
638
|
|
|
489
|
-
|
|
639
|
+
const dummySegment: ResolvedSegment = {
|
|
490
640
|
id: parallelId,
|
|
491
641
|
namespace: parallelEntry.id,
|
|
492
642
|
type: "parallel",
|
|
493
643
|
index: 0,
|
|
494
|
-
component,
|
|
495
|
-
loading: parallelEntry.loading === false ? null : parallelEntry.loading,
|
|
496
|
-
transition: parallelEntry.transition,
|
|
644
|
+
component: null as any,
|
|
497
645
|
params,
|
|
498
646
|
slot,
|
|
499
647
|
belongsToRoute,
|
|
@@ -501,27 +649,70 @@ export async function resolveParallelSegmentsWithRevalidation<TEnv>(
|
|
|
501
649
|
...(parallelEntry.mountPath
|
|
502
650
|
? { mountPath: parallelEntry.mountPath }
|
|
503
651
|
: {}),
|
|
504
|
-
}
|
|
505
|
-
}
|
|
652
|
+
};
|
|
506
653
|
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
parallelEntry,
|
|
510
|
-
context,
|
|
511
|
-
belongsToRoute,
|
|
512
|
-
clientSegmentIds,
|
|
654
|
+
shouldResolve = await evaluateRevalidation({
|
|
655
|
+
segment: dummySegment,
|
|
513
656
|
prevParams,
|
|
657
|
+
getPrevSegment: null,
|
|
514
658
|
request,
|
|
515
659
|
prevUrl,
|
|
516
660
|
nextUrl,
|
|
661
|
+
revalidations: parallelEntry.revalidate.map((fn, i) => ({
|
|
662
|
+
name: `revalidate${i}`,
|
|
663
|
+
fn,
|
|
664
|
+
})),
|
|
517
665
|
routeKey,
|
|
518
|
-
|
|
666
|
+
context,
|
|
519
667
|
actionContext,
|
|
520
|
-
entry.shortCode,
|
|
521
668
|
stale,
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
669
|
+
traceSource: "parallel",
|
|
670
|
+
defaultOverride,
|
|
671
|
+
});
|
|
672
|
+
}
|
|
673
|
+
emitRevalidationDecision(
|
|
674
|
+
parallelId,
|
|
675
|
+
context.pathname,
|
|
676
|
+
routeKey,
|
|
677
|
+
shouldResolve,
|
|
678
|
+
);
|
|
679
|
+
|
|
680
|
+
const { component, handlerRan } = await resolveParallelSlotComponent({
|
|
681
|
+
shouldResolve,
|
|
682
|
+
parallelEntry,
|
|
683
|
+
slot,
|
|
684
|
+
parallelId,
|
|
685
|
+
handler,
|
|
686
|
+
context,
|
|
687
|
+
deps,
|
|
688
|
+
routeKey,
|
|
689
|
+
params,
|
|
690
|
+
});
|
|
691
|
+
|
|
692
|
+
segments.push({
|
|
693
|
+
id: parallelId,
|
|
694
|
+
namespace: parallelEntry.id,
|
|
695
|
+
type: "parallel",
|
|
696
|
+
index: 0,
|
|
697
|
+
component,
|
|
698
|
+
loading: parallelEntry.loading === false ? null : parallelEntry.loading,
|
|
699
|
+
transition: applyViewTransitionDefault(
|
|
700
|
+
parallelEntry.transition,
|
|
701
|
+
deps.viewTransitionDefault,
|
|
702
|
+
parallelId,
|
|
703
|
+
),
|
|
704
|
+
params,
|
|
705
|
+
slot,
|
|
706
|
+
_handlerRan: handlerRan,
|
|
707
|
+
belongsToRoute,
|
|
708
|
+
parallelName: `${parallelEntry.id}.${slot}`,
|
|
709
|
+
...(parallelEntry.mountPath
|
|
710
|
+
? { mountPath: parallelEntry.mountPath }
|
|
711
|
+
: {}),
|
|
712
|
+
});
|
|
713
|
+
|
|
714
|
+
if (loaderOrder === "after") {
|
|
715
|
+
await resolveSlotLoaders();
|
|
525
716
|
}
|
|
526
717
|
}
|
|
527
718
|
|
|
@@ -548,6 +739,7 @@ export async function resolveEntryHandlerWithRevalidation<TEnv>(
|
|
|
548
739
|
): Promise<{ segment: ResolvedSegment; matchedId: string }> {
|
|
549
740
|
const matchedId = entry.shortCode;
|
|
550
741
|
|
|
742
|
+
let handlerRan = false;
|
|
551
743
|
const component = await revalidate(
|
|
552
744
|
async () => {
|
|
553
745
|
const hasSegment = clientSegmentIds.has(entry.shortCode);
|
|
@@ -608,6 +800,8 @@ export async function resolveEntryHandlerWithRevalidation<TEnv>(
|
|
|
608
800
|
context,
|
|
609
801
|
actionContext,
|
|
610
802
|
stale,
|
|
803
|
+
traceSource:
|
|
804
|
+
entry.type === "route" ? "route-handler" : "layout-handler",
|
|
611
805
|
});
|
|
612
806
|
emitRevalidationDecision(
|
|
613
807
|
entry.shortCode,
|
|
@@ -622,6 +816,7 @@ export async function resolveEntryHandlerWithRevalidation<TEnv>(
|
|
|
622
816
|
return shouldRevalidate;
|
|
623
817
|
},
|
|
624
818
|
async () => {
|
|
819
|
+
handlerRan = true;
|
|
625
820
|
const doneHandler = track(`handler:${entry.id}`, 2);
|
|
626
821
|
(context as InternalHandlerContext<any, TEnv>)._currentSegmentId =
|
|
627
822
|
entry.shortCode;
|
|
@@ -636,14 +831,26 @@ export async function resolveEntryHandlerWithRevalidation<TEnv>(
|
|
|
636
831
|
return staticComponent;
|
|
637
832
|
}
|
|
638
833
|
const routeEntry = entry as Extract<EntryData, { type: "route" }>;
|
|
834
|
+
// For Passthrough routes at runtime, use the live handler instead of
|
|
835
|
+
// the build handler. At build time (context.build === true), always
|
|
836
|
+
// use the build handler from routeEntry.handler.
|
|
837
|
+
const handler =
|
|
838
|
+
!context.build && routeEntry.liveHandler
|
|
839
|
+
? routeEntry.liveHandler
|
|
840
|
+
: routeEntry.handler;
|
|
639
841
|
if (!routeEntry.loading) {
|
|
640
|
-
const result = handleHandlerResult(
|
|
842
|
+
const result = handleHandlerResult(
|
|
843
|
+
await observeHandler(entry.id, handler, context),
|
|
844
|
+
);
|
|
641
845
|
doneHandler();
|
|
642
846
|
return result;
|
|
643
847
|
}
|
|
644
848
|
if (!actionContext) {
|
|
645
|
-
const result = handleHandlerResult(
|
|
849
|
+
const result = handleHandlerResult(
|
|
850
|
+
observeHandler(entry.id, handler, context),
|
|
851
|
+
);
|
|
646
852
|
if (result instanceof Promise) {
|
|
853
|
+
warnOnStreamedResponse(result, routeEntry.id);
|
|
647
854
|
result.finally(doneHandler).catch(() => {});
|
|
648
855
|
const tracked = deps.trackHandler(result, {
|
|
649
856
|
segmentId: entry.shortCode,
|
|
@@ -666,7 +873,7 @@ export async function resolveEntryHandlerWithRevalidation<TEnv>(
|
|
|
666
873
|
entryId: entry.id,
|
|
667
874
|
});
|
|
668
875
|
const actionResult = handleHandlerResult(
|
|
669
|
-
await
|
|
876
|
+
await observeHandler(entry.id, handler, context),
|
|
670
877
|
);
|
|
671
878
|
doneHandler();
|
|
672
879
|
return {
|
|
@@ -676,10 +883,12 @@ export async function resolveEntryHandlerWithRevalidation<TEnv>(
|
|
|
676
883
|
() => null,
|
|
677
884
|
);
|
|
678
885
|
|
|
886
|
+
// Normalize void handlers (undefined) to null so the reconciler's
|
|
887
|
+
// component === null checks work consistently for both void and explicit null.
|
|
679
888
|
const resolvedComponent =
|
|
680
889
|
component && typeof component === "object" && "content" in component
|
|
681
|
-
? (component as { content: ReactNode }).content
|
|
682
|
-
: component;
|
|
890
|
+
? ((component as { content: ReactNode }).content ?? null)
|
|
891
|
+
: (component ?? null);
|
|
683
892
|
|
|
684
893
|
const segment: ResolvedSegment = {
|
|
685
894
|
id: entry.shortCode,
|
|
@@ -689,13 +898,18 @@ export async function resolveEntryHandlerWithRevalidation<TEnv>(
|
|
|
689
898
|
index: 0,
|
|
690
899
|
component: resolvedComponent,
|
|
691
900
|
loading: entry.loading === false ? null : entry.loading,
|
|
692
|
-
transition:
|
|
901
|
+
transition: applyViewTransitionDefault(
|
|
902
|
+
entry.transition,
|
|
903
|
+
deps.viewTransitionDefault,
|
|
904
|
+
entry.shortCode,
|
|
905
|
+
),
|
|
693
906
|
params,
|
|
694
907
|
belongsToRoute,
|
|
695
908
|
...(entry.type === "layout" || entry.type === "cache"
|
|
696
909
|
? { layoutName: entry.id }
|
|
697
910
|
: {}),
|
|
698
911
|
...(entry.mountPath ? { mountPath: entry.mountPath } : {}),
|
|
912
|
+
_handlerRan: handlerRan,
|
|
699
913
|
};
|
|
700
914
|
|
|
701
915
|
return { segment, matchedId };
|
|
@@ -714,7 +928,6 @@ export async function resolveSegmentWithRevalidation<TEnv>(
|
|
|
714
928
|
request: Request,
|
|
715
929
|
prevUrl: URL,
|
|
716
930
|
nextUrl: URL,
|
|
717
|
-
loaderPromises: Map<string, Promise<any>>,
|
|
718
931
|
deps: SegmentResolutionDeps<TEnv>,
|
|
719
932
|
actionContext?: ActionContext,
|
|
720
933
|
stale?: boolean,
|
|
@@ -776,11 +989,11 @@ export async function resolveSegmentWithRevalidation<TEnv>(
|
|
|
776
989
|
prevUrl,
|
|
777
990
|
nextUrl,
|
|
778
991
|
routeKey,
|
|
779
|
-
loaderPromises,
|
|
780
992
|
true,
|
|
781
993
|
deps,
|
|
782
994
|
actionContext,
|
|
783
995
|
stale,
|
|
996
|
+
entry,
|
|
784
997
|
);
|
|
785
998
|
segments.push(...orphanResult.segments);
|
|
786
999
|
matchedIds.push(...orphanResult.matchedIds);
|
|
@@ -860,7 +1073,6 @@ export async function resolveSegmentWithRevalidation<TEnv>(
|
|
|
860
1073
|
prevUrl,
|
|
861
1074
|
nextUrl,
|
|
862
1075
|
routeKey,
|
|
863
|
-
loaderPromises,
|
|
864
1076
|
false,
|
|
865
1077
|
deps,
|
|
866
1078
|
actionContext,
|
|
@@ -887,11 +1099,12 @@ export async function resolveOrphanLayoutWithRevalidation<TEnv>(
|
|
|
887
1099
|
prevUrl: URL,
|
|
888
1100
|
nextUrl: URL,
|
|
889
1101
|
routeKey: string,
|
|
890
|
-
loaderPromises: Map<string, Promise<any>>,
|
|
891
1102
|
belongsToRoute: boolean,
|
|
892
1103
|
deps: SegmentResolutionDeps<TEnv>,
|
|
893
1104
|
actionContext?: ActionContext,
|
|
894
1105
|
stale?: boolean,
|
|
1106
|
+
/** Parent route entry — its loaders are inherited so parallel slots can access them. */
|
|
1107
|
+
parentRouteEntry?: EntryData,
|
|
895
1108
|
): Promise<SegmentRevalidationResult> {
|
|
896
1109
|
invariant(
|
|
897
1110
|
orphan.type === "layout" || orphan.type === "cache",
|
|
@@ -919,6 +1132,37 @@ export async function resolveOrphanLayoutWithRevalidation<TEnv>(
|
|
|
919
1132
|
segments.push(...loaderResult.segments);
|
|
920
1133
|
matchedIds.push(...loaderResult.matchedIds);
|
|
921
1134
|
|
|
1135
|
+
// Inherit parent route's loaders so parallel slots inside this layout
|
|
1136
|
+
// can access them via useLoader(). See resolveOrphanLayout in fresh.ts.
|
|
1137
|
+
if (
|
|
1138
|
+
parentRouteEntry &&
|
|
1139
|
+
parentRouteEntry.loader &&
|
|
1140
|
+
parentRouteEntry.loader.length > 0 &&
|
|
1141
|
+
Object.keys(orphan.parallel).length > 0
|
|
1142
|
+
) {
|
|
1143
|
+
const inheritedResult = await resolveLoadersWithRevalidation(
|
|
1144
|
+
parentRouteEntry,
|
|
1145
|
+
context,
|
|
1146
|
+
belongsToRoute,
|
|
1147
|
+
clientSegmentIds,
|
|
1148
|
+
prevParams,
|
|
1149
|
+
request,
|
|
1150
|
+
prevUrl,
|
|
1151
|
+
nextUrl,
|
|
1152
|
+
routeKey,
|
|
1153
|
+
deps,
|
|
1154
|
+
actionContext,
|
|
1155
|
+
orphan.shortCode,
|
|
1156
|
+
stale,
|
|
1157
|
+
);
|
|
1158
|
+
// Tag as inherited so buildMatchResult can deduplicate when safe
|
|
1159
|
+
for (const s of inheritedResult.segments) {
|
|
1160
|
+
s._inherited = true;
|
|
1161
|
+
}
|
|
1162
|
+
segments.push(...inheritedResult.segments);
|
|
1163
|
+
matchedIds.push(...inheritedResult.matchedIds);
|
|
1164
|
+
}
|
|
1165
|
+
|
|
922
1166
|
// Handler-first: resolve orphan layout handler before its parallels
|
|
923
1167
|
// so ctx.set() values are visible to parallel children.
|
|
924
1168
|
matchedIds.push(orphan.shortCode);
|
|
@@ -991,157 +1235,41 @@ export async function resolveOrphanLayoutWithRevalidation<TEnv>(
|
|
|
991
1235
|
belongsToRoute,
|
|
992
1236
|
layoutName: orphan.id,
|
|
993
1237
|
loading: orphan.loading === false ? null : orphan.loading,
|
|
994
|
-
transition:
|
|
1238
|
+
transition: applyViewTransitionDefault(
|
|
1239
|
+
orphan.transition,
|
|
1240
|
+
deps.viewTransitionDefault,
|
|
1241
|
+
orphan.shortCode,
|
|
1242
|
+
),
|
|
995
1243
|
...(orphan.mountPath ? { mountPath: orphan.mountPath } : {}),
|
|
996
1244
|
});
|
|
997
1245
|
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
| ReactNode
|
|
1026
|
-
>;
|
|
1027
|
-
|
|
1028
|
-
for (const [slot, handler] of Object.entries(slots)) {
|
|
1029
|
-
// Use orphan.shortCode (the parent layout) to match the SSR path
|
|
1030
|
-
// (resolveParallelEntry receives parentShortCode = orphan.shortCode).
|
|
1031
|
-
// Using parallelEntry.shortCode would generate IDs the client doesn't know about.
|
|
1032
|
-
const parallelId = `${orphan.shortCode}.${slot}`;
|
|
1033
|
-
matchedIds.push(parallelId);
|
|
1034
|
-
|
|
1035
|
-
const shouldResolve = await (async () => {
|
|
1036
|
-
if (!clientSegmentIds.has(parallelId)) {
|
|
1037
|
-
if (isTraceActive()) {
|
|
1038
|
-
pushRevalidationTraceEntry({
|
|
1039
|
-
segmentId: parallelId,
|
|
1040
|
-
segmentType: "parallel",
|
|
1041
|
-
belongsToRoute,
|
|
1042
|
-
source: "parallel",
|
|
1043
|
-
defaultShouldRevalidate: true,
|
|
1044
|
-
finalShouldRevalidate: true,
|
|
1045
|
-
reason: "new-segment",
|
|
1046
|
-
});
|
|
1047
|
-
}
|
|
1048
|
-
return true;
|
|
1049
|
-
}
|
|
1050
|
-
|
|
1051
|
-
const dummySegment: ResolvedSegment = {
|
|
1052
|
-
id: parallelId,
|
|
1053
|
-
namespace: parallelEntry.id,
|
|
1054
|
-
type: "parallel",
|
|
1055
|
-
index: 0,
|
|
1056
|
-
component: null as any,
|
|
1057
|
-
params,
|
|
1058
|
-
slot,
|
|
1059
|
-
belongsToRoute,
|
|
1060
|
-
parallelName: `${parallelEntry.id}.${slot}`,
|
|
1061
|
-
...(parallelEntry.mountPath
|
|
1062
|
-
? { mountPath: parallelEntry.mountPath }
|
|
1063
|
-
: {}),
|
|
1064
|
-
};
|
|
1065
|
-
|
|
1066
|
-
return await evaluateRevalidation({
|
|
1067
|
-
segment: dummySegment,
|
|
1068
|
-
prevParams,
|
|
1069
|
-
getPrevSegment: null,
|
|
1070
|
-
request,
|
|
1071
|
-
prevUrl,
|
|
1072
|
-
nextUrl,
|
|
1073
|
-
revalidations: parallelEntry.revalidate.map((fn, i) => ({
|
|
1074
|
-
name: `revalidate${i}`,
|
|
1075
|
-
fn,
|
|
1076
|
-
})),
|
|
1077
|
-
routeKey,
|
|
1078
|
-
context,
|
|
1079
|
-
actionContext,
|
|
1080
|
-
stale,
|
|
1081
|
-
traceSource: "parallel",
|
|
1082
|
-
});
|
|
1083
|
-
})();
|
|
1084
|
-
emitRevalidationDecision(
|
|
1085
|
-
parallelId,
|
|
1086
|
-
context.pathname,
|
|
1087
|
-
routeKey,
|
|
1088
|
-
shouldResolve,
|
|
1089
|
-
);
|
|
1090
|
-
|
|
1091
|
-
let component: ReactNode | undefined;
|
|
1092
|
-
if (shouldResolve) {
|
|
1093
|
-
component = await tryStaticSlot(parallelEntry, slot, parallelId);
|
|
1094
|
-
}
|
|
1095
|
-
if (component === undefined) {
|
|
1096
|
-
const hasLoadingFallback =
|
|
1097
|
-
parallelEntry.loading !== undefined &&
|
|
1098
|
-
parallelEntry.loading !== false;
|
|
1099
|
-
if (!shouldResolve) {
|
|
1100
|
-
component = null;
|
|
1101
|
-
} else if (hasLoadingFallback) {
|
|
1102
|
-
const result =
|
|
1103
|
-
typeof handler === "function" ? handler(context) : handler;
|
|
1104
|
-
if (result instanceof Promise) {
|
|
1105
|
-
const tracked = deps.trackHandler(result, {
|
|
1106
|
-
segmentId: parallelId,
|
|
1107
|
-
segmentType: "parallel",
|
|
1108
|
-
});
|
|
1109
|
-
observeStreamedHandler(
|
|
1110
|
-
tracked,
|
|
1111
|
-
parallelId,
|
|
1112
|
-
"parallel",
|
|
1113
|
-
context.pathname,
|
|
1114
|
-
routeKey,
|
|
1115
|
-
params,
|
|
1116
|
-
);
|
|
1117
|
-
component = tracked as ReactNode;
|
|
1118
|
-
} else {
|
|
1119
|
-
component = result as ReactNode;
|
|
1120
|
-
}
|
|
1121
|
-
} else {
|
|
1122
|
-
component =
|
|
1123
|
-
typeof handler === "function" ? await handler(context) : handler;
|
|
1124
|
-
}
|
|
1125
|
-
}
|
|
1126
|
-
|
|
1127
|
-
segments.push({
|
|
1128
|
-
id: parallelId,
|
|
1129
|
-
namespace: parallelEntry.id,
|
|
1130
|
-
type: "parallel",
|
|
1131
|
-
index: 0,
|
|
1132
|
-
component,
|
|
1133
|
-
loading: parallelEntry.loading === false ? null : parallelEntry.loading,
|
|
1134
|
-
transition: parallelEntry.transition,
|
|
1135
|
-
params,
|
|
1136
|
-
slot,
|
|
1137
|
-
belongsToRoute,
|
|
1138
|
-
parallelName: `${parallelEntry.id}.${slot}`,
|
|
1139
|
-
...(parallelEntry.mountPath
|
|
1140
|
-
? { mountPath: parallelEntry.mountPath }
|
|
1141
|
-
: {}),
|
|
1142
|
-
});
|
|
1143
|
-
}
|
|
1144
|
-
}
|
|
1246
|
+
// Resolve the orphan layout's parallel slots through the shared main-path
|
|
1247
|
+
// helper. The orphan policy is carried by explicit args, byte-for-byte:
|
|
1248
|
+
// - parentChainDefault "force-render": an unknown parent-chain slot seeds
|
|
1249
|
+
// `true` (orphan parallels always belong to the route — the #482 guard),
|
|
1250
|
+
// where the main path would seed `belongsToRoute || isNewParent`.
|
|
1251
|
+
// - loaderOrder "before": a slot's loaders are emitted before the slot
|
|
1252
|
+
// segment, matching the prior inlined order.
|
|
1253
|
+
// `entry.shortCode` inside the helper is `orphan.shortCode` (orphan is passed
|
|
1254
|
+
// as `entry`), so the parallel ids + loader shortCodeOverride are unchanged.
|
|
1255
|
+
const parallelResult = await resolveParallelSegmentsWithRevalidation(
|
|
1256
|
+
orphan,
|
|
1257
|
+
params,
|
|
1258
|
+
context,
|
|
1259
|
+
belongsToRoute,
|
|
1260
|
+
clientSegmentIds,
|
|
1261
|
+
prevParams,
|
|
1262
|
+
request,
|
|
1263
|
+
prevUrl,
|
|
1264
|
+
nextUrl,
|
|
1265
|
+
routeKey,
|
|
1266
|
+
deps,
|
|
1267
|
+
actionContext,
|
|
1268
|
+
stale,
|
|
1269
|
+
{ parentChainDefault: "force-render", loaderOrder: "before" },
|
|
1270
|
+
);
|
|
1271
|
+
segments.push(...parallelResult.segments);
|
|
1272
|
+
matchedIds.push(...parallelResult.matchedIds);
|
|
1145
1273
|
|
|
1146
1274
|
return { segments, matchedIds };
|
|
1147
1275
|
}
|
|
@@ -1159,18 +1287,21 @@ export async function resolveAllSegmentsWithRevalidation<TEnv>(
|
|
|
1159
1287
|
request: Request,
|
|
1160
1288
|
prevUrl: URL,
|
|
1161
1289
|
nextUrl: URL,
|
|
1162
|
-
loaderPromises: Map<string, Promise<any>>,
|
|
1163
1290
|
actionContext: ActionContext | undefined,
|
|
1164
1291
|
interceptResult: { intercept: any; entry: EntryData } | null,
|
|
1165
1292
|
localRouteName: string,
|
|
1166
1293
|
pathname: string,
|
|
1167
1294
|
deps: SegmentResolutionDeps<TEnv>,
|
|
1295
|
+
stale?: boolean,
|
|
1168
1296
|
): Promise<{ segments: ResolvedSegment[]; matchedIds: string[] }> {
|
|
1169
1297
|
const allSegments: ResolvedSegment[] = [];
|
|
1170
1298
|
const matchedIds: string[] = [];
|
|
1171
1299
|
const seenSegIds = new Set<string>();
|
|
1172
1300
|
const seenMatchIds = new Set<string>();
|
|
1173
1301
|
|
|
1302
|
+
// ppr header-write guard latch — see resolveAllSegments (fresh.ts).
|
|
1303
|
+
latchPprHeaderScopeForEntries(entries, routeKey);
|
|
1304
|
+
|
|
1174
1305
|
const telemetry = getRouterContext()?.telemetry;
|
|
1175
1306
|
|
|
1176
1307
|
for (const entry of entries) {
|
|
@@ -1191,6 +1322,11 @@ export async function resolveAllSegmentsWithRevalidation<TEnv>(
|
|
|
1191
1322
|
}
|
|
1192
1323
|
|
|
1193
1324
|
const nonParallelEntry = entry as Exclude<EntryData, { type: "parallel" }>;
|
|
1325
|
+
if (entry.type === "cache") {
|
|
1326
|
+
const store = RangoContext.getStore();
|
|
1327
|
+
if (store) store.insideCacheScope = true;
|
|
1328
|
+
latchCachedHeaderScope("cache", routeKey);
|
|
1329
|
+
}
|
|
1194
1330
|
const doneEntry = track(`segment:${entry.id}`, 1);
|
|
1195
1331
|
const resolved = await resolveWithErrorBoundary(
|
|
1196
1332
|
nonParallelEntry,
|
|
@@ -1206,10 +1342,9 @@ export async function resolveAllSegmentsWithRevalidation<TEnv>(
|
|
|
1206
1342
|
request,
|
|
1207
1343
|
prevUrl,
|
|
1208
1344
|
nextUrl,
|
|
1209
|
-
loaderPromises,
|
|
1210
1345
|
deps,
|
|
1211
1346
|
actionContext,
|
|
1212
|
-
|
|
1347
|
+
stale,
|
|
1213
1348
|
),
|
|
1214
1349
|
(seg) => ({ segments: [seg], matchedIds: [seg.id] }),
|
|
1215
1350
|
deps,
|