@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
|
@@ -13,7 +13,6 @@ import type { EventController, NavigationHandle } from "./event-controller.js";
|
|
|
13
13
|
import { debugLog } from "./logging.js";
|
|
14
14
|
import { buildHistoryState, pushHistoryWithIdx } from "./history-state.js";
|
|
15
15
|
|
|
16
|
-
// Re-export for consumers that import from navigation-transaction
|
|
17
16
|
export { resolveNavigationState } from "./history-state.js";
|
|
18
17
|
|
|
19
18
|
/** Check if a history state object contains location state keys. */
|
|
@@ -25,7 +24,6 @@ function hasLocationState(state: unknown): boolean {
|
|
|
25
24
|
);
|
|
26
25
|
}
|
|
27
26
|
|
|
28
|
-
// Polyfill Symbol.dispose for Safari and older browsers
|
|
29
27
|
if (typeof Symbol.dispose === "undefined") {
|
|
30
28
|
(Symbol as any).dispose = Symbol("Symbol.dispose");
|
|
31
29
|
}
|
|
@@ -114,7 +112,6 @@ export function createNavigationTransaction(
|
|
|
114
112
|
let committed = false;
|
|
115
113
|
const currentUrl = window.location.href;
|
|
116
114
|
|
|
117
|
-
// Start navigation in event controller (this sets loading state)
|
|
118
115
|
const handle = eventController.startNavigation(url, options);
|
|
119
116
|
|
|
120
117
|
/**
|
|
@@ -138,72 +135,50 @@ export function createNavigationTransaction(
|
|
|
138
135
|
|
|
139
136
|
const parsedUrl = new URL(url, window.location.origin);
|
|
140
137
|
|
|
141
|
-
// Generate history key from URL (with intercept suffix for separate caching)
|
|
142
138
|
const historyKey = generateHistoryKey(url, { intercept });
|
|
143
139
|
|
|
144
|
-
// For cache-only commits (stale revalidation), only update cache and return
|
|
145
|
-
// Don't touch store state or history - user may have navigated elsewhere
|
|
146
140
|
if (cacheOnly) {
|
|
147
141
|
const currentHandleData = eventController.getHandleState().data;
|
|
148
142
|
store.cacheSegmentsForHistory(historyKey, segments, currentHandleData);
|
|
149
|
-
// Complete the navigation handle so currentNavigation is cleared.
|
|
150
|
-
// Without this, the entry lingers and weakens state-machine invariants.
|
|
151
143
|
handle.complete(parsedUrl);
|
|
152
144
|
debugLog("[Browser] Cache-only commit, historyKey:", historyKey);
|
|
153
145
|
return { scroll: false };
|
|
154
146
|
}
|
|
155
147
|
|
|
156
|
-
// Save current scroll position before navigating
|
|
157
148
|
handleNavigationStart();
|
|
158
149
|
|
|
159
|
-
// Update segment state atomically
|
|
160
150
|
store.setSegmentIds(segmentIds);
|
|
161
151
|
store.setCurrentUrl(url);
|
|
162
152
|
store.setPath(parsedUrl.pathname);
|
|
163
153
|
|
|
164
154
|
store.setHistoryKey(historyKey);
|
|
165
155
|
|
|
166
|
-
// Cache segments with current handleData for this history entry
|
|
167
156
|
const currentHandleData = eventController.getHandleState().data;
|
|
168
157
|
store.cacheSegmentsForHistory(historyKey, segments, currentHandleData);
|
|
169
158
|
|
|
170
|
-
// For server actions, skip URL/history updates but still complete navigation
|
|
171
159
|
if (storeOnly) {
|
|
172
160
|
debugLog("[Browser] Store updated (action)");
|
|
173
|
-
// Complete navigation to clear loading state
|
|
174
161
|
handle.complete(parsedUrl);
|
|
175
162
|
return { scroll: false };
|
|
176
163
|
}
|
|
177
164
|
|
|
178
|
-
// Build history state - include user state, intercept info, and server-set state
|
|
179
165
|
const historyState = buildHistoryState(
|
|
180
166
|
opts.state,
|
|
181
167
|
{ intercept, sourceUrl: interceptSourceUrl },
|
|
182
168
|
serverState,
|
|
183
169
|
);
|
|
184
170
|
|
|
185
|
-
// Snapshot old state before pushState/replaceState overwrites it.
|
|
186
|
-
// Used to detect when location state is being cleared.
|
|
187
171
|
const oldState = window.history.state;
|
|
188
172
|
|
|
189
|
-
// Update browser URL (stamps history.state.idx for back() first-entry detection)
|
|
190
173
|
pushHistoryWithIdx(historyState, url, replace ?? false);
|
|
191
|
-
// Ensure new history entry has a scroll restoration key
|
|
192
174
|
ensureHistoryKey();
|
|
193
175
|
|
|
194
|
-
// Notify location state hooks when either old or new state carries
|
|
195
|
-
// location state. This covers both "set new state" and "clear old state"
|
|
196
|
-
// for same-page navigations where components don't remount.
|
|
197
176
|
if (hasLocationState(oldState) || hasLocationState(historyState)) {
|
|
198
177
|
window.dispatchEvent(new Event("__rsc_locationstate"));
|
|
199
178
|
}
|
|
200
179
|
|
|
201
|
-
// Complete the navigation in event controller (sets idle state, updates location)
|
|
202
180
|
handle.complete(parsedUrl);
|
|
203
181
|
|
|
204
|
-
// NOTE: Scroll is NOT handled here. The caller (partial-update.ts) handles
|
|
205
|
-
// scroll AFTER onUpdate() so React has the new content before we scroll.
|
|
206
|
-
|
|
207
182
|
debugLog(
|
|
208
183
|
"[Browser] Navigation committed, historyKey:",
|
|
209
184
|
historyKey,
|
|
@@ -217,10 +192,6 @@ export function createNavigationTransaction(
|
|
|
217
192
|
handle,
|
|
218
193
|
commit,
|
|
219
194
|
|
|
220
|
-
/**
|
|
221
|
-
* Create a bound transaction with pre-configured URL options
|
|
222
|
-
* segmentIds and segments provided at commit time (after they're resolved)
|
|
223
|
-
*/
|
|
224
195
|
with(
|
|
225
196
|
opts: Omit<CommitOptions, "segmentIds" | "segments">,
|
|
226
197
|
): BoundTransaction {
|
|
@@ -264,13 +235,10 @@ export function createNavigationTransaction(
|
|
|
264
235
|
},
|
|
265
236
|
|
|
266
237
|
[Symbol.dispose]() {
|
|
267
|
-
// Superseded: another navigation took over.
|
|
268
238
|
if (handle.signal.aborted) {
|
|
269
239
|
return;
|
|
270
240
|
}
|
|
271
241
|
|
|
272
|
-
// Failed (not committed): keep the target URL -- the error UI owns it.
|
|
273
|
-
// Just reset the event controller to idle.
|
|
274
242
|
if (!committed) {
|
|
275
243
|
handle[Symbol.dispose]();
|
|
276
244
|
}
|
|
@@ -24,20 +24,12 @@ import { debugLog } from "./logging.js";
|
|
|
24
24
|
import { validateRedirectOrigin } from "./validate-redirect-origin.js";
|
|
25
25
|
import type { NavigationUpdate } from "./types.js";
|
|
26
26
|
|
|
27
|
-
/** Build a scroll payload from the commit's scroll option */
|
|
28
27
|
function toScrollPayload(
|
|
29
28
|
scroll: boolean | undefined,
|
|
30
29
|
): NonNullable<NavigationUpdate["scroll"]> {
|
|
31
30
|
return { enabled: scroll !== false ? scroll : false };
|
|
32
31
|
}
|
|
33
32
|
|
|
34
|
-
/**
|
|
35
|
-
* Whether to wrap an update in startViewTransition.
|
|
36
|
-
*
|
|
37
|
-
* Intercept-driven updates only mutate the parallel slot — the main outlet
|
|
38
|
-
* shows the same content — so transitions on the underlying main segments
|
|
39
|
-
* shouldn't fire (otherwise their elements get hoisted above the modal).
|
|
40
|
-
*/
|
|
41
33
|
function shouldStartViewTransition(segments: ResolvedSegment[]): boolean {
|
|
42
34
|
let hasIntercept = false;
|
|
43
35
|
let hasTransition = false;
|
|
@@ -112,15 +104,6 @@ export type PartialUpdater = (
|
|
|
112
104
|
mode?: UpdateMode,
|
|
113
105
|
) => Promise<void>;
|
|
114
106
|
|
|
115
|
-
/**
|
|
116
|
-
* Create a partial updater for fetching and applying RSC partial updates
|
|
117
|
-
*
|
|
118
|
-
* This function is shared between navigation-bridge and server-action-bridge
|
|
119
|
-
* to handle partial RSC updates with HMR resilience.
|
|
120
|
-
*
|
|
121
|
-
* @param config - Partial update configuration
|
|
122
|
-
* @returns fetchPartialUpdate function
|
|
123
|
-
*/
|
|
124
107
|
export function createPartialUpdater(
|
|
125
108
|
config: PartialUpdateConfig,
|
|
126
109
|
): PartialUpdater {
|
|
@@ -132,21 +115,12 @@ export function createPartialUpdater(
|
|
|
132
115
|
getVersion = () => undefined,
|
|
133
116
|
} = config;
|
|
134
117
|
|
|
135
|
-
/**
|
|
136
|
-
* Get current page's cached segments as an array
|
|
137
|
-
*/
|
|
138
118
|
function getCurrentCachedSegments(): ResolvedSegment[] {
|
|
139
119
|
const currentKey = store.getHistoryKey();
|
|
140
120
|
const cached = store.getCachedSegments(currentKey);
|
|
141
121
|
return cached?.segments || [];
|
|
142
122
|
}
|
|
143
123
|
|
|
144
|
-
/**
|
|
145
|
-
* Fetch partial update and trigger UI update
|
|
146
|
-
*
|
|
147
|
-
* @param tx - Transaction for committing segment state (required)
|
|
148
|
-
* @param signal - AbortSignal to check if navigation is stale (not for aborting fetch)
|
|
149
|
-
*/
|
|
150
124
|
async function fetchPartialUpdate(
|
|
151
125
|
targetUrl: string,
|
|
152
126
|
segmentIds: string[] | undefined,
|
|
@@ -158,20 +132,16 @@ export function createPartialUpdater(
|
|
|
158
132
|
const segmentState = store.getSegmentState();
|
|
159
133
|
const url = targetUrl || window.location.href;
|
|
160
134
|
|
|
161
|
-
// Capture history key at start for stale revalidation consistency check
|
|
162
135
|
const historyKeyAtStart = store.getHistoryKey();
|
|
163
136
|
|
|
164
137
|
const interceptSourceUrl = mode.interceptSourceUrl;
|
|
165
138
|
|
|
166
|
-
// When leaving intercept, filter out intercept-specific segments
|
|
167
139
|
let segments: string[];
|
|
168
140
|
if (mode.type === "leave-intercept") {
|
|
169
141
|
const currentSegments = segmentIds ?? segmentState.currentSegmentIds;
|
|
170
142
|
const currentCached = getCurrentCachedSegments();
|
|
171
143
|
const interceptIds = new Set(
|
|
172
|
-
currentCached
|
|
173
|
-
.filter((s) => s.namespace?.startsWith("intercept:"))
|
|
174
|
-
.map((s) => s.id),
|
|
144
|
+
currentCached.filter(isInterceptSegment).map((s) => s.id),
|
|
175
145
|
);
|
|
176
146
|
segments = currentSegments.filter((id) => !interceptIds.has(id));
|
|
177
147
|
debugLog(
|
|
@@ -181,12 +151,6 @@ export function createPartialUpdater(
|
|
|
181
151
|
segments = segmentIds ?? segmentState.currentSegmentIds;
|
|
182
152
|
}
|
|
183
153
|
|
|
184
|
-
// For intercept revalidation, use the intercept source URL as previousUrl.
|
|
185
|
-
// For leave-intercept, tx.currentUrl captures window.location.href at tx
|
|
186
|
-
// creation, which on popstate is already the destination URL and would
|
|
187
|
-
// tell the server "from == to". segmentState.currentUrl still points at
|
|
188
|
-
// the URL the cached segments render (the intercept URL), which is the
|
|
189
|
-
// correct "from" for the server's diff computation.
|
|
190
154
|
const previousUrl =
|
|
191
155
|
mode.type === "leave-intercept"
|
|
192
156
|
? segmentState.currentUrl || tx.currentUrl
|
|
@@ -200,9 +164,6 @@ export function createPartialUpdater(
|
|
|
200
164
|
debugLog(`[Browser] Intercept context from: ${interceptSourceUrl}`);
|
|
201
165
|
}
|
|
202
166
|
|
|
203
|
-
// Get cached segments for merging with server diff.
|
|
204
|
-
// When navigating with targetCacheSegments, use those for consistency.
|
|
205
|
-
// Otherwise fall back to current page's segments (for same-route revalidation).
|
|
206
167
|
const targetCache =
|
|
207
168
|
mode.type === "navigate" && mode.targetCacheSegments?.length
|
|
208
169
|
? mode.targetCacheSegments
|
|
@@ -213,22 +174,16 @@ export function createPartialUpdater(
|
|
|
213
174
|
`[Browser] cachedSegs source: ${cachedSegsSource} (${cachedSegs.length} segments: ${cachedSegs.map((s) => s.id).join(", ")})`,
|
|
214
175
|
);
|
|
215
176
|
|
|
216
|
-
// Fetch partial payload (no abort signal - RSC doesn't support it well)
|
|
217
177
|
let fetchResult: Awaited<ReturnType<NavigationClient["fetchPartial"]>>;
|
|
218
178
|
fetchResult = await client.fetchPartial({
|
|
219
179
|
targetUrl: url,
|
|
220
180
|
segmentIds: segments,
|
|
221
181
|
previousUrl,
|
|
222
|
-
// Mark stale when explicitly requested OR when no segments are sent
|
|
223
|
-
// (action redirect sends empty segments for a fresh render).
|
|
224
182
|
staleRevalidation:
|
|
225
183
|
mode.type === "stale-revalidation" || segments.length === 0,
|
|
226
184
|
version: getVersion(),
|
|
227
185
|
routerId: store.getRouterId?.(),
|
|
228
186
|
});
|
|
229
|
-
// Mark navigation as streaming (response received, now parsing RSC).
|
|
230
|
-
// Called after fetchPartial so pendingUrl stays set during the network wait,
|
|
231
|
-
// allowing useLinkStatus to show per-link pending indicators.
|
|
232
187
|
const streamingToken = tx.startStreaming();
|
|
233
188
|
const { payload, streamComplete: rawStreamComplete } = fetchResult;
|
|
234
189
|
debugLog("payload.metadata", payload.metadata);
|
|
@@ -237,13 +192,6 @@ export function createPartialUpdater(
|
|
|
237
192
|
streamingToken.end();
|
|
238
193
|
});
|
|
239
194
|
|
|
240
|
-
// Integrity guard (defense in depth). The server redirects on a cross-app
|
|
241
|
-
// routerId mismatch (X-RSC-Reload), so a partial payload's routerId must
|
|
242
|
-
// match this client's. If it doesn't — a stale/edge cache keyed without the
|
|
243
|
-
// routerId, a proxy mixing app responses, or a server classification bug —
|
|
244
|
-
// do NOT splice a foreign app's segments and client references into this
|
|
245
|
-
// document. Force a full reload so the server re-establishes the
|
|
246
|
-
// authoritative document for this URL.
|
|
247
195
|
const currentRouterId = store.getRouterId?.();
|
|
248
196
|
if (
|
|
249
197
|
payload.metadata?.routerId &&
|
|
@@ -258,7 +206,6 @@ export function createPartialUpdater(
|
|
|
258
206
|
return;
|
|
259
207
|
}
|
|
260
208
|
|
|
261
|
-
// Handle server-side redirect with state
|
|
262
209
|
if (payload.metadata?.redirect) {
|
|
263
210
|
if (signal?.aborted) {
|
|
264
211
|
debugLog("[Browser] Ignoring stale redirect (aborted)");
|
|
@@ -288,7 +235,6 @@ export function createPartialUpdater(
|
|
|
288
235
|
debugLog(`[Browser] Partial update - matched: ${matched?.join(", ")}`);
|
|
289
236
|
debugLog(`[Browser] Diff: ${diff?.join(", ")}`);
|
|
290
237
|
|
|
291
|
-
// If diff is empty, nothing changed on server side.
|
|
292
238
|
if (!diff || diff.length === 0) {
|
|
293
239
|
const matchedIds = matched || [];
|
|
294
240
|
const cacheMap = new Map(cachedSegs.map((s) => [s.id, s]));
|
|
@@ -296,7 +242,6 @@ export function createPartialUpdater(
|
|
|
296
242
|
.map((id: string) => cacheMap.get(id))
|
|
297
243
|
.filter(Boolean) as ResolvedSegment[];
|
|
298
244
|
|
|
299
|
-
// When navigating with cached segments to a different route, render them.
|
|
300
245
|
if (mode.type === "navigate" && targetCache) {
|
|
301
246
|
debugLog(
|
|
302
247
|
"[Browser] No diff but navigating with cached segments - rendering target route",
|
|
@@ -311,10 +256,6 @@ export function createPartialUpdater(
|
|
|
311
256
|
existingSegments,
|
|
312
257
|
);
|
|
313
258
|
|
|
314
|
-
// tx.commit() cached the source page's handleData because
|
|
315
|
-
// eventController hasn't been updated yet. Overwrite with the
|
|
316
|
-
// correct cached handleData to prevent cache corruption on
|
|
317
|
-
// subsequent navigations to this same URL.
|
|
318
259
|
if (mode.targetCacheHandleData) {
|
|
319
260
|
store.updateCacheHandleData(
|
|
320
261
|
store.getHistoryKey(),
|
|
@@ -322,10 +263,6 @@ export function createPartialUpdater(
|
|
|
322
263
|
);
|
|
323
264
|
}
|
|
324
265
|
|
|
325
|
-
// Include cachedHandleData in metadata so NavigationProvider can restore
|
|
326
|
-
// breadcrumbs and other handle data from cache.
|
|
327
|
-
// Remove `handles` from metadata to prevent NavigationProvider from
|
|
328
|
-
// processing an empty handles stream, which would clear the cached breadcrumbs.
|
|
329
266
|
const { handles: _unusedHandles, ...metadataWithoutHandles } =
|
|
330
267
|
payload.metadata!;
|
|
331
268
|
const cachedUpdate = {
|
|
@@ -352,7 +289,6 @@ export function createPartialUpdater(
|
|
|
352
289
|
return;
|
|
353
290
|
}
|
|
354
291
|
|
|
355
|
-
// When leaving intercept, force re-render even with empty diff
|
|
356
292
|
if (mode.type === "leave-intercept") {
|
|
357
293
|
debugLog(
|
|
358
294
|
"[Browser] Leaving intercept - forcing re-render to remove modal",
|
|
@@ -377,7 +313,6 @@ export function createPartialUpdater(
|
|
|
377
313
|
return;
|
|
378
314
|
}
|
|
379
315
|
|
|
380
|
-
// Same route revalidation with no changes - skip UI update
|
|
381
316
|
debugLog(
|
|
382
317
|
"[Browser] No changes - all revalidations returned false, keeping existing UI",
|
|
383
318
|
);
|
|
@@ -386,7 +321,6 @@ export function createPartialUpdater(
|
|
|
386
321
|
return;
|
|
387
322
|
}
|
|
388
323
|
|
|
389
|
-
// Reconcile server segments with cached segments (single source of truth)
|
|
390
324
|
const matchedIds = matched || [];
|
|
391
325
|
const actor: ReconcileActor =
|
|
392
326
|
mode.type === "stale-revalidation" || mode.type === "action"
|
|
@@ -402,7 +336,6 @@ export function createPartialUpdater(
|
|
|
402
336
|
insertMissingDiff: true,
|
|
403
337
|
});
|
|
404
338
|
|
|
405
|
-
// HMR RESILIENCE: Check if we're missing any matched segments
|
|
406
339
|
const reconciledIdSet = new Set(reconciled.segments.map((s) => s.id));
|
|
407
340
|
const missingIds = matchedIds.filter(
|
|
408
341
|
(id: string) => !reconciledIdSet.has(id),
|
|
@@ -430,7 +363,6 @@ export function createPartialUpdater(
|
|
|
430
363
|
`[Browser] HMR detected: Missing ${missingCount} segments. Refetching all...`,
|
|
431
364
|
);
|
|
432
365
|
|
|
433
|
-
// Refetch with empty segments = server sends everything
|
|
434
366
|
return fetchPartialUpdate(url, [], true, signal, tx, mode);
|
|
435
367
|
}
|
|
436
368
|
|
|
@@ -439,7 +371,6 @@ export function createPartialUpdater(
|
|
|
439
371
|
return;
|
|
440
372
|
}
|
|
441
373
|
|
|
442
|
-
// Rebuild tree on client (await for loader data resolution)
|
|
443
374
|
const renderOptions = {
|
|
444
375
|
isAction: mode.type === "action",
|
|
445
376
|
forceAwait: mode.type === "stale-revalidation",
|
|
@@ -462,21 +393,15 @@ export function createPartialUpdater(
|
|
|
462
393
|
])
|
|
463
394
|
: renderSegments(reconciled.mainSegments, renderOptions));
|
|
464
395
|
|
|
465
|
-
// Final abort check before committing - another navigation may have started
|
|
466
396
|
if (signal?.aborted) {
|
|
467
397
|
debugLog("[Browser] Ignoring stale navigation (aborted before commit)");
|
|
468
398
|
return;
|
|
469
399
|
}
|
|
470
400
|
|
|
471
|
-
// Check if this is an intercept response (any slot is active)
|
|
472
401
|
const isInterceptResponse = hasActiveInterceptSlots(
|
|
473
402
|
payload.metadata?.slots,
|
|
474
403
|
);
|
|
475
404
|
|
|
476
|
-
// Track intercept context (only on navigation, not actions or stale revalidation)
|
|
477
|
-
// Use the authoritative source from mode/history state when restoring an
|
|
478
|
-
// intercept via popstate cache miss; fall back to the current URL for fresh
|
|
479
|
-
// intercept navigations.
|
|
480
405
|
const effectiveInterceptSource =
|
|
481
406
|
interceptSourceUrl || segmentState.currentUrl;
|
|
482
407
|
if (mode.type !== "action" && mode.type !== "stale-revalidation") {
|
|
@@ -487,9 +412,6 @@ export function createPartialUpdater(
|
|
|
487
412
|
}
|
|
488
413
|
}
|
|
489
414
|
|
|
490
|
-
// Commit navigation - use server's matched as the authoritative segment ID list.
|
|
491
|
-
// reconciled.segments may be missing IDs (e.g., loader segments not in diff or cache)
|
|
492
|
-
// but the server's matched always includes all expected segment IDs.
|
|
493
415
|
const allSegmentIds = matchedIds;
|
|
494
416
|
const serverLocationState = payload.metadata?.locationState;
|
|
495
417
|
const overrides: CommitOverrides | undefined = isInterceptResponse
|
|
@@ -508,7 +430,6 @@ export function createPartialUpdater(
|
|
|
508
430
|
overrides,
|
|
509
431
|
);
|
|
510
432
|
|
|
511
|
-
// For stale revalidation: verify history key hasn't changed before updating UI
|
|
512
433
|
if (mode.type === "stale-revalidation") {
|
|
513
434
|
const historyKeyNow = store.getHistoryKey();
|
|
514
435
|
if (historyKeyNow !== historyKeyAtStart) {
|
|
@@ -521,8 +442,6 @@ export function createPartialUpdater(
|
|
|
521
442
|
|
|
522
443
|
debugLog("[partial-update] updating document");
|
|
523
444
|
|
|
524
|
-
// Emit update to trigger React render.
|
|
525
|
-
// Scroll info is included so NavigationProvider applies it after React commits.
|
|
526
445
|
const hasTransition = shouldStartViewTransition(reconciled.segments);
|
|
527
446
|
const scrollPayload = toScrollPayload(navScroll);
|
|
528
447
|
|
|
@@ -559,7 +478,6 @@ export function createPartialUpdater(
|
|
|
559
478
|
debugLog("[Browser] Navigation complete");
|
|
560
479
|
return;
|
|
561
480
|
} else {
|
|
562
|
-
// Full update (fallback)
|
|
563
481
|
console.warn(`[Browser] Full update (fallback)`);
|
|
564
482
|
|
|
565
483
|
const segments = payload.metadata?.segments || [];
|
|
@@ -31,6 +31,12 @@
|
|
|
31
31
|
*
|
|
32
32
|
* Replaces the previous browser HTTP cache approach which was unreliable
|
|
33
33
|
* due to response draining race conditions and browser inconsistencies.
|
|
34
|
+
*
|
|
35
|
+
* State here lives in module-level singletons (cache, inflight, generation,
|
|
36
|
+
* cacheTTL, etc.) rather than a per-instance factory. This is correct because
|
|
37
|
+
* exactly one router is live per document — an SPA navigation crossing a
|
|
38
|
+
* host-router boundary forces a full document reload — so the singletons are
|
|
39
|
+
* effectively per-document. Unit tests reset them via clearPrefetchCache().
|
|
34
40
|
*/
|
|
35
41
|
|
|
36
42
|
import { abortAllPrefetches } from "./queue.js";
|
|
@@ -61,9 +67,6 @@ export interface DecodedPrefetch {
|
|
|
61
67
|
scope: "source" | "wildcard";
|
|
62
68
|
}
|
|
63
69
|
|
|
64
|
-
// Default TTL: 5 minutes. Overridden by initPrefetchCache() with
|
|
65
|
-
// the server-configured prefetchCacheTTL from router options.
|
|
66
|
-
// 0 disables the in-memory cache entirely.
|
|
67
70
|
let cacheTTL = 300_000;
|
|
68
71
|
|
|
69
72
|
/**
|
|
@@ -92,41 +95,12 @@ interface PrefetchCacheEntry {
|
|
|
92
95
|
const cache = new Map<string, PrefetchCacheEntry>();
|
|
93
96
|
const inflight = new Set<string>();
|
|
94
97
|
|
|
95
|
-
/**
|
|
96
|
-
* In-flight promise map. When a prefetch fetch+decode is in progress, its
|
|
97
|
-
* Promise<DecodedPrefetch | null> is stored here so navigation can await it
|
|
98
|
-
* instead of starting a duplicate request. Resolves to null when the prefetch
|
|
99
|
-
* failed, was aborted, or carried a control header (reload/redirect) that the
|
|
100
|
-
* navigation must re-fetch to act on.
|
|
101
|
-
*/
|
|
102
98
|
const inflightPromises = new Map<string, Promise<DecodedPrefetch | null>>();
|
|
103
99
|
|
|
104
|
-
/**
|
|
105
|
-
* Alias map for in-flight promises registered under multiple keys (see
|
|
106
|
-
* dual inflight in prefetch/fetch.ts). Records each key's sibling set so
|
|
107
|
-
* that consuming or clearing any one key atomically removes every alias —
|
|
108
|
-
* guaranteeing a single consumer for the shared decode.
|
|
109
|
-
*/
|
|
110
100
|
const inflightAliases = new Map<string, string[]>();
|
|
111
101
|
|
|
112
|
-
/**
|
|
113
|
-
* Keys whose in-flight prefetch promise was adopted by a navigation (via
|
|
114
|
-
* `consumeInflightPrefetch`). A `DecodedPrefetch` carries a single-use
|
|
115
|
-
* `metadata.handles` async generator; the adopter drains it. The same entry is
|
|
116
|
-
* also published to the `cache` map by `storePrefetch` when the fetch resolves
|
|
117
|
-
* — which runs AFTER adoption (adoption only succeeds while the fetch is still
|
|
118
|
-
* in flight, so the entry is not yet cached). Without this guard the adopted,
|
|
119
|
-
* now-drained entry would be left in the cache and served to a later navigation
|
|
120
|
-
* whose handle generator yields nothing, silently dropping that route's
|
|
121
|
-
* breadcrumbs. Recording the adopted keys lets `storePrefetch` skip publishing
|
|
122
|
-
* them, keeping the existing one-time-consumption contract (a consumed prefetch
|
|
123
|
-
* is gone; the next navigation re-fetches).
|
|
124
|
-
*/
|
|
125
102
|
const adoptedKeys = new Set<string>();
|
|
126
103
|
|
|
127
|
-
// Generation counter incremented on each clearPrefetchCache(). Fetches that
|
|
128
|
-
// started before a clear carry a stale generation and must not store their
|
|
129
|
-
// response (the data may be stale due to a server action invalidation).
|
|
130
104
|
let generation = 0;
|
|
131
105
|
|
|
132
106
|
/**
|
|
@@ -306,9 +280,6 @@ export function markPrefetchInflight(key: string): void {
|
|
|
306
280
|
inflight.add(key);
|
|
307
281
|
}
|
|
308
282
|
|
|
309
|
-
/**
|
|
310
|
-
* Store the in-flight Promise for a prefetch so navigation can reuse it.
|
|
311
|
-
*/
|
|
312
283
|
export function setInflightPromise(
|
|
313
284
|
key: string,
|
|
314
285
|
promise: Promise<DecodedPrefetch | null>,
|
|
@@ -337,20 +308,10 @@ export function clearPrefetchInflight(key: string): void {
|
|
|
337
308
|
inflight.delete(k);
|
|
338
309
|
inflightPromises.delete(k);
|
|
339
310
|
inflightAliases.delete(k);
|
|
340
|
-
// Clear any adopted marker too, so a fetch that failed before storePrefetch
|
|
341
|
-
// (the marker's normal consumer) does not strand it across the next prefetch.
|
|
342
311
|
adoptedKeys.delete(k);
|
|
343
312
|
});
|
|
344
313
|
}
|
|
345
314
|
|
|
346
|
-
/**
|
|
347
|
-
* Invalidate all prefetch state. Called when server actions mutate data.
|
|
348
|
-
* Clears the in-memory cache, cancels in-flight prefetches, and rotates
|
|
349
|
-
* the Rango state key so CDN-cached responses are also invalidated.
|
|
350
|
-
*
|
|
351
|
-
* Uses abortAllPrefetches (hard cancel) because in-flight responses
|
|
352
|
-
* may contain stale data after a mutation.
|
|
353
|
-
*/
|
|
354
315
|
export function clearPrefetchCache(): void {
|
|
355
316
|
generation++;
|
|
356
317
|
inflight.clear();
|
|
@@ -71,10 +71,13 @@ function scheduleDrain(): void {
|
|
|
71
71
|
Promise.race([waitForViewportImages(), wait(IMAGE_WAIT_TIMEOUT)]),
|
|
72
72
|
)
|
|
73
73
|
.then(() => {
|
|
74
|
-
|
|
75
|
-
//
|
|
76
|
-
//
|
|
74
|
+
// Stale drain: a cancel/abort happened while we were waiting, and a fresh
|
|
75
|
+
// scheduleDrain may already own drainScheduled for the new generation.
|
|
76
|
+
// Bail WITHOUT clearing the flag so we don't clobber the live wait's
|
|
77
|
+
// single-in-flight-drain coalescing (clearing it here would let the next
|
|
78
|
+
// enqueue start a third overlapping wait).
|
|
77
79
|
if (gen !== drainGeneration) return;
|
|
80
|
+
drainScheduled = false;
|
|
78
81
|
if (queue.length > 0) drain();
|
|
79
82
|
});
|
|
80
83
|
}
|
|
@@ -32,23 +32,13 @@ import {
|
|
|
32
32
|
serializeStateCookie,
|
|
33
33
|
} from "./cookie-name.js";
|
|
34
34
|
|
|
35
|
-
// The resolved cookie name this document is bound to (server-resolved, read
|
|
36
|
-
// from payload metadata at boot). Bare default until initRangoState runs.
|
|
37
35
|
let cookieName: string = DEFAULT_STATE_COOKIE_PREFIX;
|
|
38
36
|
|
|
39
|
-
// Build version for this document, used as the prefix of minted values.
|
|
40
37
|
let currentVersion = "0";
|
|
41
38
|
|
|
42
|
-
// Write-through mirror of the value. Authoritative only when the cookie is
|
|
43
|
-
// unreadable. `cookieBacked` records whether the mirror was last confirmed
|
|
44
|
-
// present in the jar, so a present->absent transition (an external clear) is
|
|
45
|
-
// detected exactly once instead of re-firing on every subsequent read.
|
|
46
39
|
let mirror: string | null = null;
|
|
47
40
|
let cookieBacked = false;
|
|
48
41
|
|
|
49
|
-
// External-rotation observer, registered by the store-handle wiring (so a
|
|
50
|
-
// sibling tab's rotation or a server Set-Cookie marks the history cache stale).
|
|
51
|
-
// Null until registered; self-rotations never call it.
|
|
52
42
|
let externalRotationObserver: ((value: string) => void) | null = null;
|
|
53
43
|
|
|
54
44
|
/**
|
|
@@ -81,7 +71,6 @@ function readCookie(name: string): CookieRead {
|
|
|
81
71
|
} catch {
|
|
82
72
|
return { readable: false, value: null };
|
|
83
73
|
}
|
|
84
|
-
// Shared parser with the server seat so both read the same jar entry.
|
|
85
74
|
return { readable: true, value: getRawCookieValue(raw, name) };
|
|
86
75
|
}
|
|
87
76
|
|
|
@@ -91,14 +80,9 @@ function writeCookie(name: string, value: string): void {
|
|
|
91
80
|
typeof location !== "undefined" && location.protocol === "https:";
|
|
92
81
|
try {
|
|
93
82
|
document.cookie = serializeStateCookie(name, value, secure);
|
|
94
|
-
} catch {
|
|
95
|
-
// Write failures are silently absorbed; the mirror carries the value.
|
|
96
|
-
}
|
|
83
|
+
} catch {}
|
|
97
84
|
}
|
|
98
85
|
|
|
99
|
-
// Mint a fresh value: same version, a timestamp strictly greater than the
|
|
100
|
-
// current one (the in-memory mirror is the previous value). The monotonic guard
|
|
101
|
-
// lives in mintStateValue, shared with the server seat.
|
|
102
86
|
function mintValue(): string {
|
|
103
87
|
return mintStateValue(currentVersion, mirror);
|
|
104
88
|
}
|
|
@@ -195,9 +179,6 @@ export function invalidateRangoState(): void {
|
|
|
195
179
|
writeCookie(cookieName, mirror);
|
|
196
180
|
}
|
|
197
181
|
|
|
198
|
-
// One-time migration: remove the legacy localStorage keys this mechanism used
|
|
199
|
-
// before the cookie cutover. No value porting — a fresh cookie mint just misses
|
|
200
|
-
// cleanly. Idempotent: scans for `rango-state` and `rango-state:{routerId}`.
|
|
201
182
|
function cleanupLegacyStorage(): void {
|
|
202
183
|
if (typeof localStorage === "undefined") return;
|
|
203
184
|
try {
|
|
@@ -209,7 +190,5 @@ function cleanupLegacyStorage(): void {
|
|
|
209
190
|
}
|
|
210
191
|
}
|
|
211
192
|
for (const key of toRemove) localStorage.removeItem(key);
|
|
212
|
-
} catch {
|
|
213
|
-
// localStorage unavailable; nothing to clean.
|
|
214
|
-
}
|
|
193
|
+
} catch {}
|
|
215
194
|
}
|
|
@@ -39,8 +39,6 @@ import {
|
|
|
39
39
|
unobserveForPrefetch,
|
|
40
40
|
} from "../prefetch/observer.js";
|
|
41
41
|
|
|
42
|
-
// Touch device detection for adaptive strategy.
|
|
43
|
-
// Checked once at module load (Link.tsx is "use client", runs only in browser).
|
|
44
42
|
const isTouchDevice =
|
|
45
43
|
typeof window !== "undefined" && window.matchMedia("(hover: none)").matches;
|
|
46
44
|
|
|
@@ -29,6 +29,7 @@ import type { ResolvedThemeConfig, Theme } from "../../theme/types.js";
|
|
|
29
29
|
import { cancelAllPrefetches } from "../prefetch/queue.js";
|
|
30
30
|
import { handleNavigationEnd } from "../scroll-restoration.js";
|
|
31
31
|
import { createAppShellRef, type AppShellRef } from "../app-shell.js";
|
|
32
|
+
import { debugLog } from "../logging.js";
|
|
32
33
|
|
|
33
34
|
/**
|
|
34
35
|
* Process handles from an async generator, updating the event controller
|
|
@@ -70,7 +71,7 @@ async function processHandles(
|
|
|
70
71
|
// This prevents handle data from cancelled navigations polluting
|
|
71
72
|
// the current route's breadcrumbs (e.g., quick popstate after clicking a link).
|
|
72
73
|
if (historyKey !== store.getHistoryKey()) {
|
|
73
|
-
|
|
74
|
+
debugLog(
|
|
74
75
|
"[NavigationProvider] Stopping handle processing - user navigated away",
|
|
75
76
|
);
|
|
76
77
|
return;
|
|
@@ -14,17 +14,21 @@ export interface ScrollRestorationProps {
|
|
|
14
14
|
* Return location.pathname to restore scroll based on path
|
|
15
15
|
* (useful for keeping scroll position on the same page).
|
|
16
16
|
*
|
|
17
|
+
* Provide a stable reference: a module-level function or one wrapped in
|
|
18
|
+
* useCallback. The init effect re-runs when getKey's identity changes, and
|
|
19
|
+
* teardown clears in-memory scroll positions — a fresh inline arrow on every
|
|
20
|
+
* parent render would discard unpersisted positions mid-session.
|
|
21
|
+
*
|
|
17
22
|
* @example
|
|
18
23
|
* ```tsx
|
|
24
|
+
* // Stable module-level getKey (recommended)
|
|
25
|
+
* const byPathname = (location) => location.pathname;
|
|
26
|
+
*
|
|
19
27
|
* // Restore based on pathname (same URL = same scroll)
|
|
20
|
-
* <ScrollRestoration
|
|
21
|
-
* getKey={(location) => location.pathname}
|
|
22
|
-
* />
|
|
28
|
+
* <ScrollRestoration getKey={byPathname} />
|
|
23
29
|
*
|
|
24
30
|
* // Restore based on unique history entry (default)
|
|
25
|
-
* <ScrollRestoration
|
|
26
|
-
* getKey={(location) => location.key}
|
|
27
|
-
* />
|
|
31
|
+
* // <ScrollRestoration /> — omit getKey to use location.key
|
|
28
32
|
* ```
|
|
29
33
|
*/
|
|
30
34
|
getKey?: (location: {
|
|
@@ -46,8 +46,6 @@ export function filterSegmentOrder(matched: string[]): string[] {
|
|
|
46
46
|
const slots = slotsByParent.get(id);
|
|
47
47
|
if (slots) result.push(...slots);
|
|
48
48
|
}
|
|
49
|
-
// Defensive: any slot whose parent is missing from the filtered list still
|
|
50
|
-
// gets included rather than silently dropped. Shouldn't happen in practice.
|
|
51
49
|
for (const [parent, slots] of slotsByParent) {
|
|
52
50
|
if (!nonSlotSet.has(parent)) result.push(...slots);
|
|
53
51
|
}
|