@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
|
@@ -14,7 +14,6 @@ import { traverseBack } from "./pattern-matching.js";
|
|
|
14
14
|
import type { RouteMatchResult } from "./pattern-matching.js";
|
|
15
15
|
import type { RouteSnapshot } from "./route-snapshot.js";
|
|
16
16
|
|
|
17
|
-
// Response type -> MIME type used for Accept header matching
|
|
18
17
|
export const RESPONSE_TYPE_MIME: Record<string, string> = {
|
|
19
18
|
json: "application/json",
|
|
20
19
|
text: "text/plain",
|
|
@@ -23,7 +22,6 @@ export const RESPONSE_TYPE_MIME: Record<string, string> = {
|
|
|
23
22
|
md: "text/markdown",
|
|
24
23
|
};
|
|
25
24
|
|
|
26
|
-
// Reverse lookup: MIME type -> response type tag (e.g. "text/html" -> "html")
|
|
27
25
|
export const MIME_RESPONSE_TYPE: Record<string, string> = Object.fromEntries(
|
|
28
26
|
Object.entries(RESPONSE_TYPE_MIME).map(([tag, mime]) => [mime, tag]),
|
|
29
27
|
);
|
|
@@ -71,12 +69,10 @@ export function parseAcceptTypes(accept: string): AcceptEntry[] {
|
|
|
71
69
|
}
|
|
72
70
|
entries.push({ mime, q, order: i });
|
|
73
71
|
}
|
|
74
|
-
// Sort: highest q first, then lowest client order first (stable)
|
|
75
72
|
entries.sort((a, b) => b.q - a.q || a.order - b.order);
|
|
76
73
|
return entries;
|
|
77
74
|
}
|
|
78
75
|
|
|
79
|
-
// Sentinel response type for RSC routes in negotiation candidates
|
|
80
76
|
export const RSC_RESPONSE_TYPE = "__rsc__";
|
|
81
77
|
|
|
82
78
|
/**
|
|
@@ -89,7 +85,6 @@ export function pickNegotiateVariant(
|
|
|
89
85
|
acceptEntries: AcceptEntry[],
|
|
90
86
|
candidates: Array<{ routeKey: string; responseType: string }>,
|
|
91
87
|
): { routeKey: string; responseType: string } {
|
|
92
|
-
// Build a MIME -> candidate lookup for O(1) matching
|
|
93
88
|
const byCandidateMime = new Map<
|
|
94
89
|
string,
|
|
95
90
|
{ routeKey: string; responseType: string }
|
|
@@ -106,9 +101,7 @@ export function pickNegotiateVariant(
|
|
|
106
101
|
|
|
107
102
|
for (const entry of acceptEntries) {
|
|
108
103
|
if (entry.q === 0) continue;
|
|
109
|
-
// Wildcard matches first candidate
|
|
110
104
|
if (entry.mime === "*/*") return candidates[0]!;
|
|
111
|
-
// Type wildcard (e.g. "text/*") -- match first candidate with that type
|
|
112
105
|
if (entry.mime.endsWith("/*")) {
|
|
113
106
|
const typePrefix = entry.mime.slice(0, entry.mime.indexOf("/"));
|
|
114
107
|
for (const [mime, candidate] of byCandidateMime) {
|
|
@@ -119,7 +112,6 @@ export function pickNegotiateVariant(
|
|
|
119
112
|
const match = byCandidateMime.get(entry.mime);
|
|
120
113
|
if (match) return match;
|
|
121
114
|
}
|
|
122
|
-
// No match -- use first candidate as default
|
|
123
115
|
return candidates[0]!;
|
|
124
116
|
}
|
|
125
117
|
|
|
@@ -173,7 +165,6 @@ export async function negotiateRoute(
|
|
|
173
165
|
|
|
174
166
|
const acceptEntries = parseAcceptTypes(request.headers.get("accept") || "");
|
|
175
167
|
|
|
176
|
-
// Build candidate list preserving definition order.
|
|
177
168
|
const variants = matched.negotiateVariants;
|
|
178
169
|
let candidates: Array<{ routeKey: string; responseType: string }>;
|
|
179
170
|
if (responseType) {
|
|
@@ -190,12 +181,10 @@ export async function negotiateRoute(
|
|
|
190
181
|
|
|
191
182
|
const variant = pickNegotiateVariant(acceptEntries, candidates);
|
|
192
183
|
|
|
193
|
-
// RSC won negotiation
|
|
194
184
|
if (variant.responseType === RSC_RESPONSE_TYPE) {
|
|
195
185
|
return null;
|
|
196
186
|
}
|
|
197
187
|
|
|
198
|
-
// Primary response-type won — use existing manifest entry and middleware
|
|
199
188
|
if (responseType && variant.routeKey === matched.routeKey) {
|
|
200
189
|
return {
|
|
201
190
|
responseType,
|
|
@@ -205,8 +194,6 @@ export async function negotiateRoute(
|
|
|
205
194
|
negotiated: true,
|
|
206
195
|
};
|
|
207
196
|
}
|
|
208
|
-
|
|
209
|
-
// Different variant won — load its manifest entry
|
|
210
197
|
const negotiateEntry = await loadManifest(
|
|
211
198
|
matched.entry,
|
|
212
199
|
variant.routeKey,
|
|
@@ -117,16 +117,10 @@ export function findNearestErrorBoundary(
|
|
|
117
117
|
let current: EntryData | null = entry;
|
|
118
118
|
|
|
119
119
|
while (current) {
|
|
120
|
-
// Check if this entry has error boundaries defined
|
|
121
120
|
if (current.errorBoundary && current.errorBoundary.length > 0) {
|
|
122
|
-
// Return the last error boundary (most recently defined takes precedence)
|
|
123
121
|
return current.errorBoundary[current.errorBoundary.length - 1];
|
|
124
122
|
}
|
|
125
123
|
|
|
126
|
-
// Check orphan layouts for error boundaries
|
|
127
|
-
// Orphan layouts are siblings that render alongside the main route chain
|
|
128
|
-
// They can define error boundaries that catch errors from routes in the same route group
|
|
129
|
-
// Check from first to last (first sibling takes precedence as the "outer" wrapper)
|
|
130
124
|
if (current.layout && current.layout.length > 0) {
|
|
131
125
|
for (const orphan of current.layout) {
|
|
132
126
|
if (orphan.errorBoundary && orphan.errorBoundary.length > 0) {
|
|
@@ -153,11 +147,21 @@ export function findNearestNotFoundBoundary(
|
|
|
153
147
|
let current: EntryData | null = entry;
|
|
154
148
|
|
|
155
149
|
while (current) {
|
|
156
|
-
// Check if this entry has notFound boundaries defined
|
|
157
150
|
if (current.notFoundBoundary && current.notFoundBoundary.length > 0) {
|
|
158
|
-
// Return the last notFound boundary (most recently defined takes precedence)
|
|
159
151
|
return current.notFoundBoundary[current.notFoundBoundary.length - 1];
|
|
160
152
|
}
|
|
153
|
+
|
|
154
|
+
// Check orphan layouts mirroring findNearestErrorBoundary: notFoundBoundary
|
|
155
|
+
// attaches identically (onto parent.notFoundBoundary), and an orphan layout
|
|
156
|
+
// (parent=null) is reachable only via this scan. First sibling is "outer".
|
|
157
|
+
if (current.layout && current.layout.length > 0) {
|
|
158
|
+
for (const orphan of current.layout) {
|
|
159
|
+
if (orphan.notFoundBoundary && orphan.notFoundBoundary.length > 0) {
|
|
160
|
+
return orphan.notFoundBoundary[orphan.notFoundBoundary.length - 1];
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
161
165
|
current = current.parent;
|
|
162
166
|
}
|
|
163
167
|
|
|
@@ -207,22 +211,17 @@ export function createErrorSegment(
|
|
|
207
211
|
entry: EntryData,
|
|
208
212
|
params: Record<string, string>,
|
|
209
213
|
): ResolvedSegment {
|
|
210
|
-
// Determine the component to render
|
|
211
214
|
let component: ReactNode;
|
|
212
215
|
|
|
213
216
|
if (typeof fallback === "function") {
|
|
214
|
-
// ErrorBoundaryHandler - call with error info
|
|
215
217
|
const props: ErrorBoundaryFallbackProps = {
|
|
216
218
|
error: errorInfo,
|
|
217
219
|
};
|
|
218
220
|
component = fallback(props);
|
|
219
221
|
} else {
|
|
220
|
-
// Static ReactNode fallback
|
|
221
222
|
component = fallback;
|
|
222
223
|
}
|
|
223
224
|
|
|
224
|
-
// Error segment uses the same ID as the layout that has the error boundary
|
|
225
|
-
// The error boundary content replaces the layout's outlet content
|
|
226
225
|
return {
|
|
227
226
|
id: entry.shortCode,
|
|
228
227
|
namespace: entry.id,
|
|
@@ -261,17 +260,14 @@ export function createNotFoundSegment(
|
|
|
261
260
|
entry: EntryData,
|
|
262
261
|
params: Record<string, string>,
|
|
263
262
|
): ResolvedSegment {
|
|
264
|
-
// Determine the component to render
|
|
265
263
|
let component: ReactNode;
|
|
266
264
|
|
|
267
265
|
if (typeof fallback === "function") {
|
|
268
|
-
// NotFoundBoundaryHandler - call with props
|
|
269
266
|
const props: NotFoundBoundaryFallbackProps = {
|
|
270
267
|
notFound: notFoundInfo,
|
|
271
268
|
};
|
|
272
269
|
component = fallback(props);
|
|
273
270
|
} else {
|
|
274
|
-
// Static ReactNode fallback
|
|
275
271
|
component = fallback;
|
|
276
272
|
}
|
|
277
273
|
|
package/src/router/find-match.ts
CHANGED
|
@@ -8,13 +8,10 @@ import {
|
|
|
8
8
|
import type { MetricsStore } from "../server/context";
|
|
9
9
|
import type { RouteEntry } from "../types";
|
|
10
10
|
|
|
11
|
-
//
|
|
12
|
-
//
|
|
13
|
-
// object
|
|
14
|
-
//
|
|
15
|
-
// that mutates ctx.params would corrupt the cached entry for later requests.
|
|
16
|
-
// `entry` and the flags are intentionally shared by reference: they are
|
|
17
|
-
// read-only, and entry identity is compared in match-api (prevMatch.entry).
|
|
11
|
+
// The single-entry cache is module-lifetime, keyed only on pathname, so the same
|
|
12
|
+
// result object is handed to every same-pathname request. ctx.params aliases
|
|
13
|
+
// this object, so handlers mutating it would corrupt the cache for later requests.
|
|
14
|
+
// Clone params; entry/flags are read-only and shared safely.
|
|
18
15
|
function cloneMatchResult<TEnv>(
|
|
19
16
|
r: RouteMatchResult<TEnv> | null,
|
|
20
17
|
): RouteMatchResult<TEnv> | null {
|
|
@@ -40,21 +37,14 @@ export function createFindMatch<TEnv = any>(
|
|
|
40
37
|
let lastFindMatchPathname: string | null = null;
|
|
41
38
|
let lastFindMatchResult: RouteMatchResult<TEnv> | null = null;
|
|
42
39
|
|
|
43
|
-
// Wrapper for findMatch that uses routesEntries
|
|
44
|
-
// Handles lazy evaluation by evaluating lazy entries on first match.
|
|
45
|
-
// Phase 1: try O(path_length) trie match.
|
|
46
|
-
// Phase 2: fall back to regex iteration.
|
|
47
40
|
return function findMatch(
|
|
48
41
|
pathname: string,
|
|
49
42
|
ms?: MetricsStore,
|
|
50
43
|
): RouteMatchResult<TEnv> | null {
|
|
51
|
-
// Return cached result if same pathname (avoids double-match per request).
|
|
52
|
-
// Clone so a caller mutating ctx.params cannot corrupt the shared cache.
|
|
53
44
|
if (lastFindMatchPathname === pathname) {
|
|
54
45
|
return cloneMatchResult(lastFindMatchResult);
|
|
55
46
|
}
|
|
56
47
|
|
|
57
|
-
// Helper to push sub-metrics
|
|
58
48
|
const pushMetric = ms
|
|
59
49
|
? (label: string, start: number) => {
|
|
60
50
|
ms.metrics.push({
|
|
@@ -65,16 +55,7 @@ export function createFindMatch<TEnv = any>(
|
|
|
65
55
|
}
|
|
66
56
|
: undefined;
|
|
67
57
|
|
|
68
|
-
// Phase 1: Try trie match (O(path_length))
|
|
69
|
-
// Only use the per-router trie. The global trie merges routes from ALL
|
|
70
|
-
// routers and must not be used — in multi-router setups (host routing)
|
|
71
|
-
// overlapping paths like "/" would match the wrong app's route.
|
|
72
58
|
const routeTrie = getRouterTrie(deps.routerId);
|
|
73
|
-
// Whether the trie produced a match for this pathname (independent of
|
|
74
|
-
// whether the owning RouteEntry was resolvable yet). Used to suppress the
|
|
75
|
-
// R3 dev warning below: if the trie DID match but we fell through to the
|
|
76
|
-
// regex fallback only because a lazy entry was not spliced in yet, that is
|
|
77
|
-
// not a trie gap.
|
|
78
59
|
let trieMatched = false;
|
|
79
60
|
if (routeTrie) {
|
|
80
61
|
const trieStart = performance.now();
|
|
@@ -104,12 +85,8 @@ export function createFindMatch<TEnv = any>(
|
|
|
104
85
|
}
|
|
105
86
|
}
|
|
106
87
|
|
|
107
|
-
// If no entry had the route in its routes map, use the first matching
|
|
108
|
-
// entry as fallback (handles main entry with inline routes not yet
|
|
109
|
-
// reflected in its routes object).
|
|
110
88
|
if (!entry) entry = fallbackEntry;
|
|
111
89
|
|
|
112
|
-
// If entry not found (nested include not yet discovered), evaluate parent
|
|
113
90
|
if (!entry) {
|
|
114
91
|
const parent = deps.routesEntries.find(
|
|
115
92
|
(e) =>
|
|
@@ -150,12 +127,9 @@ export function createFindMatch<TEnv = any>(
|
|
|
150
127
|
}
|
|
151
128
|
}
|
|
152
129
|
|
|
153
|
-
// Phase 2: Fall back to existing matching (regex iteration)
|
|
154
130
|
const regexStart = performance.now();
|
|
155
131
|
let result = findRouteMatch(pathname, deps.routesEntries);
|
|
156
132
|
|
|
157
|
-
// If we hit a lazy entry that needs evaluation, evaluate and retry.
|
|
158
|
-
// Cap iterations to prevent infinite loops from pathological nesting.
|
|
159
133
|
const MAX_LAZY_ITERATIONS = 100;
|
|
160
134
|
let iterations = 0;
|
|
161
135
|
while (isLazyEvaluationNeeded(result)) {
|
|
@@ -21,7 +21,10 @@ import { getRequestContext } from "../server/request-context.js";
|
|
|
21
21
|
import { executeInterceptMiddleware } from "./middleware.js";
|
|
22
22
|
import { createReverseFunction } from "./handler-context.js";
|
|
23
23
|
import { getGlobalRouteMap } from "../route-map-builder.js";
|
|
24
|
-
import {
|
|
24
|
+
import {
|
|
25
|
+
handleHandlerResult,
|
|
26
|
+
warnOnStreamedResponse,
|
|
27
|
+
} from "./segment-resolution.js";
|
|
25
28
|
import type { SegmentResolutionDeps } from "./types.js";
|
|
26
29
|
import { debugLog } from "./logging.js";
|
|
27
30
|
import { runInsideLoaderScope } from "../server/context.js";
|
|
@@ -228,6 +231,12 @@ export async function resolveInterceptEntry<TEnv>(
|
|
|
228
231
|
let loaderDataPromise: Promise<any[]> | any[] | undefined;
|
|
229
232
|
|
|
230
233
|
if (interceptEntry.loading && loaderPromises.length > 0) {
|
|
234
|
+
if (handlerResult instanceof Promise) {
|
|
235
|
+
warnOnStreamedResponse(
|
|
236
|
+
handlerResult,
|
|
237
|
+
`intercept ${interceptEntry.slotName}`,
|
|
238
|
+
);
|
|
239
|
+
}
|
|
231
240
|
component =
|
|
232
241
|
handlerResult instanceof Promise
|
|
233
242
|
? handlerResult
|
|
@@ -18,9 +18,6 @@ export interface LazyEvalDeps<TEnv = any> {
|
|
|
18
18
|
routerId?: string;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
// Detect lazy includes in handler result and create placeholder entries
|
|
22
|
-
// Lazy includes are IncludeItem with lazy: true and _lazyContext
|
|
23
|
-
// Moved to outer scope so it can be reused by evaluateLazyEntry for nested includes
|
|
24
21
|
export function findLazyIncludes<TEnv = any>(
|
|
25
22
|
items: AllUseItems[],
|
|
26
23
|
): Array<{
|
|
@@ -56,7 +53,6 @@ export function findLazyIncludes<TEnv = any>(
|
|
|
56
53
|
});
|
|
57
54
|
}
|
|
58
55
|
}
|
|
59
|
-
// Recursively check nested items (in layouts, etc.)
|
|
60
56
|
if ((item as any).uses && Array.isArray((item as any).uses)) {
|
|
61
57
|
lazyItems.push(...findLazyIncludes((item as any).uses));
|
|
62
58
|
}
|
|
@@ -78,19 +74,6 @@ export function evaluateLazyEntry<TEnv = any>(
|
|
|
78
74
|
return;
|
|
79
75
|
}
|
|
80
76
|
|
|
81
|
-
// Check for pre-computed routes from build-time data.
|
|
82
|
-
// Only leaf nodes (no nested includes) are precomputed, so entries with
|
|
83
|
-
// nested lazy includes fall through to the handler below.
|
|
84
|
-
//
|
|
85
|
-
// The load-bearing protection against two includes sharing a staticPrefix
|
|
86
|
-
// lives UPSTREAM in buildPrecomputedByPrefix (build/prefix-tree-utils): a
|
|
87
|
-
// shared staticPrefix is omitted from the map entirely, so currentPrecomputed
|
|
88
|
-
// never returns routes for it and the shortcut is skipped. The live-count
|
|
89
|
-
// check below is a secondary guard only — it is TIMING-BLIND (it counts
|
|
90
|
-
// routesEntries, which cannot see a nested sibling that has not been spliced
|
|
91
|
-
// in yet), so it must NOT be relied on alone. Kept as defense-in-depth for the
|
|
92
|
-
// all-siblings-live case (e.g. several include("/", ...) placeholders created
|
|
93
|
-
// up front).
|
|
94
77
|
const currentPrecomputed = deps.getPrecomputedByPrefix();
|
|
95
78
|
if (currentPrecomputed) {
|
|
96
79
|
const routes = currentPrecomputed.get(entry.staticPrefix);
|
|
@@ -110,33 +93,18 @@ export function evaluateLazyEntry<TEnv = any>(
|
|
|
110
93
|
}
|
|
111
94
|
}
|
|
112
95
|
|
|
113
|
-
// Mark as evaluated immediately to prevent concurrent evaluation.
|
|
114
|
-
// JS is single-threaded but handlers.handler() could theoretically yield,
|
|
115
|
-
// and the while-loop in findMatch retries after evaluation.
|
|
116
96
|
entry.lazyEvaluated = true;
|
|
117
97
|
|
|
118
98
|
const lazyPatterns = entry.lazyPatterns as UrlPatterns<TEnv>;
|
|
119
99
|
const lazyContext = entry.lazyContext;
|
|
120
100
|
|
|
121
|
-
// Create a new context for evaluating the lazy patterns.
|
|
122
|
-
// KNOWN REDUNDANCY (LP3, docs/internal/matching-and-lazy-discovery.md): this
|
|
123
|
-
// runs lazyPatterns.handler() purely to extract `patterns` (route name ->
|
|
124
|
-
// pattern) for matching, and DISCARDS the EntryData `manifest` it builds.
|
|
125
|
-
// loadManifest() then runs the SAME handler again on the first request to
|
|
126
|
-
// build the EntryData tree for rendering. Unifying the two runs is deferred
|
|
127
|
-
// (the two run in different contexts — see the LP3 todo in
|
|
128
|
-
// lazy-include-perf.test.ts). The precomputed-entries shortcut above avoids
|
|
129
|
-
// THIS run entirely for leaf includes.
|
|
130
101
|
const manifest = new Map<string, EntryData>();
|
|
131
102
|
const patterns = new Map<string, string>();
|
|
132
103
|
const patternsByPrefix = new Map<string, Map<string, string>>();
|
|
133
104
|
const trailingSlashMap = new Map<string, TrailingSlashMode>();
|
|
134
105
|
|
|
135
|
-
// Capture the handler result to detect nested lazy includes
|
|
136
106
|
let handlerResult: AllUseItems[] = [];
|
|
137
107
|
|
|
138
|
-
// Merge captured counters from include() to maintain consistent
|
|
139
|
-
// shortCode indices with sibling entries from pattern extraction
|
|
140
108
|
const lazyCounters: Record<string, number> = {};
|
|
141
109
|
if (lazyContext?.counters) {
|
|
142
110
|
for (const [key, value] of Object.entries(lazyContext.counters)) {
|
|
@@ -158,11 +126,6 @@ export function evaluateLazyEntry<TEnv = any>(
|
|
|
158
126
|
includeScope: lazyContext?.includeScope,
|
|
159
127
|
},
|
|
160
128
|
() => {
|
|
161
|
-
// Run the lazy patterns handler with the original context prefixes.
|
|
162
|
-
// The prefix comes from the IncludeItem stored in lazyPatterns. Use the
|
|
163
|
-
// slash-collapsing join so a trailing-slash parent prefix does not bake a
|
|
164
|
-
// double slash into the registered route patterns (entry.routes,
|
|
165
|
-
// reverse(), EntryData.pattern, mountPath) when the handler runs.
|
|
166
129
|
const includePrefix = (entry as any)._lazyPrefix || "";
|
|
167
130
|
const fullPrefix = joinPrefix(lazyContext?.urlPrefix, includePrefix);
|
|
168
131
|
|
|
@@ -176,11 +139,9 @@ export function evaluateLazyEntry<TEnv = any>(
|
|
|
176
139
|
},
|
|
177
140
|
);
|
|
178
141
|
|
|
179
|
-
// Populate the entry's routes from the patterns
|
|
180
142
|
const routesObject: Record<string, string> = {};
|
|
181
143
|
for (const [name, pattern] of patterns.entries()) {
|
|
182
144
|
routesObject[name] = pattern;
|
|
183
|
-
// Also add to merged route map for reverse() support
|
|
184
145
|
const existingPattern = deps.mergedRouteMap[name];
|
|
185
146
|
if (existingPattern !== undefined && existingPattern !== pattern) {
|
|
186
147
|
console.warn(
|
|
@@ -191,24 +152,14 @@ export function evaluateLazyEntry<TEnv = any>(
|
|
|
191
152
|
deps.mergedRouteMap[name] = pattern;
|
|
192
153
|
}
|
|
193
154
|
|
|
194
|
-
// Update the entry in-place
|
|
195
155
|
entry.routes = routesObject as ResolvedRouteMap<any>;
|
|
196
156
|
|
|
197
|
-
// Note: Do NOT clear lazyPatterns/lazyContext here.
|
|
198
|
-
// loadManifest() needs them on every request to re-run the handler
|
|
199
|
-
// in the correct AsyncLocalStorage context (Store.manifest).
|
|
200
|
-
|
|
201
|
-
// Update trailing slash config if available
|
|
202
157
|
if (trailingSlashMap.size > 0) {
|
|
203
158
|
entry.trailingSlash = Object.fromEntries(trailingSlashMap);
|
|
204
159
|
}
|
|
205
160
|
|
|
206
|
-
// Detect nested lazy includes and register them as new entries
|
|
207
161
|
const nestedLazyIncludes = findLazyIncludes(handlerResult);
|
|
208
162
|
for (const lazyInclude of nestedLazyIncludes) {
|
|
209
|
-
// Compute the full URL prefix (combining parent prefix if any). Use the
|
|
210
|
-
// slash-collapsing join so a trailing-slash parent prefix does not produce
|
|
211
|
-
// a double-slash staticPrefix the trie's sp can never match.
|
|
212
163
|
const fullPrefix = joinPrefix(
|
|
213
164
|
lazyInclude.context.urlPrefix,
|
|
214
165
|
lazyInclude.prefix,
|
|
@@ -217,23 +168,17 @@ export function evaluateLazyEntry<TEnv = any>(
|
|
|
217
168
|
const nestedEntry: RouteEntry<TEnv> & { _lazyPrefix?: string } = {
|
|
218
169
|
prefix: "",
|
|
219
170
|
staticPrefix: extractStaticPrefix(fullPrefix),
|
|
220
|
-
routes: {} as ResolvedRouteMap<any>,
|
|
171
|
+
routes: {} as ResolvedRouteMap<any>,
|
|
221
172
|
trailingSlash: entry.trailingSlash,
|
|
222
173
|
handler: (lazyInclude.patterns as UrlPatterns<TEnv>).handler,
|
|
223
174
|
mountIndex: deps.nextMountIndex(),
|
|
224
175
|
routerId: deps.routerId,
|
|
225
|
-
// Lazy evaluation fields
|
|
226
176
|
lazy: true,
|
|
227
177
|
lazyPatterns: lazyInclude.patterns,
|
|
228
178
|
lazyContext: lazyInclude.context,
|
|
229
179
|
lazyEvaluated: false,
|
|
230
|
-
// Store the include prefix for evaluation
|
|
231
180
|
_lazyPrefix: lazyInclude.prefix,
|
|
232
181
|
};
|
|
233
|
-
// Insert nested lazy entry before any entry whose staticPrefix is a
|
|
234
|
-
// prefix of (but shorter than) this lazy entry's staticPrefix.
|
|
235
|
-
// This ensures more specific lazy includes are matched before
|
|
236
|
-
// less specific eager entries (e.g., "/href/nested" before "/href/:id").
|
|
237
182
|
const nestedPrefix = nestedEntry.staticPrefix;
|
|
238
183
|
let insertIndex = deps.routesEntries.length;
|
|
239
184
|
if (nestedPrefix) {
|
|
@@ -251,6 +196,5 @@ export function evaluateLazyEntry<TEnv = any>(
|
|
|
251
196
|
deps.routesEntries.splice(insertIndex, 0, nestedEntry);
|
|
252
197
|
}
|
|
253
198
|
|
|
254
|
-
// Re-register route map for runtime reverse() usage
|
|
255
199
|
registerRouteMap(deps.mergedRouteMap);
|
|
256
200
|
}
|
|
@@ -19,7 +19,6 @@ import type {
|
|
|
19
19
|
ErrorBoundaryFallbackProps,
|
|
20
20
|
ErrorInfo,
|
|
21
21
|
} from "../types";
|
|
22
|
-
import type { LoaderRevalidationResult, ActionContext } from "./types";
|
|
23
22
|
import { isHandle, collectHandleData, type Handle } from "../handle.js";
|
|
24
23
|
import { buildHandleSnapshot } from "../server/handle-store.js";
|
|
25
24
|
import { getFetchableLoader } from "../server/fetchable-loader-store.js";
|
|
@@ -71,7 +70,9 @@ export function wrapLoaderWithErrorHandling<T>(
|
|
|
71
70
|
) => ErrorInfo,
|
|
72
71
|
onError?: LoaderErrorCallback,
|
|
73
72
|
): Promise<LoaderDataResult<T>> {
|
|
74
|
-
// Extract
|
|
73
|
+
// Extract the trailing token from segmentId (format: "<shortCode>D<i>.<loaderId>").
|
|
74
|
+
// The token is the loader's $$id (hash#export in prod, pathfrag#export in dev),
|
|
75
|
+
// not a clean display name.
|
|
75
76
|
const loaderName = segmentId.split(".").pop() || "unknown";
|
|
76
77
|
|
|
77
78
|
return Promise.resolve(promise)
|
package/src/router/logging.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
2
2
|
import { INTERNAL_RANGO_DEBUG } from "../internal-debug.js";
|
|
3
3
|
|
|
4
|
-
// -- Revalidation trace types --
|
|
5
|
-
|
|
6
4
|
export interface RevalidationTraceEntry {
|
|
7
5
|
segmentId: string;
|
|
8
6
|
segmentType: string;
|
|
@@ -36,8 +34,6 @@ export interface RevalidationTrace {
|
|
|
36
34
|
entries: RevalidationTraceEntry[];
|
|
37
35
|
}
|
|
38
36
|
|
|
39
|
-
// -- Log context --
|
|
40
|
-
|
|
41
37
|
interface RouterLogContext {
|
|
42
38
|
requestId: string;
|
|
43
39
|
transactionId: string;
|
|
@@ -195,8 +191,6 @@ export function debugWarn(
|
|
|
195
191
|
console.warn(`${prefix} ${message}`);
|
|
196
192
|
}
|
|
197
193
|
|
|
198
|
-
// -- Revalidation trace helpers --
|
|
199
|
-
|
|
200
194
|
export function isTraceActive(): boolean {
|
|
201
195
|
if (!INTERNAL_RANGO_DEBUG) return false;
|
|
202
196
|
const ctx = routerLogContext.getStore();
|
package/src/router/manifest.ts
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Router Manifest Loading
|
|
3
|
-
*
|
|
4
|
-
* Handles lazy loading and validation of route manifests.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
1
|
import { invariant, RouteNotFoundError } from "../errors";
|
|
8
2
|
import { createRouteHelpers } from "../route-definition";
|
|
9
3
|
import {
|
|
@@ -37,14 +31,6 @@ import { VERSION } from "@rangojs/router:version";
|
|
|
37
31
|
// When VERSION changes, this module re-evaluates and the cache is recreated empty.
|
|
38
32
|
const manifestModuleCache = new Map<string, Map<string, EntryData>>();
|
|
39
33
|
|
|
40
|
-
/**
|
|
41
|
-
* Load manifest from route entry with AsyncLocalStorage context
|
|
42
|
-
* Handles lazy imports, unwrapping, and validation
|
|
43
|
-
*
|
|
44
|
-
* Results are cached at module level after first execution. Subsequent calls
|
|
45
|
-
* for the same (routerId, mountIndex, routeKey, isSSR) within the same isolate
|
|
46
|
-
* return cached data without re-executing the DSL handler.
|
|
47
|
-
*/
|
|
48
34
|
/**
|
|
49
35
|
* Clear the module-level manifest cache.
|
|
50
36
|
* Called on HMR to ensure stale handler references are discarded.
|
|
@@ -98,20 +84,15 @@ export async function loadManifest(
|
|
|
98
84
|
const storeSetupStart = performance.now();
|
|
99
85
|
const Store = getContext().getOrCreateStore(routeKey);
|
|
100
86
|
|
|
101
|
-
// Set mount index in store for unique shortCode prefixes
|
|
102
87
|
Store.mountIndex = mountIndex;
|
|
103
|
-
|
|
104
|
-
// Set isSSR flag so loading() can check if we're in SSR
|
|
105
88
|
Store.isSSR = isSSR;
|
|
106
89
|
|
|
107
|
-
// Attach metrics store to context if provided
|
|
108
90
|
if (metricsStore) {
|
|
109
91
|
Store.metrics = metricsStore;
|
|
110
92
|
}
|
|
111
93
|
|
|
112
94
|
pushMetric?.("manifest:store-setup", storeSetupStart);
|
|
113
95
|
|
|
114
|
-
// Clear manifest before rebuilding to prevent stale entry mutations
|
|
115
96
|
const clearStart = performance.now();
|
|
116
97
|
Store.manifest.clear();
|
|
117
98
|
pushMetric?.("manifest:clear", clearStart);
|
|
@@ -199,20 +180,16 @@ export async function loadManifest(
|
|
|
199
180
|
return lazyPatterns.handler();
|
|
200
181
|
}
|
|
201
182
|
|
|
202
|
-
// Wrap handler execution in root layout so routes get correct parent
|
|
203
|
-
// This ensures all routes are registered with the layout as their parent
|
|
204
183
|
let promiseResult: Promise<any> | null = null;
|
|
205
184
|
const wrappedItems = helpers.layout(MapRootLayout, () => {
|
|
206
185
|
const result = entry.handler();
|
|
207
186
|
if (result instanceof Promise) {
|
|
208
|
-
// Lazy handler detected - capture promise for async handling
|
|
209
187
|
promiseResult = result;
|
|
210
|
-
return [];
|
|
188
|
+
return [];
|
|
211
189
|
}
|
|
212
190
|
return result;
|
|
213
191
|
});
|
|
214
192
|
|
|
215
|
-
// Handle lazy (Promise-based) handlers
|
|
216
193
|
if (promiseResult !== null) {
|
|
217
194
|
const load = await (promiseResult as Promise<any>);
|
|
218
195
|
if (
|
|
@@ -246,7 +223,6 @@ export async function loadManifest(
|
|
|
246
223
|
);
|
|
247
224
|
}
|
|
248
225
|
|
|
249
|
-
// Inline handler - routes were registered with correct parent inside layout
|
|
250
226
|
return [wrappedItems].flat(3);
|
|
251
227
|
},
|
|
252
228
|
);
|
package/src/router/match-api.ts
CHANGED
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Match API
|
|
3
|
-
*
|
|
4
|
-
* Extracted from createRouter closure. Contains match context creation functions
|
|
5
|
-
* and the matchError function for error boundary resolution.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
1
|
import { CacheScope, createCacheScope } from "../cache/cache-scope.js";
|
|
9
2
|
import { RouteNotFoundError } from "../errors";
|
|
10
3
|
import {
|
|
@@ -59,8 +52,6 @@ export async function createMatchContextForFull<TEnv>(
|
|
|
59
52
|
|
|
60
53
|
const metricsStore = deps.getMetricsStore();
|
|
61
54
|
|
|
62
|
-
// Full renders always resolve fresh with isSSR: true because loadManifest
|
|
63
|
-
// keys its cache on isSSR and stamps Store.isSSR for downstream behavior.
|
|
64
55
|
const result = await resolveRoute<TEnv>(pathname, {
|
|
65
56
|
findMatch: (p) => deps.findMatch(p, metricsStore),
|
|
66
57
|
metricsStore,
|
|
@@ -84,12 +75,10 @@ export async function createMatchContextForFull<TEnv>(
|
|
|
84
75
|
|
|
85
76
|
const { matched } = snapshot;
|
|
86
77
|
|
|
87
|
-
// Backward compat: downstream middleware reads matched.pt
|
|
88
78
|
if (snapshot.isPassthrough) {
|
|
89
79
|
matched.pt = true;
|
|
90
80
|
}
|
|
91
81
|
|
|
92
|
-
// Clean URL without internal _rsc* params for userland access
|
|
93
82
|
const cleanUrl = stripInternalParams(url);
|
|
94
83
|
|
|
95
84
|
const handlerContext = createHandlerContext(
|
|
@@ -231,7 +220,6 @@ export async function createMatchContextForPartial<TEnv>(
|
|
|
231
220
|
matched.pt = true;
|
|
232
221
|
}
|
|
233
222
|
|
|
234
|
-
// Navigation state (prev + intercept-source findMatch calls)
|
|
235
223
|
const nav = resolveNavigation(request, url, matched.routeKey, {
|
|
236
224
|
findMatch: deps.findMatch,
|
|
237
225
|
});
|
|
@@ -239,10 +227,6 @@ export async function createMatchContextForPartial<TEnv>(
|
|
|
239
227
|
return null;
|
|
240
228
|
}
|
|
241
229
|
|
|
242
|
-
// Push route-matching metric. On the fresh path this covers all findMatch
|
|
243
|
-
// calls (current + prev + intercept-source). On the reuse path, current-route
|
|
244
|
-
// findMatch was already timed during classification, so this only covers
|
|
245
|
-
// the nav lookups (prev + intercept-source).
|
|
246
230
|
if (metricsStore) {
|
|
247
231
|
const isReuse = !!classifiedRoute;
|
|
248
232
|
metricsStore.metrics.push({
|
|
@@ -259,7 +243,6 @@ export async function createMatchContextForPartial<TEnv>(
|
|
|
259
243
|
});
|
|
260
244
|
}
|
|
261
245
|
|
|
262
|
-
// Clean URL without internal _rsc* params for userland access
|
|
263
246
|
const cleanUrl = stripInternalParams(url);
|
|
264
247
|
|
|
265
248
|
const handlerContext = createHandlerContext(
|
|
@@ -304,9 +287,6 @@ export async function createMatchContextForPartial<TEnv>(
|
|
|
304
287
|
});
|
|
305
288
|
}
|
|
306
289
|
|
|
307
|
-
// Store previous route key on the request context for revalidation
|
|
308
|
-
// fromRouteName. Uses effectiveFromMatch so intercept-source navigations
|
|
309
|
-
// see the intercept origin route, not the plain previous URL route.
|
|
310
290
|
setRequestContextPrevRouteKey(nav.effectiveFromMatch?.routeKey);
|
|
311
291
|
|
|
312
292
|
const interceptSelectorContext: InterceptSelectorContext = {
|
|
@@ -242,25 +242,3 @@ export function createPipelineState(): MatchPipelineState {
|
|
|
242
242
|
slots: {},
|
|
243
243
|
};
|
|
244
244
|
}
|
|
245
|
-
|
|
246
|
-
/**
|
|
247
|
-
* Input parameters for createMatchContext
|
|
248
|
-
*/
|
|
249
|
-
export interface CreateMatchContextInput<TEnv = any> {
|
|
250
|
-
request: Request;
|
|
251
|
-
env: TEnv;
|
|
252
|
-
actionContext?: ActionContext;
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
/**
|
|
256
|
-
* Result from createMatchContext - either a context or null (fall back to full match)
|
|
257
|
-
*/
|
|
258
|
-
export type CreateMatchContextResult<TEnv = any> =
|
|
259
|
-
| { type: "context"; ctx: MatchContext<TEnv> }
|
|
260
|
-
| { type: "fallback"; reason: string }
|
|
261
|
-
| { type: "error"; error: Error };
|
|
262
|
-
|
|
263
|
-
// Note: createMatchContext() will be implemented in Step J10 when we wire everything together.
|
|
264
|
-
// It requires access to RouterContext (findMatch, loadManifest, etc.) which are closure
|
|
265
|
-
// functions from createRouter(). The implementation will live in router.ts initially
|
|
266
|
-
// and call getRouterContext() to access these dependencies.
|