@rangojs/router 0.0.0-experimental.133 → 0.0.0-experimental.134
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/vite/index.js +22 -9
- package/package.json +1 -1
- package/skills/composability/SKILL.md +0 -1
- package/skills/handler-use/SKILL.md +7 -7
- package/skills/intercept/SKILL.md +38 -13
- package/skills/migrate-nextjs/SKILL.md +3 -3
- package/skills/prerender/SKILL.md +20 -17
- package/skills/router-setup/SKILL.md +1 -2
- package/skills/testing/SKILL.md +1 -0
- package/skills/view-transitions/SKILL.md +43 -0
- package/src/browser/navigation-bridge.ts +65 -16
- package/src/browser/navigation-client.ts +15 -1
- package/src/browser/navigation-store.ts +82 -8
- package/src/browser/network-error-handler.ts +34 -7
- package/src/browser/partial-update.ts +27 -2
- package/src/browser/prefetch/cache.ts +8 -0
- package/src/browser/prefetch/fetch.ts +32 -4
- package/src/browser/react/NavigationProvider.tsx +195 -4
- package/src/browser/react/deferred-handle-resolution.ts +75 -0
- package/src/browser/response-adapter.ts +38 -9
- package/src/browser/types.ts +32 -1
- package/src/handles/MetaTags.tsx +6 -0
- package/src/index.rsc.ts +6 -1
- package/src/index.ts +6 -4
- package/src/internal-debug.ts +11 -8
- package/src/render-error-thrower.tsx +20 -0
- package/src/route-content-wrapper.tsx +12 -5
- package/src/route-definition/dsl-helpers.ts +21 -32
- package/src/route-definition/helper-factories.ts +0 -2
- package/src/route-definition/helpers-types.ts +38 -39
- package/src/route-definition/index.ts +1 -2
- package/src/route-definition/resolve-handler-use.ts +0 -1
- package/src/route-definition/use-item-types.ts +3 -6
- package/src/route-types.ts +0 -5
- package/src/router/match-api.ts +5 -1
- package/src/router/segment-resolution/fresh.ts +4 -0
- package/src/router/segment-resolution/revalidation.ts +3 -0
- package/src/router/segment-resolution/view-transition-default.ts +35 -15
- package/src/rsc/progressive-enhancement.ts +31 -2
- package/src/rsc/rsc-rendering.ts +7 -2
- package/src/rsc/server-action.ts +19 -2
- package/src/rsc/transition-gate.ts +89 -0
- package/src/segment-system.tsx +26 -8
- package/src/server/context.ts +13 -0
- package/src/server/request-context.ts +41 -3
- package/src/testing/index.ts +6 -0
- package/src/testing/run-transition-when.ts +164 -0
- package/src/types/handler-context.ts +1 -1
- package/src/types/index.ts +2 -0
- package/src/types/segments.ts +100 -0
- package/src/urls/path-helper-types.ts +10 -7
- package/src/urls/urls-function.ts +0 -1
- package/src/vite/inject-client-debug.ts +36 -0
- package/src/vite/router-discovery.ts +8 -13
- 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/network-error-thrower.tsx +0 -18
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* runTransitionWhen — unit-test a transition({ when }) predicate in isolation.
|
|
3
|
+
*
|
|
4
|
+
* Runs the SAME two server functions the router uses — applyViewTransitionDefault
|
|
5
|
+
* (strips the `when` function from the serialized config and records the
|
|
6
|
+
* predicate on the request context) and gateTransitions (assembles the
|
|
7
|
+
* TransitionWhenContext and evaluates the predicate post-handler). So the
|
|
8
|
+
* predicate sees exactly the navigation/action metadata it would at runtime
|
|
9
|
+
* (currentUrl/currentParams/fromRouteName, nextUrl/nextParams/toRouteName,
|
|
10
|
+
* actionId/actionUrl/actionResult/formData/method, get/env), and `kept` reflects
|
|
11
|
+
* whether the transition would apply this request. The result also exposes the
|
|
12
|
+
* assembled `whenContext` so tests can assert the exact fields without reaching
|
|
13
|
+
* into private request-context state.
|
|
14
|
+
*
|
|
15
|
+
* This is the public way to exercise a transition gate: the full
|
|
16
|
+
* match -> render pipeline that wires these together only runs under real RSC
|
|
17
|
+
* rendering (which the Flight primitives do not drive), so without this primitive
|
|
18
|
+
* a consumer could not test their predicate through @rangojs/router/testing.
|
|
19
|
+
*
|
|
20
|
+
* Synchronous: a transition predicate returns a boolean and the gate has no I/O.
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
import {
|
|
24
|
+
runWithRequestContext,
|
|
25
|
+
type RequestContext,
|
|
26
|
+
} from "../server/request-context.js";
|
|
27
|
+
import { applyViewTransitionDefault } from "../router/segment-resolution/view-transition-default.js";
|
|
28
|
+
import { gateTransitions } from "../rsc/transition-gate.js";
|
|
29
|
+
import { createTestRequestContext, type VarsInit } from "./internal/context.js";
|
|
30
|
+
import type {
|
|
31
|
+
ResolvedSegment,
|
|
32
|
+
TransitionConfig,
|
|
33
|
+
TransitionWhenContext,
|
|
34
|
+
} from "../types/segments.js";
|
|
35
|
+
import type { OnErrorCallback } from "../types/error-types.js";
|
|
36
|
+
|
|
37
|
+
const toURL = (v: string | URL, base: URL): URL =>
|
|
38
|
+
typeof v === "string" ? new URL(v, base.origin) : v;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Options for runTransitionWhen. All navigation/action fields are optional and
|
|
42
|
+
* default to "absent", matching what the gate sees for an initial full load with
|
|
43
|
+
* no action: omit `currentUrl`/`currentParams`/`fromRouteName` to model the
|
|
44
|
+
* navigation source being unavailable, and omit the `action*` fields to model a
|
|
45
|
+
* plain (non-action) navigation.
|
|
46
|
+
*/
|
|
47
|
+
export interface RunTransitionWhenOptions<TEnv = any> {
|
|
48
|
+
/** The navigation TARGET request (drives `nextUrl`): a Request or URL/path string. Defaults to `http://localhost/`. */
|
|
49
|
+
request?: Request | string;
|
|
50
|
+
/** Route params for the target (`nextParams`). */
|
|
51
|
+
params?: Record<string, string>;
|
|
52
|
+
/** Target route name (`toRouteName`). */
|
|
53
|
+
toRouteName?: string;
|
|
54
|
+
/** Environment bindings surfaced as `env` (and `ctx.env`). */
|
|
55
|
+
env?: TEnv;
|
|
56
|
+
/** Variables a handler/middleware would have set this request, readable via the predicate's `get()`. */
|
|
57
|
+
vars?: VarsInit;
|
|
58
|
+
/** Navigation SOURCE url (`currentUrl`): a URL or path string. */
|
|
59
|
+
currentUrl?: string | URL;
|
|
60
|
+
/** Source route params (`currentParams`). */
|
|
61
|
+
currentParams?: Record<string, string>;
|
|
62
|
+
/** Source route name (`fromRouteName`). */
|
|
63
|
+
fromRouteName?: string;
|
|
64
|
+
/** Id of the action that triggered a revalidation (`actionId`). */
|
|
65
|
+
actionId?: string;
|
|
66
|
+
/** Url the action was submitted from (`actionUrl`). */
|
|
67
|
+
actionUrl?: string | URL;
|
|
68
|
+
/** The action's return value (`actionResult`). */
|
|
69
|
+
actionResult?: unknown;
|
|
70
|
+
/** FormData from a form action (`formData`). */
|
|
71
|
+
formData?: FormData;
|
|
72
|
+
/** Receives an error thrown by the predicate (the gate reports to `router.onError`, phase `"rendering"`). */
|
|
73
|
+
onError?: OnErrorCallback;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Result of runTransitionWhen.
|
|
78
|
+
*/
|
|
79
|
+
export interface RunTransitionWhenResult<TEnv = any> {
|
|
80
|
+
/** True if the transition would apply this request (predicate returned non-false, or there is no `when`). */
|
|
81
|
+
kept: boolean;
|
|
82
|
+
/** Convenience inverse of `kept`. */
|
|
83
|
+
dropped: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* The production-assembled predicate context. Undefined when the config has
|
|
86
|
+
* no `when` predicate.
|
|
87
|
+
*/
|
|
88
|
+
whenContext?: TransitionWhenContext<Record<string, string>, TEnv>;
|
|
89
|
+
/** The underlying RequestContext, for additional assertions (`ctx.get(...)`, etc.). */
|
|
90
|
+
ctx: RequestContext<TEnv>;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export function runTransitionWhen<TEnv = any>(
|
|
94
|
+
config: TransitionConfig,
|
|
95
|
+
opts: RunTransitionWhenOptions<TEnv> = {},
|
|
96
|
+
): RunTransitionWhenResult<TEnv> {
|
|
97
|
+
const { ctx } = createTestRequestContext<TEnv>({
|
|
98
|
+
env: opts.env,
|
|
99
|
+
request: opts.request,
|
|
100
|
+
vars: opts.vars,
|
|
101
|
+
params: opts.params,
|
|
102
|
+
});
|
|
103
|
+
const reqCtx = ctx as unknown as RequestContext<TEnv>;
|
|
104
|
+
|
|
105
|
+
// Target route name (the public field the gate reads for `toRouteName`).
|
|
106
|
+
if (opts.toRouteName !== undefined)
|
|
107
|
+
reqCtx.routeName = opts.toRouteName as RequestContext<TEnv>["routeName"];
|
|
108
|
+
// Source (match-time) data the gate reads for currentUrl/currentParams/fromRouteName.
|
|
109
|
+
if (opts.currentUrl !== undefined)
|
|
110
|
+
reqCtx._gateCurrentUrl = toURL(opts.currentUrl, reqCtx.url);
|
|
111
|
+
if (opts.currentParams !== undefined)
|
|
112
|
+
reqCtx._gateCurrentParams = opts.currentParams;
|
|
113
|
+
if (opts.fromRouteName !== undefined)
|
|
114
|
+
reqCtx._prevRouteKey = opts.fromRouteName;
|
|
115
|
+
// Action data the gate reads at the action-bearing call sites.
|
|
116
|
+
if (opts.actionId !== undefined) reqCtx._gateActionId = opts.actionId;
|
|
117
|
+
if (opts.actionUrl !== undefined)
|
|
118
|
+
reqCtx._gateActionUrl = toURL(opts.actionUrl, reqCtx.url);
|
|
119
|
+
if (opts.actionResult !== undefined)
|
|
120
|
+
reqCtx._gateActionResult = opts.actionResult;
|
|
121
|
+
if (opts.formData !== undefined) reqCtx._gateFormData = opts.formData;
|
|
122
|
+
|
|
123
|
+
let whenContext:
|
|
124
|
+
| TransitionWhenContext<Record<string, string>, TEnv>
|
|
125
|
+
| undefined;
|
|
126
|
+
const when = config.when;
|
|
127
|
+
const configForGate: TransitionConfig = when
|
|
128
|
+
? {
|
|
129
|
+
...config,
|
|
130
|
+
when: (c) => {
|
|
131
|
+
whenContext = c as TransitionWhenContext<
|
|
132
|
+
Record<string, string>,
|
|
133
|
+
TEnv
|
|
134
|
+
>;
|
|
135
|
+
return when(c);
|
|
136
|
+
},
|
|
137
|
+
}
|
|
138
|
+
: config;
|
|
139
|
+
|
|
140
|
+
return runWithRequestContext(reqCtx, () => {
|
|
141
|
+
// The real resolution-time collection + post-handler gate, so the predicate
|
|
142
|
+
// sees the production-assembled TransitionWhenContext.
|
|
143
|
+
const serialized = applyViewTransitionDefault(
|
|
144
|
+
configForGate,
|
|
145
|
+
undefined,
|
|
146
|
+
"tx-when-seg",
|
|
147
|
+
);
|
|
148
|
+
const segment = {
|
|
149
|
+
id: "tx-when-seg",
|
|
150
|
+
namespace: "r",
|
|
151
|
+
type: "route",
|
|
152
|
+
index: 0,
|
|
153
|
+
component: null,
|
|
154
|
+
transition: serialized,
|
|
155
|
+
} as ResolvedSegment;
|
|
156
|
+
gateTransitions(
|
|
157
|
+
[segment],
|
|
158
|
+
reqCtx as Parameters<typeof gateTransitions>[1],
|
|
159
|
+
opts.onError,
|
|
160
|
+
);
|
|
161
|
+
const kept = segment.transition !== undefined;
|
|
162
|
+
return { kept, dropped: !kept, whenContext, ctx: reqCtx };
|
|
163
|
+
});
|
|
164
|
+
}
|
|
@@ -504,7 +504,7 @@ export type RevalidateParams<TParams = GenericParams, TEnv = any> = Parameters<
|
|
|
504
504
|
* @param args.context - App context (db, user, etc.)
|
|
505
505
|
* @param args.actionResult - Result from action (future support)
|
|
506
506
|
* @param args.formData - Form data from action (future support)
|
|
507
|
-
* @param args.
|
|
507
|
+
* @param args.method - HTTP method: "GET" for navigation, "POST" for server actions
|
|
508
508
|
*
|
|
509
509
|
* @returns Hard decision (boolean), soft suggestion (object), or defer
|
|
510
510
|
* (`void` / `null` / `undefined`) to keep the running suggestion as-is.
|
package/src/types/index.ts
CHANGED
package/src/types/segments.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
2
|
import type { ErrorInfo, NotFoundInfo } from "./boundaries.js";
|
|
3
|
+
import type { RevalidateParams, HandlerContext } from "./handler-context.js";
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* CSS class(es) for a ViewTransition phase.
|
|
@@ -8,6 +9,96 @@ import type { ErrorInfo, NotFoundInfo } from "./boundaries.js";
|
|
|
8
9
|
*/
|
|
9
10
|
export type ViewTransitionClass = Record<string, string> | string;
|
|
10
11
|
|
|
12
|
+
/**
|
|
13
|
+
* The context a transition({ when }) predicate receives.
|
|
14
|
+
*
|
|
15
|
+
* It mirrors the {@link ShouldRevalidateFn} args a `revalidate()` predicate
|
|
16
|
+
* gets — the same navigation/action metadata — so the two read the same shape,
|
|
17
|
+
* plus `get`/`env` for post-handler reads. There is no full `HandlerContext`
|
|
18
|
+
* here: the gate runs at the RSC-payload layer with the request context, not a
|
|
19
|
+
* handler context, so handler-only sugar (`search`/`build`/`dev`/`headers`) is
|
|
20
|
+
* absent by design. `get` is the way to read what the handler/middleware set
|
|
21
|
+
* via `ctx.set(...)` this request.
|
|
22
|
+
*
|
|
23
|
+
* Field availability (all source fields are optional — never fabricated):
|
|
24
|
+
* - `currentUrl` / `currentParams` / `fromRouteName` (the navigation SOURCE) are
|
|
25
|
+
* populated on soft navigations and action-success revalidations. They are
|
|
26
|
+
* undefined on an initial full document load and on action-error / no-JS error
|
|
27
|
+
* paths that skip the navigation snapshot — there is no prior page to name.
|
|
28
|
+
* - `nextUrl` / `nextParams` / `get` / `env` / `method` are always present;
|
|
29
|
+
* `toRouteName` is present only when the target route is named (undefined for
|
|
30
|
+
* unnamed/auto-generated routes, like `fromRouteName`).
|
|
31
|
+
* - `actionId` / `actionUrl` / `actionResult` / `formData` are populated only
|
|
32
|
+
* when a server action triggered the render; `method` is "POST" then, "GET"
|
|
33
|
+
* otherwise. On no-JS (progressive-enhancement) action paths `actionId` may be
|
|
34
|
+
* undefined when React cannot surface the action's stable id: the success
|
|
35
|
+
* re-render still sets `actionUrl`/`formData` for a recognized action, but the
|
|
36
|
+
* error-boundary re-render exposes `actionUrl` only when `actionId` resolved.
|
|
37
|
+
* Malformed form bodies that fail before action detection expose no action
|
|
38
|
+
* fields. Treat `actionId` as "the action, if known", not as "was this an
|
|
39
|
+
* action".
|
|
40
|
+
*
|
|
41
|
+
* PREFETCH / CACHE CAVEAT (read this before gating on the source): the gate runs
|
|
42
|
+
* server-side during resolution. A PREFETCHED navigation renders at prefetch
|
|
43
|
+
* time, so `currentUrl`/`currentParams`/`fromRouteName` reflect the page the
|
|
44
|
+
* prefetch fired from, NOT necessarily the page the user actually navigates from
|
|
45
|
+
* — the decision is baked into the stored Flight payload and replayed verbatim.
|
|
46
|
+
* A `cache()`/prerender hit replays the stored transition with the predicate NOT
|
|
47
|
+
* re-run at all. So a source-sensitive predicate can be frozen to prefetch-time
|
|
48
|
+
* or store-time state. This is accepted (~99% of navigations match), but if your
|
|
49
|
+
* gate must reflect the exact click-time source, source-scope the prefetch
|
|
50
|
+
* (`<Link prefetchKey=":source">`) and do not `cache()` that segment.
|
|
51
|
+
*/
|
|
52
|
+
export type TransitionWhenContext<
|
|
53
|
+
TParams = Record<string, string>,
|
|
54
|
+
TEnv = unknown,
|
|
55
|
+
> = Partial<
|
|
56
|
+
Pick<
|
|
57
|
+
RevalidateParams<TParams, TEnv>,
|
|
58
|
+
"currentUrl" | "currentParams" | "fromRouteName"
|
|
59
|
+
>
|
|
60
|
+
> &
|
|
61
|
+
Pick<
|
|
62
|
+
RevalidateParams<TParams, TEnv>,
|
|
63
|
+
| "nextUrl"
|
|
64
|
+
| "nextParams"
|
|
65
|
+
| "toRouteName"
|
|
66
|
+
| "actionId"
|
|
67
|
+
| "actionUrl"
|
|
68
|
+
| "actionResult"
|
|
69
|
+
| "formData"
|
|
70
|
+
| "method"
|
|
71
|
+
> &
|
|
72
|
+
Pick<HandlerContext<any, TEnv>, "get" | "env">;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Predicate that gates whether a transition() applies for the current request.
|
|
76
|
+
*
|
|
77
|
+
* Evaluated server-side AFTER the route's handler runs (so `get(...)` can read
|
|
78
|
+
* handler/middleware-set state) and outside any cache scope. Return false to
|
|
79
|
+
* drop this segment's transition for the request; return true to apply it. The
|
|
80
|
+
* context ({@link TransitionWhenContext}) carries the same navigation/action
|
|
81
|
+
* metadata a `revalidate()` predicate sees plus `get`/`env`. If it throws, the
|
|
82
|
+
* error is reported to the router's onError (phase "rendering") and the
|
|
83
|
+
* transition is dropped (the navigation does not hold).
|
|
84
|
+
*
|
|
85
|
+
* Distinct from intercept()'s `when` config selector, which runs at MATCH time
|
|
86
|
+
* over `{ from, to, params, segments, … }`; a transition `when` runs
|
|
87
|
+
* post-handler over the resolved payload.
|
|
88
|
+
*
|
|
89
|
+
* Scope: dropping a transition removes only THIS segment's contribution to the
|
|
90
|
+
* navigation's hold. The startTransition hold is navigation-wide — it engages if
|
|
91
|
+
* any matched segment still has a transition — so `when: false` makes the
|
|
92
|
+
* navigation stream its loading fallback only when no other matched segment
|
|
93
|
+
* keeps a transition (the common case: a single transition on the route).
|
|
94
|
+
*
|
|
95
|
+
* Evaluated on every fresh (cache-miss) resolution; it is NOT re-run when a
|
|
96
|
+
* segment is replayed from the runtime cache or a build-time prerender, and a
|
|
97
|
+
* prefetched navigation freezes it to prefetch-time state — see the caveat on
|
|
98
|
+
* {@link TransitionWhenContext}.
|
|
99
|
+
*/
|
|
100
|
+
export type TransitionWhenFn = (ctx: TransitionWhenContext) => boolean;
|
|
101
|
+
|
|
11
102
|
/**
|
|
12
103
|
* Configuration for React's <ViewTransition> component.
|
|
13
104
|
*
|
|
@@ -36,6 +127,15 @@ export interface TransitionConfig {
|
|
|
36
127
|
* When unset, inherits the createRouter({ viewTransition }) default.
|
|
37
128
|
*/
|
|
38
129
|
viewTransition?: "auto" | false;
|
|
130
|
+
/**
|
|
131
|
+
* Optional server-side predicate that gates this transition per request. When
|
|
132
|
+
* present and it returns false (evaluated post-handler), the router drops this
|
|
133
|
+
* segment's transition for the request, so the navigation streams its loading
|
|
134
|
+
* fallback instead of holding. The predicate is server-only and never
|
|
135
|
+
* serialized to the client; only its resolved effect (transition kept or
|
|
136
|
+
* dropped) crosses. See {@link TransitionWhenFn}.
|
|
137
|
+
*/
|
|
138
|
+
when?: TransitionWhenFn;
|
|
39
139
|
}
|
|
40
140
|
|
|
41
141
|
/**
|
|
@@ -28,7 +28,6 @@ import type {
|
|
|
28
28
|
ParallelUseItem,
|
|
29
29
|
InterceptUseItem,
|
|
30
30
|
LoaderUseItem,
|
|
31
|
-
WhenItem,
|
|
32
31
|
TypedCacheItem,
|
|
33
32
|
TransitionItem,
|
|
34
33
|
TypedTransitionItem,
|
|
@@ -42,7 +41,6 @@ import type {
|
|
|
42
41
|
PassthroughHandlerDefinition,
|
|
43
42
|
} from "../prerender.js";
|
|
44
43
|
import type { StaticHandlerDefinition } from "../static-handler.js";
|
|
45
|
-
import type { InterceptWhenFn } from "../server/context";
|
|
46
44
|
import type {
|
|
47
45
|
ResponseHandler,
|
|
48
46
|
ResponseHandlerContext,
|
|
@@ -275,12 +273,18 @@ export type PathHelpers<TEnv> = {
|
|
|
275
273
|
slotName: `@${string}`,
|
|
276
274
|
routeName: string,
|
|
277
275
|
handler: ReactNode | Handler<any, any, TEnv>,
|
|
276
|
+
config?:
|
|
277
|
+
| import("../server/context.js").InterceptConfig<TEnv>
|
|
278
|
+
| (() => InterceptUseItem[]),
|
|
278
279
|
use?: () => InterceptUseItem[],
|
|
279
280
|
) => InterceptItem
|
|
280
281
|
: (
|
|
281
282
|
slotName: `@${string}`,
|
|
282
283
|
routeName: (keyof Rango.GeneratedRouteMap & string) | `.${string}`,
|
|
283
284
|
handler: ReactNode | Handler<any, any, TEnv>,
|
|
285
|
+
config?:
|
|
286
|
+
| import("../server/context.js").InterceptConfig<TEnv>
|
|
287
|
+
| (() => InterceptUseItem[]),
|
|
284
288
|
use?: () => InterceptUseItem[],
|
|
285
289
|
) => InterceptItem;
|
|
286
290
|
|
|
@@ -335,11 +339,6 @@ export type PathHelpers<TEnv> = {
|
|
|
335
339
|
fallback: ReactNode | NotFoundBoundaryHandler,
|
|
336
340
|
) => NotFoundBoundaryItem;
|
|
337
341
|
|
|
338
|
-
/**
|
|
339
|
-
* Define a condition for when an intercept should activate
|
|
340
|
-
*/
|
|
341
|
-
when: (fn: InterceptWhenFn) => WhenItem;
|
|
342
|
-
|
|
343
342
|
/**
|
|
344
343
|
* Define cache configuration for segments
|
|
345
344
|
*/
|
|
@@ -365,6 +364,10 @@ export type PathHelpers<TEnv> = {
|
|
|
365
364
|
* `{ viewTransition: false }` to keep #1 without the router boundary. A view
|
|
366
365
|
* transition cannot fire without a startTransition. See
|
|
367
366
|
* skills/view-transitions for the startTransition x ViewTransition matrix.
|
|
367
|
+
*
|
|
368
|
+
* Pass `when: (ctx) => boolean` to gate the transition per request: it runs
|
|
369
|
+
* server-side after the route handler (can read `ctx.get(...)`), and returning
|
|
370
|
+
* false drops the transition so the navigation streams its loading() skeleton.
|
|
368
371
|
*/
|
|
369
372
|
transition: {
|
|
370
373
|
(): TransitionItem;
|
|
@@ -58,7 +58,6 @@ export function urls<
|
|
|
58
58
|
loading: baseHelpers.loading,
|
|
59
59
|
errorBoundary: baseHelpers.errorBoundary,
|
|
60
60
|
notFoundBoundary: baseHelpers.notFoundBoundary,
|
|
61
|
-
when: baseHelpers.when,
|
|
62
61
|
cache: baseHelpers.cache as PathHelpers<TEnv>["cache"],
|
|
63
62
|
transition: baseHelpers.transition as PathHelpers<TEnv>["transition"],
|
|
64
63
|
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bake the resolved INTERNAL_RANGO_DEBUG value into the router's `internal-debug`
|
|
3
|
+
* module so the flag reaches the CLIENT debug logs by just setting the env var.
|
|
4
|
+
*
|
|
5
|
+
* internal-debug.ts normally reads the flag via `typeof __RANGO_DEBUG__`, a Vite
|
|
6
|
+
* define. That delivery is unreliable on the client: in dev Vite ships the define
|
|
7
|
+
* only as an injected global whose presence varies across consumer setups, so the
|
|
8
|
+
* module can fall through to `process.env` (undefined in the browser) and the FE
|
|
9
|
+
* debug flag silently stays false while the server logs work. A Vite `transform`
|
|
10
|
+
* runs on the module regardless of how (or whether) the define is delivered, in
|
|
11
|
+
* both dev and build and for every environment, so the discovery plugin uses this
|
|
12
|
+
* to replace the module with the resolved literal.
|
|
13
|
+
*
|
|
14
|
+
* Returns null for any module that is not the router's internal-debug module.
|
|
15
|
+
*/
|
|
16
|
+
export function injectClientDebugFlag(
|
|
17
|
+
id: string,
|
|
18
|
+
): { code: string; map: null } | null {
|
|
19
|
+
// Cheap early-out: this hook runs on every module in every environment.
|
|
20
|
+
if (!id.includes("internal-debug")) return null;
|
|
21
|
+
const norm = id.replace(/\\/g, "/");
|
|
22
|
+
// Scope to the router's own internal-debug module: the published package
|
|
23
|
+
// (`/@rangojs/router/`, incl. pnpm's nested layout) or the monorepo workspace
|
|
24
|
+
// (`/packages/rangojs-router/`). The package-anchored path avoids matching a
|
|
25
|
+
// consumer file that merely sits under a directory named `rangojs-router`.
|
|
26
|
+
const isInternalDebug =
|
|
27
|
+
/\/internal-debug\.[cm]?[jt]sx?(\?|$)/.test(norm) &&
|
|
28
|
+
(norm.includes("/@rangojs/router/") ||
|
|
29
|
+
norm.includes("/packages/rangojs-router/"));
|
|
30
|
+
if (!isInternalDebug) return null;
|
|
31
|
+
// Emit the whole module: internal-debug.ts has a single export, kept in sync.
|
|
32
|
+
return {
|
|
33
|
+
code: `export const INTERNAL_RANGO_DEBUG = ${!!process.env.INTERNAL_RANGO_DEBUG};\n`,
|
|
34
|
+
map: null,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
createScanFilter,
|
|
20
20
|
} from "../build/generate-route-types.js";
|
|
21
21
|
import { firstCodeMatchIndex } from "../build/route-types/source-scan.js";
|
|
22
|
+
import { injectClientDebugFlag } from "./inject-client-debug.js";
|
|
22
23
|
import { createVersionPlugin } from "./plugins/version-plugin.js";
|
|
23
24
|
import { createVirtualStubPlugin } from "./plugins/virtual-stub-plugin.js";
|
|
24
25
|
import {
|
|
@@ -310,19 +311,13 @@ export function createRouterDiscoveryPlugin(
|
|
|
310
311
|
return {
|
|
311
312
|
name: "@rangojs/router:discovery",
|
|
312
313
|
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
// rest of the RSC entry. A previous design forced them into dedicated
|
|
321
|
-
// __prerender-handlers / __static-handlers chunks via manualChunks,
|
|
322
|
-
// but Rollup hoisted all shared dependencies into those chunks,
|
|
323
|
-
// inflating them to ~1 MB with active runtime code. Handler code is
|
|
324
|
-
// evicted in closeBundle regardless of which chunk it lands in.
|
|
325
|
-
return config;
|
|
314
|
+
// Make INTERNAL_RANGO_DEBUG reach the CLIENT debug logs by just setting the
|
|
315
|
+
// env var. See injectClientDebugFlag: bakes the resolved flag into the
|
|
316
|
+
// internal-debug module so FE debug no longer depends on Vite delivering the
|
|
317
|
+
// `__RANGO_DEBUG__` define to the client (which it does only as an injected
|
|
318
|
+
// global whose presence varies across consumer setups). Runs in dev and build.
|
|
319
|
+
transform(_code, id) {
|
|
320
|
+
return injectClientDebugFlag(id);
|
|
326
321
|
},
|
|
327
322
|
|
|
328
323
|
configResolved(config) {
|
package/dist/__internal.d.ts
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Internal Types - Implementation Details
|
|
3
|
-
*
|
|
4
|
-
* @internal
|
|
5
|
-
* These types are for internal use only and should not be relied upon by consumers.
|
|
6
|
-
* They may change without notice between versions.
|
|
7
|
-
*
|
|
8
|
-
* If you find yourself needing these types, please open an issue to discuss
|
|
9
|
-
* adding them to the public API.
|
|
10
|
-
*/
|
|
11
|
-
/**
|
|
12
|
-
* @internal
|
|
13
|
-
* Internal representation of a resolved route segment.
|
|
14
|
-
* Used during route matching and rendering pipeline.
|
|
15
|
-
*/
|
|
16
|
-
export type { ResolvedSegment, SegmentMetadata } from "./types.js";
|
|
17
|
-
/**
|
|
18
|
-
* @internal
|
|
19
|
-
* Internal match result from route resolution.
|
|
20
|
-
*/
|
|
21
|
-
export type { MatchResult, SlotState } from "./types.js";
|
|
22
|
-
/**
|
|
23
|
-
* @internal
|
|
24
|
-
* Context for intercept route selection.
|
|
25
|
-
*/
|
|
26
|
-
export type { InterceptSelectorContext, InterceptSegmentsState, InterceptWhenFn, } from "./server/context.js";
|
|
27
|
-
/**
|
|
28
|
-
* @internal
|
|
29
|
-
* RSC protocol payload structure.
|
|
30
|
-
*/
|
|
31
|
-
export type { RscPayload, ReactFormState } from "./rsc/types.js";
|
|
32
|
-
/**
|
|
33
|
-
* @internal
|
|
34
|
-
* Internal navigation store interface.
|
|
35
|
-
*/
|
|
36
|
-
export type { NavigationStore, NavigationBridge, RscMetadata, ActionResult, InflightAction, NavigationState, TrackedActionState, ActionStateListener, SegmentCache, SegmentState, NavigationUpdate, } from "./browser/types.js";
|
|
37
|
-
/**
|
|
38
|
-
* @internal
|
|
39
|
-
* Internal handle storage mechanism.
|
|
40
|
-
*/
|
|
41
|
-
export type { HandleStore, HandleData } from "./server/handle-store.js";
|
|
42
|
-
/**
|
|
43
|
-
* @internal
|
|
44
|
-
* Segment handle data in cache.
|
|
45
|
-
*/
|
|
46
|
-
export type { SegmentHandleData } from "./cache/types.js";
|
|
47
|
-
/**
|
|
48
|
-
* @internal
|
|
49
|
-
* Internal cache entry data structure.
|
|
50
|
-
*/
|
|
51
|
-
export type { CachedEntryData, CachedEntryResult, CacheGetResult, SerializedSegmentData, CacheDefaults, } from "./cache/types.js";
|
|
52
|
-
/**
|
|
53
|
-
* @internal
|
|
54
|
-
* Router context for AsyncLocalStorage.
|
|
55
|
-
*/
|
|
56
|
-
export type { RouterContext, RevalidationContext, InterceptResult } from "./router/router-context.js";
|
|
57
|
-
/**
|
|
58
|
-
* @internal
|
|
59
|
-
* Route match context during pipeline processing.
|
|
60
|
-
*/
|
|
61
|
-
export type { MatchContext, MatchPipelineState } from "./router/match-context.js";
|
|
62
|
-
/**
|
|
63
|
-
* @internal
|
|
64
|
-
* Pattern matching result.
|
|
65
|
-
*/
|
|
66
|
-
export type { RouteMatchResult } from "./router/pattern-matching.js";
|
|
67
|
-
/**
|
|
68
|
-
* @internal
|
|
69
|
-
* Entry data during route traversal.
|
|
70
|
-
*/
|
|
71
|
-
export type { EntryData, InterceptEntry, MetricsStore, PerformanceMetric, EntryCacheConfig, EntryPropCommon, EntryPropDatas, LoaderEntry, EntryPropSegments, } from "./server/context.js";
|
|
72
|
-
/**
|
|
73
|
-
* @internal
|
|
74
|
-
* Internal handler context with additional props for router internals.
|
|
75
|
-
* Includes `_originalRequest` and `_currentSegmentId`.
|
|
76
|
-
*/
|
|
77
|
-
export type { InternalHandlerContext } from "./types.js";
|
|
78
|
-
/**
|
|
79
|
-
* @internal
|
|
80
|
-
* Debug utilities for manifest inspection and comparison.
|
|
81
|
-
*/
|
|
82
|
-
export { serializeManifest, compareManifests, formatManifestDiff, type SerializedEntry, type SerializedManifest, } from "./debug.js";
|
|
83
|
-
//# sourceMappingURL=__internal.d.ts.map
|
package/dist/__internal.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"__internal.d.ts","sourceRoot":"","sources":["../src/__internal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAMH;;;;GAIG;AACH,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAEnE;;;GAGG;AACH,YAAY,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAMzD;;;GAGG;AACH,YAAY,EACV,wBAAwB,EACxB,sBAAsB,EACtB,eAAe,GAChB,MAAM,qBAAqB,CAAC;AAM7B;;;GAGG;AACH,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEjE;;;GAGG;AACH,YAAY,EACV,eAAe,EACf,gBAAgB,EAChB,WAAW,EACX,YAAY,EACZ,cAAc,EACd,eAAe,EACf,kBAAkB,EAClB,mBAAmB,EACnB,YAAY,EACZ,YAAY,EACZ,gBAAgB,GACjB,MAAM,oBAAoB,CAAC;AAM5B;;;GAGG;AACH,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAExE;;;GAGG;AACH,YAAY,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAM1D;;;GAGG;AACH,YAAY,EACV,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,qBAAqB,EACrB,aAAa,GACd,MAAM,kBAAkB,CAAC;AAM1B;;;GAGG;AACH,YAAY,EAAE,aAAa,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAMtG;;;GAGG;AACH,YAAY,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAElF;;;GAGG;AACH,YAAY,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAMrE;;;GAGG;AACH,YAAY,EACV,SAAS,EACT,cAAc,EACd,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,WAAW,EACX,iBAAiB,GAClB,MAAM,qBAAqB,CAAC;AAM7B;;;;GAIG;AACH,YAAY,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAMzD;;;GAGG;AACH,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,KAAK,eAAe,EACpB,KAAK,kBAAkB,GACxB,MAAM,YAAY,CAAC"}
|
package/dist/__internal.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Internal Types - Implementation Details
|
|
3
|
-
*
|
|
4
|
-
* @internal
|
|
5
|
-
* These types are for internal use only and should not be relied upon by consumers.
|
|
6
|
-
* They may change without notice between versions.
|
|
7
|
-
*
|
|
8
|
-
* If you find yourself needing these types, please open an issue to discuss
|
|
9
|
-
* adding them to the public API.
|
|
10
|
-
*/
|
|
11
|
-
// ============================================================================
|
|
12
|
-
// Debug Utilities (Internal)
|
|
13
|
-
// ============================================================================
|
|
14
|
-
/**
|
|
15
|
-
* @internal
|
|
16
|
-
* Debug utilities for manifest inspection and comparison.
|
|
17
|
-
*/
|
|
18
|
-
export { serializeManifest, compareManifests, formatManifestDiff, } from "./debug.js";
|
|
19
|
-
//# sourceMappingURL=__internal.js.map
|
package/dist/__internal.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"__internal.js","sourceRoot":"","sources":["../src/__internal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAsJH,+EAA+E;AAC/E,6BAA6B;AAC7B,+EAA+E;AAE/E;;;GAGG;AACH,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,GAGnB,MAAM,YAAY,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Mock for rsc-router:version virtual module.
|
|
3
|
-
* Used by vitest since the virtual module is only available at build time.
|
|
4
|
-
* Empty string disables version path in URLs for simpler test assertions.
|
|
5
|
-
*/
|
|
6
|
-
export declare const VERSION = "";
|
|
7
|
-
//# sourceMappingURL=version.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/__mocks__/version.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,OAAO,KAAK,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Mock for rsc-router:version virtual module.
|
|
3
|
-
* Used by vitest since the virtual module is only available at build time.
|
|
4
|
-
* Empty string disables version path in URLs for simpler test assertions.
|
|
5
|
-
*/
|
|
6
|
-
export const VERSION = "";
|
|
7
|
-
//# sourceMappingURL=version.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/__mocks__/version.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,EAAE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client-href.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/client-href.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect, expectTypeOf } from "vitest";
|
|
2
|
-
import { href } from "../href-client.js";
|
|
3
|
-
describe("href()", () => {
|
|
4
|
-
describe("without mount", () => {
|
|
5
|
-
it("returns path unchanged", () => {
|
|
6
|
-
expect(href("/foo")).toBe("/foo");
|
|
7
|
-
});
|
|
8
|
-
it("handles root path", () => {
|
|
9
|
-
expect(href("/")).toBe("/");
|
|
10
|
-
});
|
|
11
|
-
it("handles nested paths", () => {
|
|
12
|
-
expect(href("/blog/my-post")).toBe("/blog/my-post");
|
|
13
|
-
});
|
|
14
|
-
it("handles paths with query strings", () => {
|
|
15
|
-
expect(href("/search?q=test")).toBe("/search?q=test");
|
|
16
|
-
});
|
|
17
|
-
it("handles paths with hash fragments", () => {
|
|
18
|
-
expect(href("/about#contact")).toBe("/about#contact");
|
|
19
|
-
});
|
|
20
|
-
it("handles paths with query and hash", () => {
|
|
21
|
-
expect(href("/page?a=1#top")).toBe("/page?a=1#top");
|
|
22
|
-
});
|
|
23
|
-
});
|
|
24
|
-
describe("with mount", () => {
|
|
25
|
-
it("prepends mount to path", () => {
|
|
26
|
-
expect(href("/foo", "/articles")).toBe("/articles/foo");
|
|
27
|
-
});
|
|
28
|
-
it("prepends mount to root path", () => {
|
|
29
|
-
expect(href("/", "/articles")).toBe("/articles/");
|
|
30
|
-
});
|
|
31
|
-
it("handles nested mount", () => {
|
|
32
|
-
expect(href("/detail", "/articles/comments")).toBe("/articles/comments/detail");
|
|
33
|
-
});
|
|
34
|
-
it("treats root mount as no mount", () => {
|
|
35
|
-
expect(href("/foo", "/")).toBe("/foo");
|
|
36
|
-
});
|
|
37
|
-
it("handles undefined mount", () => {
|
|
38
|
-
expect(href("/foo", undefined)).toBe("/foo");
|
|
39
|
-
});
|
|
40
|
-
it("handles empty string mount", () => {
|
|
41
|
-
expect(href("/foo", "")).toBe("/foo");
|
|
42
|
-
});
|
|
43
|
-
});
|
|
44
|
-
describe("PatternToPath types", () => {
|
|
45
|
-
it("static path", () => {
|
|
46
|
-
expectTypeOf().toEqualTypeOf();
|
|
47
|
-
});
|
|
48
|
-
it("dynamic param", () => {
|
|
49
|
-
expectTypeOf().toEqualTypeOf();
|
|
50
|
-
});
|
|
51
|
-
it("optional param at end", () => {
|
|
52
|
-
expectTypeOf().toEqualTypeOf();
|
|
53
|
-
});
|
|
54
|
-
it("constrained param", () => {
|
|
55
|
-
expectTypeOf().toEqualTypeOf();
|
|
56
|
-
});
|
|
57
|
-
it("multiple dynamic params", () => {
|
|
58
|
-
expectTypeOf().toEqualTypeOf();
|
|
59
|
-
});
|
|
60
|
-
it("root path stays root", () => {
|
|
61
|
-
expectTypeOf().toEqualTypeOf();
|
|
62
|
-
});
|
|
63
|
-
});
|
|
64
|
-
describe("ValidPaths fallback", () => {
|
|
65
|
-
// When no routes are registered, ValidPaths falls back to `/${string}`
|
|
66
|
-
// This is tested implicitly by the fact that href() accepts any path starting with /
|
|
67
|
-
it("accepts any path when no routes registered", () => {
|
|
68
|
-
// href() is callable with any /-prefixed string
|
|
69
|
-
const result = href("/anything/at/all");
|
|
70
|
-
expect(result).toBe("/anything/at/all");
|
|
71
|
-
});
|
|
72
|
-
});
|
|
73
|
-
});
|
|
74
|
-
//# sourceMappingURL=client-href.test.js.map
|