@rangojs/router 0.0.0-experimental.124 → 0.0.0-experimental.125
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/bin/rango.js +3 -4
- package/dist/vite/index.js +9 -43
- package/package.json +1 -1
- package/skills/hooks/SKILL.md +2 -2
- package/skills/route/SKILL.md +6 -0
- package/src/__internal.ts +0 -65
- package/src/browser/action-coordinator.ts +1 -1
- package/src/browser/action-fence.ts +10 -0
- package/src/browser/event-controller.ts +1 -83
- package/src/browser/navigation-store-handle.ts +3 -4
- package/src/browser/navigation-store.ts +0 -39
- package/src/browser/navigation-transaction.ts +0 -32
- package/src/browser/partial-update.ts +1 -83
- package/src/browser/prefetch/cache.ts +6 -45
- package/src/browser/prefetch/queue.ts +6 -3
- package/src/browser/rango-state.ts +2 -23
- package/src/browser/react/Link.tsx +0 -2
- package/src/browser/react/NavigationProvider.tsx +2 -1
- package/src/browser/react/ScrollRestoration.tsx +10 -6
- package/src/browser/react/filter-segment-order.ts +0 -2
- package/src/browser/react/index.ts +0 -45
- package/src/browser/react/location-state-shared.ts +0 -13
- package/src/browser/react/location-state.ts +0 -1
- package/src/browser/react/use-action.ts +6 -15
- package/src/browser/react/use-handle.ts +0 -5
- package/src/browser/react/use-link-status.ts +0 -4
- package/src/browser/react/use-navigation.ts +0 -3
- package/src/browser/react/use-params.ts +0 -2
- package/src/browser/react/use-search-params.ts +0 -5
- package/src/browser/react/use-segments.ts +0 -13
- package/src/browser/rsc-router.tsx +2 -2
- package/src/browser/types.ts +0 -1
- package/src/browser/validate-redirect-origin.ts +4 -5
- package/src/build/route-trie.ts +3 -0
- package/src/build/route-types/param-extraction.ts +6 -3
- package/src/build/route-types/router-processing.ts +0 -8
- package/src/cache/cache-policy.ts +0 -54
- package/src/cache/cache-runtime.ts +27 -24
- package/src/cache/cache-scope.ts +0 -27
- package/src/cache/cache-tag.ts +0 -37
- package/src/cache/cf/cf-cache-store.ts +72 -45
- package/src/cache/cf/index.ts +0 -24
- package/src/cache/document-cache.ts +0 -36
- package/src/cache/handle-snapshot.ts +0 -40
- package/src/cache/index.ts +0 -27
- package/src/cache/memory-segment-store.ts +0 -52
- package/src/cache/profile-registry.ts +7 -3
- package/src/cache/read-through-swr.ts +41 -11
- package/src/cache/segment-codec.ts +0 -16
- package/src/cache/types.ts +0 -98
- package/src/client.rsc.tsx +1 -22
- package/src/client.tsx +14 -32
- package/src/deps/ssr.ts +0 -1
- package/src/handle.ts +2 -12
- package/src/handles/MetaTags.tsx +0 -14
- package/src/handles/meta.ts +0 -39
- package/src/host/cookie-handler.ts +0 -36
- package/src/host/errors.ts +0 -24
- package/src/host/index.ts +6 -0
- package/src/host/pattern-matcher.ts +7 -50
- package/src/host/router.ts +1 -65
- package/src/host/testing.ts +0 -16
- package/src/host/types.ts +6 -2
- package/src/href-client.ts +0 -4
- package/src/index.rsc.ts +20 -2
- package/src/internal-debug.ts +2 -4
- package/src/loader.rsc.ts +4 -15
- package/src/loader.ts +3 -9
- package/src/network-error-thrower.tsx +1 -6
- package/src/outlet-provider.tsx +1 -5
- package/src/prerender/param-hash.ts +10 -11
- package/src/prerender/store.ts +23 -30
- package/src/prerender.ts +34 -0
- package/src/root-error-boundary.tsx +1 -19
- package/src/route-content-wrapper.tsx +1 -44
- package/src/route-definition/dsl-helpers.ts +7 -19
- package/src/route-definition/helpers-types.ts +3 -3
- package/src/route-definition/redirect.ts +11 -1
- package/src/route-map-builder.ts +0 -16
- package/src/router/content-negotiation.ts +0 -13
- package/src/router/error-handling.ts +12 -16
- package/src/router/find-match.ts +4 -30
- package/src/router/intercept-resolution.ts +10 -1
- package/src/router/lazy-includes.ts +1 -57
- package/src/router/loader-resolution.ts +3 -2
- package/src/router/logging.ts +0 -6
- package/src/router/manifest.ts +1 -25
- package/src/router/match-api.ts +0 -20
- package/src/router/match-context.ts +0 -22
- package/src/router/match-handlers.ts +0 -43
- package/src/router/match-middleware/background-revalidation.ts +0 -7
- package/src/router/match-middleware/cache-lookup.ts +1 -54
- package/src/router/match-middleware/cache-store.ts +0 -31
- package/src/router/match-middleware/intercept-resolution.ts +0 -22
- package/src/router/match-middleware/segment-resolution.ts +0 -21
- package/src/router/match-pipelines.ts +1 -42
- package/src/router/match-result.ts +1 -52
- package/src/router/metrics.ts +0 -34
- package/src/router/middleware-cookies.ts +0 -13
- package/src/router/middleware-types.ts +0 -115
- package/src/router/middleware.ts +7 -30
- package/src/router/navigation-snapshot.ts +0 -51
- package/src/router/params-util.ts +23 -0
- package/src/router/pattern-matching.ts +1 -33
- package/src/router/prerender-match.ts +29 -45
- package/src/router/request-classification.ts +1 -38
- package/src/router/revalidation.ts +5 -58
- package/src/router/router-context.ts +0 -26
- package/src/router/segment-resolution/fresh.ts +25 -57
- package/src/router/segment-resolution/helpers.ts +34 -0
- package/src/router/segment-resolution/loader-cache.ts +10 -13
- package/src/router/segment-resolution/revalidation.ts +5 -42
- package/src/router/segment-resolution/streamed-handler-telemetry.ts +52 -0
- package/src/router/segment-resolution.ts +4 -1
- package/src/router/telemetry-otel.ts +0 -20
- package/src/router/telemetry.ts +0 -22
- package/src/router/timeout.ts +0 -20
- package/src/router/trie-matching.ts +63 -40
- package/src/router/types.ts +1 -63
- package/src/router/url-params.ts +0 -5
- package/src/router.ts +4 -2
- package/src/rsc/handler.ts +11 -2
- package/src/rsc/helpers.ts +15 -0
- package/src/rsc/origin-guard.ts +0 -12
- package/src/rsc/progressive-enhancement.ts +2 -1
- package/src/rsc/rsc-rendering.ts +2 -7
- package/src/rsc/runtime-warnings.ts +14 -0
- package/src/rsc/server-action.ts +30 -28
- package/src/rsc/types.ts +0 -1
- package/src/search-params.ts +0 -16
- package/src/segment-loader-promise.ts +14 -2
- package/src/segment-system.tsx +79 -88
- package/src/server/handle-store.ts +7 -24
- package/src/server/loader-registry.ts +5 -24
- package/src/server/request-context.ts +6 -78
- package/src/ssr/index.tsx +14 -14
- package/src/static-handler.ts +2 -27
- package/src/testing/cache-status.ts +0 -47
- package/src/testing/collect-handle.ts +1 -24
- package/src/testing/e2e/index.ts +0 -22
- package/src/testing/e2e/matchers.ts +0 -16
- package/src/testing/flight-matchers.ts +0 -13
- package/src/testing/flight-normalize.ts +3 -30
- package/src/testing/flight.ts +0 -48
- package/src/testing/generated-routes.ts +1 -41
- package/src/testing/index.ts +0 -21
- package/src/testing/internal/context.ts +3 -45
- package/src/testing/internal/seed-vars.ts +0 -26
- package/src/testing/render-handler.ts +0 -49
- package/src/testing/render-route.tsx +0 -90
- package/src/testing/run-loader.ts +0 -96
- package/src/testing/run-middleware.ts +0 -26
- package/src/theme/ThemeProvider.tsx +0 -52
- package/src/theme/ThemeScript.tsx +0 -6
- package/src/theme/constants.ts +0 -12
- package/src/theme/index.ts +0 -7
- package/src/theme/theme-context.ts +1 -5
- package/src/theme/theme-script.ts +0 -14
- package/src/theme/use-theme.ts +0 -3
- package/src/types/boundaries.ts +0 -35
- package/src/types/error-types.ts +25 -89
- package/src/types/global-namespace.ts +4 -14
- package/src/types/handler-context.ts +0 -8
- package/src/types/index.ts +0 -10
- package/src/types/request-scope.ts +0 -19
- package/src/types/route-config.ts +6 -50
- package/src/types/route-entry.ts +0 -6
- package/src/types/segments.ts +0 -13
- package/src/urls/include-helper.ts +0 -4
- package/src/urls/index.ts +0 -6
- package/src/urls/path-helper-types.ts +2 -2
- package/src/urls/path-helper.ts +0 -54
- package/src/urls/urls-function.ts +0 -13
- package/src/use-loader.tsx +0 -186
- package/src/vite/discovery/bundle-postprocess.ts +2 -1
- package/src/vite/discovery/discover-routers.ts +6 -7
- package/src/vite/discovery/virtual-module-codegen.ts +1 -11
- package/src/vite/plugin-types.ts +3 -1
- package/src/vite/plugins/cjs-to-esm.ts +0 -11
- package/src/vite/plugins/client-ref-dedup.ts +0 -11
- package/src/vite/plugins/client-ref-hashing.ts +0 -10
- package/src/vite/plugins/cloudflare-protocol-stub.ts +0 -20
- package/src/vite/plugins/expose-action-id.ts +2 -73
- package/src/vite/plugins/expose-id-utils.ts +0 -55
- package/src/vite/plugins/expose-ids/export-analysis.ts +0 -38
- package/src/vite/plugins/expose-ids/handler-transform.ts +0 -15
- package/src/vite/plugins/expose-ids/loader-transform.ts +0 -15
- package/src/vite/plugins/expose-ids/router-transform.ts +0 -13
- package/src/vite/plugins/expose-internal-ids.ts +10 -0
- package/src/vite/plugins/performance-tracks.ts +0 -3
- package/src/vite/plugins/use-cache-transform.ts +0 -36
- package/src/vite/plugins/version-injector.ts +0 -20
- package/src/vite/plugins/version-plugin.ts +1 -49
- package/src/vite/plugins/virtual-entries.ts +0 -15
- package/src/vite/rango.ts +1 -108
- package/src/vite/router-discovery.ts +2 -1
- package/src/vite/utils/ast-handler-extract.ts +0 -16
- package/src/vite/utils/bundle-analysis.ts +6 -13
- package/src/vite/utils/client-chunks.ts +0 -6
- package/src/vite/utils/forward-user-plugins.ts +0 -22
- package/src/vite/utils/manifest-utils.ts +0 -4
- package/src/vite/utils/package-resolution.ts +1 -73
- package/src/vite/utils/prerender-utils.ts +0 -35
- package/src/vite/utils/shared-utils.ts +3 -35
- package/dist/__internal.d.ts +0 -83
- package/dist/__internal.d.ts.map +0 -1
- package/dist/__internal.js +0 -19
- package/dist/__internal.js.map +0 -1
- package/dist/__mocks__/version.d.ts +0 -7
- package/dist/__mocks__/version.d.ts.map +0 -1
- package/dist/__mocks__/version.js +0 -7
- package/dist/__mocks__/version.js.map +0 -1
- package/dist/__tests__/client-href.test.d.ts +0 -2
- package/dist/__tests__/client-href.test.d.ts.map +0 -1
- package/dist/__tests__/client-href.test.js +0 -74
- package/dist/__tests__/client-href.test.js.map +0 -1
- package/dist/__tests__/component-utils.test.d.ts +0 -2
- package/dist/__tests__/component-utils.test.d.ts.map +0 -1
- package/dist/__tests__/component-utils.test.js +0 -51
- package/dist/__tests__/component-utils.test.js.map +0 -1
- package/dist/__tests__/event-controller.test.d.ts +0 -2
- package/dist/__tests__/event-controller.test.d.ts.map +0 -1
- package/dist/__tests__/event-controller.test.js +0 -538
- package/dist/__tests__/event-controller.test.js.map +0 -1
- package/dist/__tests__/helpers/route-tree.d.ts +0 -118
- package/dist/__tests__/helpers/route-tree.d.ts.map +0 -1
- package/dist/__tests__/helpers/route-tree.js +0 -374
- package/dist/__tests__/helpers/route-tree.js.map +0 -1
- package/dist/__tests__/match-result.test.d.ts +0 -2
- package/dist/__tests__/match-result.test.d.ts.map +0 -1
- package/dist/__tests__/match-result.test.js +0 -154
- package/dist/__tests__/match-result.test.js.map +0 -1
- package/dist/__tests__/navigation-store.test.d.ts +0 -2
- package/dist/__tests__/navigation-store.test.d.ts.map +0 -1
- package/dist/__tests__/navigation-store.test.js +0 -440
- package/dist/__tests__/navigation-store.test.js.map +0 -1
- package/dist/__tests__/partial-update.test.d.ts +0 -2
- package/dist/__tests__/partial-update.test.d.ts.map +0 -1
- package/dist/__tests__/partial-update.test.js +0 -1009
- package/dist/__tests__/partial-update.test.js.map +0 -1
- package/dist/__tests__/reverse-types.test.d.ts +0 -8
- package/dist/__tests__/reverse-types.test.d.ts.map +0 -1
- package/dist/__tests__/reverse-types.test.js +0 -656
- package/dist/__tests__/reverse-types.test.js.map +0 -1
- package/dist/__tests__/route-definition.test.d.ts +0 -2
- package/dist/__tests__/route-definition.test.d.ts.map +0 -1
- package/dist/__tests__/route-definition.test.js +0 -55
- package/dist/__tests__/route-definition.test.js.map +0 -1
- package/dist/__tests__/router-helpers.test.d.ts +0 -2
- package/dist/__tests__/router-helpers.test.d.ts.map +0 -1
- package/dist/__tests__/router-helpers.test.js +0 -377
- package/dist/__tests__/router-helpers.test.js.map +0 -1
- package/dist/__tests__/router-integration-2.test.d.ts +0 -2
- package/dist/__tests__/router-integration-2.test.d.ts.map +0 -1
- package/dist/__tests__/router-integration-2.test.js +0 -426
- package/dist/__tests__/router-integration-2.test.js.map +0 -1
- package/dist/__tests__/router-integration.test.d.ts +0 -2
- package/dist/__tests__/router-integration.test.d.ts.map +0 -1
- package/dist/__tests__/router-integration.test.js +0 -1051
- package/dist/__tests__/router-integration.test.js.map +0 -1
- package/dist/__tests__/search-params.test.d.ts +0 -5
- package/dist/__tests__/search-params.test.d.ts.map +0 -1
- package/dist/__tests__/search-params.test.js +0 -306
- package/dist/__tests__/search-params.test.js.map +0 -1
- package/dist/__tests__/segment-system.test.d.ts +0 -2
- package/dist/__tests__/segment-system.test.d.ts.map +0 -1
- package/dist/__tests__/segment-system.test.js +0 -627
- package/dist/__tests__/segment-system.test.js.map +0 -1
- package/dist/__tests__/static-handler-types.test.d.ts +0 -8
- package/dist/__tests__/static-handler-types.test.d.ts.map +0 -1
- package/dist/__tests__/static-handler-types.test.js +0 -63
- package/dist/__tests__/static-handler-types.test.js.map +0 -1
- package/dist/__tests__/urls.test.d.ts +0 -2
- package/dist/__tests__/urls.test.d.ts.map +0 -1
- package/dist/__tests__/urls.test.js +0 -421
- package/dist/__tests__/urls.test.js.map +0 -1
- package/dist/__tests__/use-mount.test.d.ts +0 -2
- package/dist/__tests__/use-mount.test.d.ts.map +0 -1
- package/dist/__tests__/use-mount.test.js +0 -35
- package/dist/__tests__/use-mount.test.js.map +0 -1
- package/dist/bin/rango.d.ts +0 -2
- package/dist/bin/rango.d.ts.map +0 -1
- package/dist/bin/rango.js.map +0 -1
- package/dist/browser/event-controller.d.ts +0 -191
- package/dist/browser/event-controller.d.ts.map +0 -1
- package/dist/browser/event-controller.js +0 -559
- package/dist/browser/event-controller.js.map +0 -1
- package/dist/browser/index.d.ts +0 -2
- package/dist/browser/index.d.ts.map +0 -1
- package/dist/browser/index.js +0 -14
- package/dist/browser/index.js.map +0 -1
- package/dist/browser/link-interceptor.d.ts +0 -38
- package/dist/browser/link-interceptor.d.ts.map +0 -1
- package/dist/browser/link-interceptor.js +0 -99
- package/dist/browser/link-interceptor.js.map +0 -1
- package/dist/browser/logging.d.ts +0 -10
- package/dist/browser/logging.d.ts.map +0 -1
- package/dist/browser/logging.js +0 -29
- package/dist/browser/logging.js.map +0 -1
- package/dist/browser/lru-cache.d.ts +0 -17
- package/dist/browser/lru-cache.d.ts.map +0 -1
- package/dist/browser/lru-cache.js +0 -50
- package/dist/browser/lru-cache.js.map +0 -1
- package/dist/browser/merge-segment-loaders.d.ts +0 -39
- package/dist/browser/merge-segment-loaders.d.ts.map +0 -1
- package/dist/browser/merge-segment-loaders.js +0 -102
- package/dist/browser/merge-segment-loaders.js.map +0 -1
- package/dist/browser/navigation-bridge.d.ts +0 -102
- package/dist/browser/navigation-bridge.d.ts.map +0 -1
- package/dist/browser/navigation-bridge.js +0 -708
- package/dist/browser/navigation-bridge.js.map +0 -1
- package/dist/browser/navigation-client.d.ts +0 -25
- package/dist/browser/navigation-client.d.ts.map +0 -1
- package/dist/browser/navigation-client.js +0 -157
- package/dist/browser/navigation-client.js.map +0 -1
- package/dist/browser/navigation-store.d.ts +0 -101
- package/dist/browser/navigation-store.d.ts.map +0 -1
- package/dist/browser/navigation-store.js +0 -625
- package/dist/browser/navigation-store.js.map +0 -1
- package/dist/browser/partial-update.d.ts +0 -75
- package/dist/browser/partial-update.d.ts.map +0 -1
- package/dist/browser/partial-update.js +0 -426
- package/dist/browser/partial-update.js.map +0 -1
- package/dist/browser/react/Link.d.ts +0 -86
- package/dist/browser/react/Link.d.ts.map +0 -1
- package/dist/browser/react/Link.js +0 -128
- package/dist/browser/react/Link.js.map +0 -1
- package/dist/browser/react/NavigationProvider.d.ts +0 -63
- package/dist/browser/react/NavigationProvider.d.ts.map +0 -1
- package/dist/browser/react/NavigationProvider.js +0 -216
- package/dist/browser/react/NavigationProvider.js.map +0 -1
- package/dist/browser/react/ScrollRestoration.d.ts +0 -75
- package/dist/browser/react/ScrollRestoration.d.ts.map +0 -1
- package/dist/browser/react/ScrollRestoration.js +0 -57
- package/dist/browser/react/ScrollRestoration.js.map +0 -1
- package/dist/browser/react/context.d.ts +0 -46
- package/dist/browser/react/context.d.ts.map +0 -1
- package/dist/browser/react/context.js +0 -10
- package/dist/browser/react/context.js.map +0 -1
- package/dist/browser/react/index.d.ts +0 -11
- package/dist/browser/react/index.d.ts.map +0 -1
- package/dist/browser/react/index.js +0 -22
- package/dist/browser/react/index.js.map +0 -1
- package/dist/browser/react/location-state-shared.d.ts +0 -63
- package/dist/browser/react/location-state-shared.d.ts.map +0 -1
- package/dist/browser/react/location-state-shared.js +0 -81
- package/dist/browser/react/location-state-shared.js.map +0 -1
- package/dist/browser/react/location-state.d.ts +0 -23
- package/dist/browser/react/location-state.d.ts.map +0 -1
- package/dist/browser/react/location-state.js +0 -29
- package/dist/browser/react/location-state.js.map +0 -1
- package/dist/browser/react/mount-context.d.ts +0 -24
- package/dist/browser/react/mount-context.d.ts.map +0 -1
- package/dist/browser/react/mount-context.js +0 -24
- package/dist/browser/react/mount-context.js.map +0 -1
- package/dist/browser/react/use-action.d.ts +0 -64
- package/dist/browser/react/use-action.d.ts.map +0 -1
- package/dist/browser/react/use-action.js +0 -134
- package/dist/browser/react/use-action.js.map +0 -1
- package/dist/browser/react/use-client-cache.d.ts +0 -41
- package/dist/browser/react/use-client-cache.d.ts.map +0 -1
- package/dist/browser/react/use-client-cache.js +0 -39
- package/dist/browser/react/use-client-cache.js.map +0 -1
- package/dist/browser/react/use-handle.d.ts +0 -31
- package/dist/browser/react/use-handle.d.ts.map +0 -1
- package/dist/browser/react/use-handle.js +0 -144
- package/dist/browser/react/use-handle.js.map +0 -1
- package/dist/browser/react/use-href.d.ts +0 -33
- package/dist/browser/react/use-href.d.ts.map +0 -1
- package/dist/browser/react/use-href.js +0 -39
- package/dist/browser/react/use-href.js.map +0 -1
- package/dist/browser/react/use-link-status.d.ts +0 -37
- package/dist/browser/react/use-link-status.d.ts.map +0 -1
- package/dist/browser/react/use-link-status.js +0 -99
- package/dist/browser/react/use-link-status.js.map +0 -1
- package/dist/browser/react/use-mount.d.ts +0 -25
- package/dist/browser/react/use-mount.d.ts.map +0 -1
- package/dist/browser/react/use-mount.js +0 -30
- package/dist/browser/react/use-mount.js.map +0 -1
- package/dist/browser/react/use-navigation.d.ts +0 -27
- package/dist/browser/react/use-navigation.d.ts.map +0 -1
- package/dist/browser/react/use-navigation.js +0 -87
- package/dist/browser/react/use-navigation.js.map +0 -1
- package/dist/browser/react/use-segments.d.ts +0 -38
- package/dist/browser/react/use-segments.d.ts.map +0 -1
- package/dist/browser/react/use-segments.js +0 -130
- package/dist/browser/react/use-segments.js.map +0 -1
- package/dist/browser/request-controller.d.ts +0 -26
- package/dist/browser/request-controller.d.ts.map +0 -1
- package/dist/browser/request-controller.js +0 -147
- package/dist/browser/request-controller.js.map +0 -1
- package/dist/browser/rsc-router.d.ts +0 -129
- package/dist/browser/rsc-router.d.ts.map +0 -1
- package/dist/browser/rsc-router.js +0 -195
- package/dist/browser/rsc-router.js.map +0 -1
- package/dist/browser/scroll-restoration.d.ts +0 -93
- package/dist/browser/scroll-restoration.d.ts.map +0 -1
- package/dist/browser/scroll-restoration.js +0 -321
- package/dist/browser/scroll-restoration.js.map +0 -1
- package/dist/browser/segment-structure-assert.d.ts +0 -17
- package/dist/browser/segment-structure-assert.d.ts.map +0 -1
- package/dist/browser/segment-structure-assert.js +0 -59
- package/dist/browser/segment-structure-assert.js.map +0 -1
- package/dist/browser/server-action-bridge.d.ts +0 -26
- package/dist/browser/server-action-bridge.d.ts.map +0 -1
- package/dist/browser/server-action-bridge.js +0 -668
- package/dist/browser/server-action-bridge.js.map +0 -1
- package/dist/browser/shallow.d.ts +0 -12
- package/dist/browser/shallow.d.ts.map +0 -1
- package/dist/browser/shallow.js +0 -34
- package/dist/browser/shallow.js.map +0 -1
- package/dist/browser/types.d.ts +0 -369
- package/dist/browser/types.d.ts.map +0 -1
- package/dist/browser/types.js +0 -2
- package/dist/browser/types.js.map +0 -1
- package/dist/build/__tests__/generate-cli.test.d.ts +0 -2
- package/dist/build/__tests__/generate-cli.test.d.ts.map +0 -1
- package/dist/build/__tests__/generate-cli.test.js +0 -237
- package/dist/build/__tests__/generate-cli.test.js.map +0 -1
- package/dist/build/__tests__/generate-manifest.test.d.ts +0 -2
- package/dist/build/__tests__/generate-manifest.test.d.ts.map +0 -1
- package/dist/build/__tests__/generate-manifest.test.js +0 -119
- package/dist/build/__tests__/generate-manifest.test.js.map +0 -1
- package/dist/build/__tests__/generate-route-types.test.d.ts +0 -2
- package/dist/build/__tests__/generate-route-types.test.d.ts.map +0 -1
- package/dist/build/__tests__/generate-route-types.test.js +0 -620
- package/dist/build/__tests__/generate-route-types.test.js.map +0 -1
- package/dist/build/__tests__/per-router-manifest.test.d.ts +0 -2
- package/dist/build/__tests__/per-router-manifest.test.d.ts.map +0 -1
- package/dist/build/__tests__/per-router-manifest.test.js +0 -308
- package/dist/build/__tests__/per-router-manifest.test.js.map +0 -1
- package/dist/build/generate-manifest.d.ts +0 -81
- package/dist/build/generate-manifest.d.ts.map +0 -1
- package/dist/build/generate-manifest.js +0 -276
- package/dist/build/generate-manifest.js.map +0 -1
- package/dist/build/generate-route-types.d.ts +0 -115
- package/dist/build/generate-route-types.d.ts.map +0 -1
- package/dist/build/generate-route-types.js +0 -740
- package/dist/build/generate-route-types.js.map +0 -1
- package/dist/build/index.d.ts +0 -21
- package/dist/build/index.d.ts.map +0 -1
- package/dist/build/index.js +0 -21
- package/dist/build/index.js.map +0 -1
- package/dist/build/route-trie.d.ts +0 -71
- package/dist/build/route-trie.d.ts.map +0 -1
- package/dist/build/route-trie.js +0 -175
- package/dist/build/route-trie.js.map +0 -1
- package/dist/cache/__tests__/cache-scope.test.d.ts +0 -2
- package/dist/cache/__tests__/cache-scope.test.d.ts.map +0 -1
- package/dist/cache/__tests__/cache-scope.test.js +0 -208
- package/dist/cache/__tests__/cache-scope.test.js.map +0 -1
- package/dist/cache/__tests__/document-cache.test.d.ts +0 -2
- package/dist/cache/__tests__/document-cache.test.d.ts.map +0 -1
- package/dist/cache/__tests__/document-cache.test.js +0 -345
- package/dist/cache/__tests__/document-cache.test.js.map +0 -1
- package/dist/cache/__tests__/memory-segment-store.test.d.ts +0 -2
- package/dist/cache/__tests__/memory-segment-store.test.d.ts.map +0 -1
- package/dist/cache/__tests__/memory-segment-store.test.js +0 -425
- package/dist/cache/__tests__/memory-segment-store.test.js.map +0 -1
- package/dist/cache/__tests__/memory-store.test.d.ts +0 -2
- package/dist/cache/__tests__/memory-store.test.d.ts.map +0 -1
- package/dist/cache/__tests__/memory-store.test.js +0 -367
- package/dist/cache/__tests__/memory-store.test.js.map +0 -1
- package/dist/cache/cache-scope.d.ts +0 -102
- package/dist/cache/cache-scope.d.ts.map +0 -1
- package/dist/cache/cache-scope.js +0 -440
- package/dist/cache/cache-scope.js.map +0 -1
- package/dist/cache/cf/__tests__/cf-cache-store.test.d.ts +0 -2
- package/dist/cache/cf/__tests__/cf-cache-store.test.d.ts.map +0 -1
- package/dist/cache/cf/__tests__/cf-cache-store.test.js +0 -330
- package/dist/cache/cf/__tests__/cf-cache-store.test.js.map +0 -1
- package/dist/cache/cf/cf-cache-store.d.ts +0 -165
- package/dist/cache/cf/cf-cache-store.d.ts.map +0 -1
- package/dist/cache/cf/cf-cache-store.js +0 -242
- package/dist/cache/cf/cf-cache-store.js.map +0 -1
- package/dist/cache/cf/index.d.ts +0 -14
- package/dist/cache/cf/index.d.ts.map +0 -1
- package/dist/cache/cf/index.js +0 -17
- package/dist/cache/cf/index.js.map +0 -1
- package/dist/cache/document-cache.d.ts +0 -64
- package/dist/cache/document-cache.d.ts.map +0 -1
- package/dist/cache/document-cache.js +0 -228
- package/dist/cache/document-cache.js.map +0 -1
- package/dist/cache/index.d.ts +0 -19
- package/dist/cache/index.d.ts.map +0 -1
- package/dist/cache/index.js +0 -21
- package/dist/cache/index.js.map +0 -1
- package/dist/cache/memory-segment-store.d.ts +0 -110
- package/dist/cache/memory-segment-store.d.ts.map +0 -1
- package/dist/cache/memory-segment-store.js +0 -117
- package/dist/cache/memory-segment-store.js.map +0 -1
- package/dist/cache/memory-store.d.ts +0 -41
- package/dist/cache/memory-store.d.ts.map +0 -1
- package/dist/cache/memory-store.js +0 -191
- package/dist/cache/memory-store.js.map +0 -1
- package/dist/cache/types.d.ts +0 -317
- package/dist/cache/types.d.ts.map +0 -1
- package/dist/cache/types.js +0 -12
- package/dist/cache/types.js.map +0 -1
- package/dist/client.d.ts +0 -248
- package/dist/client.d.ts.map +0 -1
- package/dist/client.js +0 -367
- package/dist/client.js.map +0 -1
- package/dist/client.rsc.d.ts +0 -26
- package/dist/client.rsc.d.ts.map +0 -1
- package/dist/client.rsc.js +0 -46
- package/dist/client.rsc.js.map +0 -1
- package/dist/component-utils.d.ts +0 -36
- package/dist/component-utils.d.ts.map +0 -1
- package/dist/component-utils.js +0 -61
- package/dist/component-utils.js.map +0 -1
- package/dist/components/DefaultDocument.d.ts +0 -13
- package/dist/components/DefaultDocument.d.ts.map +0 -1
- package/dist/components/DefaultDocument.js +0 -15
- package/dist/components/DefaultDocument.js.map +0 -1
- package/dist/debug.d.ts +0 -58
- package/dist/debug.d.ts.map +0 -1
- package/dist/debug.js +0 -157
- package/dist/debug.js.map +0 -1
- package/dist/default-error-boundary.d.ts +0 -11
- package/dist/default-error-boundary.d.ts.map +0 -1
- package/dist/default-error-boundary.js +0 -45
- package/dist/default-error-boundary.js.map +0 -1
- package/dist/deps/browser.d.ts +0 -2
- package/dist/deps/browser.d.ts.map +0 -1
- package/dist/deps/browser.js +0 -3
- package/dist/deps/browser.js.map +0 -1
- package/dist/deps/html-stream-client.d.ts +0 -2
- package/dist/deps/html-stream-client.d.ts.map +0 -1
- package/dist/deps/html-stream-client.js +0 -3
- package/dist/deps/html-stream-client.js.map +0 -1
- package/dist/deps/html-stream-server.d.ts +0 -2
- package/dist/deps/html-stream-server.d.ts.map +0 -1
- package/dist/deps/html-stream-server.js +0 -3
- package/dist/deps/html-stream-server.js.map +0 -1
- package/dist/deps/rsc.d.ts +0 -2
- package/dist/deps/rsc.d.ts.map +0 -1
- package/dist/deps/rsc.js +0 -4
- package/dist/deps/rsc.js.map +0 -1
- package/dist/deps/ssr.d.ts +0 -2
- package/dist/deps/ssr.d.ts.map +0 -1
- package/dist/deps/ssr.js +0 -3
- package/dist/deps/ssr.js.map +0 -1
- package/dist/errors.d.ts +0 -174
- package/dist/errors.d.ts.map +0 -1
- package/dist/errors.js +0 -241
- package/dist/errors.js.map +0 -1
- package/dist/handle.d.ts +0 -78
- package/dist/handle.d.ts.map +0 -1
- package/dist/handle.js +0 -82
- package/dist/handle.js.map +0 -1
- package/dist/handles/MetaTags.d.ts +0 -14
- package/dist/handles/MetaTags.d.ts.map +0 -1
- package/dist/handles/MetaTags.js +0 -136
- package/dist/handles/MetaTags.js.map +0 -1
- package/dist/handles/index.d.ts +0 -6
- package/dist/handles/index.d.ts.map +0 -1
- package/dist/handles/index.js +0 -6
- package/dist/handles/index.js.map +0 -1
- package/dist/handles/meta.d.ts +0 -39
- package/dist/handles/meta.d.ts.map +0 -1
- package/dist/handles/meta.js +0 -202
- package/dist/handles/meta.js.map +0 -1
- package/dist/host/__tests__/errors.test.d.ts +0 -2
- package/dist/host/__tests__/errors.test.d.ts.map +0 -1
- package/dist/host/__tests__/errors.test.js +0 -76
- package/dist/host/__tests__/errors.test.js.map +0 -1
- package/dist/host/__tests__/pattern-comprehensive.test.d.ts +0 -2
- package/dist/host/__tests__/pattern-comprehensive.test.d.ts.map +0 -1
- package/dist/host/__tests__/pattern-comprehensive.test.js +0 -732
- package/dist/host/__tests__/pattern-comprehensive.test.js.map +0 -1
- package/dist/host/__tests__/pattern-matcher.test.d.ts +0 -2
- package/dist/host/__tests__/pattern-matcher.test.d.ts.map +0 -1
- package/dist/host/__tests__/pattern-matcher.test.js +0 -251
- package/dist/host/__tests__/pattern-matcher.test.js.map +0 -1
- package/dist/host/__tests__/router.test.d.ts +0 -2
- package/dist/host/__tests__/router.test.d.ts.map +0 -1
- package/dist/host/__tests__/router.test.js +0 -241
- package/dist/host/__tests__/router.test.js.map +0 -1
- package/dist/host/__tests__/testing.test.d.ts +0 -2
- package/dist/host/__tests__/testing.test.d.ts.map +0 -1
- package/dist/host/__tests__/testing.test.js +0 -64
- package/dist/host/__tests__/testing.test.js.map +0 -1
- package/dist/host/__tests__/utils.test.d.ts +0 -2
- package/dist/host/__tests__/utils.test.d.ts.map +0 -1
- package/dist/host/__tests__/utils.test.js +0 -29
- package/dist/host/__tests__/utils.test.js.map +0 -1
- package/dist/host/cookie-handler.d.ts +0 -34
- package/dist/host/cookie-handler.d.ts.map +0 -1
- package/dist/host/cookie-handler.js +0 -124
- package/dist/host/cookie-handler.js.map +0 -1
- package/dist/host/errors.d.ts +0 -56
- package/dist/host/errors.d.ts.map +0 -1
- package/dist/host/errors.js +0 -79
- package/dist/host/errors.js.map +0 -1
- package/dist/host/index.d.ts +0 -29
- package/dist/host/index.d.ts.map +0 -1
- package/dist/host/index.js +0 -32
- package/dist/host/index.js.map +0 -1
- package/dist/host/pattern-matcher.d.ts +0 -36
- package/dist/host/pattern-matcher.d.ts.map +0 -1
- package/dist/host/pattern-matcher.js +0 -172
- package/dist/host/pattern-matcher.js.map +0 -1
- package/dist/host/router.d.ts +0 -26
- package/dist/host/router.d.ts.map +0 -1
- package/dist/host/router.js +0 -218
- package/dist/host/router.js.map +0 -1
- package/dist/host/testing.d.ts +0 -36
- package/dist/host/testing.d.ts.map +0 -1
- package/dist/host/testing.js +0 -55
- package/dist/host/testing.js.map +0 -1
- package/dist/host/types.d.ts +0 -115
- package/dist/host/types.d.ts.map +0 -1
- package/dist/host/types.js +0 -7
- package/dist/host/types.js.map +0 -1
- package/dist/host/utils.d.ts +0 -21
- package/dist/host/utils.d.ts.map +0 -1
- package/dist/host/utils.js +0 -23
- package/dist/host/utils.js.map +0 -1
- package/dist/href-client.d.ts +0 -131
- package/dist/href-client.d.ts.map +0 -1
- package/dist/href-client.js +0 -64
- package/dist/href-client.js.map +0 -1
- package/dist/href-context.d.ts +0 -29
- package/dist/href-context.d.ts.map +0 -1
- package/dist/href-context.js +0 -21
- package/dist/href-context.js.map +0 -1
- package/dist/index.d.ts +0 -73
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -91
- package/dist/index.js.map +0 -1
- package/dist/index.rsc.d.ts +0 -32
- package/dist/index.rsc.d.ts.map +0 -1
- package/dist/index.rsc.js +0 -40
- package/dist/index.rsc.js.map +0 -1
- package/dist/internal-debug.d.ts +0 -2
- package/dist/internal-debug.d.ts.map +0 -1
- package/dist/internal-debug.js +0 -5
- package/dist/internal-debug.js.map +0 -1
- package/dist/loader.d.ts +0 -14
- package/dist/loader.d.ts.map +0 -1
- package/dist/loader.js +0 -20
- package/dist/loader.js.map +0 -1
- package/dist/loader.rsc.d.ts +0 -19
- package/dist/loader.rsc.d.ts.map +0 -1
- package/dist/loader.rsc.js +0 -99
- package/dist/loader.rsc.js.map +0 -1
- package/dist/network-error-thrower.d.ts +0 -17
- package/dist/network-error-thrower.d.ts.map +0 -1
- package/dist/network-error-thrower.js +0 -14
- package/dist/network-error-thrower.js.map +0 -1
- package/dist/outlet-context.d.ts +0 -13
- package/dist/outlet-context.d.ts.map +0 -1
- package/dist/outlet-context.js +0 -3
- package/dist/outlet-context.js.map +0 -1
- package/dist/prerender/__tests__/param-hash.test.d.ts +0 -2
- package/dist/prerender/__tests__/param-hash.test.d.ts.map +0 -1
- package/dist/prerender/__tests__/param-hash.test.js +0 -148
- package/dist/prerender/__tests__/param-hash.test.js.map +0 -1
- package/dist/prerender/param-hash.d.ts +0 -16
- package/dist/prerender/param-hash.d.ts.map +0 -1
- package/dist/prerender/param-hash.js +0 -36
- package/dist/prerender/param-hash.js.map +0 -1
- package/dist/prerender/store.d.ts +0 -38
- package/dist/prerender/store.d.ts.map +0 -1
- package/dist/prerender/store.js +0 -61
- package/dist/prerender/store.js.map +0 -1
- package/dist/prerender.d.ts +0 -66
- package/dist/prerender.d.ts.map +0 -1
- package/dist/prerender.js +0 -57
- package/dist/prerender.js.map +0 -1
- package/dist/reverse.d.ts +0 -196
- package/dist/reverse.d.ts.map +0 -1
- package/dist/reverse.js +0 -78
- package/dist/reverse.js.map +0 -1
- package/dist/root-error-boundary.d.ts +0 -33
- package/dist/root-error-boundary.d.ts.map +0 -1
- package/dist/root-error-boundary.js +0 -165
- package/dist/root-error-boundary.js.map +0 -1
- package/dist/route-content-wrapper.d.ts +0 -46
- package/dist/route-content-wrapper.d.ts.map +0 -1
- package/dist/route-content-wrapper.js +0 -77
- package/dist/route-content-wrapper.js.map +0 -1
- package/dist/route-definition.d.ts +0 -421
- package/dist/route-definition.d.ts.map +0 -1
- package/dist/route-definition.js +0 -868
- package/dist/route-definition.js.map +0 -1
- package/dist/route-map-builder.d.ts +0 -155
- package/dist/route-map-builder.d.ts.map +0 -1
- package/dist/route-map-builder.js +0 -237
- package/dist/route-map-builder.js.map +0 -1
- package/dist/route-types.d.ts +0 -165
- package/dist/route-types.d.ts.map +0 -1
- package/dist/route-types.js +0 -7
- package/dist/route-types.js.map +0 -1
- package/dist/router/__tests__/handler-context.test.d.ts +0 -2
- package/dist/router/__tests__/handler-context.test.d.ts.map +0 -1
- package/dist/router/__tests__/handler-context.test.js +0 -65
- package/dist/router/__tests__/handler-context.test.js.map +0 -1
- package/dist/router/__tests__/loader-cycle-detection.test.d.ts +0 -2
- package/dist/router/__tests__/loader-cycle-detection.test.d.ts.map +0 -1
- package/dist/router/__tests__/loader-cycle-detection.test.js +0 -221
- package/dist/router/__tests__/loader-cycle-detection.test.js.map +0 -1
- package/dist/router/__tests__/match-context.test.d.ts +0 -2
- package/dist/router/__tests__/match-context.test.d.ts.map +0 -1
- package/dist/router/__tests__/match-context.test.js +0 -92
- package/dist/router/__tests__/match-context.test.js.map +0 -1
- package/dist/router/__tests__/match-pipelines.test.d.ts +0 -2
- package/dist/router/__tests__/match-pipelines.test.d.ts.map +0 -1
- package/dist/router/__tests__/match-pipelines.test.js +0 -417
- package/dist/router/__tests__/match-pipelines.test.js.map +0 -1
- package/dist/router/__tests__/match-result.test.d.ts +0 -2
- package/dist/router/__tests__/match-result.test.d.ts.map +0 -1
- package/dist/router/__tests__/match-result.test.js +0 -457
- package/dist/router/__tests__/match-result.test.js.map +0 -1
- package/dist/router/__tests__/on-error.test.d.ts +0 -2
- package/dist/router/__tests__/on-error.test.d.ts.map +0 -1
- package/dist/router/__tests__/on-error.test.js +0 -678
- package/dist/router/__tests__/on-error.test.js.map +0 -1
- package/dist/router/__tests__/pattern-matching.test.d.ts +0 -2
- package/dist/router/__tests__/pattern-matching.test.d.ts.map +0 -1
- package/dist/router/__tests__/pattern-matching.test.js +0 -629
- package/dist/router/__tests__/pattern-matching.test.js.map +0 -1
- package/dist/router/__tests__/segment-resolution-parallel-loading.test.d.ts +0 -2
- package/dist/router/__tests__/segment-resolution-parallel-loading.test.d.ts.map +0 -1
- package/dist/router/__tests__/segment-resolution-parallel-loading.test.js +0 -155
- package/dist/router/__tests__/segment-resolution-parallel-loading.test.js.map +0 -1
- package/dist/router/error-handling.d.ts +0 -77
- package/dist/router/error-handling.d.ts.map +0 -1
- package/dist/router/error-handling.js +0 -202
- package/dist/router/error-handling.js.map +0 -1
- package/dist/router/handler-context.d.ts +0 -20
- package/dist/router/handler-context.d.ts.map +0 -1
- package/dist/router/handler-context.js +0 -198
- package/dist/router/handler-context.js.map +0 -1
- package/dist/router/intercept-resolution.d.ts +0 -66
- package/dist/router/intercept-resolution.d.ts.map +0 -1
- package/dist/router/intercept-resolution.js +0 -246
- package/dist/router/intercept-resolution.js.map +0 -1
- package/dist/router/loader-resolution.d.ts +0 -64
- package/dist/router/loader-resolution.d.ts.map +0 -1
- package/dist/router/loader-resolution.js +0 -284
- package/dist/router/loader-resolution.js.map +0 -1
- package/dist/router/logging.d.ts +0 -15
- package/dist/router/logging.d.ts.map +0 -1
- package/dist/router/logging.js +0 -99
- package/dist/router/logging.js.map +0 -1
- package/dist/router/manifest.d.ts +0 -22
- package/dist/router/manifest.d.ts.map +0 -1
- package/dist/router/manifest.js +0 -181
- package/dist/router/manifest.js.map +0 -1
- package/dist/router/match-api.d.ts +0 -35
- package/dist/router/match-api.d.ts.map +0 -1
- package/dist/router/match-api.js +0 -406
- package/dist/router/match-api.js.map +0 -1
- package/dist/router/match-context.d.ts +0 -206
- package/dist/router/match-context.d.ts.map +0 -1
- package/dist/router/match-context.js +0 -17
- package/dist/router/match-context.js.map +0 -1
- package/dist/router/match-middleware/background-revalidation.d.ts +0 -127
- package/dist/router/match-middleware/background-revalidation.d.ts.map +0 -1
- package/dist/router/match-middleware/background-revalidation.js +0 -75
- package/dist/router/match-middleware/background-revalidation.js.map +0 -1
- package/dist/router/match-middleware/cache-lookup.d.ts +0 -112
- package/dist/router/match-middleware/cache-lookup.d.ts.map +0 -1
- package/dist/router/match-middleware/cache-lookup.js +0 -257
- package/dist/router/match-middleware/cache-lookup.js.map +0 -1
- package/dist/router/match-middleware/cache-store.d.ts +0 -113
- package/dist/router/match-middleware/cache-store.d.ts.map +0 -1
- package/dist/router/match-middleware/cache-store.js +0 -108
- package/dist/router/match-middleware/cache-store.js.map +0 -1
- package/dist/router/match-middleware/index.d.ts +0 -81
- package/dist/router/match-middleware/index.d.ts.map +0 -1
- package/dist/router/match-middleware/index.js +0 -80
- package/dist/router/match-middleware/index.js.map +0 -1
- package/dist/router/match-middleware/intercept-resolution.d.ts +0 -117
- package/dist/router/match-middleware/intercept-resolution.d.ts.map +0 -1
- package/dist/router/match-middleware/intercept-resolution.js +0 -134
- package/dist/router/match-middleware/intercept-resolution.js.map +0 -1
- package/dist/router/match-middleware/segment-resolution.d.ts +0 -99
- package/dist/router/match-middleware/segment-resolution.d.ts.map +0 -1
- package/dist/router/match-middleware/segment-resolution.js +0 -53
- package/dist/router/match-middleware/segment-resolution.js.map +0 -1
- package/dist/router/match-pipelines.d.ts +0 -147
- package/dist/router/match-pipelines.d.ts.map +0 -1
- package/dist/router/match-pipelines.js +0 -82
- package/dist/router/match-pipelines.js.map +0 -1
- package/dist/router/match-result.d.ts +0 -126
- package/dist/router/match-result.d.ts.map +0 -1
- package/dist/router/match-result.js +0 -93
- package/dist/router/match-result.js.map +0 -1
- package/dist/router/metrics.d.ts +0 -20
- package/dist/router/metrics.d.ts.map +0 -1
- package/dist/router/metrics.js +0 -47
- package/dist/router/metrics.js.map +0 -1
- package/dist/router/middleware.d.ts +0 -249
- package/dist/router/middleware.d.ts.map +0 -1
- package/dist/router/middleware.js +0 -434
- package/dist/router/middleware.js.map +0 -1
- package/dist/router/middleware.test.d.ts +0 -2
- package/dist/router/middleware.test.d.ts.map +0 -1
- package/dist/router/middleware.test.js +0 -816
- package/dist/router/middleware.test.js.map +0 -1
- package/dist/router/pattern-matching.d.ts +0 -149
- package/dist/router/pattern-matching.d.ts.map +0 -1
- package/dist/router/pattern-matching.js +0 -349
- package/dist/router/pattern-matching.js.map +0 -1
- package/dist/router/revalidation.d.ts +0 -44
- package/dist/router/revalidation.d.ts.map +0 -1
- package/dist/router/revalidation.js +0 -147
- package/dist/router/revalidation.js.map +0 -1
- package/dist/router/router-context.d.ts +0 -135
- package/dist/router/router-context.d.ts.map +0 -1
- package/dist/router/router-context.js +0 -36
- package/dist/router/router-context.js.map +0 -1
- package/dist/router/segment-resolution.d.ts +0 -127
- package/dist/router/segment-resolution.d.ts.map +0 -1
- package/dist/router/segment-resolution.js +0 -919
- package/dist/router/segment-resolution.js.map +0 -1
- package/dist/router/trie-matching.d.ts +0 -40
- package/dist/router/trie-matching.d.ts.map +0 -1
- package/dist/router/trie-matching.js +0 -127
- package/dist/router/trie-matching.js.map +0 -1
- package/dist/router/types.d.ts +0 -136
- package/dist/router/types.d.ts.map +0 -1
- package/dist/router/types.js +0 -7
- package/dist/router/types.js.map +0 -1
- package/dist/router.d.ts +0 -753
- package/dist/router.d.ts.map +0 -1
- package/dist/router.gen.d.ts +0 -6
- package/dist/router.gen.d.ts.map +0 -1
- package/dist/router.gen.js +0 -6
- package/dist/router.gen.js.map +0 -1
- package/dist/router.js +0 -1304
- package/dist/router.js.map +0 -1
- package/dist/rsc/__tests__/helpers.test.d.ts +0 -2
- package/dist/rsc/__tests__/helpers.test.d.ts.map +0 -1
- package/dist/rsc/__tests__/helpers.test.js +0 -140
- package/dist/rsc/__tests__/helpers.test.js.map +0 -1
- package/dist/rsc/handler.d.ts +0 -45
- package/dist/rsc/handler.d.ts.map +0 -1
- package/dist/rsc/handler.js +0 -1172
- package/dist/rsc/handler.js.map +0 -1
- package/dist/rsc/helpers.d.ts +0 -16
- package/dist/rsc/helpers.d.ts.map +0 -1
- package/dist/rsc/helpers.js +0 -55
- package/dist/rsc/helpers.js.map +0 -1
- package/dist/rsc/index.d.ts +0 -22
- package/dist/rsc/index.d.ts.map +0 -1
- package/dist/rsc/index.js +0 -23
- package/dist/rsc/index.js.map +0 -1
- package/dist/rsc/nonce.d.ts +0 -9
- package/dist/rsc/nonce.d.ts.map +0 -1
- package/dist/rsc/nonce.js +0 -18
- package/dist/rsc/nonce.js.map +0 -1
- package/dist/rsc/types.d.ts +0 -206
- package/dist/rsc/types.d.ts.map +0 -1
- package/dist/rsc/types.js +0 -8
- package/dist/rsc/types.js.map +0 -1
- package/dist/search-params.d.ts +0 -103
- package/dist/search-params.d.ts.map +0 -1
- package/dist/search-params.js +0 -74
- package/dist/search-params.js.map +0 -1
- package/dist/segment-system.d.ts +0 -75
- package/dist/segment-system.d.ts.map +0 -1
- package/dist/segment-system.js +0 -336
- package/dist/segment-system.js.map +0 -1
- package/dist/server/context.d.ts +0 -245
- package/dist/server/context.d.ts.map +0 -1
- package/dist/server/context.js +0 -197
- package/dist/server/context.js.map +0 -1
- package/dist/server/fetchable-loader-store.d.ts +0 -18
- package/dist/server/fetchable-loader-store.d.ts.map +0 -1
- package/dist/server/fetchable-loader-store.js +0 -18
- package/dist/server/fetchable-loader-store.js.map +0 -1
- package/dist/server/handle-store.d.ts +0 -85
- package/dist/server/handle-store.d.ts.map +0 -1
- package/dist/server/handle-store.js +0 -142
- package/dist/server/handle-store.js.map +0 -1
- package/dist/server/loader-registry.d.ts +0 -55
- package/dist/server/loader-registry.d.ts.map +0 -1
- package/dist/server/loader-registry.js +0 -132
- package/dist/server/loader-registry.js.map +0 -1
- package/dist/server/request-context.d.ts +0 -226
- package/dist/server/request-context.d.ts.map +0 -1
- package/dist/server/request-context.js +0 -290
- package/dist/server/request-context.js.map +0 -1
- package/dist/server/root-layout.d.ts +0 -4
- package/dist/server/root-layout.d.ts.map +0 -1
- package/dist/server/root-layout.js +0 -5
- package/dist/server/root-layout.js.map +0 -1
- package/dist/server.d.ts +0 -15
- package/dist/server.d.ts.map +0 -1
- package/dist/server.js +0 -20
- package/dist/server.js.map +0 -1
- package/dist/ssr/__tests__/ssr-handler.test.d.ts +0 -2
- package/dist/ssr/__tests__/ssr-handler.test.d.ts.map +0 -1
- package/dist/ssr/__tests__/ssr-handler.test.js +0 -132
- package/dist/ssr/__tests__/ssr-handler.test.js.map +0 -1
- package/dist/ssr/index.d.ts +0 -98
- package/dist/ssr/index.d.ts.map +0 -1
- package/dist/ssr/index.js +0 -158
- package/dist/ssr/index.js.map +0 -1
- package/dist/static-handler.d.ts +0 -50
- package/dist/static-handler.d.ts.map +0 -1
- package/dist/static-handler.gen.d.ts +0 -5
- package/dist/static-handler.gen.d.ts.map +0 -1
- package/dist/static-handler.gen.js +0 -5
- package/dist/static-handler.gen.js.map +0 -1
- package/dist/static-handler.js +0 -29
- package/dist/static-handler.js.map +0 -1
- package/dist/theme/ThemeProvider.d.ts +0 -20
- package/dist/theme/ThemeProvider.d.ts.map +0 -1
- package/dist/theme/ThemeProvider.js +0 -240
- package/dist/theme/ThemeProvider.js.map +0 -1
- package/dist/theme/ThemeScript.d.ts +0 -48
- package/dist/theme/ThemeScript.d.ts.map +0 -1
- package/dist/theme/ThemeScript.js +0 -13
- package/dist/theme/ThemeScript.js.map +0 -1
- package/dist/theme/__tests__/theme.test.d.ts +0 -2
- package/dist/theme/__tests__/theme.test.d.ts.map +0 -1
- package/dist/theme/__tests__/theme.test.js +0 -103
- package/dist/theme/__tests__/theme.test.js.map +0 -1
- package/dist/theme/constants.d.ts +0 -29
- package/dist/theme/constants.d.ts.map +0 -1
- package/dist/theme/constants.js +0 -48
- package/dist/theme/constants.js.map +0 -1
- package/dist/theme/index.d.ts +0 -31
- package/dist/theme/index.d.ts.map +0 -1
- package/dist/theme/index.js +0 -36
- package/dist/theme/index.js.map +0 -1
- package/dist/theme/theme-context.d.ts +0 -40
- package/dist/theme/theme-context.d.ts.map +0 -1
- package/dist/theme/theme-context.js +0 -60
- package/dist/theme/theme-context.js.map +0 -1
- package/dist/theme/theme-script.d.ts +0 -27
- package/dist/theme/theme-script.d.ts.map +0 -1
- package/dist/theme/theme-script.js +0 -147
- package/dist/theme/theme-script.js.map +0 -1
- package/dist/theme/types.d.ts +0 -163
- package/dist/theme/types.d.ts.map +0 -1
- package/dist/theme/types.js +0 -11
- package/dist/theme/types.js.map +0 -1
- package/dist/theme/use-theme.d.ts +0 -12
- package/dist/theme/use-theme.d.ts.map +0 -1
- package/dist/theme/use-theme.js +0 -40
- package/dist/theme/use-theme.js.map +0 -1
- package/dist/types.d.ts +0 -1479
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -10
- package/dist/types.js.map +0 -1
- package/dist/urls.d.ts +0 -441
- package/dist/urls.d.ts.map +0 -1
- package/dist/urls.gen.d.ts +0 -8
- package/dist/urls.gen.d.ts.map +0 -1
- package/dist/urls.gen.js +0 -8
- package/dist/urls.gen.js.map +0 -1
- package/dist/urls.js +0 -443
- package/dist/urls.js.map +0 -1
- package/dist/use-loader.d.ts +0 -127
- package/dist/use-loader.d.ts.map +0 -1
- package/dist/use-loader.js +0 -237
- package/dist/use-loader.js.map +0 -1
- package/dist/vite/__tests__/ast-handler-extract.test.d.ts +0 -2
- package/dist/vite/__tests__/ast-handler-extract.test.d.ts.map +0 -1
- package/dist/vite/__tests__/ast-handler-extract.test.js +0 -294
- package/dist/vite/__tests__/ast-handler-extract.test.js.map +0 -1
- package/dist/vite/__tests__/expose-id-utils.test.d.ts +0 -2
- package/dist/vite/__tests__/expose-id-utils.test.d.ts.map +0 -1
- package/dist/vite/__tests__/expose-id-utils.test.js +0 -224
- package/dist/vite/__tests__/expose-id-utils.test.js.map +0 -1
- package/dist/vite/__tests__/expose-internal-ids.test.d.ts +0 -2
- package/dist/vite/__tests__/expose-internal-ids.test.d.ts.map +0 -1
- package/dist/vite/__tests__/expose-internal-ids.test.js +0 -647
- package/dist/vite/__tests__/expose-internal-ids.test.js.map +0 -1
- package/dist/vite/__tests__/expose-router-id.test.d.ts +0 -2
- package/dist/vite/__tests__/expose-router-id.test.d.ts.map +0 -1
- package/dist/vite/__tests__/expose-router-id.test.js +0 -39
- package/dist/vite/__tests__/expose-router-id.test.js.map +0 -1
- package/dist/vite/ast-handler-extract.d.ts +0 -49
- package/dist/vite/ast-handler-extract.d.ts.map +0 -1
- package/dist/vite/ast-handler-extract.js +0 -249
- package/dist/vite/ast-handler-extract.js.map +0 -1
- package/dist/vite/expose-action-id.d.ts +0 -19
- package/dist/vite/expose-action-id.d.ts.map +0 -1
- package/dist/vite/expose-action-id.js +0 -250
- package/dist/vite/expose-action-id.js.map +0 -1
- package/dist/vite/expose-id-utils.d.ts +0 -69
- package/dist/vite/expose-id-utils.d.ts.map +0 -1
- package/dist/vite/expose-id-utils.js +0 -289
- package/dist/vite/expose-id-utils.js.map +0 -1
- package/dist/vite/expose-internal-ids.d.ts +0 -22
- package/dist/vite/expose-internal-ids.d.ts.map +0 -1
- package/dist/vite/expose-internal-ids.js +0 -886
- package/dist/vite/expose-internal-ids.js.map +0 -1
- package/dist/vite/index.d.ts +0 -149
- package/dist/vite/index.d.ts.map +0 -1
- package/dist/vite/index.js.bak +0 -5448
- package/dist/vite/index.js.map +0 -1
- package/dist/vite/index.named-routes.gen.ts +0 -103
- package/dist/vite/package-resolution.d.ts +0 -43
- package/dist/vite/package-resolution.d.ts.map +0 -1
- package/dist/vite/package-resolution.js +0 -112
- package/dist/vite/package-resolution.js.map +0 -1
- package/dist/vite/virtual-entries.d.ts +0 -25
- package/dist/vite/virtual-entries.d.ts.map +0 -1
- package/dist/vite/virtual-entries.js +0 -110
- package/dist/vite/virtual-entries.js.map +0 -1
- package/src/browser/shallow.ts +0 -40
package/src/router/timeout.ts
CHANGED
|
@@ -6,10 +6,6 @@
|
|
|
6
6
|
* a Promise.race mechanism, returning 504 on expiry.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
// ---------------------------------------------------------------------------
|
|
10
|
-
// Public types
|
|
11
|
-
// ---------------------------------------------------------------------------
|
|
12
|
-
|
|
13
9
|
export interface RouterTimeouts {
|
|
14
10
|
/** Timeout for server action execution (ms). */
|
|
15
11
|
actionMs?: number;
|
|
@@ -35,10 +31,6 @@ export type OnTimeoutCallback<TEnv = any> = (
|
|
|
35
31
|
ctx: TimeoutContext<TEnv>,
|
|
36
32
|
) => Response | Promise<Response>;
|
|
37
33
|
|
|
38
|
-
// ---------------------------------------------------------------------------
|
|
39
|
-
// Internal resolved form
|
|
40
|
-
// ---------------------------------------------------------------------------
|
|
41
|
-
|
|
42
34
|
export interface ResolvedTimeouts {
|
|
43
35
|
actionMs: number | undefined;
|
|
44
36
|
renderStartMs: number | undefined;
|
|
@@ -63,10 +55,6 @@ export function resolveTimeouts(
|
|
|
63
55
|
};
|
|
64
56
|
}
|
|
65
57
|
|
|
66
|
-
// ---------------------------------------------------------------------------
|
|
67
|
-
// Error class
|
|
68
|
-
// ---------------------------------------------------------------------------
|
|
69
|
-
|
|
70
58
|
export class RouterTimeoutError extends Error {
|
|
71
59
|
override name = "RouterTimeoutError" as const;
|
|
72
60
|
phase: TimeoutPhase;
|
|
@@ -81,10 +69,6 @@ export class RouterTimeoutError extends Error {
|
|
|
81
69
|
}
|
|
82
70
|
}
|
|
83
71
|
|
|
84
|
-
// ---------------------------------------------------------------------------
|
|
85
|
-
// Race helper
|
|
86
|
-
// ---------------------------------------------------------------------------
|
|
87
|
-
|
|
88
72
|
type TimeoutResult<T> =
|
|
89
73
|
| { result: T; timedOut: false }
|
|
90
74
|
| { timedOut: true; durationMs: number };
|
|
@@ -129,10 +113,6 @@ export async function withTimeout<T>(
|
|
|
129
113
|
}
|
|
130
114
|
}
|
|
131
115
|
|
|
132
|
-
// ---------------------------------------------------------------------------
|
|
133
|
-
// Default response
|
|
134
|
-
// ---------------------------------------------------------------------------
|
|
135
|
-
|
|
136
116
|
/**
|
|
137
117
|
* Create the default 504 response for a timed-out request.
|
|
138
118
|
* Includes `X-Rango-Timeout-Phase` header for observability.
|
|
@@ -43,14 +43,12 @@ export function tryTrieMatch(
|
|
|
43
43
|
): TrieMatchResult | null {
|
|
44
44
|
if (!trie) return null;
|
|
45
45
|
|
|
46
|
-
// Split pathname into segments, filtering empty strings from leading/trailing slashes
|
|
47
46
|
const pathnameHasTrailingSlash =
|
|
48
47
|
pathname.length > 1 && pathname.endsWith("/");
|
|
49
48
|
const normalizedPath = pathnameHasTrailingSlash
|
|
50
49
|
? pathname.slice(0, -1)
|
|
51
50
|
: pathname;
|
|
52
51
|
|
|
53
|
-
// Handle root path
|
|
54
52
|
if (normalizedPath === "" || normalizedPath === "/") {
|
|
55
53
|
if (trie.r) {
|
|
56
54
|
return validateAndBuild(
|
|
@@ -77,10 +75,8 @@ export function tryTrieMatch(
|
|
|
77
75
|
return null;
|
|
78
76
|
}
|
|
79
77
|
|
|
80
|
-
// Remove leading slash and split
|
|
81
78
|
const segments = normalizedPath.slice(1).split("/");
|
|
82
79
|
|
|
83
|
-
// Try exact match with normalized path (no trailing slash)
|
|
84
80
|
const result = walkTrie(trie, segments, 0, []);
|
|
85
81
|
if (result) {
|
|
86
82
|
return validateAndBuild(
|
|
@@ -102,8 +98,58 @@ interface WalkResult {
|
|
|
102
98
|
}
|
|
103
99
|
|
|
104
100
|
/**
|
|
105
|
-
*
|
|
106
|
-
*
|
|
101
|
+
* Check a leaf's constraints (leaf.cv) against already-resolved named params.
|
|
102
|
+
* Empty/undefined values are exempt (optional params that were not bound).
|
|
103
|
+
*/
|
|
104
|
+
function constraintsSatisfied(
|
|
105
|
+
leaf: TrieLeaf,
|
|
106
|
+
params: Record<string, string>,
|
|
107
|
+
): boolean {
|
|
108
|
+
if (!leaf.cv) return true;
|
|
109
|
+
for (const paramName in leaf.cv) {
|
|
110
|
+
const allowed = leaf.cv[paramName]!;
|
|
111
|
+
const value = params[paramName];
|
|
112
|
+
if (value !== undefined && value !== "" && !allowed.includes(value)) {
|
|
113
|
+
return false;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
return true;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Constraint check for a candidate terminal DURING the walk. Builds the named
|
|
121
|
+
* params from positional walk values (decoded the same way validateAndBuild
|
|
122
|
+
* does) and validates leaf.cv. Returning false lets walkTrie unwind to a
|
|
123
|
+
* lower-priority sibling instead of committing to a leaf that would only be
|
|
124
|
+
* rejected post-walk — that post-walk rejection is what forced the regex
|
|
125
|
+
* fallback (and its false "trie gap" R3 warning) for perfectly valid configs.
|
|
126
|
+
*/
|
|
127
|
+
function leafConstraintsPass(
|
|
128
|
+
leaf: TrieLeaf,
|
|
129
|
+
paramValues: string[],
|
|
130
|
+
wildcardValue: string | undefined,
|
|
131
|
+
): boolean {
|
|
132
|
+
if (!leaf.cv) return true;
|
|
133
|
+
const params: Record<string, string> = {};
|
|
134
|
+
if (leaf.pa) {
|
|
135
|
+
for (let i = 0; i < leaf.pa.length && i < paramValues.length; i++) {
|
|
136
|
+
params[leaf.pa[i]] = safeDecodeURIComponent(paramValues[i]);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
if (wildcardValue !== undefined && "pn" in leaf) {
|
|
140
|
+
params[(leaf as TrieLeaf & { pn: string }).pn] =
|
|
141
|
+
safeDecodeURIComponent(wildcardValue);
|
|
142
|
+
}
|
|
143
|
+
return constraintsSatisfied(leaf, params);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Walk the trie by segments with priority: static > suffix-param > param >
|
|
148
|
+
* wildcard (Priority 1-4 below; matches the canonical M4 ordering in
|
|
149
|
+
* docs/internal/matching-and-lazy-discovery.md).
|
|
150
|
+
* Uses backtracking to try all possible matches. Per-leaf constraints are
|
|
151
|
+
* enforced at each candidate terminal so a constraint miss backtracks to a
|
|
152
|
+
* lower-priority sibling rather than aborting the whole match.
|
|
107
153
|
*/
|
|
108
154
|
function walkTrie(
|
|
109
155
|
node: TrieNode,
|
|
@@ -111,9 +157,8 @@ function walkTrie(
|
|
|
111
157
|
index: number,
|
|
112
158
|
paramValues: string[],
|
|
113
159
|
): WalkResult | null {
|
|
114
|
-
// All segments consumed: check for terminal
|
|
115
160
|
if (index === segments.length) {
|
|
116
|
-
if (node.r) {
|
|
161
|
+
if (node.r && leafConstraintsPass(node.r, paramValues, undefined)) {
|
|
117
162
|
return { leaf: node.r, paramValues: [...paramValues] };
|
|
118
163
|
}
|
|
119
164
|
// A wildcard at this node matches the bare prefix with an empty remainder
|
|
@@ -122,7 +167,7 @@ function walkTrie(
|
|
|
122
167
|
// so without this a request to the wildcard's own prefix misses the trie
|
|
123
168
|
// and the regex fallback emits a corrupt redirect. A static terminal
|
|
124
169
|
// (node.r) still wins.
|
|
125
|
-
if (node.w) {
|
|
170
|
+
if (node.w && leafConstraintsPass(node.w, paramValues, "")) {
|
|
126
171
|
return { leaf: node.w, paramValues: [...paramValues], wildcardValue: "" };
|
|
127
172
|
}
|
|
128
173
|
return null;
|
|
@@ -131,13 +176,11 @@ function walkTrie(
|
|
|
131
176
|
const segment = segments[index];
|
|
132
177
|
const staticChild = node.s?.[segment];
|
|
133
178
|
|
|
134
|
-
// Priority 1: Static match
|
|
135
179
|
if (staticChild) {
|
|
136
180
|
const result = walkTrie(staticChild, segments, index + 1, paramValues);
|
|
137
181
|
if (result) return result;
|
|
138
182
|
}
|
|
139
183
|
|
|
140
|
-
// Priority 2: Suffix-param match (e.g., :productId.html)
|
|
141
184
|
if (node.xp) {
|
|
142
185
|
for (const suffix in node.xp) {
|
|
143
186
|
if (segment.endsWith(suffix) && segment.length > suffix.length) {
|
|
@@ -155,7 +198,6 @@ function walkTrie(
|
|
|
155
198
|
}
|
|
156
199
|
}
|
|
157
200
|
|
|
158
|
-
// Priority 3: Param match
|
|
159
201
|
if (node.p) {
|
|
160
202
|
paramValues.push(segment);
|
|
161
203
|
const result = walkTrie(node.p.c, segments, index + 1, paramValues);
|
|
@@ -163,14 +205,15 @@ function walkTrie(
|
|
|
163
205
|
if (result) return result;
|
|
164
206
|
}
|
|
165
207
|
|
|
166
|
-
// Priority 4: Wildcard match (consumes rest)
|
|
167
208
|
if (node.w) {
|
|
168
209
|
const rest = joinRemainingSegments(segments, index);
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
210
|
+
if (leafConstraintsPass(node.w, paramValues, rest)) {
|
|
211
|
+
return {
|
|
212
|
+
leaf: node.w,
|
|
213
|
+
paramValues: [...paramValues],
|
|
214
|
+
wildcardValue: rest,
|
|
215
|
+
};
|
|
216
|
+
}
|
|
174
217
|
}
|
|
175
218
|
|
|
176
219
|
return null;
|
|
@@ -196,10 +239,6 @@ function validateAndBuild(
|
|
|
196
239
|
originalPathname: string,
|
|
197
240
|
pathnameHasTrailingSlash: boolean,
|
|
198
241
|
): TrieMatchResult | null {
|
|
199
|
-
// Build named params by zipping leaf.pa with positional paramValues.
|
|
200
|
-
// Params are URL-decoded at this boundary so ctx.params holds the values
|
|
201
|
-
// apps expect (matching Express/React Router) and round-trip cleanly
|
|
202
|
-
// through ctx.reverse.
|
|
203
242
|
const params: Record<string, string> = {};
|
|
204
243
|
if (leaf.pa) {
|
|
205
244
|
for (let i = 0; i < leaf.pa.length && i < paramValues.length; i++) {
|
|
@@ -207,31 +246,15 @@ function validateAndBuild(
|
|
|
207
246
|
}
|
|
208
247
|
}
|
|
209
248
|
|
|
210
|
-
// Add wildcard param (wildcard leaves have pn from TrieNode.w type)
|
|
211
249
|
if (wildcardValue !== undefined && "pn" in leaf) {
|
|
212
250
|
params[(leaf as TrieLeaf & { pn: string }).pn] =
|
|
213
251
|
safeDecodeURIComponent(wildcardValue);
|
|
214
252
|
}
|
|
215
253
|
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
if (leaf.cv) {
|
|
219
|
-
for (const paramName in leaf.cv) {
|
|
220
|
-
const allowed = leaf.cv[paramName]!;
|
|
221
|
-
const value = params[paramName];
|
|
222
|
-
if (value !== undefined && value !== "" && !allowed.includes(value)) {
|
|
223
|
-
return null;
|
|
224
|
-
}
|
|
225
|
-
}
|
|
254
|
+
if (!constraintsSatisfied(leaf, params)) {
|
|
255
|
+
return null;
|
|
226
256
|
}
|
|
227
257
|
|
|
228
|
-
// Optional params that weren't matched are left absent from `params` so
|
|
229
|
-
// `ctx.params.locale` reads as `undefined`, matching the
|
|
230
|
-
// `ExtractParams<"/:locale?/...">` type (`{ locale?: string }`). Both
|
|
231
|
-
// internal consumers — the constraint check above and `reverse()` —
|
|
232
|
-
// already treat missing/undefined as the absent form.
|
|
233
|
-
|
|
234
|
-
// Trailing slash handling
|
|
235
258
|
const tsMode = leaf.ts as "never" | "always" | "ignore" | undefined;
|
|
236
259
|
let redirectTo: string | undefined;
|
|
237
260
|
|
package/src/router/types.ts
CHANGED
|
@@ -22,27 +22,11 @@ import type {
|
|
|
22
22
|
ShouldRevalidateFn,
|
|
23
23
|
} from "../types";
|
|
24
24
|
|
|
25
|
-
/**
|
|
26
|
-
* Result of resolving loaders with revalidation
|
|
27
|
-
* Contains both segments to render and all matched segment IDs
|
|
28
|
-
*/
|
|
29
|
-
export interface LoaderRevalidationResult {
|
|
30
|
-
segments: ResolvedSegment[];
|
|
31
|
-
matchedIds: string[];
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Result of resolving segments with revalidation
|
|
36
|
-
* Contains both segments to render and all matched segment IDs
|
|
37
|
-
*/
|
|
38
25
|
export interface SegmentRevalidationResult {
|
|
39
26
|
segments: ResolvedSegment[];
|
|
40
27
|
matchedIds: string[];
|
|
41
28
|
}
|
|
42
29
|
|
|
43
|
-
/**
|
|
44
|
-
* Action context type for revalidation
|
|
45
|
-
*/
|
|
46
30
|
export type ActionContext = {
|
|
47
31
|
actionId?: string;
|
|
48
32
|
actionUrl?: URL;
|
|
@@ -50,23 +34,6 @@ export type ActionContext = {
|
|
|
50
34
|
formData?: FormData;
|
|
51
35
|
};
|
|
52
36
|
|
|
53
|
-
/**
|
|
54
|
-
* Dependencies passed to segment resolution functions
|
|
55
|
-
* These are created within createRouter and passed to extracted utilities
|
|
56
|
-
*/
|
|
57
|
-
export interface RouterDependencies<TEnv> {
|
|
58
|
-
findNearestErrorBoundary: (
|
|
59
|
-
entry: EntryData | null,
|
|
60
|
-
) => ReactNode | ErrorBoundaryHandler | null;
|
|
61
|
-
findNearestNotFoundBoundary: (
|
|
62
|
-
entry: EntryData | null,
|
|
63
|
-
) => ReactNode | NotFoundBoundaryHandler | null;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Dependencies injected from createRouter closure into extracted segment resolution functions.
|
|
68
|
-
* These are the closure-bound helpers that cannot be imported directly.
|
|
69
|
-
*/
|
|
70
37
|
export interface SegmentResolutionDeps<TEnv = any> {
|
|
71
38
|
wrapLoaderPromise: <T>(
|
|
72
39
|
promise: Promise<T>,
|
|
@@ -108,21 +75,6 @@ export interface SegmentResolutionDeps<TEnv = any> {
|
|
|
108
75
|
viewTransitionDefault?: "auto" | false;
|
|
109
76
|
}
|
|
110
77
|
|
|
111
|
-
/**
|
|
112
|
-
* Dependencies injected from createRouter closure into extracted intercept resolution functions.
|
|
113
|
-
*/
|
|
114
|
-
export interface InterceptResolutionDeps<TEnv = any> {
|
|
115
|
-
wrapLoaderPromise: SegmentResolutionDeps<TEnv>["wrapLoaderPromise"];
|
|
116
|
-
evaluateInterceptWhen: (
|
|
117
|
-
intercept: InterceptEntry,
|
|
118
|
-
selectorContext: InterceptSelectorContext | null,
|
|
119
|
-
isAction: boolean,
|
|
120
|
-
) => boolean;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* Dependencies injected from createRouter closure into extracted match API functions.
|
|
125
|
-
*/
|
|
126
78
|
export interface MatchApiDeps<TEnv = any> {
|
|
127
79
|
findMatch: (pathname: string, ms?: any) => any;
|
|
128
80
|
getMetricsStore: () => any;
|
|
@@ -137,23 +89,13 @@ export interface MatchApiDeps<TEnv = any> {
|
|
|
137
89
|
getRouteMap: () => Record<string, string>;
|
|
138
90
|
}
|
|
139
91
|
|
|
140
|
-
/**
|
|
141
|
-
* Title descriptor types for template support
|
|
142
|
-
*/
|
|
143
92
|
export type TitleDescriptor =
|
|
144
93
|
| string
|
|
145
94
|
| { template: string; default: string } // For layouts - template applied to child titles
|
|
146
|
-
| { absolute: string };
|
|
95
|
+
| { absolute: string };
|
|
147
96
|
|
|
148
|
-
/**
|
|
149
|
-
* Unset descriptor to remove inherited meta
|
|
150
|
-
* Key format matches getMetaKey output: "title", "name:description", "property:og:image"
|
|
151
|
-
*/
|
|
152
97
|
export type UnsetDescriptor = { unset: string };
|
|
153
98
|
|
|
154
|
-
/**
|
|
155
|
-
* Base meta descriptor types (sync values)
|
|
156
|
-
*/
|
|
157
99
|
export type MetaDescriptorBase =
|
|
158
100
|
| { charSet: "utf-8" }
|
|
159
101
|
| { title: TitleDescriptor }
|
|
@@ -165,10 +107,6 @@ export type MetaDescriptorBase =
|
|
|
165
107
|
| UnsetDescriptor
|
|
166
108
|
| { [name: string]: unknown };
|
|
167
109
|
|
|
168
|
-
/**
|
|
169
|
-
* Meta descriptor that can be sync or async.
|
|
170
|
-
* Use Promise<MetaDescriptorBase> for streaming meta that resolves after initial render.
|
|
171
|
-
*/
|
|
172
110
|
export type MetaDescriptor = MetaDescriptorBase | Promise<MetaDescriptorBase>;
|
|
173
111
|
|
|
174
112
|
type LdJsonObject = { [Key in string]: LdJsonValue } & {
|
package/src/router/url-params.ts
CHANGED
|
@@ -25,11 +25,6 @@ export function safeDecodeURIComponent(raw: string): string {
|
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
// encodeURIComponent over-encodes for path segments. After running it,
|
|
29
|
-
// un-encode the pchar sub-delims + (`:` / `@`) so the resulting URL
|
|
30
|
-
// keeps human-readable characters that are legal in a path segment.
|
|
31
|
-
// Everything dangerous — `/ ? # %` and space/control/non-ASCII — stays
|
|
32
|
-
// encoded.
|
|
33
28
|
const PATH_SAFE_ESCAPES: Record<string, string> = {
|
|
34
29
|
"%3A": ":",
|
|
35
30
|
"%40": "@",
|
package/src/router.ts
CHANGED
|
@@ -1058,8 +1058,10 @@ export function createRouter<TEnv = any>(
|
|
|
1058
1058
|
if (!handler) {
|
|
1059
1059
|
// Lazy import deferred to first request to avoid dev mode issues
|
|
1060
1060
|
const { createRSCHandler } = await import("./rsc/handler.js");
|
|
1061
|
-
// Cast:
|
|
1062
|
-
//
|
|
1061
|
+
// Cast: createRSCHandler receives `router as any`, which erases TEnv
|
|
1062
|
+
// and infers its handler as RouterRequestInput<unknown>. Re-narrow the
|
|
1063
|
+
// returned handler to RouterRequestInput<TEnv> so the call below stays
|
|
1064
|
+
// typed. (The handler already accepts (request, RouterRequestInput).)
|
|
1063
1065
|
handler = createRSCHandler({
|
|
1064
1066
|
router: router as any,
|
|
1065
1067
|
cache,
|
package/src/rsc/handler.ts
CHANGED
|
@@ -1017,10 +1017,19 @@ export function createRSCHandler<
|
|
|
1017
1017
|
} catch (error) {
|
|
1018
1018
|
// Check if middleware/handler returned Response
|
|
1019
1019
|
if (error instanceof Response) {
|
|
1020
|
+
// An action revalidation render is delivered to the client over the
|
|
1021
|
+
// same Flight-parsing path as a partial navigation, so a Response
|
|
1022
|
+
// thrown during it must be converted exactly like a partial one
|
|
1023
|
+
// (raw 200 -> hard-nav hint, 3xx -> Flight redirect). Without this,
|
|
1024
|
+
// the no-middleware path returns the raw Response (the with-middleware
|
|
1025
|
+
// path is already covered by the isPartial || actionContinuation
|
|
1026
|
+
// guard below).
|
|
1027
|
+
const treatAsPartial = isPartial || actionContinuation != null;
|
|
1028
|
+
|
|
1020
1029
|
// During partial (client-side navigation), a 200 Response from a handler
|
|
1021
1030
|
// means the route serves raw content (JSON, text, etc.), not JSX.
|
|
1022
1031
|
// Signal the browser to hard-navigate so it renders the raw response.
|
|
1023
|
-
if (
|
|
1032
|
+
if (treatAsPartial && error.status === 200) {
|
|
1024
1033
|
console.warn(
|
|
1025
1034
|
`[RSC] Route handler at ${url.pathname} returned a Response during client-side navigation. ` +
|
|
1026
1035
|
`Falling back to hard navigation. Use data-external on the <Link> to avoid the extra round-trip.`,
|
|
@@ -1034,7 +1043,7 @@ export function createRSCHandler<
|
|
|
1034
1043
|
});
|
|
1035
1044
|
}
|
|
1036
1045
|
|
|
1037
|
-
if (
|
|
1046
|
+
if (treatAsPartial) {
|
|
1038
1047
|
const intercepted = interceptRedirectForPartial(
|
|
1039
1048
|
error,
|
|
1040
1049
|
createRedirectFlightResponse,
|
package/src/rsc/helpers.ts
CHANGED
|
@@ -13,6 +13,7 @@ import { resolveLocationStateEntries } from "../browser/react/location-state-sha
|
|
|
13
13
|
import { isRedirectResponse } from "../response-utils.js";
|
|
14
14
|
import type { MiddlewareEntry, MiddlewareFn } from "../router/middleware.js";
|
|
15
15
|
import { formatCacheSignalHeader } from "../router/telemetry.js";
|
|
16
|
+
import type { RscPayload } from "./types.js";
|
|
16
17
|
|
|
17
18
|
/**
|
|
18
19
|
* DEVELOPMENT/TEST ONLY. When the debug cache signal gate is on,
|
|
@@ -185,6 +186,20 @@ export function interceptRedirectForPartial(
|
|
|
185
186
|
return intercepted;
|
|
186
187
|
}
|
|
187
188
|
|
|
189
|
+
/**
|
|
190
|
+
* Attach location state set during a request to a payload's metadata.
|
|
191
|
+
* No-op if no location state was set. Callers must ensure payload.metadata
|
|
192
|
+
* is populated (the non-null assertion holds for the partial/action payloads
|
|
193
|
+
* that reach this helper).
|
|
194
|
+
*/
|
|
195
|
+
export function attachLocationStateIfPresent(payload: RscPayload): void {
|
|
196
|
+
const locationState = getLocationState();
|
|
197
|
+
if (locationState) {
|
|
198
|
+
payload.metadata!.locationState =
|
|
199
|
+
resolveLocationStateEntries(locationState);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
188
203
|
/**
|
|
189
204
|
* Only cache successful responses. Non-200 statuses (errors, redirects) are
|
|
190
205
|
* not cached -- notFound() produces 500 in response routes, and explicit
|
package/src/rsc/origin-guard.ts
CHANGED
|
@@ -69,11 +69,8 @@ export type OriginCheckConfig<TEnv = any> =
|
|
|
69
69
|
* Returns true to allow, false to reject.
|
|
70
70
|
*/
|
|
71
71
|
export function defaultOriginCheck(request: Request, url: URL): boolean {
|
|
72
|
-
// 1. Read Origin header (present on all cross-origin requests and
|
|
73
|
-
// same-origin POST/PUT/PATCH/DELETE in modern browsers)
|
|
74
72
|
let requestOrigin = request.headers.get("origin");
|
|
75
73
|
|
|
76
|
-
// 2. Fallback to Referer if Origin is absent (some proxies strip it)
|
|
77
74
|
if (!requestOrigin) {
|
|
78
75
|
const referer = request.headers.get("referer");
|
|
79
76
|
if (referer) {
|
|
@@ -85,22 +82,13 @@ export function defaultOriginCheck(request: Request, url: URL): boolean {
|
|
|
85
82
|
}
|
|
86
83
|
}
|
|
87
84
|
|
|
88
|
-
// 3. No Origin or Referer — allow (can't be browser-initiated CSRF)
|
|
89
85
|
if (!requestOrigin) return true;
|
|
90
86
|
|
|
91
|
-
// "null" origin comes from privacy-sensitive contexts (data: URLs,
|
|
92
|
-
// sandboxed iframes, cross-origin redirects). Reject it.
|
|
93
87
|
if (requestOrigin === "null") return false;
|
|
94
88
|
|
|
95
|
-
// 4. Determine expected host from Host header or URL.
|
|
96
|
-
// X-Forwarded-Host/Proto are NOT used — they are client-controllable
|
|
97
|
-
// unless a trusted proxy strips them. On standard deployments (Cloudflare
|
|
98
|
-
// Workers, Node behind nginx/caddy) the Host header is already correct.
|
|
99
|
-
// For non-standard setups, use the custom function escape hatch.
|
|
100
89
|
const expectedHost = request.headers.get("host") || url.host;
|
|
101
90
|
const expectedProtocol = url.protocol;
|
|
102
91
|
|
|
103
|
-
// 5. Build expected origin and compare (case-insensitive)
|
|
104
92
|
const expectedOrigin = `${expectedProtocol}//${expectedHost}`;
|
|
105
93
|
|
|
106
94
|
return requestOrigin.toLowerCase() === expectedOrigin.toLowerCase();
|
|
@@ -259,7 +259,6 @@ export async function handleProgressiveEnhancement<TEnv>(
|
|
|
259
259
|
warmupEnabled: ctx.router.warmupEnabled,
|
|
260
260
|
initialTheme: requireRequestContext().theme,
|
|
261
261
|
},
|
|
262
|
-
formState: actionResult,
|
|
263
262
|
};
|
|
264
263
|
|
|
265
264
|
const rscStream = ctx.renderToReadableStream<RscPayload>(payload, {
|
|
@@ -277,6 +276,8 @@ export async function handleProgressiveEnhancement<TEnv>(
|
|
|
277
276
|
url,
|
|
278
277
|
undefined,
|
|
279
278
|
);
|
|
279
|
+
// reactFormState carries the useActionState payload via the SSR-option path
|
|
280
|
+
// (renderToReadableStream({ formState })); it does NOT travel on RscPayload.
|
|
280
281
|
const htmlStream = await ssrModule.renderHTML(rscStream, {
|
|
281
282
|
formState: reactFormState,
|
|
282
283
|
nonce,
|
package/src/rsc/rsc-rendering.ts
CHANGED
|
@@ -9,9 +9,7 @@
|
|
|
9
9
|
import {
|
|
10
10
|
requireRequestContext,
|
|
11
11
|
setRequestContextParams,
|
|
12
|
-
getLocationState,
|
|
13
12
|
} from "../server/request-context.js";
|
|
14
|
-
import { resolveLocationStateEntries } from "../browser/react/location-state-shared.js";
|
|
15
13
|
import { appendMetric } from "../router/metrics.js";
|
|
16
14
|
import { getSSRSetup, isRscRequest } from "./ssr-setup.js";
|
|
17
15
|
import type { RscPayload } from "./types.js";
|
|
@@ -19,6 +17,7 @@ import type { MatchResult } from "../types.js";
|
|
|
19
17
|
import {
|
|
20
18
|
createResponseWithMergedHeaders,
|
|
21
19
|
createSimpleRedirectResponse,
|
|
20
|
+
attachLocationStateIfPresent,
|
|
22
21
|
} from "./helpers.js";
|
|
23
22
|
import type { HandlerContext } from "./handler-context.js";
|
|
24
23
|
|
|
@@ -155,11 +154,7 @@ export async function handleRscRendering<TEnv>(
|
|
|
155
154
|
// SSR (full page) requests ignore location state since there's no history.state
|
|
156
155
|
// to write to on a fresh page load.
|
|
157
156
|
if (isPartial && payload.metadata) {
|
|
158
|
-
|
|
159
|
-
if (locationState) {
|
|
160
|
-
payload.metadata.locationState =
|
|
161
|
-
resolveLocationStateEntries(locationState);
|
|
162
|
-
}
|
|
157
|
+
attachLocationStateIfPresent(payload);
|
|
163
158
|
}
|
|
164
159
|
|
|
165
160
|
const metricsStore = reqCtx._metricsStore;
|
|
@@ -39,3 +39,17 @@ export function warnNonRedirectPeResponse(): void {
|
|
|
39
39
|
`ignored — the page will re-render at the current URL instead.`,
|
|
40
40
|
);
|
|
41
41
|
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Warn when a non-redirect Response is returned (not thrown) from an action
|
|
45
|
+
* on the JS (fetch) path. A raw Response cannot be serialized into Flight, so
|
|
46
|
+
* it is discarded — mirroring the PE path. Use `throw redirect('/path')` for
|
|
47
|
+
* redirects.
|
|
48
|
+
*/
|
|
49
|
+
export function warnNonRedirectActionResponse(actionId: string): void {
|
|
50
|
+
console.warn(
|
|
51
|
+
`[@rangojs/router] Server action "${actionId}" returned a Response ` +
|
|
52
|
+
`that is not a redirect. Non-redirect Responses cannot be serialized ` +
|
|
53
|
+
`and are ignored. Use \`throw redirect('/path')\` for redirects.`,
|
|
54
|
+
);
|
|
55
|
+
}
|
package/src/rsc/server-action.ts
CHANGED
|
@@ -18,9 +18,7 @@
|
|
|
18
18
|
import {
|
|
19
19
|
requireRequestContext,
|
|
20
20
|
setRequestContextParams,
|
|
21
|
-
getLocationState,
|
|
22
21
|
} from "../server/request-context.js";
|
|
23
|
-
import { resolveLocationStateEntries } from "../browser/react/location-state-shared.js";
|
|
24
22
|
import { appendMetric } from "../router/metrics.js";
|
|
25
23
|
import type { RscPayload } from "./types.js";
|
|
26
24
|
import {
|
|
@@ -28,21 +26,11 @@ import {
|
|
|
28
26
|
createResponseWithMergedHeaders,
|
|
29
27
|
createSimpleRedirectResponse,
|
|
30
28
|
interceptRedirectForPartial,
|
|
29
|
+
attachLocationStateIfPresent,
|
|
31
30
|
} from "./helpers.js";
|
|
31
|
+
import { warnNonRedirectActionResponse } from "./runtime-warnings.js";
|
|
32
32
|
import type { HandlerContext } from "./handler-context.js";
|
|
33
33
|
|
|
34
|
-
/**
|
|
35
|
-
* Attach location state set during the action to a payload's metadata.
|
|
36
|
-
* No-op if no location state was set.
|
|
37
|
-
*/
|
|
38
|
-
function attachLocationState(payload: RscPayload): void {
|
|
39
|
-
const locationState = getLocationState();
|
|
40
|
-
if (locationState) {
|
|
41
|
-
payload.metadata!.locationState =
|
|
42
|
-
resolveLocationStateEntries(locationState);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
34
|
/**
|
|
47
35
|
* Data flowing from action execution to the revalidation phase.
|
|
48
36
|
* When the action completes without redirect/error-boundary, the handler
|
|
@@ -109,7 +97,7 @@ export async function executeServerAction<TEnv>(
|
|
|
109
97
|
|
|
110
98
|
try {
|
|
111
99
|
loadedAction = await ctx.loadServerAction(actionId);
|
|
112
|
-
|
|
100
|
+
let data = await loadedAction!.apply(null, args);
|
|
113
101
|
|
|
114
102
|
// Intercept redirect Responses: serializing one as the action returnValue
|
|
115
103
|
// would fail, and revalidation would run needlessly.
|
|
@@ -119,6 +107,14 @@ export async function executeServerAction<TEnv>(
|
|
|
119
107
|
ctx.createRedirectFlightResponse,
|
|
120
108
|
);
|
|
121
109
|
if (intercepted) return intercepted;
|
|
110
|
+
|
|
111
|
+
// Non-redirect Response returned (not thrown): a raw Response cannot be
|
|
112
|
+
// serialized into Flight. Discard it and re-render — mirroring the PE
|
|
113
|
+
// path (progressive-enhancement.ts) so JS and no-JS behave identically.
|
|
114
|
+
if (process.env.NODE_ENV !== "production") {
|
|
115
|
+
warnNonRedirectActionResponse(actionId);
|
|
116
|
+
}
|
|
117
|
+
data = undefined;
|
|
122
118
|
}
|
|
123
119
|
|
|
124
120
|
returnValue = { ok: true, data };
|
|
@@ -224,18 +220,21 @@ export async function executeServerAction<TEnv>(
|
|
|
224
220
|
}
|
|
225
221
|
|
|
226
222
|
// Build continuation for the revalidation phase
|
|
227
|
-
const
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
223
|
+
const actionMeta = loadedAction as
|
|
224
|
+
| { $id?: string; $$id?: string }
|
|
225
|
+
| undefined;
|
|
226
|
+
const resolvedActionId = actionMeta?.$id ?? actionMeta?.$$id ?? actionId;
|
|
231
227
|
|
|
232
228
|
return {
|
|
233
229
|
returnValue,
|
|
234
230
|
actionStatus,
|
|
235
231
|
temporaryReferences,
|
|
236
232
|
actionContext: {
|
|
233
|
+
// Defensive copy of the already-parsed url (avoids re-parsing
|
|
234
|
+
// request.url). actionUrl is persisted into the continuation and later
|
|
235
|
+
// flows into matchPartial, so it must not alias the handler's live url.
|
|
237
236
|
actionId: resolvedActionId,
|
|
238
|
-
actionUrl: new URL(
|
|
237
|
+
actionUrl: new URL(url),
|
|
239
238
|
actionResult: returnValue.data,
|
|
240
239
|
formData: actionFormData,
|
|
241
240
|
},
|
|
@@ -274,8 +273,8 @@ export async function revalidateAfterAction<TEnv>(
|
|
|
274
273
|
);
|
|
275
274
|
|
|
276
275
|
if (!matchResult) {
|
|
277
|
-
// matchPartial returns null when the route is a redirect or
|
|
278
|
-
//
|
|
276
|
+
// matchPartial returns null when the route is a redirect or no previous-URL
|
|
277
|
+
// context could be resolved. Check for redirect first.
|
|
279
278
|
const fullMatch = await ctx.router.match(request, { env });
|
|
280
279
|
setRequestContextParams(fullMatch.params, fullMatch.routeName);
|
|
281
280
|
|
|
@@ -286,14 +285,17 @@ export async function revalidateAfterAction<TEnv>(
|
|
|
286
285
|
return createSimpleRedirectResponse(fullMatch.redirect);
|
|
287
286
|
}
|
|
288
287
|
|
|
289
|
-
// Non-redirect: this branch is only reachable when
|
|
290
|
-
//
|
|
291
|
-
//
|
|
292
|
-
//
|
|
288
|
+
// Non-redirect: this branch is only reachable when no previous URL could
|
|
289
|
+
// be resolved (neither X-RSC-Router-Client-Path nor a usable Referer), or
|
|
290
|
+
// the previous URL was unparseable (defensive). The client requires
|
|
291
|
+
// isPartial for action responses, so producing a full payload here would
|
|
292
|
+
// be rejected. Return 500 instead.
|
|
293
293
|
throw new Error(
|
|
294
294
|
`[RSC] matchPartial returned null for a non-redirect route ` +
|
|
295
295
|
`during action revalidation (${url.pathname}). This indicates ` +
|
|
296
|
-
`a malformed action request
|
|
296
|
+
`a malformed action request: no previous-URL context could be ` +
|
|
297
|
+
`resolved (neither X-RSC-Router-Client-Path nor a usable Referer), ` +
|
|
298
|
+
`or the previous URL was unparseable.`,
|
|
297
299
|
);
|
|
298
300
|
}
|
|
299
301
|
|
|
@@ -319,7 +321,7 @@ export async function revalidateAfterAction<TEnv>(
|
|
|
319
321
|
returnValue,
|
|
320
322
|
};
|
|
321
323
|
|
|
322
|
-
|
|
324
|
+
attachLocationStateIfPresent(payload);
|
|
323
325
|
|
|
324
326
|
const renderStart = performance.now();
|
|
325
327
|
const rscStream = ctx.renderToReadableStream<RscPayload>(payload, {
|