@rangojs/router 0.4.0 → 0.4.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/README.md +19 -1
- package/dist/types/browser/event-controller.d.ts +4 -0
- package/dist/types/browser/link-interceptor.d.ts +17 -7
- package/dist/types/browser/navigation-bridge.d.ts +13 -1
- package/dist/types/browser/notify-listeners.d.ts +2 -0
- package/dist/types/browser/prefetch/cache.d.ts +1 -1
- package/dist/types/browser/prefetch/default-strategy.d.ts +12 -3
- package/dist/types/browser/prefetch/invalidation.d.ts +6 -0
- package/dist/types/browser/prefetch/loader.d.ts +3 -1
- package/dist/types/browser/prefetch/observer.d.ts +3 -6
- package/dist/types/browser/rango-state.d.ts +4 -0
- package/dist/types/browser/react/Link.d.ts +4 -9
- package/dist/types/browser/react/context.d.ts +3 -0
- package/dist/types/browser/rsc-router.d.ts +7 -2
- package/dist/types/browser/types.d.ts +1 -0
- package/dist/types/cache/cache-key-utils.d.ts +11 -3
- package/dist/types/cache/cache-scope.d.ts +82 -3
- package/dist/types/cache/cf/cf-cache-store.d.ts +2 -2
- package/dist/types/cache/index.d.ts +3 -1
- package/dist/types/cache/search-params-filter.d.ts +64 -0
- package/dist/types/cache/shell-snapshot.d.ts +4 -4
- package/dist/types/cache/types.d.ts +30 -2
- package/dist/types/cache/vercel/vercel-cache-store.d.ts +2 -2
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.rsc.d.ts +1 -0
- package/dist/types/router/match-middleware/cache-lookup.d.ts +13 -0
- package/dist/types/router/navigation-snapshot.d.ts +29 -0
- package/dist/types/router/router-options.d.ts +27 -3
- package/dist/types/rsc/shell-build-manifest.d.ts +7 -1
- package/dist/types/rsc/shell-serve.d.ts +7 -1
- package/dist/types/rsc/types.d.ts +17 -0
- package/dist/types/server/request-context.d.ts +57 -4
- package/dist/types/testing/render-route.d.ts +10 -1
- package/dist/types/testing/shell-status.d.ts +6 -3
- package/dist/types/vite/plugin-types.d.ts +1 -1
- package/dist/vite/index.js +5 -5
- package/package.json +23 -22
- package/skills/caching/SKILL.md +39 -0
- package/skills/comparison/references/framework-comparison.md +7 -1
- package/skills/links/SKILL.md +24 -0
- package/skills/ppr/SKILL.md +53 -4
- package/skills/router-setup/SKILL.md +7 -2
- package/skills/testing/client-components.md +15 -14
- package/skills/vercel/SKILL.md +1 -1
- package/src/browser/event-controller.ts +110 -11
- package/src/browser/link-interceptor.ts +469 -20
- package/src/browser/navigation-bridge.ts +71 -2
- package/src/browser/navigation-store.ts +24 -1
- package/src/browser/notify-listeners.ts +22 -0
- package/src/browser/prefetch/cache.ts +4 -2
- package/src/browser/prefetch/default-strategy.ts +43 -3
- package/src/browser/prefetch/invalidation.ts +30 -0
- package/src/browser/prefetch/loader.ts +19 -12
- package/src/browser/prefetch/observer.ts +50 -22
- package/src/browser/rango-state.ts +21 -0
- package/src/browser/react/Link.tsx +97 -88
- package/src/browser/react/NavigationProvider.tsx +1 -0
- package/src/browser/react/context.ts +4 -0
- package/src/browser/rsc-router.tsx +22 -9
- package/src/browser/types.ts +1 -0
- package/src/cache/cache-key-utils.ts +18 -4
- package/src/cache/cache-runtime.ts +7 -2
- package/src/cache/cache-scope.ts +152 -23
- package/src/cache/cf/cf-cache-store.ts +51 -16
- package/src/cache/document-cache.ts +7 -1
- package/src/cache/index.ts +7 -0
- package/src/cache/search-params-filter.ts +118 -0
- package/src/cache/shell-snapshot.ts +8 -4
- package/src/cache/types.ts +33 -2
- package/src/cache/vercel/vercel-cache-store.ts +17 -3
- package/src/index.rsc.ts +4 -0
- package/src/index.ts +6 -0
- package/src/router/match-middleware/cache-lookup.ts +146 -33
- package/src/router/match-middleware/cache-store.ts +70 -0
- package/src/router/navigation-snapshot.ts +46 -6
- package/src/router/router-options.ts +31 -4
- package/src/rsc/handler.ts +9 -0
- package/src/rsc/response-cache-serve.ts +1 -1
- package/src/rsc/rsc-rendering.ts +252 -27
- package/src/rsc/shell-build-manifest.ts +8 -1
- package/src/rsc/shell-capture.ts +5 -0
- package/src/rsc/shell-serve.ts +8 -2
- package/src/rsc/types.ts +17 -0
- package/src/server/request-context.ts +62 -3
- package/src/testing/dispatch.ts +21 -3
- package/src/testing/render-route.tsx +86 -17
- package/src/testing/shell-status.ts +20 -3
- package/src/vite/plugin-types.ts +1 -1
- package/src/vite/plugins/vercel-output.ts +2 -2
- package/dist/types.backup/__internal.d.ts +0 -127
- package/dist/types.backup/bin/rango.d.ts +0 -1
- package/dist/types.backup/browser/action-coordinator.d.ts +0 -57
- package/dist/types.backup/browser/action-fence.d.ts +0 -33
- package/dist/types.backup/browser/app-shell.d.ts +0 -34
- package/dist/types.backup/browser/app-version.d.ts +0 -6
- package/dist/types.backup/browser/connection-warmup.d.ts +0 -31
- package/dist/types.backup/browser/cookie-name.d.ts +0 -66
- package/dist/types.backup/browser/event-controller.d.ts +0 -221
- package/dist/types.backup/browser/history-state.d.ts +0 -26
- package/dist/types.backup/browser/index.d.ts +0 -1
- package/dist/types.backup/browser/intercept-utils.d.ts +0 -30
- package/dist/types.backup/browser/invalidate-client-cache.d.ts +0 -17
- package/dist/types.backup/browser/link-interceptor.d.ts +0 -43
- package/dist/types.backup/browser/logging.d.ts +0 -33
- package/dist/types.backup/browser/merge-segment-loaders.d.ts +0 -38
- package/dist/types.backup/browser/navigation-bridge.d.ts +0 -27
- package/dist/types.backup/browser/navigation-client.d.ts +0 -17
- package/dist/types.backup/browser/navigation-store-handle.d.ts +0 -25
- package/dist/types.backup/browser/navigation-store.d.ts +0 -95
- package/dist/types.backup/browser/navigation-transaction.d.ts +0 -75
- package/dist/types.backup/browser/network-error-handler.d.ts +0 -35
- package/dist/types.backup/browser/partial-update.d.ts +0 -61
- package/dist/types.backup/browser/prefetch/cache.d.ts +0 -183
- package/dist/types.backup/browser/prefetch/fetch.d.ts +0 -52
- package/dist/types.backup/browser/prefetch/observer.d.ts +0 -27
- package/dist/types.backup/browser/prefetch/policy.d.ts +0 -13
- package/dist/types.backup/browser/prefetch/queue.d.ts +0 -48
- package/dist/types.backup/browser/prefetch/resource-ready.d.ts +0 -28
- package/dist/types.backup/browser/rango-state.d.ts +0 -52
- package/dist/types.backup/browser/react/Link.d.ts +0 -140
- package/dist/types.backup/browser/react/NavigationProvider.d.ts +0 -88
- package/dist/types.backup/browser/react/ScrollRestoration.d.ts +0 -78
- package/dist/types.backup/browser/react/context.d.ts +0 -54
- package/dist/types.backup/browser/react/filter-segment-order.d.ts +0 -35
- package/dist/types.backup/browser/react/index.d.ts +0 -1
- package/dist/types.backup/browser/react/location-state-shared.d.ts +0 -162
- package/dist/types.backup/browser/react/location-state.d.ts +0 -29
- package/dist/types.backup/browser/react/mount-context.d.ts +0 -23
- package/dist/types.backup/browser/react/nonce-context.d.ts +0 -14
- package/dist/types.backup/browser/react/shallow-equal.d.ts +0 -5
- package/dist/types.backup/browser/react/use-action.d.ts +0 -61
- package/dist/types.backup/browser/react/use-handle.d.ts +0 -21
- package/dist/types.backup/browser/react/use-href.d.ts +0 -32
- package/dist/types.backup/browser/react/use-link-status.d.ts +0 -36
- package/dist/types.backup/browser/react/use-mount.d.ts +0 -24
- package/dist/types.backup/browser/react/use-navigation.d.ts +0 -15
- package/dist/types.backup/browser/react/use-params.d.ts +0 -21
- package/dist/types.backup/browser/react/use-pathname.d.ts +0 -13
- package/dist/types.backup/browser/react/use-reverse.d.ts +0 -40
- package/dist/types.backup/browser/react/use-router.d.ts +0 -23
- package/dist/types.backup/browser/react/use-search-params.d.ts +0 -19
- package/dist/types.backup/browser/react/use-segments.d.ts +0 -29
- package/dist/types.backup/browser/response-adapter.d.ts +0 -58
- package/dist/types.backup/browser/rsc-router.d.ts +0 -141
- package/dist/types.backup/browser/scroll-restoration.d.ts +0 -103
- package/dist/types.backup/browser/segment-reconciler.d.ts +0 -74
- package/dist/types.backup/browser/segment-structure-assert.d.ts +0 -16
- package/dist/types.backup/browser/server-action-bridge.d.ts +0 -29
- package/dist/types.backup/browser/types.d.ts +0 -530
- package/dist/types.backup/browser/validate-redirect-origin.d.ts +0 -28
- package/dist/types.backup/build/collect-fallback-refs.d.ts +0 -5
- package/dist/types.backup/build/generate-manifest.d.ts +0 -100
- package/dist/types.backup/build/generate-route-types.d.ts +0 -8
- package/dist/types.backup/build/index.d.ts +0 -21
- package/dist/types.backup/build/prefix-tree-utils.d.ts +0 -56
- package/dist/types.backup/build/route-trie.d.ts +0 -89
- package/dist/types.backup/build/route-types/ast-helpers.d.ts +0 -3
- package/dist/types.backup/build/route-types/ast-route-extraction.d.ts +0 -13
- package/dist/types.backup/build/route-types/codegen.d.ts +0 -16
- package/dist/types.backup/build/route-types/include-resolution.d.ts +0 -74
- package/dist/types.backup/build/route-types/param-extraction.d.ts +0 -13
- package/dist/types.backup/build/route-types/per-module-writer.d.ts +0 -18
- package/dist/types.backup/build/route-types/router-processing.d.ts +0 -82
- package/dist/types.backup/build/route-types/scan-filter.d.ts +0 -17
- package/dist/types.backup/build/route-types/source-scan.d.ts +0 -13
- package/dist/types.backup/build/runtime-discovery.d.ts +0 -24
- package/dist/types.backup/cache/background-task.d.ts +0 -21
- package/dist/types.backup/cache/cache-error.d.ts +0 -71
- package/dist/types.backup/cache/cache-key-utils.d.ts +0 -35
- package/dist/types.backup/cache/cache-policy.d.ts +0 -59
- package/dist/types.backup/cache/cache-runtime.d.ts +0 -51
- package/dist/types.backup/cache/cache-scope.d.ts +0 -134
- package/dist/types.backup/cache/cache-tag.d.ts +0 -79
- package/dist/types.backup/cache/cf/cf-base64.d.ts +0 -4
- package/dist/types.backup/cache/cf/cf-cache-constants.d.ts +0 -105
- package/dist/types.backup/cache/cf/cf-cache-store.d.ts +0 -481
- package/dist/types.backup/cache/cf/cf-cache-types.d.ts +0 -300
- package/dist/types.backup/cache/cf/cf-kv-utils.d.ts +0 -22
- package/dist/types.backup/cache/cf/cf-tag-marker-memo.d.ts +0 -15
- package/dist/types.backup/cache/cf/index.d.ts +0 -3
- package/dist/types.backup/cache/document-cache.d.ts +0 -69
- package/dist/types.backup/cache/handle-capture.d.ts +0 -23
- package/dist/types.backup/cache/handle-snapshot.d.ts +0 -39
- package/dist/types.backup/cache/index.d.ts +0 -7
- package/dist/types.backup/cache/memory-segment-store.d.ts +0 -163
- package/dist/types.backup/cache/profile-registry.d.ts +0 -40
- package/dist/types.backup/cache/read-through-swr.d.ts +0 -60
- package/dist/types.backup/cache/segment-codec.d.ts +0 -78
- package/dist/types.backup/cache/shell-snapshot.d.ts +0 -162
- package/dist/types.backup/cache/tag-invalidation.d.ts +0 -74
- package/dist/types.backup/cache/taint.d.ts +0 -71
- package/dist/types.backup/cache/types.d.ts +0 -407
- package/dist/types.backup/cache/vercel/index.d.ts +0 -1
- package/dist/types.backup/cache/vercel/vercel-cache-store.d.ts +0 -267
- package/dist/types.backup/client.d.ts +0 -184
- package/dist/types.backup/client.rsc.d.ts +0 -39
- package/dist/types.backup/cloudflare/index.d.ts +0 -7
- package/dist/types.backup/cloudflare/tracing.d.ts +0 -53
- package/dist/types.backup/component-utils.d.ts +0 -46
- package/dist/types.backup/components/DefaultDocument.d.ts +0 -13
- package/dist/types.backup/context-var.d.ts +0 -84
- package/dist/types.backup/debug.d.ts +0 -57
- package/dist/types.backup/decode-loader-results.d.ts +0 -5
- package/dist/types.backup/default-error-boundary.d.ts +0 -10
- package/dist/types.backup/defer.d.ts +0 -89
- package/dist/types.backup/deps/browser.d.ts +0 -1
- package/dist/types.backup/deps/html-stream-client.d.ts +0 -1
- package/dist/types.backup/deps/html-stream-server.d.ts +0 -1
- package/dist/types.backup/deps/rsc.d.ts +0 -1
- package/dist/types.backup/deps/ssr.d.ts +0 -1
- package/dist/types.backup/encode-kv.d.ts +0 -35
- package/dist/types.backup/errors.d.ts +0 -226
- package/dist/types.backup/escape-script.d.ts +0 -44
- package/dist/types.backup/handle.d.ts +0 -93
- package/dist/types.backup/handles/MetaTags.d.ts +0 -17
- package/dist/types.backup/handles/Scripts.d.ts +0 -38
- package/dist/types.backup/handles/breadcrumbs.d.ts +0 -43
- package/dist/types.backup/handles/deferred-resolution.d.ts +0 -53
- package/dist/types.backup/handles/is-thenable.d.ts +0 -12
- package/dist/types.backup/handles/meta.d.ts +0 -43
- package/dist/types.backup/handles/script.d.ts +0 -139
- package/dist/types.backup/host/cookie-handler.d.ts +0 -8
- package/dist/types.backup/host/errors.d.ts +0 -40
- package/dist/types.backup/host/index.d.ts +0 -33
- package/dist/types.backup/host/pattern-matcher.d.ts +0 -30
- package/dist/types.backup/host/router.d.ts +0 -12
- package/dist/types.backup/host/testing.d.ts +0 -41
- package/dist/types.backup/host/types.d.ts +0 -148
- package/dist/types.backup/host/utils.d.ts +0 -20
- package/dist/types.backup/href-client.d.ts +0 -214
- package/dist/types.backup/index.d.ts +0 -112
- package/dist/types.backup/index.rsc.d.ts +0 -51
- package/dist/types.backup/internal-debug.d.ts +0 -1
- package/dist/types.backup/loader-store.d.ts +0 -193
- package/dist/types.backup/loader.d.ts +0 -18
- package/dist/types.backup/loader.rsc.d.ts +0 -18
- package/dist/types.backup/missing-id-error.d.ts +0 -1
- package/dist/types.backup/outlet-context.d.ts +0 -12
- package/dist/types.backup/outlet-provider.d.ts +0 -12
- package/dist/types.backup/prerender/build-shell-capture.d.ts +0 -104
- package/dist/types.backup/prerender/param-hash.d.ts +0 -6
- package/dist/types.backup/prerender/shell-manifest-key.d.ts +0 -18
- package/dist/types.backup/prerender/store.d.ts +0 -62
- package/dist/types.backup/prerender.d.ts +0 -292
- package/dist/types.backup/redirect-origin.d.ts +0 -55
- package/dist/types.backup/regex-escape.d.ts +0 -6
- package/dist/types.backup/render-error-thrower.d.ts +0 -13
- package/dist/types.backup/response-utils.d.ts +0 -35
- package/dist/types.backup/reverse.d.ts +0 -206
- package/dist/types.backup/root-error-boundary.d.ts +0 -32
- package/dist/types.backup/route-content-wrapper.d.ts +0 -40
- package/dist/types.backup/route-definition/dsl-helpers.d.ts +0 -130
- package/dist/types.backup/route-definition/helper-factories.d.ts +0 -22
- package/dist/types.backup/route-definition/helpers-types.d.ts +0 -392
- package/dist/types.backup/route-definition/index.d.ts +0 -7
- package/dist/types.backup/route-definition/redirect.d.ts +0 -48
- package/dist/types.backup/route-definition/resolve-handler-use.d.ts +0 -19
- package/dist/types.backup/route-definition/use-item-types.d.ts +0 -1
- package/dist/types.backup/route-definition.d.ts +0 -1
- package/dist/types.backup/route-map-builder.d.ts +0 -127
- package/dist/types.backup/route-name.d.ts +0 -27
- package/dist/types.backup/route-types.d.ts +0 -172
- package/dist/types.backup/router/basename.d.ts +0 -10
- package/dist/types.backup/router/content-negotiation.d.ts +0 -91
- package/dist/types.backup/router/debug-manifest.d.ts +0 -7
- package/dist/types.backup/router/error-handling.d.ts +0 -76
- package/dist/types.backup/router/find-match.d.ts +0 -19
- package/dist/types.backup/router/handler-context.d.ts +0 -41
- package/dist/types.backup/router/instrument.d.ts +0 -161
- package/dist/types.backup/router/intercept-resolution.d.ts +0 -79
- package/dist/types.backup/router/lazy-includes.d.ts +0 -26
- package/dist/types.backup/router/loader-resolution.d.ts +0 -63
- package/dist/types.backup/router/logging.d.ts +0 -41
- package/dist/types.backup/router/manifest.d.ts +0 -8
- package/dist/types.backup/router/match-api.d.ts +0 -19
- package/dist/types.backup/router/match-context.d.ts +0 -184
- package/dist/types.backup/router/match-handlers.d.ts +0 -49
- package/dist/types.backup/router/match-middleware/background-revalidation.d.ts +0 -113
- package/dist/types.backup/router/match-middleware/cache-lookup.d.ts +0 -113
- package/dist/types.backup/router/match-middleware/cache-store.d.ts +0 -112
- package/dist/types.backup/router/match-middleware/index.d.ts +0 -80
- package/dist/types.backup/router/match-middleware/intercept-resolution.d.ts +0 -116
- package/dist/types.backup/router/match-middleware/segment-resolution.d.ts +0 -94
- package/dist/types.backup/router/match-pipelines.d.ts +0 -103
- package/dist/types.backup/router/match-result.d.ts +0 -114
- package/dist/types.backup/router/metrics.d.ts +0 -6
- package/dist/types.backup/router/middleware-types.d.ts +0 -74
- package/dist/types.backup/router/middleware.d.ts +0 -116
- package/dist/types.backup/router/navigation-snapshot.d.ts +0 -22
- package/dist/types.backup/router/params-util.d.ts +0 -8
- package/dist/types.backup/router/parse-pattern.d.ts +0 -38
- package/dist/types.backup/router/pattern-matching.d.ts +0 -169
- package/dist/types.backup/router/prefetch-cache-ttl.d.ts +0 -27
- package/dist/types.backup/router/prefetch-limits.d.ts +0 -20
- package/dist/types.backup/router/prerender-match.d.ts +0 -50
- package/dist/types.backup/router/preview-match.d.ts +0 -22
- package/dist/types.backup/router/request-classification.d.ts +0 -104
- package/dist/types.backup/router/revalidation.d.ts +0 -57
- package/dist/types.backup/router/route-snapshot.d.ts +0 -112
- package/dist/types.backup/router/router-context.d.ts +0 -137
- package/dist/types.backup/router/router-interfaces.d.ts +0 -432
- package/dist/types.backup/router/router-options.d.ts +0 -738
- package/dist/types.backup/router/router-registry.d.ts +0 -15
- package/dist/types.backup/router/segment-resolution/fresh.d.ts +0 -55
- package/dist/types.backup/router/segment-resolution/helpers.d.ts +0 -93
- package/dist/types.backup/router/segment-resolution/loader-cache.d.ts +0 -33
- package/dist/types.backup/router/segment-resolution/loader-mask.d.ts +0 -44
- package/dist/types.backup/router/segment-resolution/loader-snapshot.d.ts +0 -90
- package/dist/types.backup/router/segment-resolution/mask-nested.d.ts +0 -53
- package/dist/types.backup/router/segment-resolution/revalidation.d.ts +0 -85
- package/dist/types.backup/router/segment-resolution/static-store.d.ts +0 -17
- package/dist/types.backup/router/segment-resolution/streamed-handler-telemetry.d.ts +0 -16
- package/dist/types.backup/router/segment-resolution/view-transition-default.d.ts +0 -28
- package/dist/types.backup/router/segment-resolution.d.ts +0 -3
- package/dist/types.backup/router/segment-wrappers.d.ts +0 -53
- package/dist/types.backup/router/state-cookie-name.d.ts +0 -1
- package/dist/types.backup/router/substitute-pattern-params.d.ts +0 -23
- package/dist/types.backup/router/telemetry-otel.d.ts +0 -113
- package/dist/types.backup/router/telemetry.d.ts +0 -215
- package/dist/types.backup/router/timeout.d.ts +0 -68
- package/dist/types.backup/router/tracing.d.ts +0 -125
- package/dist/types.backup/router/trie-matching.d.ts +0 -32
- package/dist/types.backup/router/types.d.ts +0 -98
- package/dist/types.backup/router/url-params.d.ts +0 -26
- package/dist/types.backup/router.d.ts +0 -7
- package/dist/types.backup/rsc/capture-queue.d.ts +0 -6
- package/dist/types.backup/rsc/full-payload.d.ts +0 -22
- package/dist/types.backup/rsc/handler-context.d.ts +0 -31
- package/dist/types.backup/rsc/handler.d.ts +0 -9
- package/dist/types.backup/rsc/helpers.d.ts +0 -213
- package/dist/types.backup/rsc/index.d.ts +0 -17
- package/dist/types.backup/rsc/json-route-result.d.ts +0 -20
- package/dist/types.backup/rsc/loader-fetch.d.ts +0 -14
- package/dist/types.backup/rsc/manifest-init.d.ts +0 -18
- package/dist/types.backup/rsc/nonce.d.ts +0 -28
- package/dist/types.backup/rsc/origin-guard.d.ts +0 -50
- package/dist/types.backup/rsc/progressive-enhancement.d.ts +0 -19
- package/dist/types.backup/rsc/redirect-guard.d.ts +0 -35
- package/dist/types.backup/rsc/response-cache-serve.d.ts +0 -46
- package/dist/types.backup/rsc/response-error.d.ts +0 -19
- package/dist/types.backup/rsc/response-route-handler.d.ts +0 -29
- package/dist/types.backup/rsc/rsc-rendering.d.ts +0 -23
- package/dist/types.backup/rsc/runtime-warnings.d.ts +0 -22
- package/dist/types.backup/rsc/server-action.d.ts +0 -68
- package/dist/types.backup/rsc/shell-build-manifest.d.ts +0 -84
- package/dist/types.backup/rsc/shell-capture-constants.d.ts +0 -27
- package/dist/types.backup/rsc/shell-capture.d.ts +0 -374
- package/dist/types.backup/rsc/shell-serve.d.ts +0 -136
- package/dist/types.backup/rsc/ssr-setup.d.ts +0 -48
- package/dist/types.backup/rsc/transition-gate.d.ts +0 -27
- package/dist/types.backup/rsc/types.d.ts +0 -290
- package/dist/types.backup/runtime-env.d.ts +0 -1
- package/dist/types.backup/search-params.d.ts +0 -125
- package/dist/types.backup/segment-content-promise.d.ts +0 -13
- package/dist/types.backup/segment-fragments.d.ts +0 -56
- package/dist/types.backup/segment-loader-promise.d.ts +0 -22
- package/dist/types.backup/segment-system.d.ts +0 -84
- package/dist/types.backup/serialize.d.ts +0 -164
- package/dist/types.backup/server/context.d.ts +0 -494
- package/dist/types.backup/server/cookie-parse.d.ts +0 -10
- package/dist/types.backup/server/cookie-store.d.ts +0 -107
- package/dist/types.backup/server/fetchable-loader-store.d.ts +0 -20
- package/dist/types.backup/server/handle-store.d.ts +0 -100
- package/dist/types.backup/server/loader-registry.d.ts +0 -32
- package/dist/types.backup/server/request-context.d.ts +0 -596
- package/dist/types.backup/server/root-layout.d.ts +0 -3
- package/dist/types.backup/server.d.ts +0 -15
- package/dist/types.backup/ssr/index.d.ts +0 -233
- package/dist/types.backup/ssr/inject-rsc-eager.d.ts +0 -3
- package/dist/types.backup/ssr/preinit-client-references.d.ts +0 -71
- package/dist/types.backup/ssr/ssr-root.d.ts +0 -69
- package/dist/types.backup/static-handler.d.ts +0 -57
- package/dist/types.backup/testing/cache-status.d.ts +0 -63
- package/dist/types.backup/testing/collect-handle.d.ts +0 -20
- package/dist/types.backup/testing/dispatch.d.ts +0 -123
- package/dist/types.backup/testing/dom.entry.d.ts +0 -15
- package/dist/types.backup/testing/e2e/fixture.d.ts +0 -37
- package/dist/types.backup/testing/e2e/index.d.ts +0 -30
- package/dist/types.backup/testing/e2e/matchers.d.ts +0 -17
- package/dist/types.backup/testing/e2e/page-helpers.d.ts +0 -62
- package/dist/types.backup/testing/e2e/parity.d.ts +0 -111
- package/dist/types.backup/testing/e2e/server.d.ts +0 -35
- package/dist/types.backup/testing/flight-matchers.d.ts +0 -55
- package/dist/types.backup/testing/flight-normalize.d.ts +0 -1
- package/dist/types.backup/testing/flight-tree.d.ts +0 -192
- package/dist/types.backup/testing/flight.d.ts +0 -115
- package/dist/types.backup/testing/flight.entry.d.ts +0 -27
- package/dist/types.backup/testing/generated-routes.d.ts +0 -66
- package/dist/types.backup/testing/index.d.ts +0 -52
- package/dist/types.backup/testing/internal/context.d.ts +0 -225
- package/dist/types.backup/testing/internal/flight-client-globals.d.ts +0 -1
- package/dist/types.backup/testing/internal/seed-vars.d.ts +0 -30
- package/dist/types.backup/testing/render-handler.d.ts +0 -160
- package/dist/types.backup/testing/render-route.d.ts +0 -246
- package/dist/types.backup/testing/run-loader.d.ts +0 -186
- package/dist/types.backup/testing/run-middleware.d.ts +0 -132
- package/dist/types.backup/testing/run-transition-when.d.ts +0 -77
- package/dist/types.backup/testing/vitest-stubs/cloudflare-email.d.ts +0 -6
- package/dist/types.backup/testing/vitest-stubs/cloudflare-workers.d.ts +0 -13
- package/dist/types.backup/testing/vitest-stubs/plugin-rsc.d.ts +0 -7
- package/dist/types.backup/testing/vitest-stubs/version.d.ts +0 -1
- package/dist/types.backup/testing/vitest.d.ts +0 -205
- package/dist/types.backup/theme/ThemeProvider.d.ts +0 -13
- package/dist/types.backup/theme/ThemeScript.d.ts +0 -45
- package/dist/types.backup/theme/constants.d.ts +0 -39
- package/dist/types.backup/theme/index.d.ts +0 -29
- package/dist/types.backup/theme/theme-context.d.ts +0 -21
- package/dist/types.backup/theme/theme-script.d.ts +0 -26
- package/dist/types.backup/theme/types.d.ts +0 -162
- package/dist/types.backup/theme/use-theme.d.ts +0 -8
- package/dist/types.backup/types/boundaries.d.ts +0 -93
- package/dist/types.backup/types/cache-types.d.ts +0 -191
- package/dist/types.backup/types/error-types.d.ts +0 -114
- package/dist/types.backup/types/global-namespace.d.ts +0 -90
- package/dist/types.backup/types/handler-context.d.ts +0 -658
- package/dist/types.backup/types/index.d.ts +0 -11
- package/dist/types.backup/types/loader-types.d.ts +0 -182
- package/dist/types.backup/types/request-scope.d.ts +0 -93
- package/dist/types.backup/types/route-config.d.ts +0 -105
- package/dist/types.backup/types/route-entry.d.ts +0 -95
- package/dist/types.backup/types/segments.d.ts +0 -234
- package/dist/types.backup/types.d.ts +0 -1
- package/dist/types.backup/urls/include-helper.d.ts +0 -17
- package/dist/types.backup/urls/include-provider.d.ts +0 -27
- package/dist/types.backup/urls/index.d.ts +0 -6
- package/dist/types.backup/urls/path-helper-types.d.ts +0 -197
- package/dist/types.backup/urls/path-helper.d.ts +0 -12
- package/dist/types.backup/urls/pattern-types.d.ts +0 -166
- package/dist/types.backup/urls/response-types.d.ts +0 -67
- package/dist/types.backup/urls/type-extraction.d.ts +0 -157
- package/dist/types.backup/urls/urls-function.d.ts +0 -24
- package/dist/types.backup/urls.d.ts +0 -1
- package/dist/types.backup/use-loader.d.ts +0 -150
- package/dist/types.backup/vercel/index.d.ts +0 -10
- package/dist/types.backup/vercel/tracing.d.ts +0 -70
- package/dist/types.backup/vite/debug.d.ts +0 -80
- package/dist/types.backup/vite/discovery/bundle-postprocess.d.ts +0 -12
- package/dist/types.backup/vite/discovery/dev-prerender-cache.d.ts +0 -65
- package/dist/types.backup/vite/discovery/discover-routers.d.ts +0 -17
- package/dist/types.backup/vite/discovery/discovery-errors.d.ts +0 -113
- package/dist/types.backup/vite/discovery/gate-state.d.ts +0 -79
- package/dist/types.backup/vite/discovery/prerender-collection.d.ts +0 -24
- package/dist/types.backup/vite/discovery/route-types-writer.d.ts +0 -32
- package/dist/types.backup/vite/discovery/self-gen-tracking.d.ts +0 -22
- package/dist/types.backup/vite/discovery/shell-prerender-phase.d.ts +0 -40
- package/dist/types.backup/vite/discovery/state.d.ts +0 -162
- package/dist/types.backup/vite/discovery/virtual-module-codegen.d.ts +0 -15
- package/dist/types.backup/vite/index.d.ts +0 -11
- package/dist/types.backup/vite/inject-client-debug.d.ts +0 -56
- package/dist/types.backup/vite/plugin-types.d.ts +0 -298
- package/dist/types.backup/vite/plugins/cjs-to-esm.d.ts +0 -6
- package/dist/types.backup/vite/plugins/client-ref-dedup.d.ts +0 -40
- package/dist/types.backup/vite/plugins/client-ref-hashing.d.ts +0 -35
- package/dist/types.backup/vite/plugins/cloudflare-protocol-stub.d.ts +0 -64
- package/dist/types.backup/vite/plugins/expose-action-id.d.ts +0 -18
- package/dist/types.backup/vite/plugins/expose-id-utils.d.ts +0 -37
- package/dist/types.backup/vite/plugins/expose-ids/export-analysis.d.ts +0 -19
- package/dist/types.backup/vite/plugins/expose-ids/handler-transform.d.ts +0 -10
- package/dist/types.backup/vite/plugins/expose-ids/loader-transform.d.ts +0 -8
- package/dist/types.backup/vite/plugins/expose-ids/router-transform.d.ts +0 -13
- package/dist/types.backup/vite/plugins/expose-ids/types.d.ts +0 -29
- package/dist/types.backup/vite/plugins/expose-internal-ids.d.ts +0 -6
- package/dist/types.backup/vite/plugins/performance-tracks.d.ts +0 -25
- package/dist/types.backup/vite/plugins/refresh-cmd.d.ts +0 -20
- package/dist/types.backup/vite/plugins/use-cache-transform.d.ts +0 -20
- package/dist/types.backup/vite/plugins/vercel-output.d.ts +0 -85
- package/dist/types.backup/vite/plugins/version-injector.d.ts +0 -21
- package/dist/types.backup/vite/plugins/version-plugin.d.ts +0 -19
- package/dist/types.backup/vite/plugins/virtual-entries.d.ts +0 -36
- package/dist/types.backup/vite/plugins/virtual-stub-plugin.d.ts +0 -7
- package/dist/types.backup/vite/rango.d.ts +0 -29
- package/dist/types.backup/vite/router-discovery.d.ts +0 -23
- package/dist/types.backup/vite/utils/ast-handler-extract.d.ts +0 -64
- package/dist/types.backup/vite/utils/banner.d.ts +0 -2
- package/dist/types.backup/vite/utils/bundle-analysis.d.ts +0 -28
- package/dist/types.backup/vite/utils/client-chunks.d.ts +0 -55
- package/dist/types.backup/vite/utils/directive-prologue.d.ts +0 -16
- package/dist/types.backup/vite/utils/forward-user-plugins.d.ts +0 -37
- package/dist/types.backup/vite/utils/manifest-utils.d.ts +0 -7
- package/dist/types.backup/vite/utils/package-resolution.d.ts +0 -6
- package/dist/types.backup/vite/utils/prerender-utils.d.ts +0 -32
- package/dist/types.backup/vite/utils/shared-utils.d.ts +0 -55
|
@@ -1,432 +0,0 @@
|
|
|
1
|
-
import type { ComponentType } from "react";
|
|
2
|
-
import type { SerializedManifest } from "../debug.js";
|
|
3
|
-
import type { ReverseFunction } from "../reverse.js";
|
|
4
|
-
import type { UrlPatterns } from "../urls.js";
|
|
5
|
-
import type { UrlBuilder, EnvCompatible } from "../urls/pattern-types.js";
|
|
6
|
-
import type { EntryData } from "../server/context";
|
|
7
|
-
import type { ErrorInfo, MatchResult } from "../types";
|
|
8
|
-
import type { NonceProvider } from "../rsc/types.js";
|
|
9
|
-
import type { ShellCaptureDebug } from "../rsc/shell-capture.js";
|
|
10
|
-
import type { ExecutionContext } from "../server/request-context.js";
|
|
11
|
-
import type { SerializedSegmentData } from "../cache/types.js";
|
|
12
|
-
import type { MiddlewareEntry, MiddlewareFn } from "./middleware.js";
|
|
13
|
-
import type { RouteMatchResult } from "./pattern-matching.js";
|
|
14
|
-
import type { ExtractParams } from "../types/route-config.js";
|
|
15
|
-
import { RSC_ROUTER_BRAND } from "./router-registry.js";
|
|
16
|
-
import type { RangoOptions, RootLayoutProps } from "./router-options.js";
|
|
17
|
-
import type { DefaultVars } from "../types/global-namespace.js";
|
|
18
|
-
import type { ResolvedTimeouts, OnTimeoutCallback } from "./timeout.js";
|
|
19
|
-
import type { ResolvedTracing } from "./tracing.js";
|
|
20
|
-
import type { TelemetrySink } from "./telemetry.js";
|
|
21
|
-
/**
|
|
22
|
-
* Options passed to router.fetch(), router.match(), and other request entrypoints.
|
|
23
|
-
* All entrypoints use this same shape for consistency.
|
|
24
|
-
*/
|
|
25
|
-
export interface RouterRequestInput<TEnv, TVars = DefaultVars> {
|
|
26
|
-
env?: TEnv;
|
|
27
|
-
vars?: Partial<TVars>;
|
|
28
|
-
ctx?: ExecutionContext;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Merge route patterns with response types into a single route map.
|
|
32
|
-
* Routes with response types get { path, response } objects; others stay as strings.
|
|
33
|
-
* Handles both plain string routes and { path, search } object routes.
|
|
34
|
-
*/
|
|
35
|
-
type MergeRoutesWithResponses<TRoutes extends Record<string, unknown>, TResponses> = {
|
|
36
|
-
[K in keyof TRoutes]: K extends keyof NonNullable<TResponses> ? unknown extends NonNullable<TResponses>[K] ? TRoutes[K] : TRoutes[K] extends {
|
|
37
|
-
readonly path: infer P extends string;
|
|
38
|
-
} ? TRoutes[K] & {
|
|
39
|
-
readonly response: NonNullable<TResponses>[K];
|
|
40
|
-
} : {
|
|
41
|
-
readonly path: TRoutes[K] & string;
|
|
42
|
-
readonly response: NonNullable<TResponses>[K];
|
|
43
|
-
} : TRoutes[K];
|
|
44
|
-
};
|
|
45
|
-
/**
|
|
46
|
-
* Public Rango router interface — the user-facing API surface.
|
|
47
|
-
*
|
|
48
|
-
* Users interact with this type when building and using routers.
|
|
49
|
-
* Internal framework code uses RangoInternal (via toInternal()) to access
|
|
50
|
-
* matching, build-time, and configuration members that are not part of the
|
|
51
|
-
* public contract.
|
|
52
|
-
*
|
|
53
|
-
* TRoutes accumulates all registered route types through the builder chain.
|
|
54
|
-
*/
|
|
55
|
-
export interface Rango<TEnv = any, TRoutes extends Record<string, unknown> = Record<string, string>> {
|
|
56
|
-
/**
|
|
57
|
-
* Unique identifier for this router instance.
|
|
58
|
-
* Used to namespace static output and isolate route maps between routers.
|
|
59
|
-
*/
|
|
60
|
-
readonly id: string;
|
|
61
|
-
/**
|
|
62
|
-
* URL prefix applied to all routes. Undefined when no basename is configured.
|
|
63
|
-
*/
|
|
64
|
-
readonly basename: string | undefined;
|
|
65
|
-
/**
|
|
66
|
-
* Register routes using URL patterns from urls() or a builder function
|
|
67
|
-
*
|
|
68
|
-
* @example
|
|
69
|
-
* ```typescript
|
|
70
|
-
* // With urls()
|
|
71
|
-
* createRouter({}).routes(urlpatterns)
|
|
72
|
-
*
|
|
73
|
-
* // With builder function (urls() is implicit)
|
|
74
|
-
* createRouter({}).routes(({ path, layout }) => [
|
|
75
|
-
* layout(RootLayout, () => [
|
|
76
|
-
* path("/", HomePage),
|
|
77
|
-
* ]),
|
|
78
|
-
* ])
|
|
79
|
-
* ```
|
|
80
|
-
*/
|
|
81
|
-
routes<T extends UrlPatterns<any, any, any>>(patterns: T & EnvCompatible<T, TEnv>): Rango<TEnv, TRoutes & (NonNullable<T["_routes"]> extends Record<string, unknown> ? MergeRoutesWithResponses<NonNullable<T["_routes"]>, T["_responses"]> : Record<string, string>)>;
|
|
82
|
-
routes(builder: UrlBuilder<TEnv>): Rango<TEnv, TRoutes>;
|
|
83
|
-
/**
|
|
84
|
-
* Add global middleware that runs on all routes
|
|
85
|
-
*
|
|
86
|
-
* @example
|
|
87
|
-
* ```typescript
|
|
88
|
-
* createRouter({ document: RootLayout })
|
|
89
|
-
* .use(loggerMiddleware) // All routes
|
|
90
|
-
* .use("/api/*", rateLimiter) // Pattern match
|
|
91
|
-
* .use("/users/:id", (ctx) => {}) // ctx.params.id is typed
|
|
92
|
-
* .routes(urlpatterns)
|
|
93
|
-
* ```
|
|
94
|
-
*/
|
|
95
|
-
use<Pattern extends string>(pattern: Pattern, middleware: MiddlewareFn<TEnv, ExtractParams<Pattern>>): Rango<TEnv, TRoutes>;
|
|
96
|
-
use(patternOrMiddleware: string | MiddlewareFn<TEnv>, middleware?: MiddlewareFn<TEnv>): Rango<TEnv, TRoutes>;
|
|
97
|
-
/**
|
|
98
|
-
* Type-safe URL builder for registered routes
|
|
99
|
-
* Types are inferred from the accumulated route registrations
|
|
100
|
-
*
|
|
101
|
-
* @example
|
|
102
|
-
* ```typescript
|
|
103
|
-
* router.reverse("cart"); // "/shop/cart"
|
|
104
|
-
* router.reverse("detail", { slug: "widget" }); // "/shop/product/widget"
|
|
105
|
-
* ```
|
|
106
|
-
*/
|
|
107
|
-
reverse: ReverseFunction<TRoutes>;
|
|
108
|
-
/**
|
|
109
|
-
* Accumulated route map for typeof extraction
|
|
110
|
-
* Used for module augmentation: `type AppRoutes = typeof _router.routeMap`
|
|
111
|
-
*
|
|
112
|
-
* @example
|
|
113
|
-
* ```typescript
|
|
114
|
-
* const _router = createRouter<AppEnv>({
|
|
115
|
-
* urls: urlpatterns,
|
|
116
|
-
* });
|
|
117
|
-
*
|
|
118
|
-
* type AppRoutes = typeof _router.routeMap;
|
|
119
|
-
*
|
|
120
|
-
* declare global {
|
|
121
|
-
* namespace Rango {
|
|
122
|
-
* interface RegisteredRoutes extends AppRoutes {}
|
|
123
|
-
* }
|
|
124
|
-
* }
|
|
125
|
-
* ```
|
|
126
|
-
*/
|
|
127
|
-
readonly routeMap: TRoutes;
|
|
128
|
-
/**
|
|
129
|
-
* Handle an RSC request.
|
|
130
|
-
*
|
|
131
|
-
* Uses the router's configuration (nonce, version, cache) automatically.
|
|
132
|
-
* The handler is lazily created on first call.
|
|
133
|
-
*
|
|
134
|
-
* @example Cloudflare Workers
|
|
135
|
-
* ```tsx
|
|
136
|
-
* import { router } from "./router";
|
|
137
|
-
*
|
|
138
|
-
* export default { fetch: router.fetch };
|
|
139
|
-
* ```
|
|
140
|
-
*
|
|
141
|
-
* @example Direct export
|
|
142
|
-
* ```tsx
|
|
143
|
-
* const router = createRouter({
|
|
144
|
-
* document: Document,
|
|
145
|
-
* urls: urlpatterns,
|
|
146
|
-
* nonce: () => true,
|
|
147
|
-
* });
|
|
148
|
-
*
|
|
149
|
-
* export const fetch = router.fetch;
|
|
150
|
-
* ```
|
|
151
|
-
*/
|
|
152
|
-
fetch(request: Request, input?: RouterRequestInput<TEnv>): Promise<Response>;
|
|
153
|
-
}
|
|
154
|
-
/**
|
|
155
|
-
* Internal Rango router interface — the full framework-facing API.
|
|
156
|
-
*
|
|
157
|
-
* This type includes all members used by the Vite plugin, RSC handler,
|
|
158
|
-
* pre-rendering pipeline, and other framework internals. It is NOT exported
|
|
159
|
-
* from the public package API.
|
|
160
|
-
*
|
|
161
|
-
* Use toInternal(router) to assert a public Rango into this type
|
|
162
|
-
* at the boundary where framework code receives a user-provided router.
|
|
163
|
-
*/
|
|
164
|
-
export interface RangoInternal<TEnv = any, TRoutes extends Record<string, unknown> = Record<string, string>> {
|
|
165
|
-
/**
|
|
166
|
-
* Brand marker for build-time discovery.
|
|
167
|
-
* The Vite plugin uses this to identify router instances in module exports.
|
|
168
|
-
*/
|
|
169
|
-
readonly __brand: typeof RSC_ROUTER_BRAND;
|
|
170
|
-
/**
|
|
171
|
-
* Unique identifier for this router instance.
|
|
172
|
-
* Used to namespace static output and isolate route maps between routers.
|
|
173
|
-
*/
|
|
174
|
-
readonly id: string;
|
|
175
|
-
/** URL prefix applied to all routes. */
|
|
176
|
-
readonly basename: string | undefined;
|
|
177
|
-
/**
|
|
178
|
-
* Register routes using URL patterns from urls() or a builder function.
|
|
179
|
-
*
|
|
180
|
-
* Env compatibility is checked by EnvCompatible: an env-agnostic urls() block
|
|
181
|
-
* (its env is `unknown` — e.g. a shared module, or an app that does not augment
|
|
182
|
-
* `Rango.Env`) attaches to any router, while a urls<TEnv>() block carrying a
|
|
183
|
-
* concrete env is accepted only when this router's `TEnv` satisfies it. So a
|
|
184
|
-
* `urls<{ DB }>()` cannot be mounted on a `createRouter<{}>()`.
|
|
185
|
-
*/
|
|
186
|
-
routes<T extends UrlPatterns<any, any, any>>(patterns: T & EnvCompatible<T, TEnv>): Rango<TEnv, TRoutes & (NonNullable<T["_routes"]> extends Record<string, unknown> ? MergeRoutesWithResponses<NonNullable<T["_routes"]>, T["_responses"]> : Record<string, string>)>;
|
|
187
|
-
routes(builder: UrlBuilder<TEnv>): Rango<TEnv, TRoutes>;
|
|
188
|
-
/**
|
|
189
|
-
* Add global middleware that runs on all routes
|
|
190
|
-
*/
|
|
191
|
-
use<Pattern extends string>(pattern: Pattern, middleware: MiddlewareFn<TEnv, ExtractParams<Pattern>>): Rango<TEnv, TRoutes>;
|
|
192
|
-
use(patternOrMiddleware: string | MiddlewareFn<TEnv>, middleware?: MiddlewareFn<TEnv>): Rango<TEnv, TRoutes>;
|
|
193
|
-
/**
|
|
194
|
-
* Type-safe URL builder for registered routes
|
|
195
|
-
*/
|
|
196
|
-
reverse: ReverseFunction<TRoutes>;
|
|
197
|
-
/**
|
|
198
|
-
* Accumulated route map for typeof extraction
|
|
199
|
-
*/
|
|
200
|
-
readonly routeMap: TRoutes;
|
|
201
|
-
/**
|
|
202
|
-
* Root layout component that wraps the entire application
|
|
203
|
-
* Access this to pass to renderSegments
|
|
204
|
-
*/
|
|
205
|
-
readonly rootLayout?: ComponentType<RootLayoutProps>;
|
|
206
|
-
/**
|
|
207
|
-
* Error callback for monitoring/alerting
|
|
208
|
-
* Called when errors occur in loaders, actions, or routes
|
|
209
|
-
*/
|
|
210
|
-
readonly onError?: RangoOptions<TEnv>["onError"];
|
|
211
|
-
/**
|
|
212
|
-
* Cache configuration
|
|
213
|
-
*/
|
|
214
|
-
readonly cache?: RangoOptions<TEnv>["cache"];
|
|
215
|
-
/**
|
|
216
|
-
* Not found component to render when no route matches
|
|
217
|
-
*/
|
|
218
|
-
readonly notFound?: RangoOptions<TEnv>["notFound"];
|
|
219
|
-
/**
|
|
220
|
-
* Resolved theme configuration (null if theme not enabled)
|
|
221
|
-
* Used by NavigationProvider to include ThemeProvider and by MetaTags to render theme script
|
|
222
|
-
*/
|
|
223
|
-
readonly themeConfig: import("../theme/types.js").ResolvedThemeConfig | null;
|
|
224
|
-
/**
|
|
225
|
-
* Cache profiles for "use cache" per-request resolution.
|
|
226
|
-
* Always includes at least the "default" profile.
|
|
227
|
-
*/
|
|
228
|
-
readonly cacheProfiles: Record<string, import("../cache/profile-registry.js").CacheProfile>;
|
|
229
|
-
/**
|
|
230
|
-
* Cache-Control header value for prefetch responses.
|
|
231
|
-
* False means no caching of prefetch responses.
|
|
232
|
-
* Derived from prefetchCacheTTL.
|
|
233
|
-
*/
|
|
234
|
-
readonly prefetchCacheControl: string | false;
|
|
235
|
-
/**
|
|
236
|
-
* TTL in milliseconds for the client-side in-memory prefetch cache.
|
|
237
|
-
* 0 means caching is disabled.
|
|
238
|
-
*/
|
|
239
|
-
readonly prefetchCacheTTL: number;
|
|
240
|
-
/**
|
|
241
|
-
* Maximum number of decoded prefetch payloads the client keeps in its
|
|
242
|
-
* in-memory prefetch cache (FIFO eviction at capacity). Shipped to the
|
|
243
|
-
* client in payload metadata. Derived from prefetchCacheSize.
|
|
244
|
-
*/
|
|
245
|
-
readonly prefetchCacheSize: number;
|
|
246
|
-
/**
|
|
247
|
-
* Maximum number of speculative prefetch requests the client runs
|
|
248
|
-
* concurrently. Shipped to the client in payload metadata. Derived from
|
|
249
|
-
* prefetchConcurrency.
|
|
250
|
-
*/
|
|
251
|
-
readonly prefetchConcurrency: number;
|
|
252
|
-
/**
|
|
253
|
-
* Resolved rango state cookie name (`{prefix}_{routerId}`), composed once at
|
|
254
|
-
* router init and shipped to the client in payload metadata. The server-side
|
|
255
|
-
* cookie writer reads it from here; the client reads it from metadata.
|
|
256
|
-
*/
|
|
257
|
-
readonly resolvedStateCookieName: string;
|
|
258
|
-
/**
|
|
259
|
-
* Whether connection warmup is enabled.
|
|
260
|
-
* When true, the client sends HEAD /?_rsc_warmup after idle periods
|
|
261
|
-
* and the server responds with 204 No Content.
|
|
262
|
-
*/
|
|
263
|
-
readonly warmupEnabled: boolean;
|
|
264
|
-
/**
|
|
265
|
-
* Whether the client hydrates inside React.StrictMode. Resolved from
|
|
266
|
-
* createRouter({ strictMode }) (default true) and shipped to the client in
|
|
267
|
-
* the initial payload metadata.
|
|
268
|
-
*/
|
|
269
|
-
readonly strictMode: boolean;
|
|
270
|
-
/**
|
|
271
|
-
* Whether router-wide performance debugging is enabled.
|
|
272
|
-
* Used by the request handler to create metrics before middleware runs.
|
|
273
|
-
*/
|
|
274
|
-
readonly debugPerformance?: boolean;
|
|
275
|
-
/**
|
|
276
|
-
* PPR shell-capture debug sink (createRouter({ debugShellCapture })), read
|
|
277
|
-
* by rsc-rendering when it builds the capture descriptor for a ppr route.
|
|
278
|
-
*/
|
|
279
|
-
readonly debugShellCapture?: ShellCaptureDebug;
|
|
280
|
-
/**
|
|
281
|
-
* Resolved platform phase-span tracing (Cloudflare custom spans or OTel), or
|
|
282
|
-
* undefined when off. Threaded onto the request context and read at each
|
|
283
|
-
* traced phase.
|
|
284
|
-
*/
|
|
285
|
-
readonly tracing?: ResolvedTracing;
|
|
286
|
-
/**
|
|
287
|
-
* Raw telemetry sink from RangoOptions, exposed so handler-level emitters
|
|
288
|
-
* (rsc/handler.ts timeout/origin/late-handle) can emit WITHOUT the
|
|
289
|
-
* RouterContext ALS, which only match()/matchPartial() enter. See
|
|
290
|
-
* observeEvent's emitter list in router/instrument.ts.
|
|
291
|
-
*/
|
|
292
|
-
readonly telemetry?: TelemetrySink;
|
|
293
|
-
/**
|
|
294
|
-
* Resolved timeout configuration (merged from shorthand + structured).
|
|
295
|
-
*/
|
|
296
|
-
readonly timeouts: ResolvedTimeouts;
|
|
297
|
-
/**
|
|
298
|
-
* Custom timeout response handler.
|
|
299
|
-
*/
|
|
300
|
-
readonly onTimeout?: OnTimeoutCallback<TEnv>;
|
|
301
|
-
/**
|
|
302
|
-
* App-level middleware entries
|
|
303
|
-
* These wrap the entire request/response cycle
|
|
304
|
-
*/
|
|
305
|
-
readonly middleware: MiddlewareEntry<TEnv>[];
|
|
306
|
-
/**
|
|
307
|
-
* Nonce provider for CSP
|
|
308
|
-
*/
|
|
309
|
-
readonly nonce?: NonceProvider<TEnv>;
|
|
310
|
-
/**
|
|
311
|
-
* RSC version string
|
|
312
|
-
*/
|
|
313
|
-
readonly version?: string;
|
|
314
|
-
/**
|
|
315
|
-
* URL patterns reference for build-time manifest generation
|
|
316
|
-
*/
|
|
317
|
-
readonly urlpatterns?: UrlPatterns<TEnv, any>;
|
|
318
|
-
/**
|
|
319
|
-
* SSR configuration. resolveStreaming determines stream vs allReady
|
|
320
|
-
* per HTML request (undefined = always stream).
|
|
321
|
-
*/
|
|
322
|
-
readonly ssr?: import("./router-options.js").SSROptions<TEnv>;
|
|
323
|
-
/**
|
|
324
|
-
* Cross-origin request protection configuration.
|
|
325
|
-
* Default: true (enabled).
|
|
326
|
-
*/
|
|
327
|
-
readonly originCheck: import("../rsc/origin-guard.js").OriginCheckConfig<TEnv>;
|
|
328
|
-
/**
|
|
329
|
-
* Source file path where createRouter() was called.
|
|
330
|
-
* Set via Error.stack parsing at construction time.
|
|
331
|
-
* Used by the Vite plugin to write per-router named-routes.gen.ts files.
|
|
332
|
-
*/
|
|
333
|
-
readonly __sourceFile?: string;
|
|
334
|
-
/** @internal basename for runtime manifest generation */
|
|
335
|
-
readonly __basename?: string;
|
|
336
|
-
/**
|
|
337
|
-
* @internal Router-level error/notFound fallbacks (`createRouter` options),
|
|
338
|
-
* exposed for the build-time clientChunks discovery so a `"use client"`
|
|
339
|
-
* default boundary is routed into the dedicated `app-fallback` chunk. Unlike
|
|
340
|
-
* the route-tree `errorBoundary()`/`notFoundBoundary()` helpers these never
|
|
341
|
-
* land in `EntryData`, so they are read directly off the router instance.
|
|
342
|
-
*/
|
|
343
|
-
readonly __defaultErrorBoundary?: RangoOptions<TEnv>["defaultErrorBoundary"];
|
|
344
|
-
readonly __defaultNotFoundBoundary?: RangoOptions<TEnv>["defaultNotFoundBoundary"];
|
|
345
|
-
readonly __notFound?: RangoOptions<TEnv>["notFound"];
|
|
346
|
-
match(request: Request, input?: RouterRequestInput<TEnv>): Promise<MatchResult>;
|
|
347
|
-
/**
|
|
348
|
-
* Build-time pre-render match. Resolves segments with a BuildContext
|
|
349
|
-
* (no request/env/headers/cookies), skipping middleware and loaders.
|
|
350
|
-
* Used by the Vite plugin to collect pre-render data at build time.
|
|
351
|
-
*/
|
|
352
|
-
matchForPrerender(pathname: string, params: Record<string, string>, buildVars?: Record<string, any>, isPassthroughRoute?: boolean, buildEnv?: any, devMode?: boolean): Promise<{
|
|
353
|
-
segments: SerializedSegmentData[];
|
|
354
|
-
/** RSC-encoded handle map ("" when none) — see handle-snapshot.ts. */
|
|
355
|
-
handles: string;
|
|
356
|
-
routeName: string;
|
|
357
|
-
params: Record<string, string>;
|
|
358
|
-
interceptSegments?: SerializedSegmentData[];
|
|
359
|
-
/** RSC-encoded MERGED (main + intercept) handle map for the intercept artifact. */
|
|
360
|
-
interceptHandles?: string;
|
|
361
|
-
passthrough?: true;
|
|
362
|
-
} | null>;
|
|
363
|
-
/**
|
|
364
|
-
* Render a single Static handler at build time.
|
|
365
|
-
* Returns the RSC-serialized component string and handle data, or null on failure.
|
|
366
|
-
*/
|
|
367
|
-
renderStaticSegment(handler: Function, handlerId: string, routeName?: string, buildEnv?: any, devMode?: boolean): Promise<{
|
|
368
|
-
encoded: string;
|
|
369
|
-
handles: string;
|
|
370
|
-
} | null>;
|
|
371
|
-
/**
|
|
372
|
-
* Preview match - returns route middleware without segment resolution.
|
|
373
|
-
* Also returns responseType and handler for response routes (non-RSC short-circuit).
|
|
374
|
-
*/
|
|
375
|
-
previewMatch(request: Request, input?: RouterRequestInput<TEnv>): Promise<{
|
|
376
|
-
routeMiddleware?: Array<{
|
|
377
|
-
handler: import("./middleware.js").MiddlewareFn;
|
|
378
|
-
params: Record<string, string>;
|
|
379
|
-
}>;
|
|
380
|
-
responseType?: string;
|
|
381
|
-
handler?: Function;
|
|
382
|
-
params?: Record<string, string>;
|
|
383
|
-
negotiated?: boolean;
|
|
384
|
-
manifestEntry?: EntryData;
|
|
385
|
-
routeKey?: string;
|
|
386
|
-
} | null>;
|
|
387
|
-
matchPartial(request: Request, input?: RouterRequestInput<TEnv>, actionContext?: {
|
|
388
|
-
actionId?: string;
|
|
389
|
-
actionUrl?: URL;
|
|
390
|
-
actionResult?: any;
|
|
391
|
-
formData?: FormData;
|
|
392
|
-
}): Promise<MatchResult | null>;
|
|
393
|
-
/**
|
|
394
|
-
* Match an error to the nearest error boundary and return error segments
|
|
395
|
-
*
|
|
396
|
-
* Used when an action or other operation fails and we need to render
|
|
397
|
-
* the error boundary UI. Finds the nearest errorBoundary in the route tree
|
|
398
|
-
* for the current URL and renders it with the error info.
|
|
399
|
-
*
|
|
400
|
-
* @param request - The current request (used to match the route)
|
|
401
|
-
* @param context - Environment context
|
|
402
|
-
* @param error - The error that occurred
|
|
403
|
-
* @param segmentType - Type of segment where error occurred (default: "route")
|
|
404
|
-
* @returns MatchResult with error segment, or null if no error boundary found
|
|
405
|
-
*/
|
|
406
|
-
matchError(request: Request, input: RouterRequestInput<TEnv> | undefined, error: unknown, segmentType?: ErrorInfo["segmentType"]): Promise<MatchResult | null>;
|
|
407
|
-
/**
|
|
408
|
-
* Low-level route matching function.
|
|
409
|
-
* Used by classifyRequest() for request classification without
|
|
410
|
-
* entering the full match pipeline.
|
|
411
|
-
*/
|
|
412
|
-
findMatch(pathname: string, metricsStore?: any): Promise<RouteMatchResult<TEnv> | null>;
|
|
413
|
-
/**
|
|
414
|
-
* Debug utility to serialize the manifest for inspection
|
|
415
|
-
* Returns a JSON-friendly representation of all routes and layouts
|
|
416
|
-
*/
|
|
417
|
-
debugManifest(): Promise<SerializedManifest>;
|
|
418
|
-
/**
|
|
419
|
-
* Handle an RSC request.
|
|
420
|
-
*/
|
|
421
|
-
fetch(request: Request, input?: RouterRequestInput<TEnv>): Promise<Response>;
|
|
422
|
-
}
|
|
423
|
-
/**
|
|
424
|
-
* Assert a public Rango into the internal type.
|
|
425
|
-
*
|
|
426
|
-
* Use this at the boundary where framework code receives a user-provided
|
|
427
|
-
* router and needs access to internal members (match, config, build-time).
|
|
428
|
-
* The cast is safe because createRouter() always produces an object that
|
|
429
|
-
* satisfies RangoInternal; the public type is just a narrower view.
|
|
430
|
-
*/
|
|
431
|
-
export declare function toInternal<TEnv = any, TRoutes extends Record<string, unknown> = Record<string, string>>(router: Rango<TEnv, TRoutes>): RangoInternal<TEnv, TRoutes>;
|
|
432
|
-
export {};
|