@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
|
@@ -1,49 +1,4 @@
|
|
|
1
|
-
// React exports for browser navigation
|
|
2
|
-
|
|
3
|
-
// Hook with Zustand-style selectors
|
|
4
|
-
export { useNavigation } from "./use-navigation.js";
|
|
5
|
-
|
|
6
|
-
// Router actions hook (stable reference, no re-renders)
|
|
7
|
-
export { useRouter } from "./use-router.js";
|
|
8
|
-
|
|
9
|
-
// URL hooks
|
|
10
|
-
export { usePathname } from "./use-pathname.js";
|
|
11
|
-
export { useSearchParams } from "./use-search-params.js";
|
|
12
|
-
export { useParams } from "./use-params.js";
|
|
13
|
-
|
|
14
|
-
// Action state tracking hook
|
|
15
|
-
export { useAction, type TrackedActionState } from "./use-action.js";
|
|
16
|
-
|
|
17
|
-
// Segments state hook
|
|
18
|
-
export { useSegments, type SegmentsState } from "./use-segments.js";
|
|
19
|
-
|
|
20
|
-
// Handle data hook
|
|
21
|
-
export { useHandle } from "./use-handle.js";
|
|
22
|
-
|
|
23
|
-
// Mount-aware reverse hook
|
|
24
|
-
export { useReverse } from "./use-reverse.js";
|
|
25
|
-
|
|
26
|
-
// Provider
|
|
27
1
|
export {
|
|
28
2
|
NavigationProvider,
|
|
29
3
|
type NavigationProviderProps,
|
|
30
4
|
} from "./NavigationProvider.js";
|
|
31
|
-
|
|
32
|
-
// Context (for advanced usage)
|
|
33
|
-
export {
|
|
34
|
-
NavigationStoreContext,
|
|
35
|
-
type NavigationStoreContextValue,
|
|
36
|
-
} from "./context.js";
|
|
37
|
-
|
|
38
|
-
// Link component
|
|
39
|
-
export { Link, type LinkProps, type PrefetchStrategy } from "./Link.js";
|
|
40
|
-
|
|
41
|
-
// Link status hook
|
|
42
|
-
export { useLinkStatus, type LinkStatus } from "./use-link-status.js";
|
|
43
|
-
|
|
44
|
-
// Scroll restoration
|
|
45
|
-
export {
|
|
46
|
-
ScrollRestoration,
|
|
47
|
-
useScrollRestoration,
|
|
48
|
-
type ScrollRestorationProps,
|
|
49
|
-
} from "./ScrollRestoration.js";
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared location state utilities - works in both RSC and client contexts
|
|
3
|
-
* No "use client" directive so it can be imported from RSC
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
1
|
import type { ReactElement } from "react";
|
|
7
2
|
|
|
8
3
|
/**
|
|
@@ -26,16 +21,8 @@ export interface LocationStateOptions {
|
|
|
26
21
|
|
|
27
22
|
type LocationStateUnsafeFn = (...args: never[]) => unknown;
|
|
28
23
|
|
|
29
|
-
// Broadest constructor signature (`abstract` covers both abstract and concrete
|
|
30
|
-
// classes). A class passed as state has a `new` signature, not a call signature,
|
|
31
|
-
// so it slips past LocationStateUnsafeFn; at runtime the lazy-getter path
|
|
32
|
-
// (`typeof value === "function"`) then mistakes it for a getter and throws.
|
|
33
24
|
type LocationStateUnsafeCtor = abstract new (...args: never[]) => unknown;
|
|
34
25
|
|
|
35
|
-
// `unknown` cannot be verified serializable, so it is rejected (callers must
|
|
36
|
-
// supply a concrete type). `any` deliberately defeats type checking and is NOT
|
|
37
|
-
// guardable — it is assignable to the branded error too, so the check always
|
|
38
|
-
// passes; it remains an explicit escape hatch.
|
|
39
26
|
type IsAny<T> = 0 extends 1 & T ? true : false;
|
|
40
27
|
type IsUnknown<T> =
|
|
41
28
|
IsAny<T> extends true ? false : unknown extends T ? true : false;
|
|
@@ -24,32 +24,24 @@ const DEFAULT_ACTION_STATE: TrackedActionState = {
|
|
|
24
24
|
result: null,
|
|
25
25
|
};
|
|
26
26
|
|
|
27
|
-
/**
|
|
28
|
-
* Normalize action ID - returns the ID as-is
|
|
29
|
-
*
|
|
30
|
-
* Server actions have IDs like "hash#actionName" or "src/actions.ts#actionName".
|
|
31
|
-
* When using function references, we use the full ID for exact matching.
|
|
32
|
-
* When using strings, the event controller supports suffix matching
|
|
33
|
-
* (e.g., "addToCart" matches "hash#addToCart").
|
|
34
|
-
*/
|
|
35
|
-
function normalizeActionId(actionId: string): string {
|
|
36
|
-
return actionId;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
27
|
/**
|
|
40
28
|
* Extract action ID from a server action function or string.
|
|
41
29
|
*
|
|
42
30
|
* Actions passed as props from server components lose their metadata
|
|
43
31
|
* during RSC serialization - use a string action name instead.
|
|
32
|
+
*
|
|
33
|
+
* The extracted $$id (e.g. "hash#actionName" or "src/actions.ts#actionName")
|
|
34
|
+
* is returned as-is. Suffix-vs-exact matching against this ID happens
|
|
35
|
+
* downstream in the event controller, not here.
|
|
44
36
|
*/
|
|
45
|
-
|
|
37
|
+
function getActionId(action: ServerActionFunction | string): string {
|
|
46
38
|
invariant(
|
|
47
39
|
typeof action === "function" || typeof action === "string",
|
|
48
40
|
`useAction: action must be a function or string, got ${typeof action}`,
|
|
49
41
|
);
|
|
50
42
|
const actionId = (action as any)?.$$id;
|
|
51
43
|
if (actionId) {
|
|
52
|
-
return
|
|
44
|
+
return actionId;
|
|
53
45
|
}
|
|
54
46
|
|
|
55
47
|
// If action is a string, use it directly
|
|
@@ -162,7 +154,6 @@ export function useAction<T>(
|
|
|
162
154
|
});
|
|
163
155
|
const prevSelected = useRef(baseState);
|
|
164
156
|
prevSelected.current = baseState;
|
|
165
|
-
// useOptimistic allows immediate updates during transitions/actions
|
|
166
157
|
const [optimisticState, setOptimisticState] = useOptimistic<
|
|
167
158
|
T | TrackedActionState
|
|
168
159
|
>(null!);
|
|
@@ -43,7 +43,6 @@ export function useHandle<T, A, S>(
|
|
|
43
43
|
): Rango.FlightSerialize<A> | S {
|
|
44
44
|
const ctx = useContext(NavigationStoreContext);
|
|
45
45
|
|
|
46
|
-
// Initial state from context event controller, or empty fallback without provider.
|
|
47
46
|
const [value, setValue] = useState<Rango.FlightSerialize<A> | S>(() => {
|
|
48
47
|
if (!ctx) {
|
|
49
48
|
const collected = collectHandleData(
|
|
@@ -54,7 +53,6 @@ export function useHandle<T, A, S>(
|
|
|
54
53
|
return selector ? selector(collected) : collected;
|
|
55
54
|
}
|
|
56
55
|
|
|
57
|
-
// On client, use event controller state
|
|
58
56
|
const state = ctx.eventController.getHandleState();
|
|
59
57
|
const collected = collectHandleData(
|
|
60
58
|
handle,
|
|
@@ -65,15 +63,12 @@ export function useHandle<T, A, S>(
|
|
|
65
63
|
});
|
|
66
64
|
const [optimisticValue, setOptimisticValue] = useOptimistic(value);
|
|
67
65
|
|
|
68
|
-
// Track previous value for shallow comparison
|
|
69
66
|
const prevValueRef = useRef(value);
|
|
70
67
|
prevValueRef.current = value;
|
|
71
68
|
|
|
72
|
-
// Ref keeps the latest selector without re-subscribing on every render.
|
|
73
69
|
const selectorRef = useRef(selector);
|
|
74
70
|
selectorRef.current = selector;
|
|
75
71
|
|
|
76
|
-
// Subscribe to handle data changes (client only)
|
|
77
72
|
useEffect(() => {
|
|
78
73
|
if (!ctx) return;
|
|
79
74
|
|
|
@@ -82,11 +82,9 @@ export function useLinkStatus(): LinkStatus {
|
|
|
82
82
|
const linkTo = useContext(LinkContext);
|
|
83
83
|
const ctx = useContext(NavigationStoreContext);
|
|
84
84
|
|
|
85
|
-
// Get origin for URL normalization (stable across renders)
|
|
86
85
|
const origin =
|
|
87
86
|
typeof window !== "undefined" ? window.location.origin : "http://localhost";
|
|
88
87
|
|
|
89
|
-
// Base state for useOptimistic
|
|
90
88
|
const [basePending, setBasePending] = useState<boolean>(() => {
|
|
91
89
|
if (!ctx || linkTo === null) {
|
|
92
90
|
return false;
|
|
@@ -97,7 +95,6 @@ export function useLinkStatus(): LinkStatus {
|
|
|
97
95
|
|
|
98
96
|
const prevPending = useRef(basePending);
|
|
99
97
|
|
|
100
|
-
// useOptimistic allows immediate updates during transitions
|
|
101
98
|
const [pending, setOptimisticPending] = useOptimistic(basePending);
|
|
102
99
|
|
|
103
100
|
useEffect(() => {
|
|
@@ -105,7 +102,6 @@ export function useLinkStatus(): LinkStatus {
|
|
|
105
102
|
return;
|
|
106
103
|
}
|
|
107
104
|
|
|
108
|
-
// Subscribe to navigation state changes
|
|
109
105
|
return ctx.eventController.subscribe(() => {
|
|
110
106
|
const state = ctx.eventController.getState();
|
|
111
107
|
const isPending = isPendingFor(linkTo, state.pendingUrl, origin);
|
|
@@ -46,7 +46,6 @@ export function useNavigation<T>(
|
|
|
46
46
|
throw new Error("useNavigation must be used within NavigationProvider");
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
// Base state for useOptimistic
|
|
50
49
|
const [baseValue, setBaseValue] = useState<T | PublicNavigationState>(() => {
|
|
51
50
|
const publicState = toPublicState(ctx.eventController.getState());
|
|
52
51
|
return selector ? selector(publicState) : publicState;
|
|
@@ -59,7 +58,6 @@ export function useNavigation<T>(
|
|
|
59
58
|
// parent transition (e.g. <Link> click) is still pending.
|
|
60
59
|
const optimisticPinnedRef = useRef(false);
|
|
61
60
|
|
|
62
|
-
// useOptimistic allows immediate updates during transitions/actions
|
|
63
61
|
const [value, setOptimisticValue] = useOptimistic(baseValue);
|
|
64
62
|
|
|
65
63
|
// Store selector in a ref so the subscription callback always uses the
|
|
@@ -72,7 +70,6 @@ export function useNavigation<T>(
|
|
|
72
70
|
|
|
73
71
|
// Subscribe to event controller state changes (only runs on client)
|
|
74
72
|
useEffect(() => {
|
|
75
|
-
// Subscribe to updates from event controller
|
|
76
73
|
return ctx.eventController.subscribe(() => {
|
|
77
74
|
const currentState = ctx.eventController.getState();
|
|
78
75
|
const publicState = toPublicState(currentState);
|
|
@@ -50,8 +50,6 @@ export function useParams<T>(
|
|
|
50
50
|
});
|
|
51
51
|
|
|
52
52
|
const prevValue = useRef(value);
|
|
53
|
-
// Ref keeps the latest selector without re-subscribing. Event-driven by
|
|
54
|
-
// design: value updates on store events, not on selector identity change.
|
|
55
53
|
const selectorRef = useRef(selector);
|
|
56
54
|
selectorRef.current = selector;
|
|
57
55
|
|
|
@@ -24,9 +24,6 @@ import type { ReadonlyURLSearchParams } from "../types.js";
|
|
|
24
24
|
export function useSearchParams(): ReadonlyURLSearchParams {
|
|
25
25
|
const ctx = useContext(NavigationStoreContext);
|
|
26
26
|
|
|
27
|
-
// Always initialize with empty URLSearchParams to match SSR output
|
|
28
|
-
// and avoid hydration mismatch. The useEffect below syncs from
|
|
29
|
-
// the real URL after hydration.
|
|
30
27
|
const [searchParams, setSearchParams] = useState<ReadonlyURLSearchParams>(
|
|
31
28
|
() => new URLSearchParams(),
|
|
32
29
|
);
|
|
@@ -41,12 +38,10 @@ export function useSearchParams(): ReadonlyURLSearchParams {
|
|
|
41
38
|
const nextSearch = location.searchParams.toString();
|
|
42
39
|
if (nextSearch !== prevSearch.current) {
|
|
43
40
|
prevSearch.current = nextSearch;
|
|
44
|
-
// Create a snapshot so callers cannot mutate the source URLSearchParams
|
|
45
41
|
setSearchParams(new URLSearchParams(nextSearch));
|
|
46
42
|
}
|
|
47
43
|
};
|
|
48
44
|
|
|
49
|
-
// Sync on mount (picks up search params from browser URL)
|
|
50
45
|
update();
|
|
51
46
|
|
|
52
47
|
return ctx.eventController.subscribe(update);
|
|
@@ -86,31 +86,20 @@ export function useSegments<T>(
|
|
|
86
86
|
const selectorRef = useRef(selector);
|
|
87
87
|
selectorRef.current = selector;
|
|
88
88
|
|
|
89
|
-
// Track selector identity to detect when the selector function changes.
|
|
90
|
-
// Only then do we eagerly recompute during render to avoid staleness.
|
|
91
|
-
// Without this guard, no-selector mode causes infinite re-renders because
|
|
92
|
-
// buildSegmentsState creates fresh arrays that fail Object.is checks.
|
|
93
89
|
const prevSelectorIdentity = useRef(selector);
|
|
94
90
|
|
|
95
|
-
// Cache SegmentsState to stabilize nested references (path, segmentIds
|
|
96
|
-
// arrays) so selectors returning composite values don't cause spurious
|
|
97
|
-
// render-time setState calls.
|
|
98
91
|
const segmentsCache = useRef<{
|
|
99
92
|
location: URL;
|
|
100
93
|
routeSegmentIds: string[];
|
|
101
94
|
state: SegmentsState;
|
|
102
95
|
} | null>(null);
|
|
103
96
|
|
|
104
|
-
// Recompute selected value from current store state and apply selector.
|
|
105
|
-
// Shared by the render-time eager check and the subscription callback.
|
|
106
97
|
function recompute(
|
|
107
98
|
sel: ((state: SegmentsState) => T) | undefined,
|
|
108
99
|
): T | SegmentsState {
|
|
109
100
|
const location = ctx!.eventController.getLocation();
|
|
110
101
|
const handleState = ctx!.eventController.getHandleState();
|
|
111
102
|
|
|
112
|
-
// Reuse cached state when inputs haven't changed by reference,
|
|
113
|
-
// keeping array/object references stable for composite selectors.
|
|
114
103
|
const cache = segmentsCache.current;
|
|
115
104
|
let segmentsState: SegmentsState;
|
|
116
105
|
if (
|
|
@@ -165,8 +154,6 @@ export function useSegments<T>(
|
|
|
165
154
|
unsubscribeNav();
|
|
166
155
|
unsubscribeHandles();
|
|
167
156
|
};
|
|
168
|
-
// Stable subscription: selector changes are handled via selectorRef,
|
|
169
|
-
// state comparison uses prevState ref. No re-subscribe needed.
|
|
170
157
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
171
158
|
}, []);
|
|
172
159
|
|
|
@@ -178,8 +178,8 @@ export async function initBrowserApp(
|
|
|
178
178
|
|
|
179
179
|
// Register the active store on the module-level handle and wire the
|
|
180
180
|
// jar-divergence observer before any getRangoState() read can detect a
|
|
181
|
-
// cross-tab/server rotation.
|
|
182
|
-
//
|
|
181
|
+
// cross-tab/server rotation. There is no global store singleton, so this
|
|
182
|
+
// handle is the live reference.
|
|
183
183
|
registerNavigationStore(store);
|
|
184
184
|
|
|
185
185
|
// Seed router identity from the initial SSR payload so the first
|
package/src/browser/types.ts
CHANGED
|
@@ -17,11 +17,10 @@ export function validateRedirectOrigin(
|
|
|
17
17
|
);
|
|
18
18
|
return null;
|
|
19
19
|
}
|
|
20
|
-
//
|
|
21
|
-
// This normalizes protocol-relative and other
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
: target.pathname + target.search + target.hash;
|
|
20
|
+
// Origin matched above, so target.href is same-origin: return the
|
|
21
|
+
// canonical full href. This normalizes protocol-relative and other
|
|
22
|
+
// ambiguous forms.
|
|
23
|
+
return target.href;
|
|
25
24
|
} catch {
|
|
26
25
|
console.error(`[rango] Redirect blocked: invalid URL "${url}"`);
|
|
27
26
|
return null;
|
package/src/build/route-trie.ts
CHANGED
|
@@ -63,6 +63,9 @@ export interface TrieNode {
|
|
|
63
63
|
* @param routeAncestry - Map of route name to ancestry shortCodes
|
|
64
64
|
* @param routeToStaticPrefix - Map of route name to its entry's staticPrefix
|
|
65
65
|
* @param routeTrailingSlash - Optional map of route name to trailing slash mode
|
|
66
|
+
* @param prerenderRouteNames - Optional set of prerendered route names (sets leaf.pr)
|
|
67
|
+
* @param passthroughRouteNames - Optional set of passthrough route names (sets leaf.pt)
|
|
68
|
+
* @param responseTypeRoutes - Optional map of route name to response type (sets leaf.rt)
|
|
66
69
|
*/
|
|
67
70
|
export function buildRouteTrie(
|
|
68
71
|
routeManifest: Record<string, string>,
|
|
@@ -37,12 +37,15 @@ export function formatRouteEntry(
|
|
|
37
37
|
): string {
|
|
38
38
|
const hasSearch = search && Object.keys(search).length > 0;
|
|
39
39
|
|
|
40
|
+
// JSON.stringify the pattern and search values so backslashes and quotes in a
|
|
41
|
+
// route pattern (e.g. a custom regex constraint) survive interpolation into
|
|
42
|
+
// both the type-level string and the runtime NamedRoutes value.
|
|
40
43
|
if (!hasSearch) {
|
|
41
|
-
return ` ${key}:
|
|
44
|
+
return ` ${key}: ${JSON.stringify(pattern)},`;
|
|
42
45
|
}
|
|
43
46
|
|
|
44
47
|
const searchBody = Object.entries(search!)
|
|
45
|
-
.map(([k, v]) => `${k}:
|
|
48
|
+
.map(([k, v]) => `${k}: ${JSON.stringify(v)}`)
|
|
46
49
|
.join(", ");
|
|
47
|
-
return ` ${key}: { path:
|
|
50
|
+
return ` ${key}: { path: ${JSON.stringify(pattern)}, search: { ${searchBody} } },`;
|
|
48
51
|
}
|
|
@@ -617,9 +617,6 @@ export function writeCombinedRouteTypes(
|
|
|
617
617
|
? readFileSync(outPath, "utf-8")
|
|
618
618
|
: null;
|
|
619
619
|
|
|
620
|
-
// When the static parser can't extract routes (e.g. callback-style urls()),
|
|
621
|
-
// write an empty placeholder so the build-time transform's injected import
|
|
622
|
-
// resolves. Runtime discovery will overwrite this with the real routes.
|
|
623
620
|
if (Object.keys(result.routes).length === 0) {
|
|
624
621
|
if (!existing) {
|
|
625
622
|
const emptySource = generateRouteTypesSource({});
|
|
@@ -635,11 +632,6 @@ export function writeCombinedRouteTypes(
|
|
|
635
632
|
hasSearchSchemas ? result.searchSchemas : undefined,
|
|
636
633
|
);
|
|
637
634
|
if (existing !== source) {
|
|
638
|
-
// On initial dev startup, don't overwrite a file from runtime discovery
|
|
639
|
-
// (which has all dynamic routes) with a smaller set from the static
|
|
640
|
-
// parser. The static parser can't see routes generated by Array.from()
|
|
641
|
-
// or other dynamic code. During HMR (file watcher), always write so
|
|
642
|
-
// newly added routes appear immediately.
|
|
643
635
|
if (opts?.preserveIfLarger && existing) {
|
|
644
636
|
const existingCount = countPublicRouteEntries(existing);
|
|
645
637
|
const newCount = Object.keys(result.routes).filter(
|
|
@@ -69,24 +69,6 @@ export function computeExpiration(
|
|
|
69
69
|
return { staleAt, expiresAt };
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
// ============================================================================
|
|
73
|
-
// Cache Key Resolution
|
|
74
|
-
// ============================================================================
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* Resolve cache key using the 3-tier priority:
|
|
78
|
-
* 1. keyFn (full override from route/loader cache options)
|
|
79
|
-
* 2. store.keyGenerator (modifies default key)
|
|
80
|
-
* 3. defaultKey (used when neither keyFn nor keyGenerator is provided)
|
|
81
|
-
*
|
|
82
|
-
* Errors from keyFn and store.keyGenerator propagate to the caller.
|
|
83
|
-
* Cache identity is correctness-critical: if explicit key logic throws,
|
|
84
|
-
* silently remapping to a different key could cause cache collisions or
|
|
85
|
-
* serve stale/wrong data. Callers must handle the error or let it surface.
|
|
86
|
-
*
|
|
87
|
-
* Uses _getRequestContext (non-throwing) so that calls outside ALS
|
|
88
|
-
* (e.g. build-time) gracefully fall back to defaultKey.
|
|
89
|
-
*/
|
|
90
72
|
export async function resolveCacheKey(
|
|
91
73
|
keyFn: ((ctx: RequestContext) => string | Promise<string>) | undefined,
|
|
92
74
|
store: SegmentCacheStore | null,
|
|
@@ -95,34 +77,17 @@ export async function resolveCacheKey(
|
|
|
95
77
|
): Promise<string> {
|
|
96
78
|
const requestCtx = _getRequestContext();
|
|
97
79
|
|
|
98
|
-
// Priority 1: Route/loader-level key function (full override)
|
|
99
80
|
if (keyFn && requestCtx) {
|
|
100
81
|
return await keyFn(requestCtx);
|
|
101
82
|
}
|
|
102
83
|
|
|
103
|
-
// Priority 2: Store-level keyGenerator (modifies default key)
|
|
104
84
|
if (store?.keyGenerator && requestCtx) {
|
|
105
85
|
return await store.keyGenerator(requestCtx, defaultKey);
|
|
106
86
|
}
|
|
107
87
|
|
|
108
|
-
// Priority 3: Default key (no custom key logic provided)
|
|
109
88
|
return defaultKey;
|
|
110
89
|
}
|
|
111
90
|
|
|
112
|
-
// ============================================================================
|
|
113
|
-
// Cache Tag Resolution
|
|
114
|
-
// ============================================================================
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* Resolve cache tags from a tags option (static array or function of ctx).
|
|
118
|
-
*
|
|
119
|
-
* Fails open: a thrown tag callback falls back to no tags rather than
|
|
120
|
-
* aborting the request. Tags are additive metadata (not identity), so a
|
|
121
|
-
* missing tag does not cause cache collisions, only a missed invalidation.
|
|
122
|
-
*
|
|
123
|
-
* Shared by the cache() DSL (cache-scope) and loader caching (loader-cache)
|
|
124
|
-
* so tag resolution behaves identically across every cache axis.
|
|
125
|
-
*/
|
|
126
91
|
export function resolveTagsOption<TEnv>(
|
|
127
92
|
tags: string[] | ((ctx: RequestContext<TEnv>) => string[]) | undefined,
|
|
128
93
|
ctx: RequestContext<TEnv> | undefined,
|
|
@@ -131,10 +96,6 @@ export function resolveTagsOption<TEnv>(
|
|
|
131
96
|
if (!tags) return undefined;
|
|
132
97
|
if (typeof tags === "function") {
|
|
133
98
|
if (!ctx) {
|
|
134
|
-
// A dynamic tags function needs the request context to run. Without it
|
|
135
|
-
// (e.g. resolved outside a request, at build/prerender time) the entry is
|
|
136
|
-
// cached UNTAGGED and can never be invalidated - surface that rather than
|
|
137
|
-
// silently dropping the tags, matching the thrown-callback branch below.
|
|
138
99
|
console.warn(
|
|
139
100
|
`[${label}] Dynamic tags function present but no request context; ` +
|
|
140
101
|
`caching without tags (this entry will not be tag-invalidatable).`,
|
|
@@ -167,25 +128,10 @@ function normalizeTagList(tags: string[]): string[] | undefined {
|
|
|
167
128
|
return out.length > 0 ? out : undefined;
|
|
168
129
|
}
|
|
169
130
|
|
|
170
|
-
// ============================================================================
|
|
171
|
-
// Cache Store Resolution
|
|
172
|
-
// ============================================================================
|
|
173
|
-
|
|
174
|
-
/**
|
|
175
|
-
* Resolve cache store from the 2-tier priority:
|
|
176
|
-
* 1. Explicit store from cache options
|
|
177
|
-
* 2. App-level store from request context
|
|
178
|
-
*/
|
|
179
131
|
export function resolveCacheStore(
|
|
180
132
|
explicitStore: SegmentCacheStore | undefined,
|
|
181
133
|
): SegmentCacheStore | null {
|
|
182
134
|
if (explicitStore) {
|
|
183
|
-
// Register explicit per-scope stores so updateTag()/revalidateTag() can
|
|
184
|
-
// reach them. This is the single chokepoint every cache axis (segment,
|
|
185
|
-
// response, loader) resolves through, so registering here covers them all
|
|
186
|
-
// eagerly - no dependence on whether a tagged write has happened yet. The
|
|
187
|
-
// app-level store is intentionally not registered (always reachable via
|
|
188
|
-
// ctx._cacheStore).
|
|
189
135
|
registerExplicitTaggedStore(explicitStore);
|
|
190
136
|
return explicitStore;
|
|
191
137
|
}
|
|
@@ -46,6 +46,7 @@ import {
|
|
|
46
46
|
runWithCacheTagScope,
|
|
47
47
|
} from "./cache-tag.js";
|
|
48
48
|
import { reportCacheError } from "./cache-error.js";
|
|
49
|
+
import type { CacheItemResult } from "./types.js";
|
|
49
50
|
|
|
50
51
|
/**
|
|
51
52
|
* Convert encodeReply result to a stable string key.
|
|
@@ -84,6 +85,11 @@ export function registerCachedFunction<T extends (...args: any[]) => any>(
|
|
|
84
85
|
// cacheTag() call inside the function degrades to a no-op rather than
|
|
85
86
|
// throwing "must be called inside a use cache function" - adopting cacheTag()
|
|
86
87
|
// must not hard-fail in apps/tests without an item-capable cache configured.
|
|
88
|
+
// Note: the INSIDE_CACHE_EXEC guard (cookies()/headers()/ctx.set() rejection)
|
|
89
|
+
// is intentionally NOT stamped here. It is a cached-path-only check; in the
|
|
90
|
+
// bypass the body actually executes, so the guarded side effects take effect
|
|
91
|
+
// and nothing is lost on a (non-existent) hit. Same applies to the
|
|
92
|
+
// non-serializable-args bypass below.
|
|
87
93
|
if (!store?.getItem) {
|
|
88
94
|
const scoped = runWithCacheTagScope(() => fn.apply(this, args));
|
|
89
95
|
const result = await scoped.result;
|
|
@@ -185,23 +191,29 @@ export function registerCachedFunction<T extends (...args: any[]) => any>(
|
|
|
185
191
|
// Cache lookup
|
|
186
192
|
const cached = await store.getItem(cacheKey);
|
|
187
193
|
|
|
194
|
+
// Serve a cached entry on the hit path: deserialize the stored value,
|
|
195
|
+
// replay handle data (gated on tainted args), and surface the entry's tags
|
|
196
|
+
// to the request set (the function did not re-run, so its runtime cacheTag()
|
|
197
|
+
// tags are only available from the stored entry). Shared by the fresh-hit
|
|
198
|
+
// and stale-hit branches; the only divergence is the stale branch scheduling
|
|
199
|
+
// background revalidation, which it does after this returns.
|
|
200
|
+
const serveCached = async (entry: CacheItemResult): Promise<any> => {
|
|
201
|
+
const result = await deserializeResult(entry.value);
|
|
202
|
+
if (entry.handles && hasTaintedArgs) {
|
|
203
|
+
const handleStore = requestCtx?._handleStore;
|
|
204
|
+
if (handleStore) {
|
|
205
|
+
const r = await decodeHandles(entry.handles);
|
|
206
|
+
if (r) restoreHandles(r, handleStore);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
recordRequestTags(entry.tags, requestCtx);
|
|
210
|
+
return result;
|
|
211
|
+
};
|
|
212
|
+
|
|
188
213
|
if (cached && !cached.shouldRevalidate) {
|
|
189
214
|
// Fresh hit: deserialize and return
|
|
190
215
|
try {
|
|
191
|
-
|
|
192
|
-
// Restore handle data if present
|
|
193
|
-
if (cached.handles && hasTaintedArgs) {
|
|
194
|
-
const handleStore = requestCtx?._handleStore;
|
|
195
|
-
if (handleStore) {
|
|
196
|
-
const r = await decodeHandles(cached.handles);
|
|
197
|
-
if (r) restoreHandles(r, handleStore);
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
// Surface the hit's tags to the request set so a document built from a
|
|
201
|
-
// cached item is still tagged (the function did not re-run, so its
|
|
202
|
-
// runtime cacheTag() tags are only available from the stored entry).
|
|
203
|
-
recordRequestTags(cached.tags, requestCtx);
|
|
204
|
-
return result;
|
|
216
|
+
return await serveCached(cached);
|
|
205
217
|
} catch (error) {
|
|
206
218
|
// The stored value is corrupt/partial (failed RSC deserialize). Report
|
|
207
219
|
// it, then fall through to fresh execution - the miss path below re-runs
|
|
@@ -217,16 +229,7 @@ export function registerCachedFunction<T extends (...args: any[]) => any>(
|
|
|
217
229
|
if (cached?.shouldRevalidate) {
|
|
218
230
|
// Stale hit: return stale value, revalidate in background
|
|
219
231
|
try {
|
|
220
|
-
const result = await
|
|
221
|
-
if (cached.handles && hasTaintedArgs) {
|
|
222
|
-
const handleStore = requestCtx?._handleStore;
|
|
223
|
-
if (handleStore) {
|
|
224
|
-
const r = await decodeHandles(cached.handles);
|
|
225
|
-
if (r) restoreHandles(r, handleStore);
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
// Tag the request with the stale entry's tags (see fresh-hit note).
|
|
229
|
-
recordRequestTags(cached.tags, requestCtx);
|
|
232
|
+
const result = await serveCached(cached);
|
|
230
233
|
// Background revalidation — must capture handles if tainted args present.
|
|
231
234
|
// Use an isolated handle store so background pushes don't pollute the
|
|
232
235
|
// live response or throw LateHandlePushError on the completed store.
|
package/src/cache/cache-scope.ts
CHANGED
|
@@ -34,12 +34,6 @@ import {
|
|
|
34
34
|
} from "./cache-policy.js";
|
|
35
35
|
import type { RequestContext } from "../server/request-context.js";
|
|
36
36
|
|
|
37
|
-
/**
|
|
38
|
-
* Resolve tags for a cache() boundary from its config (static array or
|
|
39
|
-
* function of ctx). Thin wrapper over the shared resolveTagsOption so the
|
|
40
|
-
* cache() DSL and loader caching resolve tags identically.
|
|
41
|
-
* @internal
|
|
42
|
-
*/
|
|
43
37
|
export function resolveCacheTags(
|
|
44
38
|
config: PartialCacheOptions | false,
|
|
45
39
|
ctx: RequestContext | undefined,
|
|
@@ -54,17 +48,6 @@ function debugCacheLog(message: string): void {
|
|
|
54
48
|
}
|
|
55
49
|
}
|
|
56
50
|
|
|
57
|
-
// ============================================================================
|
|
58
|
-
// Key Generation (internal)
|
|
59
|
-
// ============================================================================
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Generate cache key base from host, pathname, route params, and search params.
|
|
63
|
-
* Host is included to prevent cross-host cache collisions on shared stores.
|
|
64
|
-
* Route params and search params are sorted alphabetically for deterministic keys.
|
|
65
|
-
* Internal _rsc* and __* query params are excluded.
|
|
66
|
-
* @internal
|
|
67
|
-
*/
|
|
68
51
|
function getCacheKeyBase(
|
|
69
52
|
host: string,
|
|
70
53
|
pathname: string,
|
|
@@ -80,16 +63,6 @@ function getCacheKeyBase(
|
|
|
80
63
|
return key;
|
|
81
64
|
}
|
|
82
65
|
|
|
83
|
-
/**
|
|
84
|
-
* Generate default cache key for a route request.
|
|
85
|
-
* Includes pathname, route params, and user-facing search params for
|
|
86
|
-
* correct scoping. Internal _rsc* params are excluded.
|
|
87
|
-
* Includes request type prefix since they produce different segment sets:
|
|
88
|
-
* - doc: document requests (full page load)
|
|
89
|
-
* - partial: navigation requests (client-side navigation)
|
|
90
|
-
* - intercept: intercept navigation (modal/overlay routes)
|
|
91
|
-
* @internal
|
|
92
|
-
*/
|
|
93
66
|
function getDefaultRouteCacheKey(
|
|
94
67
|
pathname: string,
|
|
95
68
|
params?: Record<string, string>,
|
package/src/cache/cache-tag.ts
CHANGED
|
@@ -18,35 +18,11 @@ import {
|
|
|
18
18
|
|
|
19
19
|
const cacheTagStorage = new AsyncLocalStorage<Set<string>>();
|
|
20
20
|
|
|
21
|
-
/**
|
|
22
|
-
* Normalize a tag for storage.
|
|
23
|
-
*
|
|
24
|
-
* Returns the tag unchanged if usable, or null if it is empty/whitespace-only
|
|
25
|
-
* (dropped consistently in every environment - an empty tag matches nothing).
|
|
26
|
-
*
|
|
27
|
-
* Backend-specific constraints are intentionally NOT enforced here so the tag
|
|
28
|
-
* primitive stays backend-agnostic. In particular, the CFCacheStore
|
|
29
|
-
* encodeURIComponent's tags at serialization time so commas/spaces/non-Latin1
|
|
30
|
-
* characters cannot corrupt the comma-delimited Cloudflare Cache-Tag header or
|
|
31
|
-
* the HTTP marker header (it does not reject them). Keep tags short and
|
|
32
|
-
* low-cardinality: a tag's KV marker key must stay under Cloudflare's 512-byte
|
|
33
|
-
* limit, and a Cache-Tag value under 1024 bytes. The in-memory store has no
|
|
34
|
-
* such limitations.
|
|
35
|
-
*
|
|
36
|
-
* @internal
|
|
37
|
-
*/
|
|
38
21
|
export function normalizeTag(tag: string): string | null {
|
|
39
22
|
if (!tag || !tag.trim()) return null;
|
|
40
23
|
return tag;
|
|
41
24
|
}
|
|
42
25
|
|
|
43
|
-
/**
|
|
44
|
-
* Normalize a tag collection: drop empty/whitespace-only tags so the WRITE path
|
|
45
|
-
* matches the invalidate path (updateTag/revalidateTag/cacheTag all normalize).
|
|
46
|
-
* Does not deduplicate - callers that need that wrap with a Set.
|
|
47
|
-
*
|
|
48
|
-
* @internal
|
|
49
|
-
*/
|
|
50
26
|
export function normalizeTags(tags: Iterable<string>): string[] {
|
|
51
27
|
const out: string[] = [];
|
|
52
28
|
for (const tag of tags) {
|
|
@@ -89,19 +65,6 @@ export function cacheTag(...tags: string[]): void {
|
|
|
89
65
|
}
|
|
90
66
|
}
|
|
91
67
|
|
|
92
|
-
/**
|
|
93
|
-
* Record `tags` into the request-scoped tag set (ctx._requestTags), the union of
|
|
94
|
-
* every cache tag resolved while producing the response. The document cache reads
|
|
95
|
-
* this after the render settles so a full-page entry is tagged with everything its
|
|
96
|
-
* content used, making it invalidatable by updateTag()/revalidateTag().
|
|
97
|
-
*
|
|
98
|
-
* Called at the tag-resolution sites: "use cache" stores (cache-runtime, both the
|
|
99
|
-
* miss and read/hit paths), loader cache (cache-policy/loader-cache), and segment
|
|
100
|
-
* cache() (cache-scope). Writes the field directly (not via ctx.set()) so it does
|
|
101
|
-
* not trip the cache-scope side-effect guard, mirroring cacheTag() itself.
|
|
102
|
-
*
|
|
103
|
-
* @internal
|
|
104
|
-
*/
|
|
105
68
|
export function recordRequestTags(
|
|
106
69
|
tags: Iterable<string> | undefined,
|
|
107
70
|
ctx: RequestContext | undefined = _getRequestContext(),
|