@rangojs/router 0.0.0-experimental.137 → 0.0.0-experimental.138
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 +237 -42
- package/dist/vite/index.js +239 -43
- package/package.json +19 -18
- package/skills/composability/SKILL.md +50 -0
- package/skills/migrate-nextjs/SKILL.md +12 -0
- package/skills/rango/SKILL.md +5 -1
- package/skills/response-routes/SKILL.md +14 -0
- package/skills/router-setup/SKILL.md +12 -0
- package/skills/testing/reverse-and-types.md +8 -7
- package/src/build/generate-manifest.ts +155 -131
- package/src/build/index.ts +3 -1
- package/src/build/route-types/include-resolution.ts +347 -47
- package/src/build/runtime-discovery.ts +4 -1
- package/src/cache/cf/cf-cache-store.ts +22 -0
- package/src/router/find-match.ts +71 -7
- package/src/router/lazy-includes.ts +64 -10
- package/src/router/manifest.ts +43 -6
- package/src/router/match-api.ts +2 -2
- package/src/router/navigation-snapshot.ts +7 -5
- package/src/router/prerender-match.ts +4 -2
- package/src/router/preview-match.ts +3 -1
- package/src/router/request-classification.ts +3 -1
- package/src/router/route-snapshot.ts +4 -2
- package/src/router/router-context.ts +3 -1
- package/src/router/router-interfaces.ts +9 -1
- package/src/router.ts +9 -2
- package/src/rsc/manifest-init.ts +1 -1
- package/src/testing/dispatch.ts +3 -3
- package/src/testing/generated-routes.ts +27 -11
- package/src/urls/include-helper.ts +10 -8
- package/src/urls/include-provider.ts +71 -0
- package/src/urls/path-helper-types.ts +25 -1
- package/src/vite/discovery/discover-routers.ts +1 -1
- package/src/vite/router-discovery.ts +8 -0
- 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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rangojs/router",
|
|
3
|
-
"version": "0.0.0-experimental.
|
|
3
|
+
"version": "0.0.0-experimental.138",
|
|
4
4
|
"description": "Django-inspired RSC router with composable URL patterns",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -162,6 +162,17 @@
|
|
|
162
162
|
"access": "public",
|
|
163
163
|
"tag": "experimental"
|
|
164
164
|
},
|
|
165
|
+
"scripts": {
|
|
166
|
+
"build": "pnpm exec esbuild src/vite/index.ts --bundle --format=esm --outfile=dist/vite/index.js --platform=node --packages=external && mkdir -p dist/vite/plugins && cp src/vite/plugins/cloudflare-protocol-loader-hook.mjs dist/vite/plugins/cloudflare-protocol-loader-hook.mjs && pnpm exec esbuild src/testing/vitest.ts --bundle --format=esm --outfile=dist/testing/vitest.js --platform=node --packages=external && pnpm exec esbuild src/bin/rango.ts --bundle --format=esm --outfile=dist/bin/rango.js --platform=node --packages=external --banner:js='#!/usr/bin/env node' && chmod +x dist/bin/rango.js",
|
|
167
|
+
"prepublishOnly": "pnpm build",
|
|
168
|
+
"typecheck": "tsc --noEmit && tsc -p tsconfig.strict-check.json --noEmit && tsc -p tsconfig.augment-check.json --noEmit",
|
|
169
|
+
"test": "playwright test",
|
|
170
|
+
"test:ui": "playwright test --ui",
|
|
171
|
+
"test:hmr-local": "playwright test --project=dev-warmup --project=hmr-routes --project=hmr-basename --project=hmr-prerender --no-deps --workers=1",
|
|
172
|
+
"test:unit": "vitest run",
|
|
173
|
+
"test:unit:watch": "vitest",
|
|
174
|
+
"test:unit:rsc": "vitest run --config vitest.rsc.config.ts"
|
|
175
|
+
},
|
|
165
176
|
"dependencies": {
|
|
166
177
|
"@types/debug": "^4.1.12",
|
|
167
178
|
"@vitejs/plugin-rsc": "^0.5.27",
|
|
@@ -173,19 +184,19 @@
|
|
|
173
184
|
},
|
|
174
185
|
"devDependencies": {
|
|
175
186
|
"@playwright/test": "^1.49.1",
|
|
187
|
+
"@shared/e2e": "workspace:*",
|
|
176
188
|
"@testing-library/dom": "^10.4.1",
|
|
177
189
|
"@testing-library/react": "^16.3.2",
|
|
178
190
|
"@types/node": "^24.10.1",
|
|
179
|
-
"@types/react": "
|
|
180
|
-
"@types/react-dom": "
|
|
191
|
+
"@types/react": "catalog:",
|
|
192
|
+
"@types/react-dom": "catalog:",
|
|
181
193
|
"esbuild": "^0.28.1",
|
|
182
194
|
"happy-dom": "^20.10.1",
|
|
183
195
|
"jiti": "^2.6.1",
|
|
184
|
-
"react": "
|
|
185
|
-
"react-dom": "
|
|
196
|
+
"react": "catalog:",
|
|
197
|
+
"react-dom": "catalog:",
|
|
186
198
|
"typescript": "^5.3.0",
|
|
187
|
-
"vitest": "^4.1.9"
|
|
188
|
-
"@shared/e2e": "0.0.1"
|
|
199
|
+
"vitest": "^4.1.9"
|
|
189
200
|
},
|
|
190
201
|
"peerDependencies": {
|
|
191
202
|
"@cloudflare/vite-plugin": "^1.42.1",
|
|
@@ -216,15 +227,5 @@
|
|
|
216
227
|
},
|
|
217
228
|
"engines": {
|
|
218
229
|
"node": "^20.19.0 || >=22.12.0"
|
|
219
|
-
},
|
|
220
|
-
"scripts": {
|
|
221
|
-
"build": "pnpm exec esbuild src/vite/index.ts --bundle --format=esm --outfile=dist/vite/index.js --platform=node --packages=external && mkdir -p dist/vite/plugins && cp src/vite/plugins/cloudflare-protocol-loader-hook.mjs dist/vite/plugins/cloudflare-protocol-loader-hook.mjs && pnpm exec esbuild src/testing/vitest.ts --bundle --format=esm --outfile=dist/testing/vitest.js --platform=node --packages=external && pnpm exec esbuild src/bin/rango.ts --bundle --format=esm --outfile=dist/bin/rango.js --platform=node --packages=external --banner:js='#!/usr/bin/env node' && chmod +x dist/bin/rango.js",
|
|
222
|
-
"typecheck": "tsc --noEmit && tsc -p tsconfig.strict-check.json --noEmit && tsc -p tsconfig.augment-check.json --noEmit",
|
|
223
|
-
"test": "playwright test",
|
|
224
|
-
"test:ui": "playwright test --ui",
|
|
225
|
-
"test:hmr-local": "playwright test --project=dev-warmup --project=hmr-routes --project=hmr-basename --project=hmr-prerender --no-deps --workers=1",
|
|
226
|
-
"test:unit": "vitest run",
|
|
227
|
-
"test:unit:watch": "vitest",
|
|
228
|
-
"test:unit:rsc": "vitest run --config vitest.rsc.config.ts"
|
|
229
230
|
}
|
|
230
|
-
}
|
|
231
|
+
}
|
|
@@ -160,6 +160,56 @@ export const adminPatterns = urls(({ path }) => [
|
|
|
160
160
|
]);
|
|
161
161
|
```
|
|
162
162
|
|
|
163
|
+
## Code-splitting a route group with async include()
|
|
164
|
+
|
|
165
|
+
`include()` takes a route module two ways. Eager — the module is already in the
|
|
166
|
+
graph:
|
|
167
|
+
|
|
168
|
+
```typescript
|
|
169
|
+
import { shopPatterns } from "./shop-patterns";
|
|
170
|
+
|
|
171
|
+
urls(({ include }) => [include("/shop", shopPatterns, { name: "shop" })]);
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
Async — the module is code-split behind a `() => import()` thunk. It becomes its
|
|
175
|
+
own chunk that is NOT evaluated at startup; the router imports it on the first
|
|
176
|
+
request that reaches the prefix, then caches it:
|
|
177
|
+
|
|
178
|
+
```typescript
|
|
179
|
+
urls(({ include }) => [
|
|
180
|
+
include("/shop", () => import("./shop-patterns"), { name: "shop" }),
|
|
181
|
+
]);
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
The split module exposes its `urls()` value as the default export (convention):
|
|
185
|
+
|
|
186
|
+
```typescript
|
|
187
|
+
// src/shop-patterns.ts
|
|
188
|
+
import { urls } from "@rangojs/router";
|
|
189
|
+
|
|
190
|
+
export const shopPatterns = urls(({ path, include }) => [
|
|
191
|
+
path("/", ShopHome, { name: "home" }),
|
|
192
|
+
include("/product", productPatterns, { name: "product" }), // nesting is fine
|
|
193
|
+
]);
|
|
194
|
+
|
|
195
|
+
export default shopPatterns; // async include() resolves this
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
**Prefer the async form** for any route group that is a natural,
|
|
199
|
+
independently-loadable unit (a localized section, an admin area, an API surface
|
|
200
|
+
with heavy handlers) — it trims the eagerly-parsed entry bundle and keeps that
|
|
201
|
+
subgraph off the cold-start path. The **eager form is still fully valid** (not
|
|
202
|
+
deprecated): keep it for small groups, or ones that share most of their module
|
|
203
|
+
graph with the entry (the bundler keeps shared modules common regardless, so
|
|
204
|
+
splitting a thin group buys little). Both match identically at runtime — only the
|
|
205
|
+
module's runtime evaluation timing differs.
|
|
206
|
+
|
|
207
|
+
What you do NOT lose by splitting: build-time discovery `await`s the provider, so
|
|
208
|
+
`href()`, `reverse()`, generated route types, and prerender still see every route
|
|
209
|
+
in the group — including nested `include()`s inside the split module. Only the
|
|
210
|
+
module's runtime evaluation defers. `rango generate` resolves the `() => import()`
|
|
211
|
+
the same way, so a code-split group is still fully typed.
|
|
212
|
+
|
|
163
213
|
## Composition Types
|
|
164
214
|
|
|
165
215
|
For typed factories, import the composition types:
|
|
@@ -153,6 +153,18 @@ export const marketingPatterns = urls(({ path }) => [
|
|
|
153
153
|
include("/", marketingPatterns, { name: "marketing" }),
|
|
154
154
|
```
|
|
155
155
|
|
|
156
|
+
Next.js code-splits each route segment automatically. Rango's eager `include()`
|
|
157
|
+
bundles the group into the entry chunk; to get Next-style per-section splitting,
|
|
158
|
+
pass an async provider so the group loads on the first request under its prefix:
|
|
159
|
+
|
|
160
|
+
```typescript
|
|
161
|
+
// urls/admin.tsx: `export default adminPatterns` — loads on first /admin request
|
|
162
|
+
include("/admin", () => import("./urls/admin"), { name: "admin" }),
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
Route types, `href()`, and prerender still see every route in the split group.
|
|
166
|
+
See `/composability`.
|
|
167
|
+
|
|
156
168
|
### Parallel routes
|
|
157
169
|
|
|
158
170
|
In Next.js, `@sidebar` and `@main` are both named slots. In Rango, the main content
|
package/skills/rango/SKILL.md
CHANGED
|
@@ -319,7 +319,11 @@ dotfiles, and existing `.gen.` files.
|
|
|
319
319
|
### Recursive includes
|
|
320
320
|
|
|
321
321
|
The generator follows `include()` calls across files, resolving imports to build
|
|
322
|
-
the full route tree.
|
|
322
|
+
the full route tree. It resolves both the eager form `include("/x", patterns)`
|
|
323
|
+
and the code-split async form `include("/x", () => import("./x"))` — for the
|
|
324
|
+
latter it walks the imported module's `export default urls(...)`, including any
|
|
325
|
+
nested `include()`s inside it — so a code-split route group is still fully typed
|
|
326
|
+
(see `/composability`). Circular includes are detected and warned about.
|
|
323
327
|
|
|
324
328
|
### First-wins deduplication
|
|
325
329
|
|
|
@@ -418,6 +418,20 @@ export const urlpatterns = urls(({ path, include }) => [
|
|
|
418
418
|
]);
|
|
419
419
|
```
|
|
420
420
|
|
|
421
|
+
A heavy module like this is a good code-split candidate. Pass an async provider
|
|
422
|
+
and the module — its handlers, response serializers, and any nested
|
|
423
|
+
`include()`s — loads on the first request under the prefix instead of at startup:
|
|
424
|
+
|
|
425
|
+
```typescript
|
|
426
|
+
// blog/urls.tsx: `export default blogPatterns`
|
|
427
|
+
include("/blog", () => import("./blog/urls"), { name: "blog" }),
|
|
428
|
+
```
|
|
429
|
+
|
|
430
|
+
Named routes and response types still resolve through the split: `TRoutes` and
|
|
431
|
+
the `_responses` phantom are inferred from the resolved `urls()` value, so
|
|
432
|
+
`Rango.PathResponse<"/blog/api/stats">` and `ctx.reverse` are unchanged. See
|
|
433
|
+
`/composability`.
|
|
434
|
+
|
|
421
435
|
### Type safety after mounting
|
|
422
436
|
|
|
423
437
|
```typescript
|
|
@@ -398,6 +398,18 @@ export const urlpatterns = urls(({ path, include }) => [
|
|
|
398
398
|
]);
|
|
399
399
|
```
|
|
400
400
|
|
|
401
|
+
`include()` also accepts an async provider to code-split that group into its own
|
|
402
|
+
chunk, imported on the first request reaching the prefix instead of at startup:
|
|
403
|
+
|
|
404
|
+
```typescript
|
|
405
|
+
// urls/shop.tsx: `export default shopPatterns`
|
|
406
|
+
include("/shop", () => import("./urls/shop"), { name: "shop" }),
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
Build-time discovery still `await`s the provider, so route types, `href()`, and
|
|
410
|
+
prerender see every route in the split group. Reach for it when a group is a
|
|
411
|
+
large, independently-loadable unit — see `/composability`.
|
|
412
|
+
|
|
401
413
|
## Environment Types
|
|
402
414
|
|
|
403
415
|
```typescript
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
**Layer:** unit (node) + typecheck · **Import:** `@rangojs/router/client` (useReverse), `@rangojs/router/testing` (assertGeneratedRoutesMatch) · **DSL it tests:** `reverse`/`href`/`useReverse` (see `/typesafety`, `/links`)
|
|
4
4
|
|
|
5
|
-
The reverse/href/params/env types are a real contract: a wrong route name, a missing param, or an unknown env binding should be a COMPILE error, not a runtime surprise. The type-test recipes have no runtime API — `tsc --noEmit` IS the assertion. `assertGeneratedRoutesMatch` is the one runtime helper here: it runs the router's real matching to expand lazy includes, then diffs the live `routeMap` against the generated named-routes map you seed.
|
|
5
|
+
The reverse/href/params/env types are a real contract: a wrong route name, a missing param, or an unknown env binding should be a COMPILE error, not a runtime surprise. The type-test recipes have no runtime API — `tsc --noEmit` IS the assertion. `assertGeneratedRoutesMatch` is the one runtime helper here: it runs the router's real matching to expand lazy includes, then diffs the live `routeMap` against the generated named-routes map you seed. It (and `diffGeneratedRoutes`) are **async — `await` them** — because expanding an async `include(prefix, () => import("./routes"))` group means importing that module first.
|
|
6
6
|
|
|
7
7
|
## API
|
|
8
8
|
|
|
@@ -13,7 +13,7 @@ The reverse/href/params/env types are a real contract: a wrong route name, a mis
|
|
|
13
13
|
| `router` | `{ routeMap; findMatch? }` | Your router (real impl). `routeMap` is the live name→pattern map; `findMatch` (when present) is called to force-expand lazy `include()`d routes. |
|
|
14
14
|
| `generatedMap` | `Record<string, unknown>` (optional) | The imported `*.named-routes.gen.ts` map (name→pattern, or `{ path }` objects). Omit to diff against the global route map (`getGlobalRouteMap()`) instead. |
|
|
15
15
|
|
|
16
|
-
### Context — `GeneratedRoutesDiff` (what `diffGeneratedRoutes`
|
|
16
|
+
### Context — `GeneratedRoutesDiff` (what `diffGeneratedRoutes` resolves to)
|
|
17
17
|
|
|
18
18
|
| Field | Type | Meaning |
|
|
19
19
|
| ---------- | ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
@@ -24,7 +24,7 @@ The reverse/href/params/env types are a real contract: a wrong route name, a mis
|
|
|
24
24
|
|
|
25
25
|
### Returns — `assertGeneratedRoutesMatch`
|
|
26
26
|
|
|
27
|
-
`void
|
|
27
|
+
`Promise<void>` — **await it**. Resolves on match; on drift the promise REJECTS with an `Error` listing every missing, extra, and mismatched route plus a "regenerate the `*.named-routes.gen.ts` file" hint. (`diffGeneratedRoutes` resolves to the `GeneratedRoutesDiff` above and never rejects.) Both are async so an async `include(() => import())` group is imported and spliced into `routeMap` before the diff — call them without `await` and every route in that group reads as a false `missing`.
|
|
28
28
|
|
|
29
29
|
## Recipe
|
|
30
30
|
|
|
@@ -57,14 +57,15 @@ expectTypeOf<
|
|
|
57
57
|
|
|
58
58
|
```ts
|
|
59
59
|
// 3. assertGeneratedRoutesMatch — a one-liner whole-app drift test. Real
|
|
60
|
-
// matching expands lazy include()d routes before the diff.
|
|
60
|
+
// matching expands lazy include()d routes before the diff. It is async
|
|
61
|
+
// (it awaits findMatch to import async include groups), so await it.
|
|
61
62
|
import { it } from "vitest";
|
|
62
63
|
import { assertGeneratedRoutesMatch } from "@rangojs/router/testing";
|
|
63
64
|
import { router } from "../src/router";
|
|
64
65
|
import generated from "../src/router.named-routes.gen";
|
|
65
66
|
|
|
66
|
-
it("generated named-routes map is in sync with the router", () => {
|
|
67
|
-
assertGeneratedRoutesMatch(router, generated);
|
|
67
|
+
it("generated named-routes map is in sync with the router", async () => {
|
|
68
|
+
await assertGeneratedRoutesMatch(router, generated);
|
|
68
69
|
});
|
|
69
70
|
```
|
|
70
71
|
|
|
@@ -74,7 +75,7 @@ For a large type-only suite, collect recipe-1/2 assertions in `*.test-d.ts` file
|
|
|
74
75
|
|
|
75
76
|
- Type tests run at TYPECHECK time (`tsc --noEmit`), NOT in the vitest runner. They are their own layer — wire them into CI as a real step (`pnpm run typecheck`). A type test nobody runs is just a comment.
|
|
76
77
|
- `@ts-expect-error` ERRORS if the line below it ever starts compiling, so a regressed guard fails the typecheck. A runtime test cannot assert "this should not type-check".
|
|
77
|
-
- `assertGeneratedRoutesMatch` force-expands lazy `include()`d routes (
|
|
78
|
+
- `assertGeneratedRoutesMatch` force-expands lazy `include()`d routes (awaits `findMatch` on a concrete path derived from each generated pattern) before diffing — otherwise every included route reads as a false `missing`. It is **async** so it can await the module import behind an async `include(() => import())` group; `await` the call (or the async group's routes read as `missing`). This makes the whole-app drift check work in a plain unit test. Routers without `findMatch` (a bare `{ routeMap }`) are left as-is.
|
|
78
79
|
- MULTI-APP route-map isolation. `href()`/`reverse()` typing is GLOBAL — each app's generated file augments the one `Rango.GeneratedRouteMap` interface. A `renderRoute` suite that imports a client component from app B (which calls `href("/b-route")`) won't typecheck if the same tsconfig program also carries app A's augmentation: A's route union rejects B's name. `renderRoute` is app-agnostic at RUNTIME; the collision is purely the global `href` typing. Keep a `renderRoute` suite single-app, or give each app its OWN tsconfig program (see `/typesafety`); a quick sidestep is to probe `useMount`/`useHref` inline instead of importing the cross-app component.
|
|
79
80
|
|
|
80
81
|
## See also
|
|
@@ -17,6 +17,11 @@ import type { TrailingSlashMode } from "../types.js";
|
|
|
17
17
|
import { createRouteHelpers } from "../route-definition.js";
|
|
18
18
|
import MapRootLayout from "../server/root-layout.js";
|
|
19
19
|
import { collectFallbackClientRefs } from "./collect-fallback-refs.js";
|
|
20
|
+
import {
|
|
21
|
+
isIncludeProvider,
|
|
22
|
+
resolveIncludeModule,
|
|
23
|
+
type IncludeProvider,
|
|
24
|
+
} from "../urls/include-provider.js";
|
|
20
25
|
|
|
21
26
|
/**
|
|
22
27
|
* Node in the prefix tree
|
|
@@ -61,13 +66,32 @@ export interface GeneratedManifest {
|
|
|
61
66
|
// Merge tracked nested includes into `target`. Multiple includes can share a
|
|
62
67
|
// fullPrefix (e.g. include("/", a), include("/", b)) — concat their routes and
|
|
63
68
|
// Object.assign children rather than overwrite.
|
|
64
|
-
function mergeIncludeNodes(
|
|
69
|
+
async function mergeIncludeNodes(
|
|
65
70
|
target: Record<string, PrefixTreeNode>,
|
|
66
71
|
includes: TrackedInclude[],
|
|
67
|
-
buildChild: (include: TrackedInclude) => PrefixTreeNode
|
|
68
|
-
): void {
|
|
72
|
+
buildChild: (include: TrackedInclude) => Promise<PrefixTreeNode>,
|
|
73
|
+
): Promise<void> {
|
|
69
74
|
for (const include of includes) {
|
|
70
|
-
|
|
75
|
+
let node: PrefixTreeNode;
|
|
76
|
+
try {
|
|
77
|
+
node = await buildChild(include);
|
|
78
|
+
} catch (err) {
|
|
79
|
+
// Discovery (build-time, and the dev trie-rebuild) populates the
|
|
80
|
+
// manifest / trie / generated types for the WHOLE app. A failing async
|
|
81
|
+
// include provider here — a broken import, a module that throws at eval —
|
|
82
|
+
// must HARD-FAIL, not be swallowed: swallowing produces a green build with
|
|
83
|
+
// the entire route group silently absent from the manifest/trie/types, so
|
|
84
|
+
// CI passes, the deploy ships, and every one of that group's URLs then
|
|
85
|
+
// 404s/500s in production. On main an eager include that threw failed the
|
|
86
|
+
// build loudly; the async form must keep that contract. Rethrow with the
|
|
87
|
+
// offending prefix so the failure is actionable. (Sibling isolation
|
|
88
|
+
// belongs at PER-REQUEST runtime — see find-match.ts — not at discovery.)
|
|
89
|
+
throw new Error(
|
|
90
|
+
`[@rangojs/router] Failed to resolve include at prefix "${include.fullPrefix}" ` +
|
|
91
|
+
`during route discovery: ${(err as Error)?.message ?? String(err)}`,
|
|
92
|
+
{ cause: err },
|
|
93
|
+
);
|
|
94
|
+
}
|
|
71
95
|
const existing = target[include.fullPrefix];
|
|
72
96
|
if (existing) {
|
|
73
97
|
existing.routes.push(...node.routes);
|
|
@@ -78,10 +102,10 @@ function mergeIncludeNodes(
|
|
|
78
102
|
}
|
|
79
103
|
}
|
|
80
104
|
|
|
81
|
-
function buildPrefixTreeNode(
|
|
105
|
+
async function buildPrefixTreeNode(
|
|
82
106
|
urlPrefix: string,
|
|
83
107
|
namePrefix: string | undefined,
|
|
84
|
-
|
|
108
|
+
patternsOrProvider: UrlPatterns<any> | IncludeProvider<any>,
|
|
85
109
|
routeManifest: Record<string, string>,
|
|
86
110
|
routeAncestry: Record<string, string[]>, // internal: feeds trie building, not exported
|
|
87
111
|
mountIndex: number,
|
|
@@ -92,7 +116,14 @@ function buildPrefixTreeNode(
|
|
|
92
116
|
passthroughRoutes?: string[],
|
|
93
117
|
responseTypeRoutes?: Record<string, string>,
|
|
94
118
|
routeSearchSchemas?: Record<string, Record<string, string>>,
|
|
95
|
-
): PrefixTreeNode {
|
|
119
|
+
): Promise<PrefixTreeNode> {
|
|
120
|
+
// Resolve an async include provider (`() => import("./routes")`) so its routes
|
|
121
|
+
// are walked into the build-time manifest/types/href. Runtime matching still
|
|
122
|
+
// defers the import via lazy-includes; this only runs during build/dev
|
|
123
|
+
// discovery, which is async.
|
|
124
|
+
const patterns: UrlPatterns<any> = isIncludeProvider(patternsOrProvider)
|
|
125
|
+
? resolveIncludeModule(await patternsOrProvider(), urlPrefix)
|
|
126
|
+
: patternsOrProvider;
|
|
96
127
|
if (visited.has(patterns)) {
|
|
97
128
|
console.warn(
|
|
98
129
|
`[@rangojs/router] Circular include detected at prefix "${urlPrefix}". Skipping.`,
|
|
@@ -106,118 +137,117 @@ function buildPrefixTreeNode(
|
|
|
106
137
|
};
|
|
107
138
|
}
|
|
108
139
|
visited.add(patterns);
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
140
|
+
try {
|
|
141
|
+
// Create context for running patterns with include tracking
|
|
142
|
+
const manifest = new Map<string, EntryData>();
|
|
143
|
+
const patternsMap = new Map<string, string>();
|
|
144
|
+
const patternsByPrefix = new Map<string, Map<string, string>>();
|
|
145
|
+
const trailingSlashMap = new Map<string, TrailingSlashMode>();
|
|
146
|
+
const searchSchemasMap = new Map<string, Record<string, string>>();
|
|
147
|
+
const trackedIncludes: TrackedInclude[] = [];
|
|
116
148
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
149
|
+
RangoContext.run(
|
|
150
|
+
{
|
|
151
|
+
manifest,
|
|
152
|
+
patterns: patternsMap,
|
|
153
|
+
patternsByPrefix,
|
|
154
|
+
trailingSlash: trailingSlashMap,
|
|
155
|
+
searchSchemas: searchSchemasMap,
|
|
156
|
+
namespace: "build",
|
|
157
|
+
parent: null,
|
|
158
|
+
counters: {},
|
|
159
|
+
mountIndex,
|
|
160
|
+
trackedIncludes, // Enable nested include tracking
|
|
161
|
+
},
|
|
162
|
+
() => {
|
|
163
|
+
const helpers = createRouteHelpers();
|
|
164
|
+
// Wrap in root layout for correct parent hierarchy (matches runtime)
|
|
165
|
+
helpers.layout(MapRootLayout, () => {
|
|
166
|
+
if (urlPrefix || namePrefix) {
|
|
167
|
+
return runWithPrefixes(urlPrefix, namePrefix, () => {
|
|
168
|
+
return patterns.handler() as AllUseItems[];
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
return patterns.handler() as AllUseItems[];
|
|
172
|
+
});
|
|
173
|
+
},
|
|
174
|
+
);
|
|
143
175
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
routes.push(name);
|
|
148
|
-
routeManifest[name] = pattern;
|
|
149
|
-
}
|
|
176
|
+
// Collect route names defined in this include (routes have prefixes applied)
|
|
177
|
+
const routes = [...patternsMap.keys()];
|
|
178
|
+
Object.assign(routeManifest, Object.fromEntries(patternsMap));
|
|
150
179
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
180
|
+
// Collect trailing slash config
|
|
181
|
+
if (routeTrailingSlash) {
|
|
182
|
+
for (const [name, mode] of trailingSlashMap.entries()) {
|
|
183
|
+
routeTrailingSlash[name] = mode;
|
|
184
|
+
}
|
|
155
185
|
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
186
|
+
if (routeSearchSchemas) {
|
|
187
|
+
for (const [name, schema] of searchSchemasMap.entries()) {
|
|
188
|
+
routeSearchSchemas[name] = schema;
|
|
189
|
+
}
|
|
160
190
|
}
|
|
161
|
-
}
|
|
162
191
|
|
|
163
|
-
|
|
164
|
-
|
|
192
|
+
// Capture ancestry from manifest entries' parent chains
|
|
193
|
+
captureAncestry(manifest, routeAncestry);
|
|
165
194
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
195
|
+
// Collect prerender route names and handler definitions from manifest entries
|
|
196
|
+
if (prerenderRoutes) {
|
|
197
|
+
for (const [name, entry] of manifest) {
|
|
198
|
+
if (entry.type === "route" && entry.isPrerender) {
|
|
199
|
+
prerenderRoutes.push(name);
|
|
200
|
+
if (prerenderDefs && entry.prerenderDef) {
|
|
201
|
+
prerenderDefs[name] = entry.prerenderDef;
|
|
202
|
+
}
|
|
203
|
+
if (passthroughRoutes && entry.isPassthrough === true) {
|
|
204
|
+
passthroughRoutes.push(name);
|
|
205
|
+
}
|
|
176
206
|
}
|
|
177
207
|
}
|
|
178
208
|
}
|
|
179
|
-
}
|
|
180
209
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
210
|
+
// Collect response type routes from manifest entries
|
|
211
|
+
if (responseTypeRoutes) {
|
|
212
|
+
for (const [name, entry] of manifest) {
|
|
213
|
+
if (entry.type === "route" && entry.responseType) {
|
|
214
|
+
responseTypeRoutes[name] = entry.responseType;
|
|
215
|
+
}
|
|
186
216
|
}
|
|
187
217
|
}
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
const children: Record<string, PrefixTreeNode> = {};
|
|
191
|
-
mergeIncludeNodes(children, trackedIncludes, (include) =>
|
|
192
|
-
buildPrefixTreeNode(
|
|
193
|
-
include.fullPrefix,
|
|
194
|
-
include.namePrefix,
|
|
195
|
-
include.patterns as UrlPatterns<any>,
|
|
196
|
-
routeManifest,
|
|
197
|
-
routeAncestry,
|
|
198
|
-
mountIndex,
|
|
199
|
-
visited,
|
|
200
|
-
routeTrailingSlash,
|
|
201
|
-
prerenderRoutes,
|
|
202
|
-
prerenderDefs,
|
|
203
|
-
passthroughRoutes,
|
|
204
|
-
responseTypeRoutes,
|
|
205
|
-
routeSearchSchemas,
|
|
206
|
-
),
|
|
207
|
-
);
|
|
208
218
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
219
|
+
const children: Record<string, PrefixTreeNode> = {};
|
|
220
|
+
await mergeIncludeNodes(children, trackedIncludes, (include) =>
|
|
221
|
+
buildPrefixTreeNode(
|
|
222
|
+
include.fullPrefix,
|
|
223
|
+
include.namePrefix,
|
|
224
|
+
include.patterns as UrlPatterns<any> | IncludeProvider<any>,
|
|
225
|
+
routeManifest,
|
|
226
|
+
routeAncestry,
|
|
227
|
+
mountIndex,
|
|
228
|
+
visited,
|
|
229
|
+
routeTrailingSlash,
|
|
230
|
+
prerenderRoutes,
|
|
231
|
+
prerenderDefs,
|
|
232
|
+
passthroughRoutes,
|
|
233
|
+
responseTypeRoutes,
|
|
234
|
+
routeSearchSchemas,
|
|
235
|
+
),
|
|
236
|
+
);
|
|
213
237
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
238
|
+
return {
|
|
239
|
+
staticPrefix: extractStaticPrefix(urlPrefix),
|
|
240
|
+
fullPrefix: urlPrefix,
|
|
241
|
+
namePrefix: namePrefix || undefined,
|
|
242
|
+
children,
|
|
243
|
+
routes,
|
|
244
|
+
};
|
|
245
|
+
} finally {
|
|
246
|
+
// Remove from visited so sibling branches can reuse the same patterns without
|
|
247
|
+
// false circular-include detection — and so a throwing handler (caught by the
|
|
248
|
+
// parent mergeIncludeNodes) does not leak this entry into the shared set.
|
|
249
|
+
visited.delete(patterns);
|
|
250
|
+
}
|
|
221
251
|
}
|
|
222
252
|
|
|
223
253
|
/**
|
|
@@ -261,7 +291,8 @@ export interface FullManifest extends GeneratedManifest {
|
|
|
261
291
|
* import { generateManifest } from "@rangojs/router/build";
|
|
262
292
|
* import { urlpatterns } from "./urls";
|
|
263
293
|
*
|
|
264
|
-
*
|
|
294
|
+
* // Async: awaits async include() providers (`() => import("./routes")`).
|
|
295
|
+
* const manifest = await generateManifest(urlpatterns);
|
|
265
296
|
* // Write to file for runtime use
|
|
266
297
|
* fs.writeFileSync(
|
|
267
298
|
* "src/generated/route-manifest.json",
|
|
@@ -269,15 +300,12 @@ export interface FullManifest extends GeneratedManifest {
|
|
|
269
300
|
* );
|
|
270
301
|
* ```
|
|
271
302
|
*/
|
|
272
|
-
export function generateManifest<TEnv>(
|
|
303
|
+
export async function generateManifest<TEnv>(
|
|
273
304
|
urlpatterns: UrlPatterns<TEnv, any>,
|
|
274
305
|
mountIndex: number = 0,
|
|
275
|
-
): GeneratedManifest {
|
|
276
|
-
const {
|
|
277
|
-
|
|
278
|
-
_prerenderDefs: __,
|
|
279
|
-
...publicManifest
|
|
280
|
-
} = generateManifestFull(urlpatterns, mountIndex);
|
|
306
|
+
): Promise<GeneratedManifest> {
|
|
307
|
+
const { _routeAncestry, _prerenderDefs, ...publicManifest } =
|
|
308
|
+
await generateManifestFull(urlpatterns, mountIndex);
|
|
281
309
|
return publicManifest;
|
|
282
310
|
}
|
|
283
311
|
|
|
@@ -288,7 +316,7 @@ export function generateManifest<TEnv>(
|
|
|
288
316
|
* @rangojs/router/build), manifest-init (direct import), and trie
|
|
289
317
|
* building. Not intended for external use.
|
|
290
318
|
*/
|
|
291
|
-
export function generateManifestFull<TEnv>(
|
|
319
|
+
export async function generateManifestFull<TEnv>(
|
|
292
320
|
urlpatterns: UrlPatterns<TEnv, any>,
|
|
293
321
|
mountIndex: number = 0,
|
|
294
322
|
options?: {
|
|
@@ -302,7 +330,7 @@ export function generateManifestFull<TEnv>(
|
|
|
302
330
|
*/
|
|
303
331
|
collectClientFallbackRef?: (refKey: string) => void;
|
|
304
332
|
},
|
|
305
|
-
): FullManifest {
|
|
333
|
+
): Promise<FullManifest> {
|
|
306
334
|
const routeManifest: Record<string, string> = {};
|
|
307
335
|
const routeAncestry: Record<string, string[]> = {};
|
|
308
336
|
const prefixTree: Record<string, PrefixTreeNode> = {};
|
|
@@ -356,17 +384,13 @@ export function generateManifestFull<TEnv>(
|
|
|
356
384
|
}
|
|
357
385
|
|
|
358
386
|
// Collect root-level routes and trailing slash config
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
const routeSearchSchemas: Record<string, Record<string, string>> = {};
|
|
367
|
-
for (const [name, schema] of searchSchemasMap.entries()) {
|
|
368
|
-
routeSearchSchemas[name] = schema;
|
|
369
|
-
}
|
|
387
|
+
Object.assign(routeManifest, Object.fromEntries(patternsMap));
|
|
388
|
+
const routeTrailingSlash: Record<string, string> =
|
|
389
|
+
Object.fromEntries(trailingSlashMap);
|
|
390
|
+
const routeSearchSchemas: Record<
|
|
391
|
+
string,
|
|
392
|
+
Record<string, string>
|
|
393
|
+
> = Object.fromEntries(searchSchemasMap);
|
|
370
394
|
|
|
371
395
|
// Capture ancestry from manifest entries' parent chains
|
|
372
396
|
captureAncestry(manifest, routeAncestry);
|
|
@@ -393,11 +417,11 @@ export function generateManifestFull<TEnv>(
|
|
|
393
417
|
|
|
394
418
|
// Shared visited set for cycle detection across all root-level includes.
|
|
395
419
|
const visited = new Set<unknown>();
|
|
396
|
-
mergeIncludeNodes(prefixTree, trackedIncludes, (include) =>
|
|
420
|
+
await mergeIncludeNodes(prefixTree, trackedIncludes, (include) =>
|
|
397
421
|
buildPrefixTreeNode(
|
|
398
422
|
include.fullPrefix,
|
|
399
423
|
include.namePrefix,
|
|
400
|
-
include.patterns as UrlPatterns<any>,
|
|
424
|
+
include.patterns as UrlPatterns<any> | IncludeProvider<any>,
|
|
401
425
|
routeManifest,
|
|
402
426
|
routeAncestry,
|
|
403
427
|
mountIndex,
|
|
@@ -441,14 +465,14 @@ export function generateManifestFull<TEnv>(
|
|
|
441
465
|
*
|
|
442
466
|
* @example
|
|
443
467
|
* ```typescript
|
|
444
|
-
* const code = generateManifestCode(urlpatterns);
|
|
468
|
+
* const code = await generateManifestCode(urlpatterns);
|
|
445
469
|
* fs.writeFileSync("src/generated/route-manifest.ts", code);
|
|
446
470
|
* ```
|
|
447
471
|
*/
|
|
448
|
-
export function generateManifestCode<TEnv>(
|
|
472
|
+
export async function generateManifestCode<TEnv>(
|
|
449
473
|
urlpatterns: UrlPatterns<TEnv, any>,
|
|
450
|
-
): string {
|
|
451
|
-
const manifest = generateManifest(urlpatterns);
|
|
474
|
+
): Promise<string> {
|
|
475
|
+
const manifest = await generateManifest(urlpatterns);
|
|
452
476
|
|
|
453
477
|
return `/**
|
|
454
478
|
* Auto-generated route manifest
|