@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
|
@@ -112,9 +112,6 @@ import type { MatchContext, MatchPipelineState } from "./match-context.js";
|
|
|
112
112
|
import { debugLog } from "./logging.js";
|
|
113
113
|
import { appendMetric } from "./metrics.js";
|
|
114
114
|
|
|
115
|
-
/**
|
|
116
|
-
* Collect all segments from an async generator
|
|
117
|
-
*/
|
|
118
115
|
export async function collectSegments(
|
|
119
116
|
generator: AsyncGenerator<ResolvedSegment>,
|
|
120
117
|
): Promise<ResolvedSegment[]> {
|
|
@@ -159,8 +156,6 @@ function deduplicateLoaderSegments(
|
|
|
159
156
|
}
|
|
160
157
|
}
|
|
161
158
|
|
|
162
|
-
// An inherited loader is needed when it shares a namespace with a
|
|
163
|
-
// loading-bearing segment (its data sits behind that LoaderBoundary).
|
|
164
159
|
const loadersWithLoading = new Set<string>();
|
|
165
160
|
for (const ns of namespacesWithLoading) {
|
|
166
161
|
for (const id of loaderIdsByNamespace.get(ns) ?? []) {
|
|
@@ -195,9 +190,6 @@ function deduplicateLoaderSegments(
|
|
|
195
190
|
return { segments: result, removedIds };
|
|
196
191
|
}
|
|
197
192
|
|
|
198
|
-
/**
|
|
199
|
-
* Build the final MatchResult from collected segments and context
|
|
200
|
-
*/
|
|
201
193
|
export function buildMatchResult<TEnv>(
|
|
202
194
|
allSegments: ResolvedSegment[],
|
|
203
195
|
ctx: MatchContext<TEnv>,
|
|
@@ -211,11 +203,6 @@ export function buildMatchResult<TEnv>(
|
|
|
211
203
|
let segmentsToRender: ResolvedSegment[];
|
|
212
204
|
|
|
213
205
|
if (ctx.isFullMatch) {
|
|
214
|
-
// Full match (document request) - all segments are rendered
|
|
215
|
-
// Deduplicate by segment ID (defense-in-depth). The primary dedup is in
|
|
216
|
-
// resolveAllSegments, but this guards against any path that bypasses it.
|
|
217
|
-
// include() scopes can produce entries that resolve the same shared layout,
|
|
218
|
-
// and duplicate IDs change the client's React tree depth causing remounts.
|
|
219
206
|
const seen = new Set<string>();
|
|
220
207
|
segmentsToRender = [];
|
|
221
208
|
for (const s of allSegments) {
|
|
@@ -226,24 +213,14 @@ export function buildMatchResult<TEnv>(
|
|
|
226
213
|
}
|
|
227
214
|
allIds = segmentsToRender.map((s) => s.id);
|
|
228
215
|
} else {
|
|
229
|
-
// Partial match (navigation) - filter and handle intercepts
|
|
230
|
-
// When intercepting, tell browser to keep its current segments + add modal
|
|
231
|
-
// This prevents the browser from discarding the current page content
|
|
232
|
-
// If client sent empty segments (HMR recovery), use segment IDs from allSegments
|
|
233
216
|
allIds = ctx.interceptResult
|
|
234
217
|
? ctx.clientSegmentIds.length > 0
|
|
235
218
|
? [...ctx.clientSegmentIds, ...state.interceptSegments.map((s) => s.id)]
|
|
236
|
-
: allSegments.map((s) => s.id)
|
|
219
|
+
: allSegments.map((s) => s.id)
|
|
237
220
|
: [...state.matchedIds, ...state.interceptSegments.map((s) => s.id)];
|
|
238
221
|
|
|
239
|
-
// Deduplicate allIds (defense-in-depth for partial match path)
|
|
240
222
|
allIds = [...new Set(allIds)];
|
|
241
223
|
|
|
242
|
-
// Filter out null-component segments only when the client already has
|
|
243
|
-
// them cached (revalidation skip). If the client doesn't have the segment,
|
|
244
|
-
// it must be included even with null component — it's structurally required
|
|
245
|
-
// as a parent node for child layouts/parallels to reconcile against.
|
|
246
|
-
// Loader segments are always included as they carry data.
|
|
247
224
|
const clientIdSet = new Set(ctx.clientSegmentIds);
|
|
248
225
|
segmentsToRender = allSegments.filter(
|
|
249
226
|
(s) =>
|
|
@@ -256,34 +233,13 @@ export function buildMatchResult<TEnv>(
|
|
|
256
233
|
logPrefix,
|
|
257
234
|
);
|
|
258
235
|
|
|
259
|
-
debugLog(logPrefix, "all segments", {
|
|
260
|
-
segments: allSegments.map((s) => ({
|
|
261
|
-
id: s.id,
|
|
262
|
-
type: s.type,
|
|
263
|
-
hasComponent: s.component !== null,
|
|
264
|
-
})),
|
|
265
|
-
});
|
|
266
|
-
debugLog(logPrefix, "segments to render", {
|
|
267
|
-
segmentIds: dedupedSegments.map((s) => s.id),
|
|
268
|
-
});
|
|
269
|
-
|
|
270
|
-
// Remove deduped loader IDs from matched so the client doesn't treat
|
|
271
|
-
// them as missing segments and trigger a fallback refetch.
|
|
272
236
|
const matchedIds =
|
|
273
237
|
removedIds.size > 0 ? allIds.filter((id) => !removedIds.has(id)) : allIds;
|
|
274
238
|
|
|
275
|
-
// resolvedIds: every segment whose handler actually ran this request.
|
|
276
|
-
// For full-match every segment is fresh; for partial-match we filter by
|
|
277
|
-
// the internal `_handlerRan` flag set in revalidation.ts. Drives the
|
|
278
|
-
// client's handle-bucket cleanup — a slot that re-resolved and pushed
|
|
279
|
-
// nothing must have its previous handle data cleared, but `diff` won't
|
|
280
|
-
// carry it because the segment payload skips null-component cached
|
|
281
|
-
// segments to save bytes.
|
|
282
239
|
const resolvedIds = ctx.isFullMatch
|
|
283
240
|
? allSegments.map((s) => s.id)
|
|
284
241
|
: allSegments.filter((s) => s._handlerRan).map((s) => s.id);
|
|
285
242
|
|
|
286
|
-
// Strip internal-only fields from the segments going on the wire.
|
|
287
243
|
const cleanedSegments = dedupedSegments.map((s) => {
|
|
288
244
|
if (s._handlerRan === undefined) return s;
|
|
289
245
|
const { _handlerRan: _drop, ...rest } = s;
|
|
@@ -303,12 +259,6 @@ export function buildMatchResult<TEnv>(
|
|
|
303
259
|
};
|
|
304
260
|
}
|
|
305
261
|
|
|
306
|
-
/**
|
|
307
|
-
* Collect segments from pipeline and build MatchResult
|
|
308
|
-
*
|
|
309
|
-
* This is the main entry point for building the final result after
|
|
310
|
-
* the pipeline has processed all segments.
|
|
311
|
-
*/
|
|
312
262
|
export async function collectMatchResult<TEnv>(
|
|
313
263
|
pipeline: AsyncGenerator<ResolvedSegment>,
|
|
314
264
|
ctx: MatchContext<TEnv>,
|
|
@@ -318,7 +268,6 @@ export async function collectMatchResult<TEnv>(
|
|
|
318
268
|
|
|
319
269
|
const buildStart = performance.now();
|
|
320
270
|
|
|
321
|
-
// Update state with collected segments if not already set
|
|
322
271
|
if (state.segments.length === 0) {
|
|
323
272
|
state.segments = allSegments;
|
|
324
273
|
}
|
package/src/router/metrics.ts
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Router Metrics Utilities
|
|
3
|
-
*
|
|
4
|
-
* Performance metrics collection and reporting for Rango.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
1
|
import type { MetricsStore, PerformanceMetric } from "../server/context";
|
|
8
2
|
|
|
9
3
|
const BASE_INDENT = 2;
|
|
@@ -16,7 +10,6 @@ function formatMs(value: number): string {
|
|
|
16
10
|
|
|
17
11
|
function sortMetrics(metrics: PerformanceMetric[]): PerformanceMetric[] {
|
|
18
12
|
return [...metrics].sort((a, b) => {
|
|
19
|
-
// handler:total always goes last (it wraps everything)
|
|
20
13
|
if (a.label === "handler:total") return 1;
|
|
21
14
|
if (b.label === "handler:total") return -1;
|
|
22
15
|
return a.startTime - b.startTime;
|
|
@@ -68,11 +61,6 @@ function createTimelineAxis(total: number): string {
|
|
|
68
61
|
)}${totalLabel}`;
|
|
69
62
|
}
|
|
70
63
|
|
|
71
|
-
/**
|
|
72
|
-
* Create a metrics store for the request if debugPerformance is enabled.
|
|
73
|
-
* An optional `requestStart` timestamp can anchor the store to an earlier
|
|
74
|
-
* point (e.g. handler start) so that handler:total has startTime=0.
|
|
75
|
-
*/
|
|
76
64
|
export function createMetricsStore(
|
|
77
65
|
debugPerformance: boolean,
|
|
78
66
|
requestStart?: number,
|
|
@@ -85,9 +73,6 @@ export function createMetricsStore(
|
|
|
85
73
|
};
|
|
86
74
|
}
|
|
87
75
|
|
|
88
|
-
/**
|
|
89
|
-
* Append a metric to the request store using an absolute start timestamp.
|
|
90
|
-
*/
|
|
91
76
|
export function appendMetric(
|
|
92
77
|
metricsStore: MetricsStore | undefined,
|
|
93
78
|
label: string,
|
|
@@ -104,9 +89,6 @@ export function appendMetric(
|
|
|
104
89
|
});
|
|
105
90
|
}
|
|
106
91
|
|
|
107
|
-
/**
|
|
108
|
-
* Log the current request metrics and return the corresponding Server-Timing value.
|
|
109
|
-
*/
|
|
110
92
|
export function buildMetricsTiming(
|
|
111
93
|
method: string,
|
|
112
94
|
pathname: string,
|
|
@@ -117,7 +99,6 @@ export function buildMetricsTiming(
|
|
|
117
99
|
return generateServerTiming(metricsStore) || undefined;
|
|
118
100
|
}
|
|
119
101
|
|
|
120
|
-
/** Display row produced by merging :pre/:post metric pairs. */
|
|
121
102
|
interface DisplayRow {
|
|
122
103
|
label: string;
|
|
123
104
|
startTime: number;
|
|
@@ -126,12 +107,7 @@ interface DisplayRow {
|
|
|
126
107
|
spans: Span[];
|
|
127
108
|
}
|
|
128
109
|
|
|
129
|
-
/**
|
|
130
|
-
* Build display rows from sorted metrics, merging :pre/:post pairs into
|
|
131
|
-
* a single row with disjoint timeline segments.
|
|
132
|
-
*/
|
|
133
110
|
function buildDisplayRows(sorted: PerformanceMetric[]): DisplayRow[] {
|
|
134
|
-
// Index :pre and :post metrics by their base label
|
|
135
111
|
const preMap = new Map<string, PerformanceMetric>();
|
|
136
112
|
const postMap = new Map<string, PerformanceMetric>();
|
|
137
113
|
const consumed = new Set<PerformanceMetric>();
|
|
@@ -211,11 +187,6 @@ function buildDisplayRows(sorted: PerformanceMetric[]): DisplayRow[] {
|
|
|
211
187
|
return rows;
|
|
212
188
|
}
|
|
213
189
|
|
|
214
|
-
/**
|
|
215
|
-
* Log metrics to console in a formatted way.
|
|
216
|
-
* Uses a shared-axis timeline so overlapping work stays visible.
|
|
217
|
-
* Merges :pre/:post pairs onto one row with disjoint timeline segments.
|
|
218
|
-
*/
|
|
219
190
|
export function logMetrics(
|
|
220
191
|
method: string,
|
|
221
192
|
pathname: string,
|
|
@@ -267,11 +238,6 @@ export function logMetrics(
|
|
|
267
238
|
}
|
|
268
239
|
}
|
|
269
240
|
|
|
270
|
-
/**
|
|
271
|
-
* Generate Server-Timing header value from metrics
|
|
272
|
-
* Format: metric-name;dur=X.XX
|
|
273
|
-
* Depth is encoded as a "d{N}-" prefix for nested metrics.
|
|
274
|
-
*/
|
|
275
241
|
export function generateServerTiming(metricsStore: MetricsStore): string {
|
|
276
242
|
return metricsStore.metrics
|
|
277
243
|
.map((m) => {
|
|
@@ -1,14 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Cookie Utilities
|
|
3
|
-
*
|
|
4
|
-
* Parsing and serialization for HTTP cookies used by middleware context.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
1
|
import type { CookieOptions } from "./middleware-types.js";
|
|
8
2
|
|
|
9
|
-
/**
|
|
10
|
-
* Parse cookies from Cookie header
|
|
11
|
-
*/
|
|
12
3
|
export function parseCookies(
|
|
13
4
|
cookieHeader: string | null,
|
|
14
5
|
): Record<string, string> {
|
|
@@ -24,7 +15,6 @@ export function parseCookies(
|
|
|
24
15
|
try {
|
|
25
16
|
cookies[name] = decodeURIComponent(raw);
|
|
26
17
|
} catch {
|
|
27
|
-
// Malformed percent-encoded value (e.g. %zz) - fall back to raw value
|
|
28
18
|
cookies[name] = raw;
|
|
29
19
|
}
|
|
30
20
|
}
|
|
@@ -33,9 +23,6 @@ export function parseCookies(
|
|
|
33
23
|
return cookies;
|
|
34
24
|
}
|
|
35
25
|
|
|
36
|
-
/**
|
|
37
|
-
* Serialize a cookie for Set-Cookie header
|
|
38
|
-
*/
|
|
39
26
|
export function serializeCookie(
|
|
40
27
|
name: string,
|
|
41
28
|
value: string,
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Middleware Types
|
|
3
|
-
*
|
|
4
|
-
* Type definitions and interfaces for the middleware system.
|
|
5
|
-
* Separated from execution logic for cleaner imports.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
1
|
import type { ContextVar } from "../context-var.js";
|
|
9
2
|
import type {
|
|
10
3
|
DefaultReverseRouteMap,
|
|
@@ -16,17 +9,11 @@ import type { Theme } from "../theme/types.js";
|
|
|
16
9
|
import type { LocationStateEntry } from "../browser/react/location-state-shared.js";
|
|
17
10
|
import type { RequestScope } from "../types/request-scope.js";
|
|
18
11
|
|
|
19
|
-
/**
|
|
20
|
-
* Get variable function type
|
|
21
|
-
*/
|
|
22
12
|
type GetVariableFn = {
|
|
23
13
|
<T>(contextVar: ContextVar<T>): T | undefined;
|
|
24
14
|
<K extends keyof DefaultVars>(key: K): DefaultVars[K];
|
|
25
15
|
};
|
|
26
16
|
|
|
27
|
-
/**
|
|
28
|
-
* Set variable function type
|
|
29
|
-
*/
|
|
30
17
|
type SetVariableFn = {
|
|
31
18
|
<T>(contextVar: ContextVar<T>, value: T, options?: { cache?: boolean }): void;
|
|
32
19
|
<K extends keyof DefaultVars>(
|
|
@@ -36,9 +23,6 @@ type SetVariableFn = {
|
|
|
36
23
|
): void;
|
|
37
24
|
};
|
|
38
25
|
|
|
39
|
-
/**
|
|
40
|
-
* Cookie options for setting cookies
|
|
41
|
-
*/
|
|
42
26
|
export interface CookieOptions {
|
|
43
27
|
domain?: string;
|
|
44
28
|
path?: string;
|
|
@@ -49,109 +33,36 @@ export interface CookieOptions {
|
|
|
49
33
|
sameSite?: "strict" | "lax" | "none";
|
|
50
34
|
}
|
|
51
35
|
|
|
52
|
-
/**
|
|
53
|
-
* Context passed to middleware
|
|
54
|
-
*
|
|
55
|
-
* @template TEnv - Environment type (bindings, variables) - defaults to any for internal flexibility
|
|
56
|
-
* @template TParams - URL params type (typed for route middleware,
|
|
57
|
-
* `Record<string, string | undefined>` for global middleware — absent
|
|
58
|
-
* optional segments are omitted from the params record at runtime, so
|
|
59
|
-
* the index signature must include `undefined`)
|
|
60
|
-
*/
|
|
61
36
|
export interface MiddlewareContext<
|
|
62
37
|
TEnv = any,
|
|
63
38
|
TParams = Record<string, string | undefined>,
|
|
64
39
|
> extends RequestScope<TEnv> {
|
|
65
|
-
/** URL params extracted from route/middleware pattern */
|
|
66
40
|
params: TParams;
|
|
67
41
|
|
|
68
|
-
/**
|
|
69
|
-
* Response headers.
|
|
70
|
-
* Before `next()`, returns headers from the shared response stub.
|
|
71
|
-
* After `next()`, returns headers from the downstream response.
|
|
72
|
-
*/
|
|
73
42
|
readonly headers: Headers;
|
|
74
43
|
|
|
75
|
-
/** Get a context variable (shared with route handlers) */
|
|
76
44
|
get: GetVariableFn;
|
|
77
45
|
|
|
78
|
-
/** Set a context variable (shared with route handlers) */
|
|
79
46
|
set: SetVariableFn;
|
|
80
47
|
|
|
81
|
-
/**
|
|
82
|
-
* Set a response header - can be called before or after `next()`.
|
|
83
|
-
*
|
|
84
|
-
* When called before `next()`, headers are queued and merged into the final response.
|
|
85
|
-
* When called after `next()`, headers are set directly on the response.
|
|
86
|
-
*/
|
|
87
48
|
header(name: string, value: string): void;
|
|
88
49
|
|
|
89
|
-
/**
|
|
90
|
-
* The matched route name, if available and the route has an explicit name.
|
|
91
|
-
* Undefined for global middleware (runs before route matching) or unnamed routes.
|
|
92
|
-
*/
|
|
93
50
|
routeName?: DefaultRouteName;
|
|
94
51
|
|
|
95
|
-
/**
|
|
96
|
-
* Enable performance metrics for this request.
|
|
97
|
-
* When called, granular timing breakdown is logged to console and
|
|
98
|
-
* included in the Server-Timing response header, regardless of the
|
|
99
|
-
* router-level `debugPerformance` option.
|
|
100
|
-
*
|
|
101
|
-
* Call **before** `await next()` so the metrics store exists when
|
|
102
|
-
* downstream phases (route matching, rendering, SSR) record their
|
|
103
|
-
* spans. Calling after `next()` returns still emits `handler:total`
|
|
104
|
-
* but misses all upstream metrics.
|
|
105
|
-
*/
|
|
106
52
|
debugPerformance(): void;
|
|
107
53
|
|
|
108
|
-
/**
|
|
109
|
-
* Current theme (from cookie or default).
|
|
110
|
-
* Only available when theme is enabled in router config.
|
|
111
|
-
*/
|
|
112
54
|
theme?: Theme;
|
|
113
55
|
|
|
114
|
-
/**
|
|
115
|
-
* Set the theme (only available when theme is enabled in router config).
|
|
116
|
-
* Sets a cookie with the new theme value.
|
|
117
|
-
*/
|
|
118
56
|
setTheme?: (theme: Theme) => void;
|
|
119
57
|
|
|
120
|
-
/**
|
|
121
|
-
* Attach location state entries to this response.
|
|
122
|
-
* State is delivered to the client via history.pushState and accessible
|
|
123
|
-
* through the useLocationState() hook.
|
|
124
|
-
*/
|
|
125
58
|
setLocationState(entries: LocationStateEntry | LocationStateEntry[]): void;
|
|
126
59
|
|
|
127
|
-
/**
|
|
128
|
-
* Generate URLs from route names.
|
|
129
|
-
* - `name` — global route, from the named-routes definition
|
|
130
|
-
*/
|
|
131
60
|
reverse: ScopedReverseFunction<
|
|
132
61
|
Record<string, string>,
|
|
133
62
|
DefaultReverseRouteMap
|
|
134
63
|
>;
|
|
135
64
|
}
|
|
136
65
|
|
|
137
|
-
/**
|
|
138
|
-
* Middleware function signature
|
|
139
|
-
*
|
|
140
|
-
* @template TEnv - Environment type - defaults to any for internal flexibility
|
|
141
|
-
* @template TParams - URL params type (typed for route middleware)
|
|
142
|
-
*
|
|
143
|
-
* When using middleware with global augmentation (Rango.Env), explicitly
|
|
144
|
-
* annotate your middleware functions, or the types will be inferred from context:
|
|
145
|
-
*
|
|
146
|
-
* @example
|
|
147
|
-
* ```typescript
|
|
148
|
-
* // With explicit annotation (recommended for reusable middleware)
|
|
149
|
-
* const authMiddleware: MiddlewareFn<AppEnv> = async (ctx, next) => {...}
|
|
150
|
-
*
|
|
151
|
-
* // Types inferred from router.use() call
|
|
152
|
-
* router.use((ctx, next) => {...}) // ctx is typed from router's TEnv
|
|
153
|
-
* ```
|
|
154
|
-
*/
|
|
155
66
|
export type MiddlewareFn<
|
|
156
67
|
TEnv = any,
|
|
157
68
|
TParams = Record<string, string | undefined>,
|
|
@@ -160,50 +71,24 @@ export type MiddlewareFn<
|
|
|
160
71
|
next: () => Promise<Response>,
|
|
161
72
|
) => Response | void | Promise<Response | void>;
|
|
162
73
|
|
|
163
|
-
/**
|
|
164
|
-
* Stored middleware entry with pattern matching info
|
|
165
|
-
* @internal - uses any for internal flexibility
|
|
166
|
-
*/
|
|
167
74
|
export interface MiddlewareEntry<TEnv = any> {
|
|
168
|
-
/** Original pattern string */
|
|
169
75
|
pattern: string | null;
|
|
170
|
-
|
|
171
|
-
/** Compiled regex for matching */
|
|
172
76
|
regex: RegExp | null;
|
|
173
|
-
|
|
174
|
-
/** Param names extracted from pattern */
|
|
175
77
|
paramNames: string[];
|
|
176
|
-
|
|
177
|
-
/** The middleware function */
|
|
178
78
|
handler: MiddlewareFn<TEnv>;
|
|
179
|
-
|
|
180
|
-
/** Mount prefix this middleware is scoped to (null = global) */
|
|
181
79
|
mountPrefix: string | null;
|
|
182
80
|
}
|
|
183
81
|
|
|
184
|
-
/**
|
|
185
|
-
* Mutable response holder - tracks the current response through the middleware chain.
|
|
186
|
-
*/
|
|
187
82
|
export interface ResponseHolder {
|
|
188
83
|
response: Response | null;
|
|
189
84
|
}
|
|
190
85
|
|
|
191
|
-
/**
|
|
192
|
-
* Entry type for middleware collection
|
|
193
|
-
* Matches the shape of EntryData used in router.ts
|
|
194
|
-
*/
|
|
195
86
|
export interface MiddlewareCollectableEntry {
|
|
196
87
|
middleware?: MiddlewareFn<any, any>[];
|
|
197
88
|
layout?: MiddlewareCollectableEntry[];
|
|
198
89
|
}
|
|
199
90
|
|
|
200
|
-
/**
|
|
201
|
-
* Collected route middleware with params
|
|
202
|
-
*/
|
|
203
91
|
export interface CollectedMiddleware {
|
|
204
92
|
handler: MiddlewareFn<any, any>;
|
|
205
|
-
// Internal shape only. The user-facing `MiddlewareContext.params` is
|
|
206
|
-
// typed `Record<string, string | undefined>` to reflect that absent
|
|
207
|
-
// optional segments are omitted from the params record at runtime.
|
|
208
93
|
params: Record<string, string>;
|
|
209
94
|
}
|
package/src/router/middleware.ts
CHANGED
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
/// <reference types="vite/types/importMeta.d.ts" />
|
|
2
|
-
/**
|
|
3
|
-
* Middleware Execution
|
|
4
|
-
*
|
|
5
|
-
* True middleware that wraps the entire RSC handler.
|
|
6
|
-
* - `await next()` returns actual Response
|
|
7
|
-
* - Can modify response headers
|
|
8
|
-
* - Can catch errors from RSC rendering
|
|
9
|
-
* - Forgiving API: if middleware doesn't return, original response is used
|
|
10
|
-
*/
|
|
11
2
|
|
|
12
3
|
import { contextGet, contextSet } from "../context-var.js";
|
|
13
4
|
import { safeDecodeURIComponent } from "./url-params.js";
|
|
@@ -26,23 +17,20 @@ import { appendMetric, createMetricsStore } from "./metrics.js";
|
|
|
26
17
|
import { stripInternalParams } from "./handler-context.js";
|
|
27
18
|
import { isWebSocketUpgradeResponse } from "../response-utils.js";
|
|
28
19
|
|
|
29
|
-
// Re-export types and cookie utilities
|
|
20
|
+
// Re-export types and cookie utilities consumed through this module's path.
|
|
30
21
|
export type {
|
|
31
22
|
CookieOptions,
|
|
32
|
-
CollectedMiddleware,
|
|
33
23
|
MiddlewareCollectableEntry,
|
|
34
24
|
MiddlewareContext,
|
|
35
25
|
MiddlewareEntry,
|
|
36
26
|
MiddlewareFn,
|
|
37
|
-
ResponseHolder,
|
|
38
27
|
} from "./middleware-types.js";
|
|
39
28
|
export { parseCookies, serializeCookie } from "./middleware-cookies.js";
|
|
40
29
|
|
|
41
30
|
const MIDDLEWARE_METRIC_DEPTH = 1;
|
|
42
|
-
/** Ignore post-next() durations below this threshold (measurement noise). */
|
|
43
31
|
const POST_METRIC_MIN_DURATION_MS = 0.01;
|
|
44
32
|
|
|
45
|
-
function
|
|
33
|
+
function getMiddlewareMetricLabel<TEnv>(
|
|
46
34
|
entry: MiddlewareEntry<TEnv>,
|
|
47
35
|
ordinal: number,
|
|
48
36
|
): string {
|
|
@@ -50,23 +38,12 @@ function getMiddlewareMetricBase<TEnv>(
|
|
|
50
38
|
const scope = entry.pattern ?? "*";
|
|
51
39
|
|
|
52
40
|
if (handlerName) {
|
|
53
|
-
return
|
|
41
|
+
return `middleware:${handlerName}@${scope}`;
|
|
54
42
|
}
|
|
55
43
|
|
|
56
|
-
return
|
|
44
|
+
return `middleware:${scope}#${ordinal + 1}`;
|
|
57
45
|
}
|
|
58
46
|
|
|
59
|
-
function getMiddlewareMetricLabel<TEnv>(
|
|
60
|
-
entry: MiddlewareEntry<TEnv>,
|
|
61
|
-
ordinal: number,
|
|
62
|
-
): string {
|
|
63
|
-
return `middleware:${getMiddlewareMetricBase(entry, ordinal)}`;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Parse a route pattern into regex and param names
|
|
68
|
-
* Supports: *, /path, /path/*, /path/:param, /path/:param/*
|
|
69
|
-
*/
|
|
70
47
|
export function parsePattern(pattern: string): {
|
|
71
48
|
regex: RegExp;
|
|
72
49
|
paramNames: string[];
|
|
@@ -355,7 +332,7 @@ function mergeReqCtxStub(
|
|
|
355
332
|
* - `ctx.headers` available before and after `await next()`
|
|
356
333
|
* - `ctx.header()` shorthand for setting a single header
|
|
357
334
|
* - Forgiving: if middleware doesn't return, uses the downstream response
|
|
358
|
-
* - Short-circuit: return Response to stop chain
|
|
335
|
+
* - Short-circuit: return OR throw a Response to stop chain
|
|
359
336
|
* - Error catching: try/catch around `next()` works
|
|
360
337
|
*/
|
|
361
338
|
export async function executeMiddleware<TEnv>(
|
|
@@ -490,7 +467,7 @@ export async function executeMiddleware<TEnv>(
|
|
|
490
467
|
|
|
491
468
|
// Explicit return takes precedence (middleware short-circuit).
|
|
492
469
|
// Merge stub headers (from ctx.header before this point) and
|
|
493
|
-
// RequestContext stub headers (from
|
|
470
|
+
// RequestContext stub headers (from cookies().set()) into the
|
|
494
471
|
// returned Response so they are not lost.
|
|
495
472
|
if (result instanceof Response) {
|
|
496
473
|
if (isWebSocketUpgradeResponse(result)) {
|
|
@@ -564,7 +541,7 @@ export async function executeMiddleware<TEnv>(
|
|
|
564
541
|
*
|
|
565
542
|
* Intercepts use a shared stubResponse from the request context. This function:
|
|
566
543
|
* - Runs middleware in sequence with a simple next() chain
|
|
567
|
-
* - Returns Response if any middleware short-circuits (returns Response or redirects BEFORE next())
|
|
544
|
+
* - Returns Response if any middleware short-circuits (returns OR throws a Response, or redirects, BEFORE next())
|
|
568
545
|
* - Returns null if all middleware calls next() - headers set after next() remain on stubResponse
|
|
569
546
|
*
|
|
570
547
|
* @param middlewares - Array of middleware functions
|
|
@@ -1,58 +1,26 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Navigation Snapshot
|
|
3
|
-
*
|
|
4
|
-
* Pure data type representing the navigation-specific state for partial requests.
|
|
5
|
-
* Consolidates the header parsing, previous-route matching, intercept-context
|
|
6
|
-
* detection, and segment ID filtering that previously lived inline in
|
|
7
|
-
* createMatchContextForPartial (match-api.ts).
|
|
8
|
-
*
|
|
9
|
-
* resolveNavigation() is the factory: given a request + URL + current route key,
|
|
10
|
-
* it returns a NavigationSnapshot (or null if no previous URL).
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
1
|
import type { RouteMatchResult } from "./pattern-matching.js";
|
|
14
2
|
|
|
15
|
-
/**
|
|
16
|
-
* Snapshot of navigation state for a partial (navigation/action) request.
|
|
17
|
-
*
|
|
18
|
-
* Contains the "where are we coming from?" data: previous route, intercept
|
|
19
|
-
* source, client segment state, and derived flags.
|
|
20
|
-
*/
|
|
21
3
|
export interface NavigationSnapshot {
|
|
22
|
-
/** Previous page URL (from X-RSC-Router-Client-Path or Referer) */
|
|
23
4
|
prevUrl: URL;
|
|
24
|
-
/** Params from the previous route match */
|
|
25
5
|
prevParams: Record<string, string>;
|
|
26
|
-
/** Previous route match result (null if prev URL doesn't match any route) */
|
|
27
6
|
prevMatch: RouteMatchResult | null;
|
|
28
7
|
|
|
29
|
-
/** URL used as intercept context source */
|
|
30
8
|
interceptContextUrl: URL;
|
|
31
|
-
/** Route match for the intercept context URL */
|
|
32
9
|
interceptContextMatch: RouteMatchResult | null;
|
|
33
10
|
|
|
34
|
-
/** Raw segment IDs the client currently has */
|
|
35
11
|
clientSegmentIds: string[];
|
|
36
|
-
/** Set version for O(1) lookup */
|
|
37
12
|
clientSegmentSet: Set<string>;
|
|
38
|
-
/** Segment IDs filtered to remove parallel (.@) and loader (D\d+.) entries */
|
|
39
13
|
filteredSegmentIds: string[];
|
|
40
14
|
|
|
41
|
-
/** Whether client considers its cache stale */
|
|
42
15
|
stale: boolean;
|
|
43
16
|
|
|
44
|
-
/** Whether the intercept context route is the same as the current route */
|
|
45
17
|
isSameRouteNavigation: boolean;
|
|
46
18
|
|
|
47
|
-
/** Effective "from" URL (intercept source URL when present, else prevUrl) */
|
|
48
19
|
effectiveFromUrl: URL;
|
|
49
|
-
/** Effective "from" match (intercept source match when present, else prevMatch) */
|
|
50
20
|
effectiveFromMatch: RouteMatchResult | null;
|
|
51
21
|
|
|
52
|
-
/** Whether an intercept source header was present */
|
|
53
22
|
hasInterceptSource: boolean;
|
|
54
23
|
|
|
55
|
-
/** Whether an HMR request header was present */
|
|
56
24
|
isHmr: boolean;
|
|
57
25
|
}
|
|
58
26
|
|
|
@@ -60,23 +28,12 @@ export interface ResolveNavigationDeps {
|
|
|
60
28
|
findMatch: (pathname: string) => RouteMatchResult | null;
|
|
61
29
|
}
|
|
62
30
|
|
|
63
|
-
/**
|
|
64
|
-
* Resolve navigation state from a partial request.
|
|
65
|
-
*
|
|
66
|
-
* Returns null if no previous URL is available (required for partial navigation).
|
|
67
|
-
*
|
|
68
|
-
* @param request - The incoming HTTP request
|
|
69
|
-
* @param url - Parsed URL of the request
|
|
70
|
-
* @param currentRouteKey - Route key of the current (target) route match
|
|
71
|
-
* @param deps - Dependencies (findMatch)
|
|
72
|
-
*/
|
|
73
31
|
export function resolveNavigation(
|
|
74
32
|
request: Request,
|
|
75
33
|
url: URL,
|
|
76
34
|
currentRouteKey: string,
|
|
77
35
|
deps: ResolveNavigationDeps,
|
|
78
36
|
): NavigationSnapshot | null {
|
|
79
|
-
// Parse client state from RSC request params/headers
|
|
80
37
|
const clientSegmentIds =
|
|
81
38
|
url.searchParams.get("_rsc_segments")?.split(",").filter(Boolean) || [];
|
|
82
39
|
const stale = url.searchParams.get("_rsc_stale") === "true";
|
|
@@ -92,7 +49,6 @@ export function resolveNavigation(
|
|
|
92
49
|
return null;
|
|
93
50
|
}
|
|
94
51
|
|
|
95
|
-
// Parse previous URL
|
|
96
52
|
let prevUrl: URL;
|
|
97
53
|
try {
|
|
98
54
|
prevUrl = new URL(previousUrl, url.origin);
|
|
@@ -100,7 +56,6 @@ export function resolveNavigation(
|
|
|
100
56
|
return null;
|
|
101
57
|
}
|
|
102
58
|
|
|
103
|
-
// Parse intercept context URL
|
|
104
59
|
let interceptContextUrl: URL;
|
|
105
60
|
try {
|
|
106
61
|
interceptContextUrl = interceptSourceUrl
|
|
@@ -110,14 +65,12 @@ export function resolveNavigation(
|
|
|
110
65
|
interceptContextUrl = prevUrl;
|
|
111
66
|
}
|
|
112
67
|
|
|
113
|
-
// Match previous and intercept context routes
|
|
114
68
|
const prevMatch = deps.findMatch(prevUrl.pathname);
|
|
115
69
|
const prevParams = prevMatch?.params || {};
|
|
116
70
|
const interceptContextMatch = interceptSourceUrl
|
|
117
71
|
? deps.findMatch(interceptContextUrl.pathname)
|
|
118
72
|
: prevMatch;
|
|
119
73
|
|
|
120
|
-
// Derived state
|
|
121
74
|
const isSameRouteNavigation = !!(
|
|
122
75
|
interceptContextMatch && interceptContextMatch.routeKey === currentRouteKey
|
|
123
76
|
);
|
|
@@ -128,7 +81,6 @@ export function resolveNavigation(
|
|
|
128
81
|
? interceptContextMatch
|
|
129
82
|
: prevMatch;
|
|
130
83
|
|
|
131
|
-
// Filter segment IDs: remove parallel (.@) and loader (D\d+.) entries
|
|
132
84
|
const filteredSegmentIds = clientSegmentIds.filter((id) => {
|
|
133
85
|
if (id.includes(".@")) return false;
|
|
134
86
|
if (/D\d+\./.test(id)) return false;
|
|
@@ -155,9 +107,6 @@ export function resolveNavigation(
|
|
|
155
107
|
};
|
|
156
108
|
}
|
|
157
109
|
|
|
158
|
-
/**
|
|
159
|
-
* Test helper: create a NavigationSnapshot with sensible defaults and overrides.
|
|
160
|
-
*/
|
|
161
110
|
export function createNavigationSnapshot(
|
|
162
111
|
overrides?: Partial<NavigationSnapshot>,
|
|
163
112
|
): NavigationSnapshot {
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared route-param comparison helpers.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Shallow equality for two route-param records. Same-reference is a fast path;
|
|
7
|
+
* otherwise compares key count then each value.
|
|
8
|
+
*/
|
|
9
|
+
export function paramsEqual(
|
|
10
|
+
a: Record<string, string>,
|
|
11
|
+
b: Record<string, string>,
|
|
12
|
+
): boolean {
|
|
13
|
+
if (a === b) return true;
|
|
14
|
+
|
|
15
|
+
const keysA = Object.keys(a);
|
|
16
|
+
if (keysA.length !== Object.keys(b).length) return false;
|
|
17
|
+
|
|
18
|
+
for (const key of keysA) {
|
|
19
|
+
if (a[key] !== b[key]) return false;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return true;
|
|
23
|
+
}
|