@rangojs/router 0.4.3 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/types/browser/prefetch/cache.d.ts +31 -2
- package/dist/types/cache/cf/cf-cache-store.d.ts +2 -0
- package/dist/types/cache/types.d.ts +39 -6
- package/dist/types/route-definition/helpers-types.d.ts +5 -4
- package/dist/types/rsc/capture-queue.d.ts +19 -3
- package/dist/types/rsc/shell-build-manifest.d.ts +2 -2
- package/dist/types/rsc/shell-capture.d.ts +22 -2
- package/dist/types/rsc/shell-serve.d.ts +18 -12
- package/dist/types/static-handler.d.ts +15 -1
- package/dist/types/urls/path-helper-types.d.ts +6 -7
- 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 +1 -1
- package/package.json +1 -1
- package/skills/parallel/SKILL.md +1 -1
- package/skills/ppr/SKILL.md +44 -3
- package/src/browser/prefetch/cache.ts +53 -9
- package/src/browser/prefetch/fetch.ts +83 -2
- package/src/cache/cf/cf-cache-store.ts +27 -8
- package/src/cache/types.ts +41 -6
- package/src/cache/vercel/vercel-cache-store.ts +24 -10
- package/src/route-definition/helpers-types.ts +5 -3
- package/src/rsc/capture-queue.ts +120 -47
- package/src/rsc/rsc-rendering.ts +11 -3
- package/src/rsc/shell-build-manifest.ts +20 -7
- package/src/rsc/shell-capture.ts +164 -12
- package/src/rsc/shell-serve.ts +27 -12
- package/src/static-handler.ts +18 -2
- package/src/urls/path-helper-types.ts +9 -10
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { RangoInternal } from "./router-interfaces.js";
|
|
2
|
+
/**
|
|
3
|
+
* Brand marker for identifying router instances at build time.
|
|
4
|
+
* Used by the Vite plugin to auto-discover routers from module exports.
|
|
5
|
+
*/
|
|
6
|
+
export declare const RSC_ROUTER_BRAND: "__rsc_router__";
|
|
7
|
+
/**
|
|
8
|
+
* Global registry of all router instances created via createRouter().
|
|
9
|
+
* Each router is keyed by its id (auto-generated or user-provided).
|
|
10
|
+
* Used by the Vite plugin at build time to discover routers and extract
|
|
11
|
+
* manifests, prefix trees, and pre-render candidates.
|
|
12
|
+
*/
|
|
13
|
+
export declare const RouterRegistry: Map<string, RangoInternal<any, any>>;
|
|
14
|
+
export declare let routerAutoId: number;
|
|
15
|
+
export declare function nextRouterAutoId(): number;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fresh Path Segment Resolution
|
|
3
|
+
*
|
|
4
|
+
* Functions for resolving segments during a full (non-revalidation) request.
|
|
5
|
+
* Handles loaders, layouts, routes, parallels, orphan layouts, and error boundaries.
|
|
6
|
+
*/
|
|
7
|
+
import { type EntryData } from "../../server/context";
|
|
8
|
+
import type { HandlerContext, ResolvedSegment } from "../../types";
|
|
9
|
+
import type { SegmentResolutionDeps } from "../types.js";
|
|
10
|
+
/**
|
|
11
|
+
* Resolve loaders for an entry and emit segments.
|
|
12
|
+
* Loaders are run lazily via ctx.use() and memoized for parallel execution.
|
|
13
|
+
*/
|
|
14
|
+
export declare function resolveLoaders<TEnv>(entry: EntryData, ctx: HandlerContext<any, TEnv>, belongsToRoute: boolean, deps: SegmentResolutionDeps<TEnv>, shortCodeOverride?: string): Promise<ResolvedSegment[]>;
|
|
15
|
+
/**
|
|
16
|
+
* Options for segment resolution.
|
|
17
|
+
*/
|
|
18
|
+
export interface ResolveSegmentOptions {
|
|
19
|
+
/** When true, skip resolveLoaders() calls (used for pre-rendering) */
|
|
20
|
+
skipLoaders?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* When true, a thrown render error is re-thrown instead of being converted
|
|
23
|
+
* into an error-boundary segment. Set only by the pre-render path so a
|
|
24
|
+
* build-time render failure (and a `throw new Skip()` inside a render fn)
|
|
25
|
+
* surfaces to the build instead of being silently baked into a frozen error
|
|
26
|
+
* page served as a 200 (issue #587). The live request path leaves this unset,
|
|
27
|
+
* so error boundaries keep catching at request time.
|
|
28
|
+
*/
|
|
29
|
+
throwOnError?: boolean;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Resolve segments from EntryData.
|
|
33
|
+
* Executes middlewares, loaders, parallels, and handlers in correct order.
|
|
34
|
+
* Returns array: [main segment, ...orphan layout segments]
|
|
35
|
+
*/
|
|
36
|
+
export declare function resolveSegment<TEnv>(entry: EntryData, routeKey: string, params: Record<string, string>, context: HandlerContext<any, TEnv>, loaderPromises: Map<string, Promise<any>>, deps: SegmentResolutionDeps<TEnv>, isRouteEntry?: boolean, options?: ResolveSegmentOptions): Promise<ResolvedSegment[]>;
|
|
37
|
+
/**
|
|
38
|
+
* Resolve orphan layout with its middlewares, loaders, and parallels.
|
|
39
|
+
*/
|
|
40
|
+
export declare function resolveOrphanLayout<TEnv>(orphan: EntryData, params: Record<string, string>, context: HandlerContext<any, TEnv>, loaderPromises: Map<string, Promise<any>>, belongsToRoute: boolean, deps: SegmentResolutionDeps<TEnv>, options?: ResolveSegmentOptions, routeKey?: string,
|
|
41
|
+
/** Parent route entry — its loaders are inherited by the layout so
|
|
42
|
+
* parallel slots inside this layout can access them via useLoader(). */
|
|
43
|
+
parentRouteEntry?: EntryData): Promise<ResolvedSegment[]>;
|
|
44
|
+
/**
|
|
45
|
+
* Resolve parallel EntryData with its loaders and slot handlers.
|
|
46
|
+
*/
|
|
47
|
+
export declare function resolveParallelEntry<TEnv>(parallelEntry: EntryData, params: Record<string, string>, context: HandlerContext<any, TEnv>, belongsToRoute: boolean, parentShortCode: string, deps: SegmentResolutionDeps<TEnv>, options?: ResolveSegmentOptions, routeKey?: string, slotNames?: `@${string}`[], includeLoaders?: boolean): Promise<ResolvedSegment[]>;
|
|
48
|
+
/**
|
|
49
|
+
* Resolve all segments for a route (used for single-cache-per-request pattern).
|
|
50
|
+
*/
|
|
51
|
+
export declare function resolveAllSegments<TEnv>(entries: EntryData[], routeKey: string, params: Record<string, string>, context: HandlerContext<any, TEnv>, loaderPromises: Map<string, Promise<any>>, deps: SegmentResolutionDeps<TEnv>, options?: ResolveSegmentOptions): Promise<ResolvedSegment[]>;
|
|
52
|
+
/**
|
|
53
|
+
* Resolve only loader segments for all entries (used when serving cached non-loader segments).
|
|
54
|
+
*/
|
|
55
|
+
export declare function resolveLoadersOnly<TEnv>(entries: EntryData[], context: HandlerContext<any, TEnv>, deps: SegmentResolutionDeps<TEnv>): Promise<ResolvedSegment[]>;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared Helpers for Segment Resolution
|
|
3
|
+
*
|
|
4
|
+
* Common utilities used by both fresh and revalidation resolution paths:
|
|
5
|
+
* - Handler result processing (Response vs ReactNode)
|
|
6
|
+
* - Static handler interception (build-time pre-rendered components)
|
|
7
|
+
* - Layout handler resolution with static fallback
|
|
8
|
+
* - Error boundary segment creation
|
|
9
|
+
*/
|
|
10
|
+
import { type ReactNode } from "react";
|
|
11
|
+
import type { EntryData } from "../../server/context";
|
|
12
|
+
import type { ResolvedSegment, HandlerContext } from "../../types";
|
|
13
|
+
import type { SegmentResolutionDeps } from "../types.js";
|
|
14
|
+
import type { TelemetrySink } from "../telemetry.js";
|
|
15
|
+
/** The errorContext shape wrapLoaderPromise expects as its 5th argument. */
|
|
16
|
+
type LoaderErrorContext<TEnv> = NonNullable<Parameters<SegmentResolutionDeps<TEnv>["wrapLoaderPromise"]>[4]>;
|
|
17
|
+
/**
|
|
18
|
+
* Build the errorContext passed to wrapLoaderPromise so a throwing DSL loader
|
|
19
|
+
* fires createRouter({ onError }) (phase "loader") and emits the loader.error
|
|
20
|
+
* telemetry event. wrapLoaderPromise only wires the onError/telemetry path when
|
|
21
|
+
* this 5th argument is present; every real call site previously omitted it, so
|
|
22
|
+
* loaders were the one phase whose failures were silently dropped (handlers,
|
|
23
|
+
* actions, routing, rendering, and fetchable loaders all reported correctly).
|
|
24
|
+
*
|
|
25
|
+
* The fields come off the handler context, which already carries the request,
|
|
26
|
+
* url, params, env, and (on the internal shape) the matched route name.
|
|
27
|
+
*/
|
|
28
|
+
export declare function buildLoaderErrorContext<TEnv>(ctx: HandlerContext<any, TEnv>): LoaderErrorContext<TEnv>;
|
|
29
|
+
/**
|
|
30
|
+
* Handle Response returns from handlers.
|
|
31
|
+
* When a handler returns a Response (e.g., redirect), throw it to trigger
|
|
32
|
+
* the short-circuit mechanism. Otherwise return the ReactNode.
|
|
33
|
+
*/
|
|
34
|
+
export declare function handleHandlerResult(result: ReactNode | Response | Promise<ReactNode | Response>): ReactNode;
|
|
35
|
+
/**
|
|
36
|
+
* Dev-only: warn when a handler on a route that declares loading() resolves or
|
|
37
|
+
* rejects with a Response (e.g. redirect()).
|
|
38
|
+
*
|
|
39
|
+
* On a non-loading route a returned/thrown Response short-circuits to an HTTP
|
|
40
|
+
* redirect. But when the route declares loading(), the handler result is
|
|
41
|
+
* streamed (not awaited at the resolution boundary), so the Response surfaces
|
|
42
|
+
* only during RSC serialization and is rendered into the stream instead of
|
|
43
|
+
* becoming a 302/308 — a silent failure mode. Issue redirects from middleware,
|
|
44
|
+
* a loader, or a synchronous handler return instead. Compiled out in production.
|
|
45
|
+
*/
|
|
46
|
+
export declare function warnOnStreamedResponse(result: Promise<unknown>, entryId: string): void;
|
|
47
|
+
/**
|
|
48
|
+
* Try to resolve a component from the build-time static store.
|
|
49
|
+
* Returns undefined synchronously when the entry is not a static prerender,
|
|
50
|
+
* avoiding unnecessary promise wrapping on the hot path.
|
|
51
|
+
*/
|
|
52
|
+
export declare function tryStaticHandler(entry: EntryData, segmentId: string): Promise<ReactNode | undefined> | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* Try to resolve a parallel slot component from the build-time static store.
|
|
55
|
+
* Returns undefined synchronously when no static handler ID exists for the slot.
|
|
56
|
+
*/
|
|
57
|
+
export declare function tryStaticSlot(parallelEntry: EntryData, slot: string, segmentId: string): Promise<ReactNode | undefined> | undefined;
|
|
58
|
+
/**
|
|
59
|
+
* Resolve a layout or cache entry's handler component.
|
|
60
|
+
* Checks build-time static store first, then invokes the handler.
|
|
61
|
+
*/
|
|
62
|
+
export declare function resolveLayoutComponent<TEnv>(entry: EntryData, context: HandlerContext<any, TEnv>): Promise<ReactNode>;
|
|
63
|
+
/**
|
|
64
|
+
* Context for error reporting in segment resolution.
|
|
65
|
+
* When provided, callOnError is invoked with this context.
|
|
66
|
+
*/
|
|
67
|
+
export interface ErrorReportContext {
|
|
68
|
+
request?: Request;
|
|
69
|
+
url?: URL;
|
|
70
|
+
routeKey?: string;
|
|
71
|
+
env?: any;
|
|
72
|
+
isPartial?: boolean;
|
|
73
|
+
requestStartTime?: number;
|
|
74
|
+
telemetry?: TelemetrySink;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Handle a caught error during segment resolution by creating an
|
|
78
|
+
* error or not-found segment with the nearest boundary.
|
|
79
|
+
*
|
|
80
|
+
* Called by resolveWithErrorBoundary to produce error/notFound segments.
|
|
81
|
+
*/
|
|
82
|
+
export declare function catchSegmentError<TEnv>(error: unknown, entry: EntryData, params: Record<string, string>, deps: SegmentResolutionDeps<TEnv>, report?: ErrorReportContext, pathname?: string): ResolvedSegment;
|
|
83
|
+
/**
|
|
84
|
+
* Generic error boundary wrapper for segment resolution.
|
|
85
|
+
* Catches non-Response errors and produces an error/notFound segment
|
|
86
|
+
* via catchSegmentError. Response throws (e.g. redirects) are re-thrown.
|
|
87
|
+
*
|
|
88
|
+
* The caller provides a `wrapError` callback to shape the error segment
|
|
89
|
+
* into the expected return type (e.g. ResolvedSegment[] for the fresh
|
|
90
|
+
* path, or SegmentRevalidationResult for the revalidation path).
|
|
91
|
+
*/
|
|
92
|
+
export declare function resolveWithErrorBoundary<TEnv, TResult>(entry: EntryData, params: Record<string, string>, resolveFn: () => Promise<TResult>, wrapError: (segment: ResolvedSegment) => TResult, deps: SegmentResolutionDeps<TEnv>, report?: ErrorReportContext, pathname?: string, throwOnError?: boolean): Promise<TResult>;
|
|
93
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Loader-Level Caching
|
|
3
|
+
*
|
|
4
|
+
* When a LoaderEntry has a cache config (set via loader(Fn, () => [cache({...})])),
|
|
5
|
+
* this module wraps the loader execution with cache lookup/store using the
|
|
6
|
+
* getItem()/setItem() methods on SegmentCacheStore.
|
|
7
|
+
*
|
|
8
|
+
* Cache key resolution (3-tier, matching CacheScope.resolveKey):
|
|
9
|
+
* 1. options.key(requestCtx) — full override
|
|
10
|
+
* 2. store.keyGenerator(requestCtx, defaultKey) — store-level modification
|
|
11
|
+
* 3. loader:{loaderId}:{host}{pathname}:{sortedParams} — default
|
|
12
|
+
*
|
|
13
|
+
* Values are serialized via RSC Flight (serializeResult/deserializeResult),
|
|
14
|
+
* supporting ReactNode, Promises, null, and all RSC-serializable types.
|
|
15
|
+
*
|
|
16
|
+
* On hit: returns cached data directly, skips loader execution.
|
|
17
|
+
* On stale hit (SWR): returns stale data, schedules background revalidation.
|
|
18
|
+
* On miss: executes loader, schedules non-blocking cache write.
|
|
19
|
+
*/
|
|
20
|
+
import type { LoaderEntry } from "../../server/context.js";
|
|
21
|
+
import type { HandlerContext } from "../../types.js";
|
|
22
|
+
/**
|
|
23
|
+
* Resolve loader data with optional caching.
|
|
24
|
+
*
|
|
25
|
+
* When the LoaderEntry has no cache config, delegates directly to ctx.use(loader).
|
|
26
|
+
* When cached, checks store first and stores on miss via waitUntil.
|
|
27
|
+
*
|
|
28
|
+
* Loader metering is NOT done here — it lives at the ctx.use execution funnel
|
|
29
|
+
* (observePhase; see instrument.ts). A cache HIT returns without calling ctx.use,
|
|
30
|
+
* so it emits no loader phase (the loader did not execute; the hit is only a
|
|
31
|
+
* LoaderCache debug log).
|
|
32
|
+
*/
|
|
33
|
+
export declare function resolveLoaderData<TEnv>(loaderEntry: LoaderEntry, ctx: HandlerContext<any, TEnv>, pathname: string, bakeSegmentKey?: string | null): Promise<any>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PPR shell-capture loader masking.
|
|
3
|
+
*
|
|
4
|
+
* During a shell CAPTURE re-render (Axis 2, see docs/design/ppr-shell-resume.md)
|
|
5
|
+
* route loaders are the "live lane": they must NOT execute — no side effects, no
|
|
6
|
+
* cost, no cache round-trips. Instead every loader segment's value slot receives
|
|
7
|
+
* a never-resolving promise, so the loader-consuming Suspense subtree stays
|
|
8
|
+
* pending and React's static `prerender` marks it as a postponed hole. The frozen
|
|
9
|
+
* shell (prelude) captures only the fallback; the resumed serve pass runs the
|
|
10
|
+
* loaders fresh through the unchanged execution path and streams their output
|
|
11
|
+
* into the holes.
|
|
12
|
+
*
|
|
13
|
+
* Capture mode is signalled by `requestCtx._shellCaptureRun`, set to true ONLY on
|
|
14
|
+
* the derived request context of the background capture task (shell-capture.ts) —
|
|
15
|
+
* NOT by the foreground render, whose `_shellCapture` descriptor merely means "a
|
|
16
|
+
* capture is wanted" and must not change behavior. This module is the single home
|
|
17
|
+
* for the mask so every loader execution site gates the same way (loader-cache.ts
|
|
18
|
+
* `resolveLoaderData`, fresh.ts `resolveLoaders`).
|
|
19
|
+
*/
|
|
20
|
+
import { type RequestContext } from "../../server/request-context.js";
|
|
21
|
+
/**
|
|
22
|
+
* True when the current render is the active PPR shell capture and route loaders
|
|
23
|
+
* must be masked rather than executed. Reads `_shellCaptureRun` off the ALS
|
|
24
|
+
* request context (the capture task re-establishes its derived context via
|
|
25
|
+
* runWithRequestContext), so it is accurate at the loader resolution sites, which
|
|
26
|
+
* run synchronously inside the pipeline's context frame.
|
|
27
|
+
*/
|
|
28
|
+
export declare function isShellCaptureActive(reqCtx?: RequestContext<any> | undefined): boolean;
|
|
29
|
+
export { createMaskedLoaderPromise } from "./mask-nested.js";
|
|
30
|
+
/**
|
|
31
|
+
* Lane decision for an entry's loaders under PPR (the loading() value decides;
|
|
32
|
+
* docs/design/loader-container-bake.md):
|
|
33
|
+
*
|
|
34
|
+
* - RENDERABLE loading() (the LoaderBoundary Suspense fallback) — the LIVE
|
|
35
|
+
* lane: masked at capture, guaranteed fresh on every serve. Returns true.
|
|
36
|
+
* - No loading() (absent, or explicitly `false`, incl. `loading(x, { ssr:
|
|
37
|
+
* false })` under the SSR manifest) — the BAKE lane: the loader executes
|
|
38
|
+
* during capture, its settled container bakes, nested pending promises hole
|
|
39
|
+
* at the consumer's own Suspense. Returns false.
|
|
40
|
+
*
|
|
41
|
+
* Mirrors segment-system's isRenderableLoading so the mask decision and the
|
|
42
|
+
* tree's boundary placement can never disagree.
|
|
43
|
+
*/
|
|
44
|
+
export declare function entryLoadingMasksLoaders(loading: unknown): boolean;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Loader-family capture snapshot: elide + overlay for bake-lane loader
|
|
3
|
+
* containers (docs/design/loader-container-bake.md).
|
|
4
|
+
*
|
|
5
|
+
* A loader on an entry with NO renderable loading() executes during shell
|
|
6
|
+
* capture; its settled container bakes into the prelude while every promise
|
|
7
|
+
* still pending at the quiet window postpones as a hole. To keep a HIT's fresh
|
|
8
|
+
* payload byte-identical to that frozen prelude, the capture pins the container
|
|
9
|
+
* in the shell snapshot:
|
|
10
|
+
*
|
|
11
|
+
* - elide: deep-walk the settled container; a PENDING nested promise is a
|
|
12
|
+
* hole, replaced by {@link LOADER_HOLE_KEY} — and since
|
|
13
|
+
* loader-cache masks every nested thenable at capture
|
|
14
|
+
* ({@link maskNestedContainerThenables}), nested promises are
|
|
15
|
+
* ALWAYS pending here for new captures. The SETTLED-marker branch
|
|
16
|
+
* below is legacy: it fires only if a settled thenable reaches
|
|
17
|
+
* elide anyway, and the overlay keeps decoding SETTLED markers
|
|
18
|
+
* from pre-mask snapshots. The result is promise-free and
|
|
19
|
+
* Flight-serializable.
|
|
20
|
+
* - overlay: on a HIT the loader runs fresh (only the loader body can mint
|
|
21
|
+
* the live nested promises), then the recorded container is laid
|
|
22
|
+
* over it: recorded paths win (they are what the prelude froze),
|
|
23
|
+
* hole-marker paths take the fresh run's value (the live hole),
|
|
24
|
+
* SETTLED-marker paths become Promise.resolve(pinned) — consumers
|
|
25
|
+
* wrote use(data.x) against a promise-shaped container, and
|
|
26
|
+
* handing them the raw value throws React #438 on every HIT (the
|
|
27
|
+
* storefront PDP regression) — and fresh-only paths pass through
|
|
28
|
+
* (they cannot contradict prelude bytes that never rendered them).
|
|
29
|
+
*/
|
|
30
|
+
export { maskNestedContainerThenables } from "./mask-nested.js";
|
|
31
|
+
/**
|
|
32
|
+
* Marker object standing in for a pending nested promise in a recorded loader
|
|
33
|
+
* container. Shape-checked (not identity-checked) because the record round-trips
|
|
34
|
+
* through Flight serialization and a JSON-embedding store envelope.
|
|
35
|
+
*/
|
|
36
|
+
export declare const LOADER_HOLE_KEY: "$rangoLoaderHole";
|
|
37
|
+
export interface LoaderHoleMarker {
|
|
38
|
+
[LOADER_HOLE_KEY]: 1;
|
|
39
|
+
}
|
|
40
|
+
export declare function isLoaderHoleMarker(value: unknown): value is LoaderHoleMarker;
|
|
41
|
+
/**
|
|
42
|
+
* Marker wrapping the inlined value of a NESTED promise that settled during
|
|
43
|
+
* capture. The value baked (physics), but the container key was a promise —
|
|
44
|
+
* the overlay must hand consumers a Promise.resolve(value), not the raw value,
|
|
45
|
+
* or an unconditional use(data.x) throws React #438 on every HIT. The ROOT
|
|
46
|
+
* container is never wrapped: loader-cache overlays against the awaited fresh
|
|
47
|
+
* container value.
|
|
48
|
+
*/
|
|
49
|
+
export declare const LOADER_SETTLED_KEY: "$rangoLoaderSettled";
|
|
50
|
+
export interface LoaderSettledMarker {
|
|
51
|
+
[LOADER_SETTLED_KEY]: 1;
|
|
52
|
+
value: unknown;
|
|
53
|
+
/**
|
|
54
|
+
* Present when the pinned subtree contains hole markers. Computed once at
|
|
55
|
+
* capture (elide already visits every node) so the per-HIT overlay never
|
|
56
|
+
* rescans the pinned structure to pick its rehydration path.
|
|
57
|
+
*/
|
|
58
|
+
holes?: 1;
|
|
59
|
+
}
|
|
60
|
+
export declare function isLoaderSettledMarker(value: unknown): value is LoaderSettledMarker;
|
|
61
|
+
export type ElideResult = {
|
|
62
|
+
state: "ok";
|
|
63
|
+
value: unknown;
|
|
64
|
+
hasHole: boolean;
|
|
65
|
+
} | {
|
|
66
|
+
state: "rejected";
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Deep-elide a settled bake-lane container for recording. Settled nested
|
|
70
|
+
* promises pin their value behind a settled marker (they baked, but consumers
|
|
71
|
+
* hold a promise-shaped key); pending ones become hole markers; a REJECTED
|
|
72
|
+
* nested promise poisons the record (error UI must never bake into a shared
|
|
73
|
+
* shell) — the caller refuses the capture. Only plain objects/arrays are
|
|
74
|
+
* traversed; anything else (Date, Map, class instance) is a pinned leaf.
|
|
75
|
+
* Cycles are cut as pinned references (best effort — Flight rejects true
|
|
76
|
+
* cycles later regardless).
|
|
77
|
+
*
|
|
78
|
+
* The ROOT container promise-chain unwraps with NO marker: loader-cache
|
|
79
|
+
* overlays against the AWAITED fresh container, so the recorded root must be
|
|
80
|
+
* the unwrapped structure. Everything below it goes through elideNested.
|
|
81
|
+
*/
|
|
82
|
+
export declare function elideLoaderContainer(value: unknown, seen?: Set<object>): Promise<ElideResult>;
|
|
83
|
+
/**
|
|
84
|
+
* Overlay a recorded (elided) container onto the fresh run's container for a
|
|
85
|
+
* shell HIT. Recorded wins per path; hole markers take the fresh value (the
|
|
86
|
+
* live nested promise); fresh-only object keys pass through. Where the shapes
|
|
87
|
+
* disagree structurally, recorded wins wholesale — it is what the prelude
|
|
88
|
+
* froze, and parity beats freshness inside the shell.
|
|
89
|
+
*/
|
|
90
|
+
export declare function overlayLoaderContainer(fresh: unknown, recorded: unknown): unknown;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Capture-side nested-thenable masking — the mechanism behind "nested-promise
|
|
3
|
+
* shape is the liveness declaration" for BOTH bake-lane loader containers
|
|
4
|
+
* (loader-cache.ts) and pushed handle containers (request-context.ts
|
|
5
|
+
* createUseFunction).
|
|
6
|
+
*
|
|
7
|
+
* Deliberately a LEAF module: request-context needs the mask for handle
|
|
8
|
+
* pushes, and loader-mask (the other natural home) imports request-context —
|
|
9
|
+
* importing from there would cycle. This module imports only is-thenable.
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* A promise that never settles — the masked stand-in for a per-request value
|
|
13
|
+
* during shell capture. The consuming Suspense subtree suspends forever, so
|
|
14
|
+
* the static prerender postpones it as a hole instead of baking a per-request
|
|
15
|
+
* value into the shared shell. The capture abort (`maxWaitMs` in
|
|
16
|
+
* captureShellHTML) bounds how long the prerender waits before it freezes the
|
|
17
|
+
* prelude, so this never hangs the request.
|
|
18
|
+
*/
|
|
19
|
+
export declare function createMaskedLoaderPromise<T = unknown>(): Promise<T>;
|
|
20
|
+
/**
|
|
21
|
+
* Deep-copy a container with every NESTED thenable replaced by a masked
|
|
22
|
+
* (never-resolving) promise. Applied during shell capture to (a) bake-lane
|
|
23
|
+
* loader containers (loader-cache.ts) and (b) pushed handle containers
|
|
24
|
+
* (createUseFunction) — the two rango-owned funnels where consumers declare
|
|
25
|
+
* per-request data by promise SHAPE.
|
|
26
|
+
*
|
|
27
|
+
* Why: a nested promise that happened to SETTLE before the capture's quiet
|
|
28
|
+
* window closed used to bake its value into the SHARED shell (and, for
|
|
29
|
+
* loaders, the snapshot pinned it for every HIT) — per-request data frozen
|
|
30
|
+
* and served cross-session (found live: a storefront basket, carrying the
|
|
31
|
+
* capturing session's basketId/customer identifiers, served to anonymous
|
|
32
|
+
* visitors). The window waits for the slowest shared material on the page, so
|
|
33
|
+
* any real data source (a 5ms SQL read, a 200ms basket API) lost the race.
|
|
34
|
+
* Masking makes the consuming subtree postpone as a hole no matter when the
|
|
35
|
+
* promise settles: liveness by declaration, not by racing the window.
|
|
36
|
+
*
|
|
37
|
+
* Only plain objects/arrays are traversed; other values are leaves. The INPUT
|
|
38
|
+
* IS NEVER MUTATED — handler-side loader consumption (the consumption-lane
|
|
39
|
+
* rule, semantic-matrix PPR3) shares the raw container and must keep real
|
|
40
|
+
* values. Cycles are preserved as cycles in the copy.
|
|
41
|
+
*/
|
|
42
|
+
/**
|
|
43
|
+
* Optional single-walk report for maskNestedContainerThenables: `thenable`
|
|
44
|
+
* flips true when the walk masked at least one thenable. The shell fast path
|
|
45
|
+
* reads it at handle-push time — a pushed container with a nested thenable
|
|
46
|
+
* declares per-request data, and a shell entry whose HANDLER layer made such
|
|
47
|
+
* a declaration cannot be served handler-free (the hole would never fill).
|
|
48
|
+
* Same single-pass shape as elideLoaderContainer's `hasHole`.
|
|
49
|
+
*/
|
|
50
|
+
export interface MaskReport {
|
|
51
|
+
thenable: boolean;
|
|
52
|
+
}
|
|
53
|
+
export declare function maskNestedContainerThenables(value: unknown, seen?: Map<object, unknown>, report?: MaskReport): unknown;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Revalidation Path Segment Resolution
|
|
3
|
+
*
|
|
4
|
+
* Functions for resolving segments during partial (revalidation) requests.
|
|
5
|
+
* Mirrors the fresh path but adds revalidation awareness: only re-resolves
|
|
6
|
+
* segments whose revalidate() predicate returns true.
|
|
7
|
+
*/
|
|
8
|
+
import { type EntryData } from "../../server/context";
|
|
9
|
+
import type { HandlerContext, ResolvedSegment, ShouldRevalidateFn } from "../../types";
|
|
10
|
+
import type { SegmentResolutionDeps, SegmentRevalidationResult, ActionContext } from "../types.js";
|
|
11
|
+
/**
|
|
12
|
+
* Resolve loaders with revalidation awareness (for partial rendering).
|
|
13
|
+
* Returns both segments to render AND all matched segment IDs.
|
|
14
|
+
*/
|
|
15
|
+
export declare function resolveLoadersWithRevalidation<TEnv>(entry: EntryData, ctx: HandlerContext<any, TEnv>, belongsToRoute: boolean, clientSegmentIds: Set<string>, prevParams: Record<string, string>, request: Request, prevUrl: URL, nextUrl: URL, routeKey: string, deps: SegmentResolutionDeps<TEnv>, actionContext?: ActionContext, shortCodeOverride?: string, stale?: boolean): Promise<{
|
|
16
|
+
segments: ResolvedSegment[];
|
|
17
|
+
matchedIds: string[];
|
|
18
|
+
}>;
|
|
19
|
+
/**
|
|
20
|
+
* Resolve only loader segments for all entries with revalidation logic.
|
|
21
|
+
*/
|
|
22
|
+
export declare function resolveLoadersOnlyWithRevalidation<TEnv>(entries: EntryData[], context: HandlerContext<any, TEnv>, clientSegmentIds: Set<string>, prevParams: Record<string, string>, request: Request, prevUrl: URL, nextUrl: URL, routeKey: string, deps: SegmentResolutionDeps<TEnv>, actionContext?: ActionContext, stale?: boolean): Promise<{
|
|
23
|
+
segments: ResolvedSegment[];
|
|
24
|
+
matchedIds: string[];
|
|
25
|
+
}>;
|
|
26
|
+
/**
|
|
27
|
+
* Build a map of segment shortCode -> entry with revalidate functions.
|
|
28
|
+
*/
|
|
29
|
+
export declare function buildEntryRevalidateMap(entries: EntryData[]): Map<string, {
|
|
30
|
+
entry: EntryData;
|
|
31
|
+
revalidate: ShouldRevalidateFn<any, any>[];
|
|
32
|
+
}>;
|
|
33
|
+
/**
|
|
34
|
+
* Resolve parallel segments with revalidation.
|
|
35
|
+
*/
|
|
36
|
+
export declare function resolveParallelSegmentsWithRevalidation<TEnv>(entry: EntryData, params: Record<string, string>, context: HandlerContext<any, TEnv>, belongsToRoute: boolean, clientSegmentIds: Set<string>, prevParams: Record<string, string>, request: Request, prevUrl: URL, nextUrl: URL, routeKey: string, deps: SegmentResolutionDeps<TEnv>, actionContext?: ActionContext, stale?: boolean, options?: {
|
|
37
|
+
/**
|
|
38
|
+
* Seed for an unknown parent-chain slot (slot not in clientSegmentIds) when
|
|
39
|
+
* there are no deciding revalidate fns. "type-derived" (default, main path):
|
|
40
|
+
* `belongsToRoute || isNewParent`. "force-render" (orphan path): always
|
|
41
|
+
* `true` — orphan parallels always belong to the route and must render
|
|
42
|
+
* unless the user opts out via revalidate(); the #482 blank-parent-chain-
|
|
43
|
+
* slot guard.
|
|
44
|
+
*/
|
|
45
|
+
parentChainDefault?: "type-derived" | "force-render";
|
|
46
|
+
/**
|
|
47
|
+
* When a slot's loaders are resolved relative to the slot segment push.
|
|
48
|
+
* "after" (default, main path) pushes the slot segment first; "before"
|
|
49
|
+
* (orphan path) resolves loaders first. This only changes the
|
|
50
|
+
* segments/matchedIds emission ORDER (the client reconciler is insensitive
|
|
51
|
+
* to it: loader sub-ids are filtered out and slots are re-grouped by parent).
|
|
52
|
+
*/
|
|
53
|
+
loaderOrder?: "after" | "before";
|
|
54
|
+
}): Promise<SegmentRevalidationResult>;
|
|
55
|
+
/**
|
|
56
|
+
* Resolve entry handler (layout, cache, or route) with revalidation.
|
|
57
|
+
*/
|
|
58
|
+
export declare function resolveEntryHandlerWithRevalidation<TEnv>(entry: Exclude<EntryData, {
|
|
59
|
+
type: "parallel";
|
|
60
|
+
}>, params: Record<string, string>, context: HandlerContext<any, TEnv>, belongsToRoute: boolean, clientSegmentIds: Set<string>, prevParams: Record<string, string>, request: Request, prevUrl: URL, nextUrl: URL, routeKey: string, deps: SegmentResolutionDeps<TEnv>, actionContext?: ActionContext, stale?: boolean): Promise<{
|
|
61
|
+
segment: ResolvedSegment;
|
|
62
|
+
matchedId: string;
|
|
63
|
+
}>;
|
|
64
|
+
/**
|
|
65
|
+
* Resolve segments with revalidation awareness (for partial rendering).
|
|
66
|
+
*/
|
|
67
|
+
export declare function resolveSegmentWithRevalidation<TEnv>(entry: Exclude<EntryData, {
|
|
68
|
+
type: "parallel";
|
|
69
|
+
}>, routeKey: string, params: Record<string, string>, context: HandlerContext<any, TEnv>, clientSegmentIds: Set<string>, prevParams: Record<string, string>, request: Request, prevUrl: URL, nextUrl: URL, deps: SegmentResolutionDeps<TEnv>, actionContext?: ActionContext, stale?: boolean): Promise<SegmentRevalidationResult>;
|
|
70
|
+
/**
|
|
71
|
+
* Resolve orphan layout with revalidation.
|
|
72
|
+
*/
|
|
73
|
+
export declare function resolveOrphanLayoutWithRevalidation<TEnv>(orphan: EntryData, params: Record<string, string>, context: HandlerContext<any, TEnv>, clientSegmentIds: Set<string>, prevParams: Record<string, string>, request: Request, prevUrl: URL, nextUrl: URL, routeKey: string, belongsToRoute: boolean, deps: SegmentResolutionDeps<TEnv>, actionContext?: ActionContext, stale?: boolean,
|
|
74
|
+
/** Parent route entry — its loaders are inherited so parallel slots can access them. */
|
|
75
|
+
parentRouteEntry?: EntryData): Promise<SegmentRevalidationResult>;
|
|
76
|
+
/**
|
|
77
|
+
* Resolve all segments for a route with revalidation logic (for matchPartial).
|
|
78
|
+
*/
|
|
79
|
+
export declare function resolveAllSegmentsWithRevalidation<TEnv>(entries: EntryData[], routeKey: string, params: Record<string, string>, context: HandlerContext<any, TEnv>, clientSegmentSet: Set<string>, prevParams: Record<string, string>, request: Request, prevUrl: URL, nextUrl: URL, actionContext: ActionContext | undefined, interceptResult: {
|
|
80
|
+
intercept: any;
|
|
81
|
+
entry: EntryData;
|
|
82
|
+
} | null, localRouteName: string, pathname: string, deps: SegmentResolutionDeps<TEnv>, stale?: boolean): Promise<{
|
|
83
|
+
segments: ResolvedSegment[];
|
|
84
|
+
matchedIds: string[];
|
|
85
|
+
}>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Static Store
|
|
3
|
+
*
|
|
4
|
+
* Lazy-initialized static store for production Static handler interception.
|
|
5
|
+
* Manages the build-time static manifest lookup for pre-rendered components.
|
|
6
|
+
*/
|
|
7
|
+
import type { ReactNode } from "react";
|
|
8
|
+
/**
|
|
9
|
+
* Try to load a pre-rendered Static component from the build-time store.
|
|
10
|
+
* Returns the deserialized React element, or undefined if not available.
|
|
11
|
+
* Also replays any handle data captured at build time into the request's HandleStore.
|
|
12
|
+
*
|
|
13
|
+
* @param handlerId - The handler's $$id used to look up the static store entry.
|
|
14
|
+
* @param segmentId - The runtime segment shortCode. Handle data is replayed under
|
|
15
|
+
* this key so that useHandle's segmentOrder matching works correctly.
|
|
16
|
+
*/
|
|
17
|
+
export declare function tryStaticLookup(handlerId: string, segmentId: string): Promise<ReactNode | undefined>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Streamed Handler Telemetry
|
|
3
|
+
*
|
|
4
|
+
* Shared fire-and-forget rejection observer for streamed handler promises,
|
|
5
|
+
* used by both the fresh and revalidation segment-resolution paths. Lives in
|
|
6
|
+
* its own module (never mocked) so the resolution unit tests that mock
|
|
7
|
+
* helpers.js / telemetry.js with explicit export lists do not resolve it to
|
|
8
|
+
* undefined.
|
|
9
|
+
*/
|
|
10
|
+
import type { ReactNode } from "react";
|
|
11
|
+
/**
|
|
12
|
+
* Attach a fire-and-forget rejection observer to a streamed handler promise.
|
|
13
|
+
* React catches the actual error via its error boundary; this only emits
|
|
14
|
+
* the handler.error telemetry event.
|
|
15
|
+
*/
|
|
16
|
+
export declare function observeStreamedHandler(promise: Promise<ReactNode>, segmentId: string, segmentType: string, pathname?: string, routeKey?: string, params?: Record<string, string>): void;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* View-transition boundary default resolution.
|
|
3
|
+
*
|
|
4
|
+
* Kept in its own module (rather than helpers.ts) because several resolution
|
|
5
|
+
* tests mock helpers.ts with an explicit export list; a shared util here is
|
|
6
|
+
* never mocked, so the fresh and revalidation paths always get the real
|
|
7
|
+
* implementation.
|
|
8
|
+
*/
|
|
9
|
+
import type { EntryData } from "../../server/context";
|
|
10
|
+
/**
|
|
11
|
+
* Resolve a segment's transition config: stamp the `viewTransition` default and
|
|
12
|
+
* peel off a transition({ when }) predicate.
|
|
13
|
+
*
|
|
14
|
+
* `viewTransition`: the per-segment value (set via the transition() DSL) always
|
|
15
|
+
* wins. When it is unset, the router-level createRouter({ viewTransition })
|
|
16
|
+
* default is stamped in so the render gate reads the boundary decision off the
|
|
17
|
+
* segment — server and client, via the serialized segment — without the router
|
|
18
|
+
* option being threaded to the client. Only `false` is ever stamped; an unset
|
|
19
|
+
* (or "auto") value is left untouched because it already means "wrap" at the
|
|
20
|
+
* gate, which also avoids needless object allocation and payload growth.
|
|
21
|
+
*
|
|
22
|
+
* `when`: a server-only predicate. It is STRIPPED from the returned config (a
|
|
23
|
+
* function cannot cross Flight or the segment cache) and recorded on the request
|
|
24
|
+
* context keyed by `segmentId`, so rsc-rendering can evaluate it post-handler —
|
|
25
|
+
* outside any cache scope — and drop this segment's transition when it returns
|
|
26
|
+
* false. Used by both the fresh and revalidation resolution paths.
|
|
27
|
+
*/
|
|
28
|
+
export declare function applyViewTransitionDefault(transition: EntryData["transition"], viewTransitionDefault: "auto" | false | undefined, segmentId?: string): EntryData["transition"];
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { handleHandlerResult, warnOnStreamedResponse, buildLoaderErrorContext, } from "./segment-resolution/helpers.js";
|
|
2
|
+
export { resolveLoaders, type ResolveSegmentOptions, resolveSegment, resolveOrphanLayout, resolveParallelEntry, resolveAllSegments, resolveLoadersOnly, } from "./segment-resolution/fresh.js";
|
|
3
|
+
export { resolveLoadersWithRevalidation, resolveLoadersOnlyWithRevalidation, buildEntryRevalidateMap, resolveParallelSegmentsWithRevalidation, resolveEntryHandlerWithRevalidation, resolveSegmentWithRevalidation, resolveOrphanLayoutWithRevalidation, resolveAllSegmentsWithRevalidation, } from "./segment-resolution/revalidation.js";
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { EntryData, InterceptEntry } from "../server/context";
|
|
2
|
+
import type { HandlerContext, ResolvedSegment, ShouldRevalidateFn } from "../types";
|
|
3
|
+
import type { SegmentResolutionDeps } from "./types.js";
|
|
4
|
+
import type { ResolveSegmentOptions } from "./segment-resolution.js";
|
|
5
|
+
import type { InterceptSelectorContext } from "../server/context";
|
|
6
|
+
export interface SegmentWrappers<TEnv = any> {
|
|
7
|
+
resolveAllSegments: (entries: EntryData[], routeKey: string, params: Record<string, string>, context: HandlerContext<any, TEnv>, loaderPromises: Map<string, Promise<any>>, options?: ResolveSegmentOptions) => Promise<ResolvedSegment[]>;
|
|
8
|
+
resolveLoadersOnly: (entries: EntryData[], context: HandlerContext<any, TEnv>) => Promise<ResolvedSegment[]>;
|
|
9
|
+
resolveLoadersOnlyWithRevalidation: (entries: EntryData[], context: HandlerContext<any, TEnv>, clientSegmentIds: Set<string>, prevParams: Record<string, string>, request: Request, prevUrl: URL, nextUrl: URL, routeKey: string, actionContext?: {
|
|
10
|
+
actionId?: string;
|
|
11
|
+
actionUrl?: URL;
|
|
12
|
+
actionResult?: any;
|
|
13
|
+
formData?: FormData;
|
|
14
|
+
}, stale?: boolean) => Promise<{
|
|
15
|
+
segments: ResolvedSegment[];
|
|
16
|
+
matchedIds: string[];
|
|
17
|
+
}>;
|
|
18
|
+
buildEntryRevalidateMap: (entries: EntryData[]) => Map<string, {
|
|
19
|
+
entry: EntryData;
|
|
20
|
+
revalidate: ShouldRevalidateFn<any, any>[];
|
|
21
|
+
}>;
|
|
22
|
+
resolveAllSegmentsWithRevalidation: (entries: EntryData[], routeKey: string, params: Record<string, string>, context: HandlerContext<any, TEnv>, clientSegmentSet: Set<string>, prevParams: Record<string, string>, request: Request, prevUrl: URL, nextUrl: URL, actionContext: {
|
|
23
|
+
actionId?: string;
|
|
24
|
+
actionUrl?: URL;
|
|
25
|
+
actionResult?: any;
|
|
26
|
+
formData?: FormData;
|
|
27
|
+
} | undefined, interceptResult: {
|
|
28
|
+
intercept: InterceptEntry;
|
|
29
|
+
entry: EntryData;
|
|
30
|
+
} | null, localRouteName: string, pathname: string) => Promise<{
|
|
31
|
+
segments: ResolvedSegment[];
|
|
32
|
+
matchedIds: string[];
|
|
33
|
+
}>;
|
|
34
|
+
findInterceptForRoute: (targetRouteKey: string, fromEntry: EntryData | null, selectorContext?: InterceptSelectorContext | null, isAction?: boolean) => {
|
|
35
|
+
intercept: InterceptEntry;
|
|
36
|
+
entry: EntryData;
|
|
37
|
+
} | null;
|
|
38
|
+
resolveInterceptEntry: (interceptEntry: InterceptEntry, parentEntry: EntryData, params: Record<string, string>, context: HandlerContext<any, TEnv>, belongsToRoute?: boolean, revalidationContext?: any, options?: {
|
|
39
|
+
skipMiddleware?: boolean;
|
|
40
|
+
}) => Promise<ResolvedSegment[]>;
|
|
41
|
+
resolveInterceptLoadersOnly: (interceptEntry: InterceptEntry, parentEntry: EntryData, params: Record<string, string>, context: HandlerContext<any, TEnv>, belongsToRoute?: boolean, revalidationContext?: any) => Promise<{
|
|
42
|
+
loaderDataPromise: Promise<any[]> | any[];
|
|
43
|
+
loaderIds: string[];
|
|
44
|
+
} | null>;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Create thin wrapper functions that bind segmentDeps to extracted
|
|
48
|
+
* segment resolution and intercept resolution functions.
|
|
49
|
+
*
|
|
50
|
+
* These maintain the same signatures as the original inline functions
|
|
51
|
+
* so that RouterContext and call sites don't need to change.
|
|
52
|
+
*/
|
|
53
|
+
export declare function createSegmentWrappers<TEnv = any>(segmentDeps: SegmentResolutionDeps<TEnv>): SegmentWrappers<TEnv>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function resolveStateCookieName(prefix: string | undefined, routerId: string): string;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Substitute `:param` placeholders in a route pattern with values from
|
|
3
|
+
* `params`, producing a URL. Built by walking the SAME parsed segments the
|
|
4
|
+
* matcher uses (`parsePattern`) and emitting one piece per segment — so a
|
|
5
|
+
* substituted value is never re-scanned as if it were another placeholder (a
|
|
6
|
+
* catch-all value like `sha:abc/x` used to make the "required" pass read `:abc`
|
|
7
|
+
* and throw). Constraint syntax (`:name(en|gb)`) is stripped; trailing-slash
|
|
8
|
+
* patterns like `/blog/` are preserved unless an optional segment was omitted.
|
|
9
|
+
*
|
|
10
|
+
* Semantics per segment:
|
|
11
|
+
* - static -> emitted verbatim.
|
|
12
|
+
* - `:name` -> required; `undefined` throws, `""` yields an empty segment.
|
|
13
|
+
* - `:name?` -> optional; `undefined`/`""` omitted.
|
|
14
|
+
* - `:name*` / `:name+`-> catch-all; the value is multi-segment, so each segment
|
|
15
|
+
* is encoded and the `/` separators are preserved. `+`
|
|
16
|
+
* (one-or-more) throws when absent; `*` (and bare `*`)
|
|
17
|
+
* omit when absent.
|
|
18
|
+
*
|
|
19
|
+
* Shared by `ctx.reverse()` (server), `createReverse()` (typed runtime
|
|
20
|
+
* helper), and `useReverse()` (client hook). The behavior must stay
|
|
21
|
+
* identical across all three call sites.
|
|
22
|
+
*/
|
|
23
|
+
export declare function substitutePatternParams(pattern: string, params: Record<string, string | undefined>, routeName: string): string;
|