@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
|
@@ -42,14 +42,6 @@ interface MatcherResult {
|
|
|
42
42
|
message: () => string;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
/**
|
|
46
|
-
* Matcher object for `expect.extend(flightMatchers)`.
|
|
47
|
-
*
|
|
48
|
-
* - `toMatchFlight(received, expected)` — `received` is a rendered Flight
|
|
49
|
-
* string; passes if its normalized form contains `expected`.
|
|
50
|
-
* - `toMatchFlightSnapshot(received)` — delegates to vitest's snapshot on the
|
|
51
|
-
* normalized Flight string.
|
|
52
|
-
*/
|
|
53
45
|
export const flightMatchers: {
|
|
54
46
|
toMatchFlight(received: string, expected: string): MatcherResult;
|
|
55
47
|
toMatchFlightSnapshot(received: string): MatcherResult;
|
|
@@ -78,12 +70,7 @@ export const flightMatchers: {
|
|
|
78
70
|
},
|
|
79
71
|
|
|
80
72
|
toMatchFlightSnapshot(received: string): MatcherResult {
|
|
81
|
-
// Delegate to vitest's snapshot engine on the normalized string. The
|
|
82
|
-
// snapshot is keyed by the current test file/title (vitest tracks this via
|
|
83
|
-
// the active test context), not by this call site, so delegating through a
|
|
84
|
-
// freshly imported `expect` is reliable.
|
|
85
73
|
expect(normalizeFlight(received)).toMatchSnapshot();
|
|
86
|
-
// toMatchSnapshot throws on mismatch; reaching here means it passed.
|
|
87
74
|
return {
|
|
88
75
|
pass: true,
|
|
89
76
|
message: () => "Flight snapshot matched.",
|
|
@@ -1,36 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
* normalizeFlight — scrub volatile bits from a Flight wire string so snapshots
|
|
3
|
-
* are stable across runs/machines.
|
|
4
|
-
*
|
|
5
|
-
* This is two regex replacements and NOTHING else. It is split out of flight.ts
|
|
6
|
-
* on purpose: flight.ts top-level imports the vendored react-server-dom
|
|
7
|
-
* serializer, which throws when imported outside the `react-server` export
|
|
8
|
-
* condition. The flight-matchers module (and a consumer's shared `setupFiles`
|
|
9
|
-
* that does `expect.extend(flightMatchers)`) must be importable under the PLAIN
|
|
10
|
-
* node condition, so the normalizer it needs cannot live next to that import.
|
|
11
|
-
* flight.ts re-exports normalizeFlight from here, so the public surface of the
|
|
12
|
-
* `@rangojs/router/testing/flight` entry is unchanged.
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
// Volatile leading reference row: `:N<timestamp>` (dev debug-info anchor).
|
|
1
|
+
// Volatile leading reference row: `:N<timestamp>` (dev only).
|
|
16
2
|
const REFERENCE_ROW_RE = /^:N[\d.]+\n/;
|
|
17
|
-
// Absolute file:// paths
|
|
18
|
-
//
|
|
19
|
-
// path is a quoted JSON string immediately followed by `",<line>,<col>`. The
|
|
20
|
-
// lookahead scopes the scrub to exactly that frame shape, leaving a legitimate
|
|
21
|
-
// `file://` href in RENDERED content (e.g. `{"href":"file:///x"}`) untouched.
|
|
3
|
+
// Absolute file:// paths in dev stack rows. Pattern matches frames
|
|
4
|
+
// `["Component","file:///path",<line>,<col>...]` and scrubs the path only.
|
|
22
5
|
const FILE_URL_RE = /file:\/\/[^"\\]+(?=",\d+,\d+)/g;
|
|
23
6
|
|
|
24
|
-
/**
|
|
25
|
-
* Scrub volatile bits from a Flight string so snapshots are stable across runs
|
|
26
|
-
* and machines:
|
|
27
|
-
* - the leading `:N<timestamp>` reference row (dev only),
|
|
28
|
-
* - absolute `file://...` paths inside dev stack rows.
|
|
29
|
-
*
|
|
30
|
-
* Under NODE_ENV=production these rows are already absent; normalize is a
|
|
31
|
-
* no-op safety net there. In dev mode it removes the machine/clock-specific
|
|
32
|
-
* noise while leaving the rendered tree intact.
|
|
33
|
-
*/
|
|
34
7
|
export function normalizeFlight(flight: string): string {
|
|
35
8
|
return flight
|
|
36
9
|
.replace(REFERENCE_ROW_RE, "")
|
package/src/testing/flight.ts
CHANGED
|
@@ -82,13 +82,6 @@ export interface RenderToFlightStringOptions {
|
|
|
82
82
|
|
|
83
83
|
const DEFAULT_URL = "http://localhost/";
|
|
84
84
|
|
|
85
|
-
/**
|
|
86
|
-
* Guard the pre-rename `{ url }` option (renamed to `{ request }`). A plain-JS
|
|
87
|
-
* consumer, or one whose object spread defeats the compile-time type error,
|
|
88
|
-
* would otherwise have `{ url }` SILENTLY ignored and render against
|
|
89
|
-
* http://localhost/. Throw a clear migration error instead. Cheap: a single
|
|
90
|
-
* `in` check on the already-built options object.
|
|
91
|
-
*/
|
|
92
85
|
export function assertNoLegacyUrlOption(opts: object, fnName: string): void {
|
|
93
86
|
if ("url" in opts) {
|
|
94
87
|
throw new Error(
|
|
@@ -100,11 +93,6 @@ export function assertNoLegacyUrlOption(opts: object, fnName: string): void {
|
|
|
100
93
|
}
|
|
101
94
|
}
|
|
102
95
|
|
|
103
|
-
/**
|
|
104
|
-
* Wrap a single element in the minimal ResolvedSegment + RscPayload shape that
|
|
105
|
-
* mirrors Rango's wire format, so the serialized output matches what a real
|
|
106
|
-
* route segment would emit.
|
|
107
|
-
*/
|
|
108
96
|
function wrapAsPayload(element: ReactNode, pathname: string): RscPayload {
|
|
109
97
|
const segment: ResolvedSegment = {
|
|
110
98
|
id: "test",
|
|
@@ -137,20 +125,9 @@ export async function renderToFlightString(
|
|
|
137
125
|
opts: RenderToFlightStringOptions = {},
|
|
138
126
|
): Promise<string> {
|
|
139
127
|
assertNoLegacyUrlOption(opts, "renderToFlightString");
|
|
140
|
-
// Server-only trees: empty client manifest. A client reference would emit an
|
|
141
|
-
// unresolvable `I` row here; use renderServerTree (flight-tree.ts) when the
|
|
142
|
-
// tree has client boundaries you want to inspect.
|
|
143
128
|
return serializeToFlightString(element, opts, {});
|
|
144
129
|
}
|
|
145
130
|
|
|
146
|
-
/**
|
|
147
|
-
* Shared serialize core: set up a request context, wrap the element as a Rango
|
|
148
|
-
* payload, and serialize it with the given client-reference manifest. Used by
|
|
149
|
-
* {@link renderToFlightString} (empty manifest) and renderServerTree (a manifest
|
|
150
|
-
* that resolves every registered client reference).
|
|
151
|
-
*
|
|
152
|
-
* Must run under the `react-server` export condition (see module header).
|
|
153
|
-
*/
|
|
154
131
|
export async function serializeToFlightString(
|
|
155
132
|
element: ReactNode,
|
|
156
133
|
opts: RenderToFlightStringOptions,
|
|
@@ -167,8 +144,6 @@ export async function serializeToFlightString(
|
|
|
167
144
|
env: opts.env ?? {},
|
|
168
145
|
request,
|
|
169
146
|
url,
|
|
170
|
-
// Seed vars so a server component reading ctx.get(MyVar) during render sees
|
|
171
|
-
// them — same seeding the handler-test primitives use.
|
|
172
147
|
variables: seedVariables({}, opts.vars),
|
|
173
148
|
});
|
|
174
149
|
|
|
@@ -178,28 +153,12 @@ export async function serializeToFlightString(
|
|
|
178
153
|
});
|
|
179
154
|
}
|
|
180
155
|
|
|
181
|
-
/**
|
|
182
|
-
* Serialize a node to a Flight string, ASSUMING a request context is already
|
|
183
|
-
* active (i.e. called inside `runWithRequestContext`). This is the core
|
|
184
|
-
* `renderHandler` reuses: it enters its own context, builds a HandlerContext,
|
|
185
|
-
* invokes the handler, then serializes the returned RSC in that SAME context (so
|
|
186
|
-
* cookies/headers/vars/handles the handler set are all on one context).
|
|
187
|
-
*
|
|
188
|
-
* Must run under the `react-server` export condition (see module header).
|
|
189
|
-
*/
|
|
190
156
|
export async function serializeNodeToFlight(
|
|
191
157
|
node: ReactNode,
|
|
192
158
|
clientManifest: unknown,
|
|
193
159
|
pathname: string,
|
|
194
160
|
): Promise<string> {
|
|
195
161
|
const payload = wrapAsPayload(node, pathname);
|
|
196
|
-
// Capture (do NOT rethrow) the first render error. The serializer calls
|
|
197
|
-
// onError from its own scheduled work; throwing there escapes as an unhandled
|
|
198
|
-
// rejection AND leaves the stream un-closed, so the drain below would hang
|
|
199
|
-
// until the test times out. Production's onError returns void (rsc-rendering.ts)
|
|
200
|
-
// so the stream completes with an error row. We mirror that — let the stream
|
|
201
|
-
// finish — then surface the error as a clean rejection after draining, so
|
|
202
|
-
// `await expect(...).rejects.toThrow()` works.
|
|
203
162
|
let renderError: unknown;
|
|
204
163
|
let didError = false;
|
|
205
164
|
const stream = RSDServer.renderToReadableStream(payload, clientManifest, {
|
|
@@ -210,18 +169,11 @@ export async function serializeNodeToFlight(
|
|
|
210
169
|
}
|
|
211
170
|
},
|
|
212
171
|
});
|
|
213
|
-
// Drain inside the context so async components see ctx during streaming.
|
|
214
172
|
const text = await new Response(stream).text();
|
|
215
173
|
if (didError) throw renderError;
|
|
216
174
|
return text;
|
|
217
175
|
}
|
|
218
176
|
|
|
219
|
-
/**
|
|
220
|
-
* Smoke check that the vendored serializer subpath still resolves and exposes
|
|
221
|
-
* `renderToReadableStream`. The vendored path is private to plugin-rsc; a minor
|
|
222
|
-
* bump could relocate it. Call this in a test to fail loudly with a clear
|
|
223
|
-
* message instead of an opaque import error.
|
|
224
|
-
*/
|
|
225
177
|
export function assertFlightRuntimeAvailable(): void {
|
|
226
178
|
if (typeof RSDServer.renderToReadableStream !== "function") {
|
|
227
179
|
throw new Error(
|
|
@@ -32,14 +32,6 @@ interface RouterWithRouteMap {
|
|
|
32
32
|
findMatch?: (pathname: string) => unknown;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
/**
|
|
36
|
-
* Derive a best-effort concrete path from a route pattern so `findMatch` can be
|
|
37
|
-
* invoked to expand a lazy include. `:param`, `:param(constraint)`, optional
|
|
38
|
-
* `:param?`, and `*` are all replaced with a literal segment. A constrained
|
|
39
|
-
* param may not match its constraint (so that one route's match fails), but
|
|
40
|
-
* since matching ANY route in an include expands ALL of the include's routes,
|
|
41
|
-
* a sibling route in the same include will still trigger expansion.
|
|
42
|
-
*/
|
|
43
35
|
function concretePath(pattern: string): string {
|
|
44
36
|
return (
|
|
45
37
|
pattern
|
|
@@ -50,17 +42,6 @@ function concretePath(pattern: string): string {
|
|
|
50
42
|
);
|
|
51
43
|
}
|
|
52
44
|
|
|
53
|
-
/**
|
|
54
|
-
* Force-expand the router's lazy `include()`d routes into `router.routeMap`.
|
|
55
|
-
*
|
|
56
|
-
* All Rango includes are lazy — their child routes only populate `routeMap` when
|
|
57
|
-
* the router first matches a path inside them (in production the build-time
|
|
58
|
-
* manifest virtual carries the full map; in a bare test that virtual is absent).
|
|
59
|
-
* To make the whole-app drift check work in a unit test, we trigger expansion by
|
|
60
|
-
* calling `findMatch` on a concrete path derived from each known pattern. This is
|
|
61
|
-
* idempotent and side-effect-free beyond populating the route map. Routers that
|
|
62
|
-
* don't expose `findMatch` (e.g. a plain `{ routeMap }` object) are left as-is.
|
|
63
|
-
*/
|
|
64
45
|
function expandLazyIncludes(
|
|
65
46
|
router: RouterWithRouteMap,
|
|
66
47
|
patterns: Iterable<string>,
|
|
@@ -70,10 +51,7 @@ function expandLazyIncludes(
|
|
|
70
51
|
for (const pattern of patterns) {
|
|
71
52
|
try {
|
|
72
53
|
findMatch.call(router, concretePath(pattern));
|
|
73
|
-
} catch {
|
|
74
|
-
// A pattern that fails to match (constrained param, etc.) is fine — a
|
|
75
|
-
// sibling route in the same include still triggers expansion.
|
|
76
|
-
}
|
|
54
|
+
} catch {}
|
|
77
55
|
}
|
|
78
56
|
}
|
|
79
57
|
|
|
@@ -100,11 +78,6 @@ export interface GeneratedRoutesDiff {
|
|
|
100
78
|
ok: boolean;
|
|
101
79
|
}
|
|
102
80
|
|
|
103
|
-
/**
|
|
104
|
-
* Normalize a route map value to its pattern string. Route maps may carry
|
|
105
|
-
* either a bare pattern string or a `{ path, ... }` object (for response/search
|
|
106
|
-
* routes); compare on the `path`.
|
|
107
|
-
*/
|
|
108
81
|
function patternOf(value: unknown): string {
|
|
109
82
|
if (typeof value === "string") return value;
|
|
110
83
|
if (
|
|
@@ -118,19 +91,12 @@ function patternOf(value: unknown): string {
|
|
|
118
91
|
return String(value);
|
|
119
92
|
}
|
|
120
93
|
|
|
121
|
-
/**
|
|
122
|
-
* Compute the diff between a router's runtime route map and a generated map.
|
|
123
|
-
*/
|
|
124
94
|
export function diffGeneratedRoutes(
|
|
125
95
|
router: RouterWithRouteMap,
|
|
126
96
|
generatedMap?: Record<string, unknown>,
|
|
127
97
|
): GeneratedRoutesDiff {
|
|
128
98
|
const generated = generatedMap ?? getGlobalRouteMap();
|
|
129
99
|
|
|
130
|
-
// Lazy `include()`d routes are absent from `routeMap` until first matched, so
|
|
131
|
-
// expand them first (using the generated patterns to drive the matches) —
|
|
132
|
-
// otherwise every included route is a false `missing`. No-op for plain
|
|
133
|
-
// `{ routeMap }` objects that don't expose `findMatch`.
|
|
134
100
|
expandLazyIncludes(
|
|
135
101
|
router,
|
|
136
102
|
Object.values(generated).map((v) => patternOf(v)),
|
|
@@ -155,12 +121,6 @@ export function diffGeneratedRoutes(
|
|
|
155
121
|
}
|
|
156
122
|
|
|
157
123
|
for (const name of Object.keys(runtime)) {
|
|
158
|
-
// Auto-generated internal names ($path_*/$prefix_*) live in the runtime
|
|
159
|
-
// mergedRouteMap but are deliberately excluded from the generated
|
|
160
|
-
// *.named-routes.gen.ts file (route-types-writer / runtime-discovery skip
|
|
161
|
-
// them). Reporting them as `extra` would throw on a perfectly in-sync app
|
|
162
|
-
// that simply uses an unnamed path()/include() route, so skip them here to
|
|
163
|
-
// match exactly the surface the generator emits.
|
|
164
124
|
if (isAutoGeneratedRouteName(name)) continue;
|
|
165
125
|
if (!(name in generated)) {
|
|
166
126
|
extra.push(name);
|
package/src/testing/index.ts
CHANGED
|
@@ -34,7 +34,6 @@
|
|
|
34
34
|
* - RSC: see @rangojs/router/testing/flight
|
|
35
35
|
*/
|
|
36
36
|
|
|
37
|
-
// Unit
|
|
38
37
|
export { runMiddleware } from "./run-middleware.js";
|
|
39
38
|
export type {
|
|
40
39
|
RunMiddlewareOptions,
|
|
@@ -48,15 +47,9 @@ export type {
|
|
|
48
47
|
TestLoaderContext,
|
|
49
48
|
} from "./run-loader.js";
|
|
50
49
|
|
|
51
|
-
// Integration
|
|
52
50
|
export { dispatch } from "./dispatch.js";
|
|
53
51
|
export type { DispatchOptions } from "./dispatch.js";
|
|
54
52
|
|
|
55
|
-
// renderRoute lives at `@rangojs/router/testing/dom` — it pulls React, the
|
|
56
|
-
// browser runtime, and @testing-library/react types, which this barrel keeps
|
|
57
|
-
// out so node-only unit suites depend on none of them.
|
|
58
|
-
|
|
59
|
-
// Cross-cutting: cache/prerender status
|
|
60
53
|
export {
|
|
61
54
|
assertCacheStatus,
|
|
62
55
|
parseCacheHeader,
|
|
@@ -68,9 +61,6 @@ export type {
|
|
|
68
61
|
CacheStatusTarget,
|
|
69
62
|
CacheSink,
|
|
70
63
|
} from "./cache-status.js";
|
|
71
|
-
// The telemetry event types a cache-status assertion inspects (createCacheSink
|
|
72
|
-
// records CacheDecisionEvents; filterCacheDecisions narrows them). Re-exported
|
|
73
|
-
// here so a test can annotate the events without reaching past `@rangojs/router/testing`.
|
|
74
64
|
export type {
|
|
75
65
|
TelemetryEvent,
|
|
76
66
|
TelemetrySink,
|
|
@@ -79,10 +69,8 @@ export type {
|
|
|
79
69
|
CacheSegmentStatus,
|
|
80
70
|
} from "../router/telemetry.js";
|
|
81
71
|
|
|
82
|
-
// Cross-cutting: handle collect/accumulator
|
|
83
72
|
export { collectHandle } from "./collect-handle.js";
|
|
84
73
|
|
|
85
|
-
// Cross-cutting: generated-route drift
|
|
86
74
|
export {
|
|
87
75
|
diffGeneratedRoutes,
|
|
88
76
|
assertGeneratedRoutesMatch,
|
|
@@ -92,7 +80,6 @@ export type {
|
|
|
92
80
|
GeneratedRouteMismatch,
|
|
93
81
|
} from "./generated-routes.js";
|
|
94
82
|
|
|
95
|
-
// Advanced: build a real RequestContext for bespoke loader/middleware setups
|
|
96
83
|
export {
|
|
97
84
|
createTestRequestContext,
|
|
98
85
|
runInRequestContext,
|
|
@@ -108,12 +95,4 @@ export type {
|
|
|
108
95
|
StateCookieSeed,
|
|
109
96
|
} from "./internal/context.js";
|
|
110
97
|
|
|
111
|
-
// The low-level context runner that enters a RequestContext (the same one the
|
|
112
|
-
// RSC handler uses for server actions). Re-exported so a ctx built with
|
|
113
|
-
// createTestRequestContext can be entered directly; runInRequestContext is the
|
|
114
|
-
// one-call convenience over createTestRequestContext + runWithRequestContext.
|
|
115
98
|
export { runWithRequestContext } from "../server/request-context.js";
|
|
116
|
-
|
|
117
|
-
// The E2E harness is NOT re-exported here: it must be imported from
|
|
118
|
-
// `@rangojs/router/testing/e2e` so it stays loadable in a plain Playwright
|
|
119
|
-
// runner (this barrel pulls in router-manifest code that needs Vite virtuals).
|
|
@@ -28,8 +28,6 @@ import type { CacheProfile } from "../../cache/profile-registry.js";
|
|
|
28
28
|
|
|
29
29
|
const DEFAULT_ORIGIN = "http://localhost/";
|
|
30
30
|
|
|
31
|
-
// VarsInit + seedVariables live in ./seed-vars.js (react-server-safe) so the
|
|
32
|
-
// Flight tier can seed vars too; re-exported here for existing importers.
|
|
33
31
|
export type { VarsInit, StateCookieSeed };
|
|
34
32
|
export { seedVariables };
|
|
35
33
|
|
|
@@ -39,10 +37,9 @@ export function toRequest(
|
|
|
39
37
|
init?: RequestInit,
|
|
40
38
|
): Request {
|
|
41
39
|
if (request instanceof Request) return request;
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
return new Request(DEFAULT_ORIGIN, init);
|
|
40
|
+
return typeof request === "string"
|
|
41
|
+
? new Request(new URL(request, DEFAULT_ORIGIN), init)
|
|
42
|
+
: new Request(DEFAULT_ORIGIN, init);
|
|
46
43
|
}
|
|
47
44
|
|
|
48
45
|
export interface CreateTestContextOptions<TEnv> {
|
|
@@ -146,10 +143,6 @@ export function createTestRequestContext<TEnv>(
|
|
|
146
143
|
const request = toRequest(opts.request, opts.requestInit);
|
|
147
144
|
const url = new URL(request.url);
|
|
148
145
|
const variables = seedVariables(opts.variables ?? {}, opts.vars);
|
|
149
|
-
// Always seed a resolved name so invalidateClientCache() rotates (and emits
|
|
150
|
-
// the Set-Cookie) like production instead of no-opping; opts.stateCookie
|
|
151
|
-
// customizes the name/version. Surfaced on the result so a consumer asserts
|
|
152
|
-
// the rotation against the same name without recomputing it.
|
|
153
146
|
const stateCookieName = resolveSeededStateCookieName(opts.stateCookie);
|
|
154
147
|
const ctx = createRequestContext<TEnv>({
|
|
155
148
|
env: (opts.env ?? {}) as TEnv,
|
|
@@ -174,10 +167,6 @@ export function createTestRequestContext<TEnv>(
|
|
|
174
167
|
opts.params ?? {},
|
|
175
168
|
) as RequestContext<TEnv>["reverse"];
|
|
176
169
|
}
|
|
177
|
-
// ctx.reverse is assigned the routeMap-scoped reverse (string-accepting) above;
|
|
178
|
-
// expose it through the relaxed type so a test reverses a local route name
|
|
179
|
-
// without casting. The runtime value matches; RequestContext's reverse is
|
|
180
|
-
// declared against the narrower global route-name union, hence the cast.
|
|
181
170
|
return {
|
|
182
171
|
ctx: ctx as unknown as TestRequestContextObject<TEnv>,
|
|
183
172
|
request,
|
|
@@ -246,13 +235,6 @@ export interface RunInRequestContextResult<T> {
|
|
|
246
235
|
stateCookieName: string;
|
|
247
236
|
}
|
|
248
237
|
|
|
249
|
-
/**
|
|
250
|
-
* Snapshot the observable effects a run left on `ctx` (cookies + location
|
|
251
|
-
* state). Reads the fields directly off the ctx object, so it works both inside
|
|
252
|
-
* and outside the AsyncLocalStorage scope (no `getRequestContext()`). Headers are
|
|
253
|
-
* snapshotted separately from the final {@link Response} (via
|
|
254
|
-
* {@link headersToObject}) so a thrown redirect's `Location` is included.
|
|
255
|
-
*/
|
|
256
238
|
export function snapshotRunEffects<TEnv>(ctx: RequestContext<TEnv>): {
|
|
257
239
|
cookies: Record<string, string>;
|
|
258
240
|
locationState: Record<string, unknown>;
|
|
@@ -263,12 +245,6 @@ export function snapshotRunEffects<TEnv>(ctx: RequestContext<TEnv>): {
|
|
|
263
245
|
};
|
|
264
246
|
}
|
|
265
247
|
|
|
266
|
-
/**
|
|
267
|
-
* The response headers as a plain `{ name: value }` object, EXCLUDING
|
|
268
|
-
* `set-cookie` (surfaced parsed on `cookies`). Names are lowercased (HTTP header
|
|
269
|
-
* names are case-insensitive). Read from the final response so a thrown
|
|
270
|
-
* redirect's `Location` and any `ctx.header(...)` both appear.
|
|
271
|
-
*/
|
|
272
248
|
export function headersToObject(headers: Headers): Record<string, string> {
|
|
273
249
|
const out: Record<string, string> = {};
|
|
274
250
|
headers.forEach((value, name) => {
|
|
@@ -278,14 +254,6 @@ export function headersToObject(headers: Headers): Record<string, string> {
|
|
|
278
254
|
return out;
|
|
279
255
|
}
|
|
280
256
|
|
|
281
|
-
/**
|
|
282
|
-
* Build the observable response from what the run accumulated on `ctx.res`. When
|
|
283
|
-
* `fn` threw a `Response` (a `redirect()`/`notFound()`), that Response IS the
|
|
284
|
-
* response — merge the accumulated Set-Cookie/other headers into it (the
|
|
285
|
-
* framework does this when it catches the thrown Response in production), with
|
|
286
|
-
* its status/Location preserved. Otherwise snapshot the stub (status + headers).
|
|
287
|
-
* The `Response`/`Headers` constructors copy, so the result is immutable.
|
|
288
|
-
*/
|
|
289
257
|
export function buildRunResponse<TEnv>(
|
|
290
258
|
ctx: RequestContext<TEnv>,
|
|
291
259
|
thrown: unknown,
|
|
@@ -305,14 +273,6 @@ export function buildRunResponse<TEnv>(
|
|
|
305
273
|
return new Response(null, { status: stub.status, headers: stub.headers });
|
|
306
274
|
}
|
|
307
275
|
|
|
308
|
-
/**
|
|
309
|
-
* Snapshot the shared run-result envelope fields (everything except the primary
|
|
310
|
-
* value) from what a run left on `ctx`: the captured `thrown`, the merged
|
|
311
|
-
* `response`, the effective `cookies`/`headers` views, the `locationState`, and
|
|
312
|
-
* the resolved `stateCookieName`. Shared by `runInRequestContext` and
|
|
313
|
-
* `runLoaderResult` so the snapshot sequence lives once; each spreads it next to
|
|
314
|
-
* its own primary field (`result` / `data`).
|
|
315
|
-
*/
|
|
316
276
|
export function buildRunSnapshot<TEnv>(
|
|
317
277
|
ctx: RequestContext<TEnv>,
|
|
318
278
|
thrown: unknown,
|
|
@@ -382,8 +342,6 @@ export async function runInRequestContext<T, TEnv = unknown>(
|
|
|
382
342
|
try {
|
|
383
343
|
result = (await runWithRequestContext(ctx, () => fn(ctx))) as T;
|
|
384
344
|
} catch (error) {
|
|
385
|
-
// Capture (do NOT re-throw): a redirect/notFound action throws its Response
|
|
386
|
-
// on the SUCCESS path, and its cookie/flash output must stay observable.
|
|
387
345
|
thrown = error;
|
|
388
346
|
}
|
|
389
347
|
return { result, ...buildRunSnapshot(ctx, thrown, stateCookieName) };
|
|
@@ -9,14 +9,6 @@
|
|
|
9
9
|
import { contextSet, type ContextVar } from "../../context-var.js";
|
|
10
10
|
import { resolveStateCookieName } from "../../router/state-cookie-name.js";
|
|
11
11
|
|
|
12
|
-
/**
|
|
13
|
-
* Seed for the rango state cookie a handler/action/loader rotates when it calls
|
|
14
|
-
* `invalidateClientCache()`. Production always resolves a name at router init
|
|
15
|
-
* (so rotation always fires); the test stub did not, so the call silently
|
|
16
|
-
* no-opped. Supplying this (or accepting the defaults) closes that gap. Lives in
|
|
17
|
-
* the react-server-safe seed module so both the node tier (createTestRequestContext)
|
|
18
|
-
* and the Flight tier (renderHandler) share one shape and one default.
|
|
19
|
-
*/
|
|
20
12
|
export interface StateCookieSeed {
|
|
21
13
|
/**
|
|
22
14
|
* Cookie-name prefix, sanitized then composed with `routerId` exactly like
|
|
@@ -36,37 +28,19 @@ export interface StateCookieSeed {
|
|
|
36
28
|
version?: string;
|
|
37
29
|
}
|
|
38
30
|
|
|
39
|
-
/**
|
|
40
|
-
* Resolve the state cookie name a seed maps to, mirroring `createRouter`'s
|
|
41
|
-
* `resolveStateCookieName` so a test asserts the SAME name production writes.
|
|
42
|
-
* The default routerId `"router_0"` matches a single default router.
|
|
43
|
-
*/
|
|
44
31
|
export function resolveSeededStateCookieName(seed?: StateCookieSeed): string {
|
|
45
32
|
return resolveStateCookieName(seed?.prefix, seed?.routerId ?? "router_0");
|
|
46
33
|
}
|
|
47
34
|
|
|
48
|
-
/**
|
|
49
|
-
* Initializer for seeded context variables (as a prior middleware would have
|
|
50
|
-
* set, or a server component would read during render). Either a plain object
|
|
51
|
-
* keyed by var name (the common, best-inferring form: `{ user: u }`) or a list
|
|
52
|
-
* of `[key, value]` tuples where the key may be a `createVar()` handle or a
|
|
53
|
-
* string (`[[userVar, u], ["flag", true]]`).
|
|
54
|
-
*/
|
|
55
35
|
export type VarsInit =
|
|
56
36
|
| Record<string, unknown>
|
|
57
37
|
| ReadonlyArray<readonly [ContextVar<unknown> | string, unknown]>;
|
|
58
38
|
|
|
59
|
-
/**
|
|
60
|
-
* Preload variables as if set by upstream middleware (or visible to a rendered
|
|
61
|
-
* server tree). Accepts entries keyed by either a ContextVar (from createVar) or
|
|
62
|
-
* a string, matching ctx.set().
|
|
63
|
-
*/
|
|
64
39
|
export function seedVariables(
|
|
65
40
|
variables: Record<string, unknown>,
|
|
66
41
|
vars?: VarsInit,
|
|
67
42
|
): Record<string, unknown> {
|
|
68
43
|
if (!vars) return variables;
|
|
69
|
-
// Array/iterable form -> use the tuples as-is; plain object -> its entries.
|
|
70
44
|
const entries: Iterable<readonly [ContextVar<unknown> | string, unknown]> =
|
|
71
45
|
Symbol.iterator in (vars as object)
|
|
72
46
|
? (vars as ReadonlyArray<
|
|
@@ -134,11 +134,6 @@ export interface RenderHandlerResult {
|
|
|
134
134
|
*/
|
|
135
135
|
class RenderHandlerSetupError extends Error {}
|
|
136
136
|
|
|
137
|
-
// Local copy (not imported from internal/context.ts): that module is the NODE
|
|
138
|
-
// tier and is deliberately NOT react-server-safe (the reason seed-vars.ts was
|
|
139
|
-
// split out), and render-handler ships from the react-server ./testing/flight
|
|
140
|
-
// entry. A 6-line pure projection is cheaper to duplicate than to route a
|
|
141
|
-
// shared util across that boundary.
|
|
142
137
|
function headersToObject(headers: Headers): Record<string, string> {
|
|
143
138
|
const out: Record<string, string> = {};
|
|
144
139
|
headers.forEach((value, name) => {
|
|
@@ -147,15 +142,6 @@ function headersToObject(headers: Headers): Record<string, string> {
|
|
|
147
142
|
return out;
|
|
148
143
|
}
|
|
149
144
|
|
|
150
|
-
/**
|
|
151
|
-
* Detect the server-only-API stub throw: when a handler/component imports
|
|
152
|
-
* getRequestContext()/cookies()/etc. from the BARE `@rangojs/router` specifier
|
|
153
|
-
* (the out-of-react-server stub in index.ts) instead of the react-server build.
|
|
154
|
-
* In an rsc test this happens when the vitest.rsc.config.ts `resolve.alias` does
|
|
155
|
-
* not map the bare specifier to `index.rsc.ts` (the `rangoTestAliases` preset).
|
|
156
|
-
* The dual-substring match keeps a legitimate handler throw from being
|
|
157
|
-
* reclassified as a setup error.
|
|
158
|
-
*/
|
|
159
145
|
function isServerOnlyStubError(error: unknown): boolean {
|
|
160
146
|
return (
|
|
161
147
|
error instanceof Error &&
|
|
@@ -175,20 +161,6 @@ function toRequest(
|
|
|
175
161
|
return new Request(DEFAULT_URL, { headers });
|
|
176
162
|
}
|
|
177
163
|
|
|
178
|
-
/**
|
|
179
|
-
* Build the result `response` from the request-context stub and, when present,
|
|
180
|
-
* the Response the handler returned or threw (`source`). The stub cookies and
|
|
181
|
-
* headers are merged in (Set-Cookie appended to preserve duplicates, other stub
|
|
182
|
-
* headers filled in without clobbering the source), mirroring dispatch.ts's
|
|
183
|
-
* rewrap.
|
|
184
|
-
*
|
|
185
|
-
* The source's BODY is carried over (not dropped): a response route returns a
|
|
186
|
-
* `new Response(JSON.stringify(...))`, so callers reach for
|
|
187
|
-
* `await result.response.text()`/`.json()`. Pre-fix this rewrapped to
|
|
188
|
-
* `new Response(null, ...)` and the body was lost irrecoverably. A body is a
|
|
189
|
-
* single-use stream; `source` is not read again here or by renderHandler, so
|
|
190
|
-
* handing its body to the new Response is safe.
|
|
191
|
-
*/
|
|
192
164
|
function buildResponse(reqCtx: RequestContext<any>, source: unknown): Response {
|
|
193
165
|
const stub = reqCtx.res;
|
|
194
166
|
if (source instanceof Response) {
|
|
@@ -231,9 +203,6 @@ export async function renderHandler<TEnv = any>(
|
|
|
231
203
|
if (opts.clientComponents) registerClientComponents(opts.clientComponents);
|
|
232
204
|
const request = toRequest(opts.request, opts.headers);
|
|
233
205
|
const url = new URL(request.url);
|
|
234
|
-
// Seed a resolved name so a handler calling invalidateClientCache() rotates
|
|
235
|
-
// (emits the Set-Cookie) like production; opts.stateCookie customizes it. Also
|
|
236
|
-
// surfaced on the result so a consumer asserts the rotation without recomputing.
|
|
237
206
|
const stateCookieName = resolveSeededStateCookieName(opts.stateCookie);
|
|
238
207
|
const reqCtx = createRequestContext<TEnv>({
|
|
239
208
|
env: (opts.env ?? {}) as TEnv,
|
|
@@ -264,17 +233,10 @@ export async function renderHandler<TEnv = any>(
|
|
|
264
233
|
opts.routeMap ?? {},
|
|
265
234
|
opts.routeName,
|
|
266
235
|
);
|
|
267
|
-
// Seed ctx.use: a handle returns a push fn that RECORDS (so ctx.use(Meta)
|
|
268
|
-
// doesn't crash and pushes are assertable); a loader returns its seeded data
|
|
269
|
-
// (no real loader run).
|
|
270
236
|
(hctx as { use: unknown }).use = (item: unknown) => {
|
|
271
237
|
if (isHandle(item)) {
|
|
272
238
|
const handle = item as Handle<any, any>;
|
|
273
239
|
return (dataOrFn: unknown) => {
|
|
274
|
-
// Mirror production's push fn (loader-resolution.ts): a FUNCTION arg
|
|
275
|
-
// (ctx.use(Meta)(() => fetchMeta())) is CALLED and its result is
|
|
276
|
-
// recorded, not the function itself. An async callback records the
|
|
277
|
-
// promise it returns, same as production (which does not await it).
|
|
278
240
|
const value =
|
|
279
241
|
typeof dataOrFn === "function"
|
|
280
242
|
? (dataOrFn as () => unknown)()
|
|
@@ -294,8 +256,6 @@ export async function renderHandler<TEnv = any>(
|
|
|
294
256
|
|
|
295
257
|
try {
|
|
296
258
|
out = await handler(hctx as HandlerContext<any, TEnv>);
|
|
297
|
-
// Serialize the RSC in THIS context, so nested async server components see
|
|
298
|
-
// getRequestContext()/cookies()/vars while they render.
|
|
299
259
|
if (out !== undefined && !(out instanceof Response)) {
|
|
300
260
|
flight = await serializeNodeToFlight(
|
|
301
261
|
out as ReactNode,
|
|
@@ -304,13 +264,7 @@ export async function renderHandler<TEnv = any>(
|
|
|
304
264
|
);
|
|
305
265
|
}
|
|
306
266
|
} catch (error) {
|
|
307
|
-
// A harness misconfiguration (unseeded loader) is the consumer's mistake —
|
|
308
|
-
// surface it as a rejection, not as a captured handler throw.
|
|
309
267
|
if (error instanceof RenderHandlerSetupError) throw error;
|
|
310
|
-
// Same for the server-only-API stub throw: the handler read
|
|
311
|
-
// getRequestContext()/cookies() but the bare `@rangojs/router` resolved to
|
|
312
|
-
// the throwing stub. Rethrow LOUDLY with the fix, instead of silently
|
|
313
|
-
// capturing it (which surfaces as an opaque tree:undefined + bare throw).
|
|
314
268
|
if (isServerOnlyStubError(error)) {
|
|
315
269
|
throw new RenderHandlerSetupError(
|
|
316
270
|
`renderHandler: the handler called a server-only API (getRequestContext/cookies/...) ` +
|
|
@@ -320,8 +274,6 @@ export async function renderHandler<TEnv = any>(
|
|
|
320
274
|
`Original: ${(error as Error).message}`,
|
|
321
275
|
);
|
|
322
276
|
}
|
|
323
|
-
// Otherwise captured, NOT re-thrown: a handler's success path is often
|
|
324
|
-
// `throw redirect(...)`; its cookies/flash must stay observable.
|
|
325
277
|
didThrow = true;
|
|
326
278
|
thrown = error;
|
|
327
279
|
}
|
|
@@ -342,7 +294,6 @@ export async function renderHandler<TEnv = any>(
|
|
|
342
294
|
}
|
|
343
295
|
)._locationState ?? [],
|
|
344
296
|
);
|
|
345
|
-
// Deserialize outside the context (the client deserializer needs no ctx).
|
|
346
297
|
const tree =
|
|
347
298
|
flight !== undefined ? await deserializeFlight(flight) : undefined;
|
|
348
299
|
|