@rangojs/router 0.0.0-experimental.9 → 0.0.0-experimental.90
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/AGENTS.md +9 -0
- package/README.md +972 -4
- package/dist/__internal.d.ts +83 -0
- package/dist/__internal.d.ts.map +1 -0
- package/dist/__internal.js +19 -0
- package/dist/__internal.js.map +1 -0
- package/dist/__mocks__/version.d.ts +7 -0
- package/dist/__mocks__/version.d.ts.map +1 -0
- package/dist/__mocks__/version.js +7 -0
- package/dist/__mocks__/version.js.map +1 -0
- package/dist/__tests__/client-href.test.d.ts +2 -0
- package/dist/__tests__/client-href.test.d.ts.map +1 -0
- package/dist/__tests__/client-href.test.js +74 -0
- package/dist/__tests__/client-href.test.js.map +1 -0
- package/dist/__tests__/component-utils.test.d.ts +2 -0
- package/dist/__tests__/component-utils.test.d.ts.map +1 -0
- package/dist/__tests__/component-utils.test.js +51 -0
- package/dist/__tests__/component-utils.test.js.map +1 -0
- package/dist/__tests__/event-controller.test.d.ts +2 -0
- package/dist/__tests__/event-controller.test.d.ts.map +1 -0
- package/dist/__tests__/event-controller.test.js +538 -0
- package/dist/__tests__/event-controller.test.js.map +1 -0
- package/dist/__tests__/helpers/route-tree.d.ts +118 -0
- package/dist/__tests__/helpers/route-tree.d.ts.map +1 -0
- package/dist/__tests__/helpers/route-tree.js +374 -0
- package/dist/__tests__/helpers/route-tree.js.map +1 -0
- package/dist/__tests__/match-result.test.d.ts +2 -0
- package/dist/__tests__/match-result.test.d.ts.map +1 -0
- package/dist/__tests__/match-result.test.js +154 -0
- package/dist/__tests__/match-result.test.js.map +1 -0
- package/dist/__tests__/navigation-store.test.d.ts +2 -0
- package/dist/__tests__/navigation-store.test.d.ts.map +1 -0
- package/dist/__tests__/navigation-store.test.js +440 -0
- package/dist/__tests__/navigation-store.test.js.map +1 -0
- package/dist/__tests__/partial-update.test.d.ts +2 -0
- package/dist/__tests__/partial-update.test.d.ts.map +1 -0
- package/dist/__tests__/partial-update.test.js +1009 -0
- package/dist/__tests__/partial-update.test.js.map +1 -0
- package/dist/__tests__/reverse-types.test.d.ts +8 -0
- package/dist/__tests__/reverse-types.test.d.ts.map +1 -0
- package/dist/__tests__/reverse-types.test.js +656 -0
- package/dist/__tests__/reverse-types.test.js.map +1 -0
- package/dist/__tests__/route-definition.test.d.ts +2 -0
- package/dist/__tests__/route-definition.test.d.ts.map +1 -0
- package/dist/__tests__/route-definition.test.js +55 -0
- package/dist/__tests__/route-definition.test.js.map +1 -0
- package/dist/__tests__/router-helpers.test.d.ts +2 -0
- package/dist/__tests__/router-helpers.test.d.ts.map +1 -0
- package/dist/__tests__/router-helpers.test.js +377 -0
- package/dist/__tests__/router-helpers.test.js.map +1 -0
- package/dist/__tests__/router-integration-2.test.d.ts +2 -0
- package/dist/__tests__/router-integration-2.test.d.ts.map +1 -0
- package/dist/__tests__/router-integration-2.test.js +426 -0
- package/dist/__tests__/router-integration-2.test.js.map +1 -0
- package/dist/__tests__/router-integration.test.d.ts +2 -0
- package/dist/__tests__/router-integration.test.d.ts.map +1 -0
- package/dist/__tests__/router-integration.test.js +1051 -0
- package/dist/__tests__/router-integration.test.js.map +1 -0
- package/dist/__tests__/search-params.test.d.ts +5 -0
- package/dist/__tests__/search-params.test.d.ts.map +1 -0
- package/dist/__tests__/search-params.test.js +306 -0
- package/dist/__tests__/search-params.test.js.map +1 -0
- package/dist/__tests__/segment-system.test.d.ts +2 -0
- package/dist/__tests__/segment-system.test.d.ts.map +1 -0
- package/dist/__tests__/segment-system.test.js +627 -0
- package/dist/__tests__/segment-system.test.js.map +1 -0
- package/dist/__tests__/static-handler-types.test.d.ts +8 -0
- package/dist/__tests__/static-handler-types.test.d.ts.map +1 -0
- package/dist/__tests__/static-handler-types.test.js +63 -0
- package/dist/__tests__/static-handler-types.test.js.map +1 -0
- package/dist/__tests__/urls.test.d.ts +2 -0
- package/dist/__tests__/urls.test.d.ts.map +1 -0
- package/dist/__tests__/urls.test.js +421 -0
- package/dist/__tests__/urls.test.js.map +1 -0
- package/dist/__tests__/use-mount.test.d.ts +2 -0
- package/dist/__tests__/use-mount.test.d.ts.map +1 -0
- package/dist/__tests__/use-mount.test.js +35 -0
- package/dist/__tests__/use-mount.test.js.map +1 -0
- package/dist/bin/rango.d.ts +2 -0
- package/dist/bin/rango.d.ts.map +1 -0
- package/dist/bin/rango.js +1619 -155
- package/dist/bin/rango.js.map +1 -0
- package/dist/browser/event-controller.d.ts +191 -0
- package/dist/browser/event-controller.d.ts.map +1 -0
- package/dist/browser/event-controller.js +559 -0
- package/dist/browser/event-controller.js.map +1 -0
- package/dist/browser/index.d.ts +2 -0
- package/dist/browser/index.d.ts.map +1 -0
- package/dist/browser/index.js +14 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/browser/link-interceptor.d.ts +38 -0
- package/dist/browser/link-interceptor.d.ts.map +1 -0
- package/dist/browser/link-interceptor.js +99 -0
- package/dist/browser/link-interceptor.js.map +1 -0
- package/dist/browser/logging.d.ts +10 -0
- package/dist/browser/logging.d.ts.map +1 -0
- package/dist/browser/logging.js +29 -0
- package/dist/browser/logging.js.map +1 -0
- package/dist/browser/lru-cache.d.ts +17 -0
- package/dist/browser/lru-cache.d.ts.map +1 -0
- package/dist/browser/lru-cache.js +50 -0
- package/dist/browser/lru-cache.js.map +1 -0
- package/dist/browser/merge-segment-loaders.d.ts +39 -0
- package/dist/browser/merge-segment-loaders.d.ts.map +1 -0
- package/dist/browser/merge-segment-loaders.js +102 -0
- package/dist/browser/merge-segment-loaders.js.map +1 -0
- package/dist/browser/navigation-bridge.d.ts +102 -0
- package/dist/browser/navigation-bridge.d.ts.map +1 -0
- package/dist/browser/navigation-bridge.js +708 -0
- package/dist/browser/navigation-bridge.js.map +1 -0
- package/dist/browser/navigation-client.d.ts +25 -0
- package/dist/browser/navigation-client.d.ts.map +1 -0
- package/dist/browser/navigation-client.js +157 -0
- package/dist/browser/navigation-client.js.map +1 -0
- package/dist/browser/navigation-store.d.ts +101 -0
- package/dist/browser/navigation-store.d.ts.map +1 -0
- package/dist/browser/navigation-store.js +625 -0
- package/dist/browser/navigation-store.js.map +1 -0
- package/dist/browser/partial-update.d.ts +75 -0
- package/dist/browser/partial-update.d.ts.map +1 -0
- package/dist/browser/partial-update.js +426 -0
- package/dist/browser/partial-update.js.map +1 -0
- package/dist/browser/react/Link.d.ts +86 -0
- package/dist/browser/react/Link.d.ts.map +1 -0
- package/dist/browser/react/Link.js +128 -0
- package/dist/browser/react/Link.js.map +1 -0
- package/dist/browser/react/NavigationProvider.d.ts +63 -0
- package/dist/browser/react/NavigationProvider.d.ts.map +1 -0
- package/dist/browser/react/NavigationProvider.js +216 -0
- package/dist/browser/react/NavigationProvider.js.map +1 -0
- package/dist/browser/react/ScrollRestoration.d.ts +75 -0
- package/dist/browser/react/ScrollRestoration.d.ts.map +1 -0
- package/dist/browser/react/ScrollRestoration.js +57 -0
- package/dist/browser/react/ScrollRestoration.js.map +1 -0
- package/dist/browser/react/context.d.ts +46 -0
- package/dist/browser/react/context.d.ts.map +1 -0
- package/dist/browser/react/context.js +10 -0
- package/dist/browser/react/context.js.map +1 -0
- package/dist/browser/react/index.d.ts +11 -0
- package/dist/browser/react/index.d.ts.map +1 -0
- package/dist/browser/react/index.js +22 -0
- package/dist/browser/react/index.js.map +1 -0
- package/dist/browser/react/location-state-shared.d.ts +63 -0
- package/dist/browser/react/location-state-shared.d.ts.map +1 -0
- package/dist/browser/react/location-state-shared.js +81 -0
- package/dist/browser/react/location-state-shared.js.map +1 -0
- package/dist/browser/react/location-state.d.ts +23 -0
- package/dist/browser/react/location-state.d.ts.map +1 -0
- package/dist/browser/react/location-state.js +29 -0
- package/dist/browser/react/location-state.js.map +1 -0
- package/dist/browser/react/mount-context.d.ts +24 -0
- package/dist/browser/react/mount-context.d.ts.map +1 -0
- package/dist/browser/react/mount-context.js +24 -0
- package/dist/browser/react/mount-context.js.map +1 -0
- package/dist/browser/react/use-action.d.ts +64 -0
- package/dist/browser/react/use-action.d.ts.map +1 -0
- package/dist/browser/react/use-action.js +134 -0
- package/dist/browser/react/use-action.js.map +1 -0
- package/dist/browser/react/use-client-cache.d.ts +41 -0
- package/dist/browser/react/use-client-cache.d.ts.map +1 -0
- package/dist/browser/react/use-client-cache.js +39 -0
- package/dist/browser/react/use-client-cache.js.map +1 -0
- package/dist/browser/react/use-handle.d.ts +31 -0
- package/dist/browser/react/use-handle.d.ts.map +1 -0
- package/dist/browser/react/use-handle.js +144 -0
- package/dist/browser/react/use-handle.js.map +1 -0
- package/dist/browser/react/use-href.d.ts +33 -0
- package/dist/browser/react/use-href.d.ts.map +1 -0
- package/dist/browser/react/use-href.js +39 -0
- package/dist/browser/react/use-href.js.map +1 -0
- package/dist/browser/react/use-link-status.d.ts +37 -0
- package/dist/browser/react/use-link-status.d.ts.map +1 -0
- package/dist/browser/react/use-link-status.js +99 -0
- package/dist/browser/react/use-link-status.js.map +1 -0
- package/dist/browser/react/use-mount.d.ts +25 -0
- package/dist/browser/react/use-mount.d.ts.map +1 -0
- package/dist/browser/react/use-mount.js +30 -0
- package/dist/browser/react/use-mount.js.map +1 -0
- package/dist/browser/react/use-navigation.d.ts +27 -0
- package/dist/browser/react/use-navigation.d.ts.map +1 -0
- package/dist/browser/react/use-navigation.js +87 -0
- package/dist/browser/react/use-navigation.js.map +1 -0
- package/dist/browser/react/use-segments.d.ts +38 -0
- package/dist/browser/react/use-segments.d.ts.map +1 -0
- package/dist/browser/react/use-segments.js +130 -0
- package/dist/browser/react/use-segments.js.map +1 -0
- package/dist/browser/request-controller.d.ts +26 -0
- package/dist/browser/request-controller.d.ts.map +1 -0
- package/dist/browser/request-controller.js +147 -0
- package/dist/browser/request-controller.js.map +1 -0
- package/dist/browser/rsc-router.d.ts +129 -0
- package/dist/browser/rsc-router.d.ts.map +1 -0
- package/dist/browser/rsc-router.js +195 -0
- package/dist/browser/rsc-router.js.map +1 -0
- package/dist/browser/scroll-restoration.d.ts +93 -0
- package/dist/browser/scroll-restoration.d.ts.map +1 -0
- package/dist/browser/scroll-restoration.js +321 -0
- package/dist/browser/scroll-restoration.js.map +1 -0
- package/dist/browser/segment-structure-assert.d.ts +17 -0
- package/dist/browser/segment-structure-assert.d.ts.map +1 -0
- package/dist/browser/segment-structure-assert.js +59 -0
- package/dist/browser/segment-structure-assert.js.map +1 -0
- package/dist/browser/server-action-bridge.d.ts +26 -0
- package/dist/browser/server-action-bridge.d.ts.map +1 -0
- package/dist/browser/server-action-bridge.js +668 -0
- package/dist/browser/server-action-bridge.js.map +1 -0
- package/dist/browser/shallow.d.ts +12 -0
- package/dist/browser/shallow.d.ts.map +1 -0
- package/dist/browser/shallow.js +34 -0
- package/dist/browser/shallow.js.map +1 -0
- package/dist/browser/types.d.ts +369 -0
- package/dist/browser/types.d.ts.map +1 -0
- package/dist/browser/types.js +2 -0
- package/dist/browser/types.js.map +1 -0
- package/dist/build/__tests__/generate-cli.test.d.ts +2 -0
- package/dist/build/__tests__/generate-cli.test.d.ts.map +1 -0
- package/dist/build/__tests__/generate-cli.test.js +237 -0
- package/dist/build/__tests__/generate-cli.test.js.map +1 -0
- package/dist/build/__tests__/generate-manifest.test.d.ts +2 -0
- package/dist/build/__tests__/generate-manifest.test.d.ts.map +1 -0
- package/dist/build/__tests__/generate-manifest.test.js +119 -0
- package/dist/build/__tests__/generate-manifest.test.js.map +1 -0
- package/dist/build/__tests__/generate-route-types.test.d.ts +2 -0
- package/dist/build/__tests__/generate-route-types.test.d.ts.map +1 -0
- package/dist/build/__tests__/generate-route-types.test.js +620 -0
- package/dist/build/__tests__/generate-route-types.test.js.map +1 -0
- package/dist/build/__tests__/per-router-manifest.test.d.ts +2 -0
- package/dist/build/__tests__/per-router-manifest.test.d.ts.map +1 -0
- package/dist/build/__tests__/per-router-manifest.test.js +308 -0
- package/dist/build/__tests__/per-router-manifest.test.js.map +1 -0
- package/dist/build/generate-manifest.d.ts +81 -0
- package/dist/build/generate-manifest.d.ts.map +1 -0
- package/dist/build/generate-manifest.js +276 -0
- package/dist/build/generate-manifest.js.map +1 -0
- package/dist/build/generate-route-types.d.ts +115 -0
- package/dist/build/generate-route-types.d.ts.map +1 -0
- package/dist/build/generate-route-types.js +740 -0
- package/dist/build/generate-route-types.js.map +1 -0
- package/dist/build/index.d.ts +21 -0
- package/dist/build/index.d.ts.map +1 -0
- package/dist/build/index.js +21 -0
- package/dist/build/index.js.map +1 -0
- package/dist/build/route-trie.d.ts +71 -0
- package/dist/build/route-trie.d.ts.map +1 -0
- package/dist/build/route-trie.js +175 -0
- package/dist/build/route-trie.js.map +1 -0
- package/dist/cache/__tests__/cache-scope.test.d.ts +2 -0
- package/dist/cache/__tests__/cache-scope.test.d.ts.map +1 -0
- package/dist/cache/__tests__/cache-scope.test.js +208 -0
- package/dist/cache/__tests__/cache-scope.test.js.map +1 -0
- package/dist/cache/__tests__/document-cache.test.d.ts +2 -0
- package/dist/cache/__tests__/document-cache.test.d.ts.map +1 -0
- package/dist/cache/__tests__/document-cache.test.js +345 -0
- package/dist/cache/__tests__/document-cache.test.js.map +1 -0
- package/dist/cache/__tests__/memory-segment-store.test.d.ts +2 -0
- package/dist/cache/__tests__/memory-segment-store.test.d.ts.map +1 -0
- package/dist/cache/__tests__/memory-segment-store.test.js +425 -0
- package/dist/cache/__tests__/memory-segment-store.test.js.map +1 -0
- package/dist/cache/__tests__/memory-store.test.d.ts +2 -0
- package/dist/cache/__tests__/memory-store.test.d.ts.map +1 -0
- package/dist/cache/__tests__/memory-store.test.js +367 -0
- package/dist/cache/__tests__/memory-store.test.js.map +1 -0
- package/dist/cache/cache-scope.d.ts +102 -0
- package/dist/cache/cache-scope.d.ts.map +1 -0
- package/dist/cache/cache-scope.js +440 -0
- package/dist/cache/cache-scope.js.map +1 -0
- package/dist/cache/cf/__tests__/cf-cache-store.test.d.ts +2 -0
- package/dist/cache/cf/__tests__/cf-cache-store.test.d.ts.map +1 -0
- package/dist/cache/cf/__tests__/cf-cache-store.test.js +330 -0
- package/dist/cache/cf/__tests__/cf-cache-store.test.js.map +1 -0
- package/dist/cache/cf/cf-cache-store.d.ts +165 -0
- package/dist/cache/cf/cf-cache-store.d.ts.map +1 -0
- package/dist/cache/cf/cf-cache-store.js +242 -0
- package/dist/cache/cf/cf-cache-store.js.map +1 -0
- package/dist/cache/cf/index.d.ts +14 -0
- package/dist/cache/cf/index.d.ts.map +1 -0
- package/dist/cache/cf/index.js +17 -0
- package/dist/cache/cf/index.js.map +1 -0
- package/dist/cache/document-cache.d.ts +64 -0
- package/dist/cache/document-cache.d.ts.map +1 -0
- package/dist/cache/document-cache.js +228 -0
- package/dist/cache/document-cache.js.map +1 -0
- package/dist/cache/index.d.ts +19 -0
- package/dist/cache/index.d.ts.map +1 -0
- package/dist/cache/index.js +21 -0
- package/dist/cache/index.js.map +1 -0
- package/dist/cache/memory-segment-store.d.ts +110 -0
- package/dist/cache/memory-segment-store.d.ts.map +1 -0
- package/dist/cache/memory-segment-store.js +117 -0
- package/dist/cache/memory-segment-store.js.map +1 -0
- package/dist/cache/memory-store.d.ts +41 -0
- package/dist/cache/memory-store.d.ts.map +1 -0
- package/dist/cache/memory-store.js +191 -0
- package/dist/cache/memory-store.js.map +1 -0
- package/dist/cache/types.d.ts +317 -0
- package/dist/cache/types.d.ts.map +1 -0
- package/dist/cache/types.js +12 -0
- package/dist/cache/types.js.map +1 -0
- package/dist/client.d.ts +248 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +367 -0
- package/dist/client.js.map +1 -0
- package/dist/client.rsc.d.ts +26 -0
- package/dist/client.rsc.d.ts.map +1 -0
- package/dist/client.rsc.js +46 -0
- package/dist/client.rsc.js.map +1 -0
- package/dist/component-utils.d.ts +36 -0
- package/dist/component-utils.d.ts.map +1 -0
- package/dist/component-utils.js +61 -0
- package/dist/component-utils.js.map +1 -0
- package/dist/components/DefaultDocument.d.ts +13 -0
- package/dist/components/DefaultDocument.d.ts.map +1 -0
- package/dist/components/DefaultDocument.js +15 -0
- package/dist/components/DefaultDocument.js.map +1 -0
- package/dist/debug.d.ts +58 -0
- package/dist/debug.d.ts.map +1 -0
- package/dist/debug.js +157 -0
- package/dist/debug.js.map +1 -0
- package/dist/default-error-boundary.d.ts +11 -0
- package/dist/default-error-boundary.d.ts.map +1 -0
- package/dist/default-error-boundary.js +45 -0
- package/dist/default-error-boundary.js.map +1 -0
- package/dist/deps/browser.d.ts +2 -0
- package/dist/deps/browser.d.ts.map +1 -0
- package/dist/deps/browser.js +3 -0
- package/dist/deps/browser.js.map +1 -0
- package/dist/deps/html-stream-client.d.ts +2 -0
- package/dist/deps/html-stream-client.d.ts.map +1 -0
- package/dist/deps/html-stream-client.js +3 -0
- package/dist/deps/html-stream-client.js.map +1 -0
- package/dist/deps/html-stream-server.d.ts +2 -0
- package/dist/deps/html-stream-server.d.ts.map +1 -0
- package/dist/deps/html-stream-server.js +3 -0
- package/dist/deps/html-stream-server.js.map +1 -0
- package/dist/deps/rsc.d.ts +2 -0
- package/dist/deps/rsc.d.ts.map +1 -0
- package/dist/deps/rsc.js +4 -0
- package/dist/deps/rsc.js.map +1 -0
- package/dist/deps/ssr.d.ts +2 -0
- package/dist/deps/ssr.d.ts.map +1 -0
- package/dist/deps/ssr.js +3 -0
- package/dist/deps/ssr.js.map +1 -0
- package/dist/errors.d.ts +174 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +241 -0
- package/dist/errors.js.map +1 -0
- package/dist/handle.d.ts +78 -0
- package/dist/handle.d.ts.map +1 -0
- package/dist/handle.js +82 -0
- package/dist/handle.js.map +1 -0
- package/dist/handles/MetaTags.d.ts +14 -0
- package/dist/handles/MetaTags.d.ts.map +1 -0
- package/dist/handles/MetaTags.js +136 -0
- package/dist/handles/MetaTags.js.map +1 -0
- package/dist/handles/index.d.ts +6 -0
- package/dist/handles/index.d.ts.map +1 -0
- package/dist/handles/index.js +6 -0
- package/dist/handles/index.js.map +1 -0
- package/dist/handles/meta.d.ts +39 -0
- package/dist/handles/meta.d.ts.map +1 -0
- package/dist/handles/meta.js +202 -0
- package/dist/handles/meta.js.map +1 -0
- package/dist/host/__tests__/errors.test.d.ts +2 -0
- package/dist/host/__tests__/errors.test.d.ts.map +1 -0
- package/dist/host/__tests__/errors.test.js +76 -0
- package/dist/host/__tests__/errors.test.js.map +1 -0
- package/dist/host/__tests__/pattern-comprehensive.test.d.ts +2 -0
- package/dist/host/__tests__/pattern-comprehensive.test.d.ts.map +1 -0
- package/dist/host/__tests__/pattern-comprehensive.test.js +732 -0
- package/dist/host/__tests__/pattern-comprehensive.test.js.map +1 -0
- package/dist/host/__tests__/pattern-matcher.test.d.ts +2 -0
- package/dist/host/__tests__/pattern-matcher.test.d.ts.map +1 -0
- package/dist/host/__tests__/pattern-matcher.test.js +251 -0
- package/dist/host/__tests__/pattern-matcher.test.js.map +1 -0
- package/dist/host/__tests__/router.test.d.ts +2 -0
- package/dist/host/__tests__/router.test.d.ts.map +1 -0
- package/dist/host/__tests__/router.test.js +241 -0
- package/dist/host/__tests__/router.test.js.map +1 -0
- package/dist/host/__tests__/testing.test.d.ts +2 -0
- package/dist/host/__tests__/testing.test.d.ts.map +1 -0
- package/dist/host/__tests__/testing.test.js +64 -0
- package/dist/host/__tests__/testing.test.js.map +1 -0
- package/dist/host/__tests__/utils.test.d.ts +2 -0
- package/dist/host/__tests__/utils.test.d.ts.map +1 -0
- package/dist/host/__tests__/utils.test.js +29 -0
- package/dist/host/__tests__/utils.test.js.map +1 -0
- package/dist/host/cookie-handler.d.ts +34 -0
- package/dist/host/cookie-handler.d.ts.map +1 -0
- package/dist/host/cookie-handler.js +124 -0
- package/dist/host/cookie-handler.js.map +1 -0
- package/dist/host/errors.d.ts +56 -0
- package/dist/host/errors.d.ts.map +1 -0
- package/dist/host/errors.js +79 -0
- package/dist/host/errors.js.map +1 -0
- package/dist/host/index.d.ts +29 -0
- package/dist/host/index.d.ts.map +1 -0
- package/dist/host/index.js +32 -0
- package/dist/host/index.js.map +1 -0
- package/dist/host/pattern-matcher.d.ts +36 -0
- package/dist/host/pattern-matcher.d.ts.map +1 -0
- package/dist/host/pattern-matcher.js +172 -0
- package/dist/host/pattern-matcher.js.map +1 -0
- package/dist/host/router.d.ts +26 -0
- package/dist/host/router.d.ts.map +1 -0
- package/dist/host/router.js +218 -0
- package/dist/host/router.js.map +1 -0
- package/dist/host/testing.d.ts +36 -0
- package/dist/host/testing.d.ts.map +1 -0
- package/dist/host/testing.js +55 -0
- package/dist/host/testing.js.map +1 -0
- package/dist/host/types.d.ts +115 -0
- package/dist/host/types.d.ts.map +1 -0
- package/dist/host/types.js +7 -0
- package/dist/host/types.js.map +1 -0
- package/dist/host/utils.d.ts +21 -0
- package/dist/host/utils.d.ts.map +1 -0
- package/dist/host/utils.js +23 -0
- package/dist/host/utils.js.map +1 -0
- package/dist/href-client.d.ts +131 -0
- package/dist/href-client.d.ts.map +1 -0
- package/dist/href-client.js +64 -0
- package/dist/href-client.js.map +1 -0
- package/{src/href-context.ts → dist/href-context.d.ts} +7 -11
- package/dist/href-context.d.ts.map +1 -0
- package/dist/href-context.js +21 -0
- package/dist/href-context.js.map +1 -0
- package/dist/index.d.ts +73 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +91 -0
- package/dist/index.js.map +1 -0
- package/dist/index.rsc.d.ts +32 -0
- package/dist/index.rsc.d.ts.map +1 -0
- package/dist/index.rsc.js +40 -0
- package/dist/index.rsc.js.map +1 -0
- package/dist/internal-debug.d.ts +2 -0
- package/dist/internal-debug.d.ts.map +1 -0
- package/dist/internal-debug.js +5 -0
- package/dist/internal-debug.js.map +1 -0
- package/dist/loader.d.ts +14 -0
- package/dist/loader.d.ts.map +1 -0
- package/dist/loader.js +20 -0
- package/dist/loader.js.map +1 -0
- package/dist/loader.rsc.d.ts +19 -0
- package/dist/loader.rsc.d.ts.map +1 -0
- package/dist/loader.rsc.js +99 -0
- package/dist/loader.rsc.js.map +1 -0
- package/dist/network-error-thrower.d.ts +17 -0
- package/dist/network-error-thrower.d.ts.map +1 -0
- package/dist/network-error-thrower.js +14 -0
- package/dist/network-error-thrower.js.map +1 -0
- package/dist/outlet-context.d.ts +13 -0
- package/dist/outlet-context.d.ts.map +1 -0
- package/dist/outlet-context.js +3 -0
- package/dist/outlet-context.js.map +1 -0
- package/dist/prerender/__tests__/param-hash.test.d.ts +2 -0
- package/dist/prerender/__tests__/param-hash.test.d.ts.map +1 -0
- package/dist/prerender/__tests__/param-hash.test.js +148 -0
- package/dist/prerender/__tests__/param-hash.test.js.map +1 -0
- package/dist/prerender/param-hash.d.ts +16 -0
- package/dist/prerender/param-hash.d.ts.map +1 -0
- package/dist/prerender/param-hash.js +36 -0
- package/dist/prerender/param-hash.js.map +1 -0
- package/dist/prerender/store.d.ts +38 -0
- package/dist/prerender/store.d.ts.map +1 -0
- package/dist/prerender/store.js +61 -0
- package/dist/prerender/store.js.map +1 -0
- package/dist/prerender.d.ts +66 -0
- package/dist/prerender.d.ts.map +1 -0
- package/dist/prerender.js +57 -0
- package/dist/prerender.js.map +1 -0
- package/dist/reverse.d.ts +196 -0
- package/dist/reverse.d.ts.map +1 -0
- package/dist/reverse.js +78 -0
- package/dist/reverse.js.map +1 -0
- package/dist/root-error-boundary.d.ts +33 -0
- package/dist/root-error-boundary.d.ts.map +1 -0
- package/dist/root-error-boundary.js +165 -0
- package/dist/root-error-boundary.js.map +1 -0
- package/dist/route-content-wrapper.d.ts +46 -0
- package/dist/route-content-wrapper.d.ts.map +1 -0
- package/dist/route-content-wrapper.js +77 -0
- package/dist/route-content-wrapper.js.map +1 -0
- package/dist/route-definition.d.ts +421 -0
- package/dist/route-definition.d.ts.map +1 -0
- package/dist/route-definition.js +868 -0
- package/dist/route-definition.js.map +1 -0
- package/dist/route-map-builder.d.ts +155 -0
- package/dist/route-map-builder.d.ts.map +1 -0
- package/dist/route-map-builder.js +237 -0
- package/dist/route-map-builder.js.map +1 -0
- package/dist/route-types.d.ts +165 -0
- package/dist/route-types.d.ts.map +1 -0
- package/dist/route-types.js +7 -0
- package/dist/route-types.js.map +1 -0
- package/dist/router/__tests__/handler-context.test.d.ts +2 -0
- package/dist/router/__tests__/handler-context.test.d.ts.map +1 -0
- package/dist/router/__tests__/handler-context.test.js +65 -0
- package/dist/router/__tests__/handler-context.test.js.map +1 -0
- package/dist/router/__tests__/loader-cycle-detection.test.d.ts +2 -0
- package/dist/router/__tests__/loader-cycle-detection.test.d.ts.map +1 -0
- package/dist/router/__tests__/loader-cycle-detection.test.js +221 -0
- package/dist/router/__tests__/loader-cycle-detection.test.js.map +1 -0
- package/dist/router/__tests__/match-context.test.d.ts +2 -0
- package/dist/router/__tests__/match-context.test.d.ts.map +1 -0
- package/dist/router/__tests__/match-context.test.js +92 -0
- package/dist/router/__tests__/match-context.test.js.map +1 -0
- package/dist/router/__tests__/match-pipelines.test.d.ts +2 -0
- package/dist/router/__tests__/match-pipelines.test.d.ts.map +1 -0
- package/dist/router/__tests__/match-pipelines.test.js +417 -0
- package/dist/router/__tests__/match-pipelines.test.js.map +1 -0
- package/dist/router/__tests__/match-result.test.d.ts +2 -0
- package/dist/router/__tests__/match-result.test.d.ts.map +1 -0
- package/dist/router/__tests__/match-result.test.js +457 -0
- package/dist/router/__tests__/match-result.test.js.map +1 -0
- package/dist/router/__tests__/on-error.test.d.ts +2 -0
- package/dist/router/__tests__/on-error.test.d.ts.map +1 -0
- package/dist/router/__tests__/on-error.test.js +678 -0
- package/dist/router/__tests__/on-error.test.js.map +1 -0
- package/dist/router/__tests__/pattern-matching.test.d.ts +2 -0
- package/dist/router/__tests__/pattern-matching.test.d.ts.map +1 -0
- package/dist/router/__tests__/pattern-matching.test.js +629 -0
- package/dist/router/__tests__/pattern-matching.test.js.map +1 -0
- package/dist/router/__tests__/segment-resolution-parallel-loading.test.d.ts +2 -0
- package/dist/router/__tests__/segment-resolution-parallel-loading.test.d.ts.map +1 -0
- package/dist/router/__tests__/segment-resolution-parallel-loading.test.js +155 -0
- package/dist/router/__tests__/segment-resolution-parallel-loading.test.js.map +1 -0
- package/dist/router/error-handling.d.ts +77 -0
- package/dist/router/error-handling.d.ts.map +1 -0
- package/dist/router/error-handling.js +202 -0
- package/dist/router/error-handling.js.map +1 -0
- package/dist/router/handler-context.d.ts +20 -0
- package/dist/router/handler-context.d.ts.map +1 -0
- package/dist/router/handler-context.js +198 -0
- package/dist/router/handler-context.js.map +1 -0
- package/dist/router/intercept-resolution.d.ts +66 -0
- package/dist/router/intercept-resolution.d.ts.map +1 -0
- package/dist/router/intercept-resolution.js +246 -0
- package/dist/router/intercept-resolution.js.map +1 -0
- package/dist/router/loader-resolution.d.ts +64 -0
- package/dist/router/loader-resolution.d.ts.map +1 -0
- package/dist/router/loader-resolution.js +284 -0
- package/dist/router/loader-resolution.js.map +1 -0
- package/dist/router/logging.d.ts +15 -0
- package/dist/router/logging.d.ts.map +1 -0
- package/dist/router/logging.js +99 -0
- package/dist/router/logging.js.map +1 -0
- package/dist/router/manifest.d.ts +22 -0
- package/dist/router/manifest.d.ts.map +1 -0
- package/dist/router/manifest.js +181 -0
- package/dist/router/manifest.js.map +1 -0
- package/dist/router/match-api.d.ts +35 -0
- package/dist/router/match-api.d.ts.map +1 -0
- package/dist/router/match-api.js +406 -0
- package/dist/router/match-api.js.map +1 -0
- package/dist/router/match-context.d.ts +206 -0
- package/dist/router/match-context.d.ts.map +1 -0
- package/dist/router/match-context.js +17 -0
- package/dist/router/match-context.js.map +1 -0
- package/dist/router/match-middleware/background-revalidation.d.ts +127 -0
- package/dist/router/match-middleware/background-revalidation.d.ts.map +1 -0
- package/dist/router/match-middleware/background-revalidation.js +75 -0
- package/dist/router/match-middleware/background-revalidation.js.map +1 -0
- package/dist/router/match-middleware/cache-lookup.d.ts +112 -0
- package/dist/router/match-middleware/cache-lookup.d.ts.map +1 -0
- package/dist/router/match-middleware/cache-lookup.js +257 -0
- package/dist/router/match-middleware/cache-lookup.js.map +1 -0
- package/dist/router/match-middleware/cache-store.d.ts +113 -0
- package/dist/router/match-middleware/cache-store.d.ts.map +1 -0
- package/dist/router/match-middleware/cache-store.js +108 -0
- package/dist/router/match-middleware/cache-store.js.map +1 -0
- package/dist/router/match-middleware/index.d.ts +81 -0
- package/dist/router/match-middleware/index.d.ts.map +1 -0
- package/dist/router/match-middleware/index.js +80 -0
- package/dist/router/match-middleware/index.js.map +1 -0
- package/dist/router/match-middleware/intercept-resolution.d.ts +117 -0
- package/dist/router/match-middleware/intercept-resolution.d.ts.map +1 -0
- package/dist/router/match-middleware/intercept-resolution.js +134 -0
- package/dist/router/match-middleware/intercept-resolution.js.map +1 -0
- package/dist/router/match-middleware/segment-resolution.d.ts +99 -0
- package/dist/router/match-middleware/segment-resolution.d.ts.map +1 -0
- package/dist/router/match-middleware/segment-resolution.js +53 -0
- package/dist/router/match-middleware/segment-resolution.js.map +1 -0
- package/dist/router/match-pipelines.d.ts +147 -0
- package/dist/router/match-pipelines.d.ts.map +1 -0
- package/dist/router/match-pipelines.js +82 -0
- package/dist/router/match-pipelines.js.map +1 -0
- package/dist/router/match-result.d.ts +126 -0
- package/dist/router/match-result.d.ts.map +1 -0
- package/dist/router/match-result.js +93 -0
- package/dist/router/match-result.js.map +1 -0
- package/dist/router/metrics.d.ts +20 -0
- package/dist/router/metrics.d.ts.map +1 -0
- package/dist/router/metrics.js +47 -0
- package/dist/router/metrics.js.map +1 -0
- package/dist/router/middleware.d.ts +249 -0
- package/dist/router/middleware.d.ts.map +1 -0
- package/dist/router/middleware.js +434 -0
- package/dist/router/middleware.js.map +1 -0
- package/dist/router/middleware.test.d.ts +2 -0
- package/dist/router/middleware.test.d.ts.map +1 -0
- package/dist/router/middleware.test.js +816 -0
- package/dist/router/middleware.test.js.map +1 -0
- package/dist/router/pattern-matching.d.ts +149 -0
- package/dist/router/pattern-matching.d.ts.map +1 -0
- package/dist/router/pattern-matching.js +349 -0
- package/dist/router/pattern-matching.js.map +1 -0
- package/dist/router/revalidation.d.ts +44 -0
- package/dist/router/revalidation.d.ts.map +1 -0
- package/dist/router/revalidation.js +147 -0
- package/dist/router/revalidation.js.map +1 -0
- package/dist/router/router-context.d.ts +135 -0
- package/dist/router/router-context.d.ts.map +1 -0
- package/dist/router/router-context.js +36 -0
- package/dist/router/router-context.js.map +1 -0
- package/dist/router/segment-resolution.d.ts +127 -0
- package/dist/router/segment-resolution.d.ts.map +1 -0
- package/dist/router/segment-resolution.js +919 -0
- package/dist/router/segment-resolution.js.map +1 -0
- package/dist/router/trie-matching.d.ts +40 -0
- package/dist/router/trie-matching.d.ts.map +1 -0
- package/dist/router/trie-matching.js +127 -0
- package/dist/router/trie-matching.js.map +1 -0
- package/dist/router/types.d.ts +136 -0
- package/dist/router/types.d.ts.map +1 -0
- package/dist/router/types.js +7 -0
- package/dist/router/types.js.map +1 -0
- package/dist/router.d.ts +753 -0
- package/dist/router.d.ts.map +1 -0
- package/dist/router.gen.d.ts +6 -0
- package/dist/router.gen.d.ts.map +1 -0
- package/dist/router.gen.js +6 -0
- package/dist/router.gen.js.map +1 -0
- package/dist/router.js +1304 -0
- package/dist/router.js.map +1 -0
- package/dist/rsc/__tests__/helpers.test.d.ts +2 -0
- package/dist/rsc/__tests__/helpers.test.d.ts.map +1 -0
- package/dist/rsc/__tests__/helpers.test.js +140 -0
- package/dist/rsc/__tests__/helpers.test.js.map +1 -0
- package/dist/rsc/handler.d.ts +45 -0
- package/dist/rsc/handler.d.ts.map +1 -0
- package/dist/rsc/handler.js +1172 -0
- package/dist/rsc/handler.js.map +1 -0
- package/dist/rsc/helpers.d.ts +16 -0
- package/dist/rsc/helpers.d.ts.map +1 -0
- package/dist/rsc/helpers.js +55 -0
- package/dist/rsc/helpers.js.map +1 -0
- package/dist/rsc/index.d.ts +22 -0
- package/dist/rsc/index.d.ts.map +1 -0
- package/dist/rsc/index.js +23 -0
- package/dist/rsc/index.js.map +1 -0
- package/dist/rsc/nonce.d.ts +9 -0
- package/dist/rsc/nonce.d.ts.map +1 -0
- package/dist/rsc/nonce.js +18 -0
- package/dist/rsc/nonce.js.map +1 -0
- package/dist/rsc/types.d.ts +206 -0
- package/dist/rsc/types.d.ts.map +1 -0
- package/dist/rsc/types.js +8 -0
- package/dist/rsc/types.js.map +1 -0
- package/dist/search-params.d.ts +103 -0
- package/dist/search-params.d.ts.map +1 -0
- package/dist/search-params.js +74 -0
- package/dist/search-params.js.map +1 -0
- package/dist/segment-system.d.ts +75 -0
- package/dist/segment-system.d.ts.map +1 -0
- package/dist/segment-system.js +336 -0
- package/dist/segment-system.js.map +1 -0
- package/dist/server/context.d.ts +245 -0
- package/dist/server/context.d.ts.map +1 -0
- package/dist/server/context.js +197 -0
- package/dist/server/context.js.map +1 -0
- package/dist/server/fetchable-loader-store.d.ts +18 -0
- package/dist/server/fetchable-loader-store.d.ts.map +1 -0
- package/dist/server/fetchable-loader-store.js +18 -0
- package/dist/server/fetchable-loader-store.js.map +1 -0
- package/dist/server/handle-store.d.ts +85 -0
- package/dist/server/handle-store.d.ts.map +1 -0
- package/dist/server/handle-store.js +142 -0
- package/dist/server/handle-store.js.map +1 -0
- package/dist/server/loader-registry.d.ts +55 -0
- package/dist/server/loader-registry.d.ts.map +1 -0
- package/dist/server/loader-registry.js +132 -0
- package/dist/server/loader-registry.js.map +1 -0
- package/dist/server/request-context.d.ts +226 -0
- package/dist/server/request-context.d.ts.map +1 -0
- package/dist/server/request-context.js +290 -0
- package/dist/server/request-context.js.map +1 -0
- package/dist/server/root-layout.d.ts +4 -0
- package/dist/server/root-layout.d.ts.map +1 -0
- package/dist/server/root-layout.js +5 -0
- package/dist/server/root-layout.js.map +1 -0
- package/dist/server.d.ts +15 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +20 -0
- package/dist/server.js.map +1 -0
- package/dist/ssr/__tests__/ssr-handler.test.d.ts +2 -0
- package/dist/ssr/__tests__/ssr-handler.test.d.ts.map +1 -0
- package/dist/ssr/__tests__/ssr-handler.test.js +132 -0
- package/dist/ssr/__tests__/ssr-handler.test.js.map +1 -0
- package/dist/ssr/index.d.ts +98 -0
- package/dist/ssr/index.d.ts.map +1 -0
- package/dist/ssr/index.js +158 -0
- package/dist/ssr/index.js.map +1 -0
- package/dist/static-handler.d.ts +50 -0
- package/dist/static-handler.d.ts.map +1 -0
- package/dist/static-handler.gen.d.ts +5 -0
- package/dist/static-handler.gen.d.ts.map +1 -0
- package/dist/static-handler.gen.js +5 -0
- package/dist/static-handler.gen.js.map +1 -0
- package/dist/static-handler.js +29 -0
- package/dist/static-handler.js.map +1 -0
- package/dist/theme/ThemeProvider.d.ts +20 -0
- package/dist/theme/ThemeProvider.d.ts.map +1 -0
- package/dist/theme/ThemeProvider.js +240 -0
- package/dist/theme/ThemeProvider.js.map +1 -0
- package/dist/theme/ThemeScript.d.ts +48 -0
- package/dist/theme/ThemeScript.d.ts.map +1 -0
- package/dist/theme/ThemeScript.js +13 -0
- package/dist/theme/ThemeScript.js.map +1 -0
- package/dist/theme/__tests__/theme.test.d.ts +2 -0
- package/dist/theme/__tests__/theme.test.d.ts.map +1 -0
- package/dist/theme/__tests__/theme.test.js +103 -0
- package/dist/theme/__tests__/theme.test.js.map +1 -0
- package/dist/theme/constants.d.ts +29 -0
- package/dist/theme/constants.d.ts.map +1 -0
- package/dist/theme/constants.js +48 -0
- package/dist/theme/constants.js.map +1 -0
- package/dist/theme/index.d.ts +31 -0
- package/dist/theme/index.d.ts.map +1 -0
- package/dist/theme/index.js +36 -0
- package/dist/theme/index.js.map +1 -0
- package/dist/theme/theme-context.d.ts +40 -0
- package/dist/theme/theme-context.d.ts.map +1 -0
- package/dist/theme/theme-context.js +60 -0
- package/dist/theme/theme-context.js.map +1 -0
- package/dist/theme/theme-script.d.ts +27 -0
- package/dist/theme/theme-script.d.ts.map +1 -0
- package/dist/theme/theme-script.js +147 -0
- package/dist/theme/theme-script.js.map +1 -0
- package/dist/theme/types.d.ts +163 -0
- package/dist/theme/types.d.ts.map +1 -0
- package/dist/theme/types.js +11 -0
- package/dist/theme/types.js.map +1 -0
- package/dist/theme/use-theme.d.ts +12 -0
- package/dist/theme/use-theme.d.ts.map +1 -0
- package/dist/theme/use-theme.js +40 -0
- package/dist/theme/use-theme.js.map +1 -0
- package/dist/types.d.ts +1479 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +10 -0
- package/dist/types.js.map +1 -0
- package/dist/urls.d.ts +441 -0
- package/dist/urls.d.ts.map +1 -0
- package/dist/urls.gen.d.ts +8 -0
- package/dist/urls.gen.d.ts.map +1 -0
- package/dist/urls.gen.js +8 -0
- package/dist/urls.gen.js.map +1 -0
- package/dist/urls.js +443 -0
- package/dist/urls.js.map +1 -0
- package/dist/use-loader.d.ts +127 -0
- package/dist/use-loader.d.ts.map +1 -0
- package/dist/use-loader.js +237 -0
- package/dist/use-loader.js.map +1 -0
- package/dist/vite/__tests__/ast-handler-extract.test.d.ts +2 -0
- package/dist/vite/__tests__/ast-handler-extract.test.d.ts.map +1 -0
- package/dist/vite/__tests__/ast-handler-extract.test.js +294 -0
- package/dist/vite/__tests__/ast-handler-extract.test.js.map +1 -0
- package/dist/vite/__tests__/expose-id-utils.test.d.ts +2 -0
- package/dist/vite/__tests__/expose-id-utils.test.d.ts.map +1 -0
- package/dist/vite/__tests__/expose-id-utils.test.js +224 -0
- package/dist/vite/__tests__/expose-id-utils.test.js.map +1 -0
- package/dist/vite/__tests__/expose-internal-ids.test.d.ts +2 -0
- package/dist/vite/__tests__/expose-internal-ids.test.d.ts.map +1 -0
- package/dist/vite/__tests__/expose-internal-ids.test.js +647 -0
- package/dist/vite/__tests__/expose-internal-ids.test.js.map +1 -0
- package/dist/vite/__tests__/expose-router-id.test.d.ts +2 -0
- package/dist/vite/__tests__/expose-router-id.test.d.ts.map +1 -0
- package/dist/vite/__tests__/expose-router-id.test.js +39 -0
- package/dist/vite/__tests__/expose-router-id.test.js.map +1 -0
- package/dist/vite/ast-handler-extract.d.ts +49 -0
- package/dist/vite/ast-handler-extract.d.ts.map +1 -0
- package/dist/vite/ast-handler-extract.js +249 -0
- package/dist/vite/ast-handler-extract.js.map +1 -0
- package/dist/vite/expose-action-id.d.ts +19 -0
- package/dist/vite/expose-action-id.d.ts.map +1 -0
- package/dist/vite/expose-action-id.js +250 -0
- package/dist/vite/expose-action-id.js.map +1 -0
- package/dist/vite/expose-id-utils.d.ts +69 -0
- package/dist/vite/expose-id-utils.d.ts.map +1 -0
- package/dist/vite/expose-id-utils.js +289 -0
- package/dist/vite/expose-id-utils.js.map +1 -0
- package/dist/vite/expose-internal-ids.d.ts +22 -0
- package/dist/vite/expose-internal-ids.d.ts.map +1 -0
- package/dist/vite/expose-internal-ids.js +886 -0
- package/dist/vite/expose-internal-ids.js.map +1 -0
- package/dist/vite/index.d.ts +149 -0
- package/dist/vite/index.d.ts.map +1 -0
- package/dist/vite/index.js +5565 -2291
- package/dist/vite/index.js.bak +5448 -0
- package/dist/vite/index.js.map +1 -0
- package/dist/vite/index.named-routes.gen.ts +103 -0
- package/dist/vite/package-resolution.d.ts +43 -0
- package/dist/vite/package-resolution.d.ts.map +1 -0
- package/{src/vite/package-resolution.ts → dist/vite/package-resolution.js} +53 -66
- package/dist/vite/package-resolution.js.map +1 -0
- package/dist/vite/plugins/cloudflare-protocol-loader-hook.mjs +76 -0
- package/dist/vite/virtual-entries.d.ts +25 -0
- package/dist/vite/virtual-entries.d.ts.map +1 -0
- package/{src/vite/virtual-entries.ts → dist/vite/virtual-entries.js} +12 -16
- package/dist/vite/virtual-entries.js.map +1 -0
- package/package.json +64 -56
- package/skills/breadcrumbs/SKILL.md +252 -0
- package/skills/cache-guide/SKILL.md +294 -0
- package/skills/caching/SKILL.md +93 -23
- package/skills/composability/SKILL.md +172 -0
- package/skills/debug-manifest/SKILL.md +12 -8
- package/skills/document-cache/SKILL.md +18 -16
- package/skills/fonts/SKILL.md +6 -4
- package/skills/handler-use/SKILL.md +362 -0
- package/skills/hooks/SKILL.md +341 -71
- package/skills/host-router/SKILL.md +218 -0
- package/skills/intercept/SKILL.md +151 -8
- package/skills/layout/SKILL.md +122 -3
- package/skills/links/SKILL.md +158 -25
- package/skills/loader/SKILL.md +439 -46
- package/skills/middleware/SKILL.md +205 -37
- package/skills/migrate-nextjs/SKILL.md +560 -0
- package/skills/migrate-react-router/SKILL.md +765 -0
- package/skills/mime-routes/SKILL.md +15 -11
- package/skills/parallel/SKILL.md +263 -1
- package/skills/prerender/SKILL.md +467 -65
- package/skills/rango/SKILL.md +87 -21
- package/skills/response-routes/SKILL.md +152 -91
- package/skills/route/SKILL.md +281 -14
- package/skills/router-setup/SKILL.md +210 -32
- package/skills/streams-and-websockets/SKILL.md +283 -0
- package/skills/theme/SKILL.md +9 -8
- package/skills/typesafety/SKILL.md +327 -86
- package/skills/use-cache/SKILL.md +324 -0
- package/src/__internal.ts +102 -4
- package/src/bin/rango.ts +312 -15
- package/src/browser/action-coordinator.ts +97 -0
- package/src/browser/action-response-classifier.ts +99 -0
- package/src/browser/app-shell.ts +52 -0
- package/src/browser/app-version.ts +14 -0
- package/src/browser/event-controller.ts +92 -64
- package/src/browser/history-state.ts +80 -0
- package/src/browser/intercept-utils.ts +52 -0
- package/src/browser/link-interceptor.ts +24 -4
- package/src/browser/logging.ts +55 -0
- package/src/browser/merge-segment-loaders.ts +20 -12
- package/src/browser/navigation-bridge.ts +367 -561
- package/src/browser/navigation-client.ts +228 -70
- package/src/browser/navigation-store.ts +97 -55
- package/src/browser/navigation-transaction.ts +297 -0
- package/src/browser/network-error-handler.ts +61 -0
- package/src/browser/partial-update.ts +362 -316
- package/src/browser/prefetch/cache.ts +314 -0
- package/src/browser/prefetch/fetch.ts +282 -0
- package/src/browser/prefetch/observer.ts +65 -0
- package/src/browser/prefetch/policy.ts +48 -0
- package/src/browser/prefetch/queue.ts +191 -0
- package/src/browser/prefetch/resource-ready.ts +77 -0
- package/src/browser/rango-state.ts +152 -0
- package/src/browser/react/Link.tsx +255 -71
- package/src/browser/react/NavigationProvider.tsx +132 -17
- package/src/browser/react/context.ts +11 -0
- package/src/browser/react/filter-segment-order.ts +11 -0
- package/src/browser/react/index.ts +12 -12
- package/src/browser/react/location-state-shared.ts +95 -53
- package/src/browser/react/location-state.ts +60 -15
- package/src/browser/react/mount-context.ts +6 -1
- package/src/browser/react/nonce-context.ts +23 -0
- package/src/browser/react/shallow-equal.ts +27 -0
- package/src/browser/react/use-action.ts +29 -51
- package/src/browser/react/use-client-cache.ts +5 -3
- package/src/browser/react/use-handle.ts +30 -120
- package/src/browser/react/use-link-status.ts +6 -5
- package/src/browser/react/use-navigation.ts +44 -65
- package/src/browser/react/use-params.ts +75 -0
- package/src/browser/react/use-pathname.ts +47 -0
- package/src/browser/react/use-router.ts +83 -0
- package/src/browser/react/use-search-params.ts +56 -0
- package/src/browser/react/use-segments.ts +80 -97
- package/src/browser/response-adapter.ts +73 -0
- package/src/browser/rsc-router.tsx +246 -64
- package/src/browser/scroll-restoration.ts +127 -52
- package/src/browser/segment-reconciler.ts +243 -0
- package/src/browser/segment-structure-assert.ts +16 -0
- package/src/browser/server-action-bridge.ts +510 -603
- package/src/browser/shallow.ts +6 -1
- package/src/browser/types.ts +152 -48
- package/src/browser/validate-redirect-origin.ts +29 -0
- package/src/build/generate-manifest.ts +84 -23
- package/src/build/generate-route-types.ts +39 -752
- package/src/build/index.ts +6 -5
- package/src/build/route-trie.ts +83 -31
- package/src/build/route-types/ast-helpers.ts +25 -0
- package/src/build/route-types/ast-route-extraction.ts +98 -0
- package/src/build/route-types/codegen.ts +102 -0
- package/src/build/route-types/include-resolution.ts +418 -0
- package/src/build/route-types/param-extraction.ts +48 -0
- package/src/build/route-types/per-module-writer.ts +128 -0
- package/src/build/route-types/router-processing.ts +618 -0
- package/src/build/route-types/scan-filter.ts +85 -0
- package/src/build/runtime-discovery.ts +231 -0
- package/src/cache/background-task.ts +34 -0
- package/src/cache/cache-key-utils.ts +44 -0
- package/src/cache/cache-policy.ts +125 -0
- package/src/cache/cache-runtime.ts +342 -0
- package/src/cache/cache-scope.ts +167 -307
- package/src/cache/cf/cf-cache-store.ts +573 -21
- package/src/cache/cf/index.ts +13 -3
- package/src/cache/document-cache.ts +116 -77
- package/src/cache/handle-capture.ts +81 -0
- package/src/cache/handle-snapshot.ts +41 -0
- package/src/cache/index.ts +1 -15
- package/src/cache/memory-segment-store.ts +191 -13
- package/src/cache/profile-registry.ts +73 -0
- package/src/cache/read-through-swr.ts +134 -0
- package/src/cache/segment-codec.ts +256 -0
- package/src/cache/taint.ts +153 -0
- package/src/cache/types.ts +72 -122
- package/src/client.rsc.tsx +3 -1
- package/src/client.tsx +113 -301
- package/src/component-utils.ts +4 -4
- package/src/components/DefaultDocument.tsx +5 -1
- package/src/context-var.ts +156 -0
- package/src/debug.ts +19 -9
- package/src/errors.ts +77 -7
- package/src/handle.ts +55 -10
- package/src/handles/MetaTags.tsx +73 -20
- package/src/handles/breadcrumbs.ts +66 -0
- package/src/handles/index.ts +1 -0
- package/src/handles/meta.ts +30 -13
- package/src/host/cookie-handler.ts +21 -15
- package/src/host/errors.ts +8 -8
- package/src/host/index.ts +4 -7
- package/src/host/pattern-matcher.ts +27 -27
- package/src/host/router.ts +61 -39
- package/src/host/testing.ts +8 -8
- package/src/host/types.ts +15 -7
- package/src/host/utils.ts +1 -1
- package/src/href-client.ts +65 -45
- package/src/index.rsc.ts +138 -21
- package/src/index.ts +206 -51
- package/src/internal-debug.ts +11 -0
- package/src/loader.rsc.ts +25 -143
- package/src/loader.ts +27 -10
- package/src/network-error-thrower.tsx +3 -1
- package/src/outlet-context.ts +1 -1
- package/src/outlet-provider.tsx +45 -0
- package/src/prerender/param-hash.ts +4 -2
- package/src/prerender/store.ts +159 -13
- package/src/prerender.ts +397 -29
- package/src/response-utils.ts +28 -0
- package/src/reverse.ts +209 -121
- package/src/root-error-boundary.tsx +41 -29
- package/src/route-content-wrapper.tsx +7 -4
- package/src/route-definition/dsl-helpers.ts +1134 -0
- package/src/route-definition/helper-factories.ts +200 -0
- package/src/route-definition/helpers-types.ts +478 -0
- package/src/route-definition/index.ts +55 -0
- package/src/route-definition/redirect.ts +101 -0
- package/src/route-definition/resolve-handler-use.ts +155 -0
- package/src/route-definition.ts +1 -1431
- package/src/route-map-builder.ts +162 -123
- package/src/route-name.ts +53 -0
- package/src/route-types.ts +66 -9
- package/src/router/content-negotiation.ts +215 -0
- package/src/router/debug-manifest.ts +72 -0
- package/src/router/error-handling.ts +9 -9
- package/src/router/find-match.ts +160 -0
- package/src/router/handler-context.ts +455 -86
- package/src/router/intercept-resolution.ts +35 -20
- package/src/router/lazy-includes.ts +237 -0
- package/src/router/loader-resolution.ts +359 -128
- package/src/router/logging.ts +251 -0
- package/src/router/manifest.ts +98 -32
- package/src/router/match-api.ts +195 -261
- package/src/router/match-context.ts +4 -2
- package/src/router/match-handlers.ts +440 -0
- package/src/router/match-middleware/background-revalidation.ts +108 -93
- package/src/router/match-middleware/cache-lookup.ts +415 -86
- package/src/router/match-middleware/cache-store.ts +91 -29
- package/src/router/match-middleware/intercept-resolution.ts +48 -21
- package/src/router/match-middleware/segment-resolution.ts +73 -9
- package/src/router/match-pipelines.ts +10 -45
- package/src/router/match-result.ts +135 -35
- package/src/router/metrics.ts +240 -15
- package/src/router/middleware-cookies.ts +55 -0
- package/src/router/middleware-types.ts +200 -0
- package/src/router/middleware.ts +373 -371
- package/src/router/navigation-snapshot.ts +182 -0
- package/src/router/pattern-matching.ts +251 -44
- package/src/router/prerender-match.ts +502 -0
- package/src/router/preview-match.ts +98 -0
- package/src/router/request-classification.ts +310 -0
- package/src/router/revalidation.ts +137 -38
- package/src/router/route-snapshot.ts +245 -0
- package/src/router/router-context.ts +41 -21
- package/src/router/router-interfaces.ts +484 -0
- package/src/router/router-options.ts +618 -0
- package/src/router/router-registry.ts +24 -0
- package/src/router/segment-resolution/fresh.ts +748 -0
- package/src/router/segment-resolution/helpers.ts +268 -0
- package/src/router/segment-resolution/loader-cache.ts +199 -0
- package/src/router/segment-resolution/revalidation.ts +1379 -0
- package/src/router/segment-resolution/static-store.ts +67 -0
- package/src/router/segment-resolution.ts +21 -1315
- package/src/router/segment-wrappers.ts +291 -0
- package/src/router/telemetry-otel.ts +299 -0
- package/src/router/telemetry.ts +300 -0
- package/src/router/timeout.ts +148 -0
- package/src/router/trie-matching.ts +103 -30
- package/src/router/types.ts +17 -9
- package/src/router/url-params.ts +49 -0
- package/src/router.ts +647 -1988
- package/src/rsc/handler-context.ts +45 -0
- package/src/rsc/handler.ts +864 -1114
- package/src/rsc/helpers.ts +181 -19
- package/src/rsc/index.ts +0 -20
- package/src/rsc/loader-fetch.ts +229 -0
- package/src/rsc/manifest-init.ts +90 -0
- package/src/rsc/nonce.ts +14 -0
- package/src/rsc/origin-guard.ts +141 -0
- package/src/rsc/progressive-enhancement.ts +393 -0
- package/src/rsc/response-error.ts +37 -0
- package/src/rsc/response-route-handler.ts +360 -0
- package/src/rsc/rsc-rendering.ts +253 -0
- package/src/rsc/runtime-warnings.ts +42 -0
- package/src/rsc/server-action.ts +358 -0
- package/src/rsc/ssr-setup.ts +128 -0
- package/src/rsc/types.ts +46 -11
- package/src/search-params.ts +230 -0
- package/src/segment-content-promise.ts +67 -0
- package/src/segment-loader-promise.ts +122 -0
- package/src/segment-system.tsx +134 -36
- package/src/server/context.ts +333 -59
- package/src/server/cookie-store.ts +190 -0
- package/src/server/fetchable-loader-store.ts +37 -0
- package/src/server/handle-store.ts +113 -15
- package/src/server/loader-registry.ts +24 -64
- package/src/server/request-context.ts +603 -109
- package/src/server.ts +35 -155
- package/src/ssr/index.tsx +103 -30
- package/src/static-handler.ts +126 -0
- package/src/theme/ThemeProvider.tsx +21 -15
- package/src/theme/ThemeScript.tsx +5 -5
- package/src/theme/constants.ts +5 -2
- package/src/theme/index.ts +4 -14
- package/src/theme/theme-context.ts +4 -30
- package/src/theme/theme-script.ts +21 -18
- package/src/types/boundaries.ts +158 -0
- package/src/types/cache-types.ts +198 -0
- package/src/types/error-types.ts +192 -0
- package/src/types/global-namespace.ts +100 -0
- package/src/types/handler-context.ts +759 -0
- package/src/types/index.ts +88 -0
- package/src/types/loader-types.ts +209 -0
- package/src/types/request-scope.ts +126 -0
- package/src/types/route-config.ts +170 -0
- package/src/types/route-entry.ts +120 -0
- package/src/types/segments.ts +150 -0
- package/src/types.ts +1 -1757
- package/src/urls/include-helper.ts +207 -0
- package/src/urls/index.ts +53 -0
- package/src/urls/path-helper-types.ts +372 -0
- package/src/urls/path-helper.ts +364 -0
- package/src/urls/pattern-types.ts +107 -0
- package/src/urls/response-types.ts +108 -0
- package/src/urls/type-extraction.ts +372 -0
- package/src/urls/urls-function.ts +98 -0
- package/src/urls.ts +1 -1282
- package/src/use-loader.tsx +161 -81
- package/src/vite/debug.ts +184 -0
- package/src/vite/discovery/bundle-postprocess.ts +181 -0
- package/src/vite/discovery/discover-routers.ts +376 -0
- package/src/vite/discovery/prerender-collection.ts +486 -0
- package/src/vite/discovery/route-types-writer.ts +258 -0
- package/src/vite/discovery/self-gen-tracking.ts +47 -0
- package/src/vite/discovery/state.ts +117 -0
- package/src/vite/discovery/virtual-module-codegen.ts +203 -0
- package/src/vite/index.ts +15 -1963
- package/src/vite/plugin-types.ts +103 -0
- package/src/vite/plugins/cjs-to-esm.ts +98 -0
- package/src/vite/plugins/client-ref-dedup.ts +131 -0
- package/src/vite/plugins/client-ref-hashing.ts +117 -0
- package/src/vite/plugins/cloudflare-protocol-loader-hook.d.mts +23 -0
- package/src/vite/plugins/cloudflare-protocol-loader-hook.mjs +76 -0
- package/src/vite/plugins/cloudflare-protocol-stub.ts +214 -0
- package/src/vite/{expose-action-id.ts → plugins/expose-action-id.ts} +107 -64
- package/src/vite/plugins/expose-id-utils.ts +299 -0
- package/src/vite/plugins/expose-ids/export-analysis.ts +296 -0
- package/src/vite/plugins/expose-ids/handler-transform.ts +209 -0
- package/src/vite/plugins/expose-ids/loader-transform.ts +74 -0
- package/src/vite/plugins/expose-ids/router-transform.ts +127 -0
- package/src/vite/plugins/expose-ids/types.ts +45 -0
- package/src/vite/plugins/expose-internal-ids.ts +816 -0
- package/src/vite/plugins/performance-tracks.ts +96 -0
- package/src/vite/plugins/refresh-cmd.ts +127 -0
- package/src/vite/plugins/use-cache-transform.ts +336 -0
- package/src/vite/plugins/version-injector.ts +83 -0
- package/src/vite/plugins/version-plugin.ts +266 -0
- package/src/vite/plugins/virtual-entries.ts +123 -0
- package/src/vite/plugins/virtual-stub-plugin.ts +29 -0
- package/src/vite/rango.ts +497 -0
- package/src/vite/router-discovery.ts +1111 -0
- package/src/vite/utils/ast-handler-extract.ts +517 -0
- package/src/vite/utils/banner.ts +36 -0
- package/src/vite/utils/bundle-analysis.ts +137 -0
- package/src/vite/utils/manifest-utils.ts +70 -0
- package/src/vite/utils/package-resolution.ts +161 -0
- package/src/vite/utils/prerender-utils.ts +221 -0
- package/src/vite/utils/shared-utils.ts +170 -0
- package/CLAUDE.md +0 -43
- package/src/browser/lru-cache.ts +0 -69
- package/src/browser/request-controller.ts +0 -164
- package/src/cache/memory-store.ts +0 -253
- package/src/router.gen.ts +0 -6
- package/src/urls.gen.ts +0 -8
- package/src/vite/expose-handle-id.ts +0 -209
- package/src/vite/expose-loader-id.ts +0 -426
- package/src/vite/expose-location-state-id.ts +0 -177
- package/src/vite/expose-prerender-handler-id.ts +0 -429
- /package/src/vite/{version.d.ts → plugins/version.d.ts} +0 -0
package/src/browser/shallow.ts
CHANGED
|
@@ -26,7 +26,12 @@ export function shallow<T>(a: T, b: T): boolean {
|
|
|
26
26
|
|
|
27
27
|
// Check each key's value with Object.is
|
|
28
28
|
for (const key of keysA) {
|
|
29
|
-
if (
|
|
29
|
+
if (
|
|
30
|
+
!Object.is(
|
|
31
|
+
(a as Record<string, unknown>)[key],
|
|
32
|
+
(b as Record<string, unknown>)[key],
|
|
33
|
+
)
|
|
34
|
+
) {
|
|
30
35
|
return false;
|
|
31
36
|
}
|
|
32
37
|
}
|
package/src/browser/types.ts
CHANGED
|
@@ -8,10 +8,10 @@ import type { RenderSegmentsOptions } from "../segment-system.js";
|
|
|
8
8
|
// ============================================================================
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
* RSC payload received from server
|
|
11
|
+
* RSC payload received from server.
|
|
12
|
+
* The tree is reconstructed from metadata.segments by the browser bridges.
|
|
12
13
|
*/
|
|
13
14
|
export interface RscPayload<TMetadata = RscMetadata> {
|
|
14
|
-
root: ReactNode | Promise<ReactNode> | null;
|
|
15
15
|
metadata?: TMetadata;
|
|
16
16
|
returnValue?: ActionResult;
|
|
17
17
|
formState?: unknown;
|
|
@@ -32,10 +32,15 @@ export type HandleData = Record<string, Record<string, unknown[]>>;
|
|
|
32
32
|
export interface RscMetadata {
|
|
33
33
|
pathname: string;
|
|
34
34
|
segments: ResolvedSegment[];
|
|
35
|
+
/** Router instance ID. When this changes between navigations, the client
|
|
36
|
+
* forces a full tree replacement (app switch via host router). */
|
|
37
|
+
routerId?: string;
|
|
35
38
|
isPartial?: boolean;
|
|
36
39
|
isError?: boolean;
|
|
37
40
|
matched?: string[];
|
|
38
41
|
diff?: string[];
|
|
42
|
+
/** Merged route params from the matched route */
|
|
43
|
+
params?: Record<string, string>;
|
|
39
44
|
/**
|
|
40
45
|
* State of named slots for this route match
|
|
41
46
|
* Key is slot name (e.g., "@modal"), value is slot state
|
|
@@ -53,6 +58,11 @@ export interface RscMetadata {
|
|
|
53
58
|
* Used to detect version mismatches after HMR/deployment.
|
|
54
59
|
*/
|
|
55
60
|
version?: string;
|
|
61
|
+
/**
|
|
62
|
+
* TTL in milliseconds for the client-side in-memory prefetch cache.
|
|
63
|
+
* Sent on initial render so the browser can configure its cache duration.
|
|
64
|
+
*/
|
|
65
|
+
prefetchCacheTTL?: number;
|
|
56
66
|
/**
|
|
57
67
|
* Theme configuration from router.
|
|
58
68
|
* Included when theme is enabled in router config.
|
|
@@ -63,8 +73,14 @@ export interface RscMetadata {
|
|
|
63
73
|
* Included when theme is enabled in router config.
|
|
64
74
|
*/
|
|
65
75
|
initialTheme?: Theme;
|
|
76
|
+
/** URL prefix for all routes (from createRouter({ basename })). */
|
|
77
|
+
basename?: string;
|
|
66
78
|
/** Whether connection warmup is enabled */
|
|
67
79
|
warmupEnabled?: boolean;
|
|
80
|
+
/** Server-side redirect with optional state (for partial requests) */
|
|
81
|
+
redirect?: { url: string };
|
|
82
|
+
/** Server-set location state to include in history.pushState */
|
|
83
|
+
locationState?: Record<string, unknown>;
|
|
68
84
|
}
|
|
69
85
|
|
|
70
86
|
/**
|
|
@@ -115,7 +131,7 @@ export interface NavigationState {
|
|
|
115
131
|
/** Whether RSC data is currently streaming (initial load or navigation) */
|
|
116
132
|
isStreaming: boolean;
|
|
117
133
|
|
|
118
|
-
/** Current location
|
|
134
|
+
/** Current location */
|
|
119
135
|
location: NavigationLocation;
|
|
120
136
|
|
|
121
137
|
/** URL being navigated to (null when idle) */
|
|
@@ -172,7 +188,7 @@ export type ActionStateListener = (state: TrackedActionState) => void;
|
|
|
172
188
|
|
|
173
189
|
/**
|
|
174
190
|
* Cache interface for storing segments
|
|
175
|
-
* Compatible with
|
|
191
|
+
* Compatible with Map
|
|
176
192
|
*
|
|
177
193
|
* @internal This type is an implementation detail and may change without notice.
|
|
178
194
|
*/
|
|
@@ -204,14 +220,25 @@ export interface SegmentState {
|
|
|
204
220
|
export interface NavigationUpdate {
|
|
205
221
|
root: ReactNode | Promise<ReactNode>;
|
|
206
222
|
metadata: RscMetadata;
|
|
223
|
+
/** Scroll behavior to apply after React commits this update */
|
|
224
|
+
scroll?: {
|
|
225
|
+
/** For back/forward: restore saved position */
|
|
226
|
+
restore?: boolean;
|
|
227
|
+
/** Set to false to disable scrolling entirely */
|
|
228
|
+
enabled?: boolean;
|
|
229
|
+
/** Function to check if streaming is in progress */
|
|
230
|
+
isStreaming?: () => boolean;
|
|
231
|
+
};
|
|
207
232
|
}
|
|
208
233
|
|
|
209
234
|
/**
|
|
210
235
|
* State value for navigate/Link
|
|
211
236
|
* - LocationStateEntry[]: Type-safe state entries (recommended)
|
|
212
|
-
* - unknown:
|
|
237
|
+
* - unknown: Plain state format (object or getter function)
|
|
213
238
|
*/
|
|
214
|
-
export type HistoryState =
|
|
239
|
+
export type HistoryState =
|
|
240
|
+
| import("./react/location-state-shared.js").LocationStateEntry[]
|
|
241
|
+
| unknown;
|
|
215
242
|
|
|
216
243
|
/**
|
|
217
244
|
* Options for navigation operations
|
|
@@ -219,6 +246,25 @@ export type HistoryState = import("./react/location-state-shared.js").LocationSt
|
|
|
219
246
|
export interface NavigateOptions {
|
|
220
247
|
replace?: boolean;
|
|
221
248
|
scroll?: boolean;
|
|
249
|
+
/**
|
|
250
|
+
* Whether to revalidate server data on navigation.
|
|
251
|
+
* Set to `false` to skip the RSC server fetch and only update the URL.
|
|
252
|
+
*
|
|
253
|
+
* Only takes effect when the pathname stays the same (search param / hash changes).
|
|
254
|
+
* If the pathname changes, this option is ignored and a full navigation occurs.
|
|
255
|
+
*
|
|
256
|
+
* All location-aware hooks (`useSearchParams`, `useNavigation`, etc.) still update.
|
|
257
|
+
* Server components do not re-render.
|
|
258
|
+
*
|
|
259
|
+
* @default true
|
|
260
|
+
*
|
|
261
|
+
* @example
|
|
262
|
+
* ```tsx
|
|
263
|
+
* router.push("/products?color=blue", { revalidate: false });
|
|
264
|
+
* router.replace("/products?page=3", { revalidate: false });
|
|
265
|
+
* ```
|
|
266
|
+
*/
|
|
267
|
+
revalidate?: boolean;
|
|
222
268
|
/**
|
|
223
269
|
* State to pass to history.pushState/replaceState
|
|
224
270
|
* Accessible via useLocationState() hook.
|
|
@@ -226,19 +272,67 @@ export interface NavigateOptions {
|
|
|
226
272
|
* @example
|
|
227
273
|
* ```tsx
|
|
228
274
|
* // Type-safe state (recommended)
|
|
229
|
-
* const ProductState = createLocationState<{ name: string }>(
|
|
275
|
+
* const ProductState = createLocationState<{ name: string }>();
|
|
230
276
|
* navigate("/product/123", { state: [ProductState({ name: "Widget" })] });
|
|
231
277
|
*
|
|
278
|
+
* // Type-safe just-in-time state (getter called at navigation time)
|
|
279
|
+
* navigate("/product/123", {
|
|
280
|
+
* state: [ProductState(() => ({ name: computeName() }))],
|
|
281
|
+
* });
|
|
282
|
+
*
|
|
232
283
|
* // Multiple states
|
|
233
284
|
* navigate("/checkout", { state: [ProductState(p), CartState(c)] });
|
|
234
285
|
*
|
|
235
|
-
* //
|
|
286
|
+
* // Plain static state
|
|
236
287
|
* navigate("/product", { state: { from: "list" } });
|
|
288
|
+
*
|
|
289
|
+
* // Plain just-in-time state
|
|
290
|
+
* navigate("/product", { state: () => ({ from: window.location.pathname }) });
|
|
237
291
|
* ```
|
|
238
292
|
*/
|
|
239
293
|
state?: HistoryState;
|
|
240
294
|
}
|
|
241
295
|
|
|
296
|
+
/** @internal Extended options used only within the navigation bridge */
|
|
297
|
+
export interface NavigateOptionsInternal extends NavigateOptions {
|
|
298
|
+
/** Skip segment cache (used by redirect-with-state to force re-render) */
|
|
299
|
+
_skipCache?: boolean;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* Options for useRouter push/replace methods.
|
|
304
|
+
* Same as NavigateOptions but without `replace` (implicit in push vs replace).
|
|
305
|
+
*/
|
|
306
|
+
export type RouterNavigateOptions = Omit<NavigateOptions, "replace">;
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* Router instance returned by useRouter hook.
|
|
310
|
+
* Provides stable action methods that never cause re-renders.
|
|
311
|
+
*/
|
|
312
|
+
export interface RouterInstance {
|
|
313
|
+
/** Navigate to a URL, pushing a new entry to the history stack */
|
|
314
|
+
push(url: string, options?: RouterNavigateOptions): Promise<void>;
|
|
315
|
+
/** Navigate to a URL, replacing the current history entry */
|
|
316
|
+
replace(url: string, options?: RouterNavigateOptions): Promise<void>;
|
|
317
|
+
/** Refresh the current route (re-fetch server data, preserve client state) */
|
|
318
|
+
refresh(): Promise<void>;
|
|
319
|
+
/** Prefetch a URL for faster client-side transition */
|
|
320
|
+
prefetch(url: string): void;
|
|
321
|
+
/** Go back in browser history */
|
|
322
|
+
back(): void;
|
|
323
|
+
/** Go forward in browser history */
|
|
324
|
+
forward(): void;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* URLSearchParams without mutation methods.
|
|
329
|
+
* Matches Next.js convention for useSearchParams return type.
|
|
330
|
+
*/
|
|
331
|
+
export type ReadonlyURLSearchParams = Omit<
|
|
332
|
+
URLSearchParams,
|
|
333
|
+
"append" | "delete" | "set" | "sort"
|
|
334
|
+
>;
|
|
335
|
+
|
|
242
336
|
// ============================================================================
|
|
243
337
|
// RSC Browser Dependencies
|
|
244
338
|
// ============================================================================
|
|
@@ -252,15 +346,21 @@ export interface NavigateOptions {
|
|
|
252
346
|
export interface RscBrowserDependencies {
|
|
253
347
|
createFromFetch: <T>(
|
|
254
348
|
response: Promise<Response>,
|
|
255
|
-
options?: {
|
|
349
|
+
options?: {
|
|
350
|
+
temporaryReferences?: any;
|
|
351
|
+
findSourceMapURL?: (
|
|
352
|
+
filename: string,
|
|
353
|
+
environmentName: string,
|
|
354
|
+
) => string | null;
|
|
355
|
+
},
|
|
256
356
|
) => Promise<T>;
|
|
257
357
|
createFromReadableStream: <T>(stream: ReadableStream) => Promise<T>;
|
|
258
358
|
encodeReply: (
|
|
259
359
|
args: any[],
|
|
260
|
-
options?: { temporaryReferences?: any }
|
|
360
|
+
options?: { temporaryReferences?: any },
|
|
261
361
|
) => Promise<FormData | string>;
|
|
262
362
|
setServerCallback: (
|
|
263
|
-
callback: (id: string, args: any[]) => Promise<any
|
|
363
|
+
callback: (id: string, args: any[]) => Promise<any>,
|
|
264
364
|
) => void;
|
|
265
365
|
createTemporaryReferenceSet: () => any;
|
|
266
366
|
}
|
|
@@ -312,16 +412,27 @@ export interface NavigationStore {
|
|
|
312
412
|
cacheSegmentsForHistory(
|
|
313
413
|
historyKey: string,
|
|
314
414
|
segments: ResolvedSegment[],
|
|
315
|
-
handleData?: HandleData
|
|
415
|
+
handleData?: HandleData,
|
|
316
416
|
): void;
|
|
317
|
-
getCachedSegments(
|
|
318
|
-
|
|
319
|
-
|
|
417
|
+
getCachedSegments(historyKey: string):
|
|
418
|
+
| {
|
|
419
|
+
segments: ResolvedSegment[];
|
|
420
|
+
stale: boolean;
|
|
421
|
+
handleData?: HandleData;
|
|
422
|
+
routerId?: string;
|
|
423
|
+
}
|
|
424
|
+
| undefined;
|
|
320
425
|
hasHistoryCache(historyKey: string): boolean;
|
|
321
426
|
updateCacheHandleData(historyKey: string, handleData: HandleData): void;
|
|
322
427
|
markCacheAsStale(): void;
|
|
323
428
|
markCacheAsStaleAndBroadcast(): void;
|
|
324
429
|
clearHistoryCache(): void;
|
|
430
|
+
/**
|
|
431
|
+
* Clear this tab's nav + prefetch caches without broadcasting or rotating
|
|
432
|
+
* shared state. Intended for app-switch transitions that affect only this
|
|
433
|
+
* tab's session.
|
|
434
|
+
*/
|
|
435
|
+
clearHistoryCacheLocal(): void;
|
|
325
436
|
broadcastCacheInvalidation(): void;
|
|
326
437
|
|
|
327
438
|
// Cross-tab refresh callback (set by navigation bridge)
|
|
@@ -331,6 +442,10 @@ export interface NavigationStore {
|
|
|
331
442
|
getInterceptSourceUrl(): string | null;
|
|
332
443
|
setInterceptSourceUrl(url: string | null): void;
|
|
333
444
|
|
|
445
|
+
// Router identity tracking (for cross-app navigation detection)
|
|
446
|
+
getRouterId?(): string | undefined;
|
|
447
|
+
setRouterId?(id: string): void;
|
|
448
|
+
|
|
334
449
|
// UI update notifications
|
|
335
450
|
onUpdate(callback: UpdateSubscriber): () => void;
|
|
336
451
|
emitUpdate(update: NavigationUpdate): void;
|
|
@@ -340,39 +455,10 @@ export interface NavigationStore {
|
|
|
340
455
|
setActionState(actionId: string, state: Partial<TrackedActionState>): void;
|
|
341
456
|
subscribeToAction(
|
|
342
457
|
actionId: string,
|
|
343
|
-
listener: ActionStateListener
|
|
458
|
+
listener: ActionStateListener,
|
|
344
459
|
): () => void;
|
|
345
460
|
}
|
|
346
461
|
|
|
347
|
-
// ============================================================================
|
|
348
|
-
// Request Controller Types
|
|
349
|
-
// ============================================================================
|
|
350
|
-
|
|
351
|
-
/**
|
|
352
|
-
* Disposable abort controller with automatic cleanup
|
|
353
|
-
*/
|
|
354
|
-
export interface DisposableAbortController extends Disposable {
|
|
355
|
-
controller: AbortController;
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
/**
|
|
359
|
-
* Request controller for managing concurrent requests
|
|
360
|
-
*
|
|
361
|
-
* Separates navigation requests (aborted on new navigation) from
|
|
362
|
-
* action requests (complete independently of navigation).
|
|
363
|
-
*/
|
|
364
|
-
export interface RequestController {
|
|
365
|
-
create(): AbortController;
|
|
366
|
-
createDisposable(): DisposableAbortController;
|
|
367
|
-
/** Create a disposable controller for actions (not aborted by navigation) */
|
|
368
|
-
createActionDisposable(): DisposableAbortController;
|
|
369
|
-
/** Abort all navigation requests (not actions) */
|
|
370
|
-
abortAll(): void;
|
|
371
|
-
/** Abort all action requests (used for error handling) */
|
|
372
|
-
abortAllActions(): void;
|
|
373
|
-
remove(controller: AbortController): void;
|
|
374
|
-
}
|
|
375
|
-
|
|
376
462
|
// ============================================================================
|
|
377
463
|
// Navigation Client Types
|
|
378
464
|
// ============================================================================
|
|
@@ -390,6 +476,8 @@ export interface FetchPartialOptions {
|
|
|
390
476
|
interceptSourceUrl?: string;
|
|
391
477
|
/** RSC version for cache invalidation detection */
|
|
392
478
|
version?: string;
|
|
479
|
+
/** Current router ID — server detects app switch and returns full response */
|
|
480
|
+
routerId?: string;
|
|
393
481
|
/** If true, this is an HMR refetch - server should invalidate manifest cache */
|
|
394
482
|
hmr?: boolean;
|
|
395
483
|
}
|
|
@@ -430,7 +518,6 @@ export interface LinkInterceptorOptions {
|
|
|
430
518
|
*/
|
|
431
519
|
export interface ServerActionBridge {
|
|
432
520
|
register(): void;
|
|
433
|
-
unregister(): void;
|
|
434
521
|
}
|
|
435
522
|
|
|
436
523
|
/**
|
|
@@ -443,7 +530,7 @@ export interface ServerActionBridgeConfig {
|
|
|
443
530
|
onUpdate: UpdateSubscriber;
|
|
444
531
|
renderSegments: (
|
|
445
532
|
segments: ResolvedSegment[],
|
|
446
|
-
options?: RenderSegmentsOptions
|
|
533
|
+
options?: RenderSegmentsOptions,
|
|
447
534
|
) => Promise<ReactNode> | ReactNode;
|
|
448
535
|
}
|
|
449
536
|
|
|
@@ -459,6 +546,15 @@ export interface NavigationBridge {
|
|
|
459
546
|
refresh(): Promise<void>;
|
|
460
547
|
handlePopstate(): Promise<void>;
|
|
461
548
|
registerLinkInterception(): () => void;
|
|
549
|
+
/** Update the RSC version (e.g. after HMR). Clears prefetch cache. */
|
|
550
|
+
updateVersion(newVersion: string): void;
|
|
551
|
+
/**
|
|
552
|
+
* Replace the active app-shell snapshot (rootLayout, basename, version)
|
|
553
|
+
* atomically. Used on cross-app navigations when the response's routerId
|
|
554
|
+
* indicates the user entered a different app. Theme, warmup, and prefetch
|
|
555
|
+
* TTL are document-lifetime and not part of the shell.
|
|
556
|
+
*/
|
|
557
|
+
updateAppShell(next: import("./app-shell.js").AppShell): void;
|
|
462
558
|
}
|
|
463
559
|
|
|
464
560
|
/**
|
|
@@ -470,9 +566,17 @@ export interface NavigationBridgeConfig {
|
|
|
470
566
|
onUpdate: UpdateSubscriber;
|
|
471
567
|
renderSegments: (
|
|
472
568
|
segments: ResolvedSegment[],
|
|
473
|
-
options?: RenderSegmentsOptions
|
|
569
|
+
options?: RenderSegmentsOptions,
|
|
474
570
|
) => Promise<ReactNode> | ReactNode;
|
|
475
571
|
}
|
|
476
572
|
|
|
477
573
|
// Re-export ResolvedSegment for convenience
|
|
478
574
|
export type { ResolvedSegment };
|
|
575
|
+
|
|
576
|
+
/**
|
|
577
|
+
* Token for tracking an active stream.
|
|
578
|
+
* Call end() when the stream completes.
|
|
579
|
+
*/
|
|
580
|
+
export interface StreamingToken {
|
|
581
|
+
end(): void;
|
|
582
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validate that a client-consumed redirect URL (from headers or Flight payload)
|
|
3
|
+
* targets the same origin as the current page. Prevents open-redirect attacks
|
|
4
|
+
* via crafted responses.
|
|
5
|
+
*
|
|
6
|
+
* @returns The canonical (normalized) URL string on success, or null if blocked.
|
|
7
|
+
*/
|
|
8
|
+
export function validateRedirectOrigin(
|
|
9
|
+
url: string,
|
|
10
|
+
currentOrigin: string,
|
|
11
|
+
): string | null {
|
|
12
|
+
try {
|
|
13
|
+
const target = new URL(url, currentOrigin);
|
|
14
|
+
if (target.origin !== currentOrigin) {
|
|
15
|
+
console.error(
|
|
16
|
+
`[rango] Redirect blocked: origin mismatch (${target.origin})`,
|
|
17
|
+
);
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
// Return pathname+search+hash for relative inputs, full href for absolute.
|
|
21
|
+
// This normalizes protocol-relative and other ambiguous forms.
|
|
22
|
+
return target.href.startsWith(currentOrigin)
|
|
23
|
+
? target.href
|
|
24
|
+
: target.pathname + target.search + target.hash;
|
|
25
|
+
} catch {
|
|
26
|
+
console.error(`[rango] Redirect blocked: invalid URL "${url}"`);
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -43,14 +43,14 @@ export interface GeneratedManifest {
|
|
|
43
43
|
routeManifest: Record<string, string>;
|
|
44
44
|
/** Route name → trailing slash mode for trie redirect handling */
|
|
45
45
|
routeTrailingSlash?: Record<string, string>;
|
|
46
|
-
/** Route names using
|
|
46
|
+
/** Route names using Prerender (for dev-mode Node.js delegation) */
|
|
47
47
|
prerenderRoutes?: string[];
|
|
48
|
-
/** Route names with
|
|
48
|
+
/** Route names wrapped with Passthrough() (live handler for runtime fallback) */
|
|
49
49
|
passthroughRoutes?: string[];
|
|
50
50
|
/** Route name → response type for non-RSC routes */
|
|
51
51
|
responseTypeRoutes?: Record<string, string>;
|
|
52
|
-
/**
|
|
53
|
-
|
|
52
|
+
/** Route name -> search schema descriptor for typed URL helpers */
|
|
53
|
+
routeSearchSchemas?: Record<string, Record<string, string>>;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
/**
|
|
@@ -62,7 +62,7 @@ function buildPrefixTreeNode(
|
|
|
62
62
|
namePrefix: string | undefined,
|
|
63
63
|
patterns: UrlPatterns<any>,
|
|
64
64
|
routeManifest: Record<string, string>,
|
|
65
|
-
routeAncestry: Record<string, string[]>,
|
|
65
|
+
routeAncestry: Record<string, string[]>, // internal: feeds trie building, not exported
|
|
66
66
|
mountIndex: number,
|
|
67
67
|
visited: Set<unknown> = new Set(),
|
|
68
68
|
routeTrailingSlash?: Record<string, string>,
|
|
@@ -70,10 +70,11 @@ function buildPrefixTreeNode(
|
|
|
70
70
|
prerenderDefs?: Record<string, any>,
|
|
71
71
|
passthroughRoutes?: string[],
|
|
72
72
|
responseTypeRoutes?: Record<string, string>,
|
|
73
|
+
routeSearchSchemas?: Record<string, Record<string, string>>,
|
|
73
74
|
): PrefixTreeNode {
|
|
74
75
|
if (visited.has(patterns)) {
|
|
75
76
|
console.warn(
|
|
76
|
-
`[@rangojs/router] Circular include detected at prefix "${urlPrefix}". Skipping
|
|
77
|
+
`[@rangojs/router] Circular include detected at prefix "${urlPrefix}". Skipping.`,
|
|
77
78
|
);
|
|
78
79
|
return {
|
|
79
80
|
staticPrefix: extractStaticPrefix(urlPrefix),
|
|
@@ -89,6 +90,7 @@ function buildPrefixTreeNode(
|
|
|
89
90
|
const patternsMap = new Map<string, string>();
|
|
90
91
|
const patternsByPrefix = new Map<string, Map<string, string>>();
|
|
91
92
|
const trailingSlashMap = new Map<string, TrailingSlashMode>();
|
|
93
|
+
const searchSchemasMap = new Map<string, Record<string, string>>();
|
|
92
94
|
const trackedIncludes: TrackedInclude[] = [];
|
|
93
95
|
|
|
94
96
|
RSCRouterContext.run(
|
|
@@ -97,6 +99,7 @@ function buildPrefixTreeNode(
|
|
|
97
99
|
patterns: patternsMap,
|
|
98
100
|
patternsByPrefix,
|
|
99
101
|
trailingSlash: trailingSlashMap,
|
|
102
|
+
searchSchemas: searchSchemasMap,
|
|
100
103
|
namespace: "build",
|
|
101
104
|
parent: null,
|
|
102
105
|
counters: {},
|
|
@@ -114,7 +117,7 @@ function buildPrefixTreeNode(
|
|
|
114
117
|
}
|
|
115
118
|
return patterns.handler() as AllUseItems[];
|
|
116
119
|
});
|
|
117
|
-
}
|
|
120
|
+
},
|
|
118
121
|
);
|
|
119
122
|
|
|
120
123
|
// Collect route names defined in this include (routes have prefixes applied)
|
|
@@ -130,6 +133,11 @@ function buildPrefixTreeNode(
|
|
|
130
133
|
routeTrailingSlash[name] = mode;
|
|
131
134
|
}
|
|
132
135
|
}
|
|
136
|
+
if (routeSearchSchemas) {
|
|
137
|
+
for (const [name, schema] of searchSchemasMap.entries()) {
|
|
138
|
+
routeSearchSchemas[name] = schema;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
133
141
|
|
|
134
142
|
// Capture ancestry from manifest entries' parent chains
|
|
135
143
|
captureAncestry(manifest, routeAncestry);
|
|
@@ -142,7 +150,7 @@ function buildPrefixTreeNode(
|
|
|
142
150
|
if (prerenderDefs && entry.prerenderDef) {
|
|
143
151
|
prerenderDefs[name] = entry.prerenderDef;
|
|
144
152
|
}
|
|
145
|
-
if (passthroughRoutes && entry.
|
|
153
|
+
if (passthroughRoutes && entry.isPassthrough === true) {
|
|
146
154
|
passthroughRoutes.push(name);
|
|
147
155
|
}
|
|
148
156
|
}
|
|
@@ -177,6 +185,7 @@ function buildPrefixTreeNode(
|
|
|
177
185
|
prerenderDefs,
|
|
178
186
|
passthroughRoutes,
|
|
179
187
|
responseTypeRoutes,
|
|
188
|
+
routeSearchSchemas,
|
|
180
189
|
);
|
|
181
190
|
|
|
182
191
|
const existing = children[include.fullPrefix];
|
|
@@ -188,6 +197,11 @@ function buildPrefixTreeNode(
|
|
|
188
197
|
}
|
|
189
198
|
}
|
|
190
199
|
|
|
200
|
+
// Remove from visited so sibling branches can reuse the same patterns
|
|
201
|
+
// without false circular-include detection. Only ancestors in the current
|
|
202
|
+
// recursion path should trigger the cycle guard.
|
|
203
|
+
visited.delete(patterns);
|
|
204
|
+
|
|
191
205
|
return {
|
|
192
206
|
staticPrefix: extractStaticPrefix(urlPrefix),
|
|
193
207
|
fullPrefix: urlPrefix,
|
|
@@ -218,11 +232,20 @@ function captureAncestry(
|
|
|
218
232
|
}
|
|
219
233
|
|
|
220
234
|
/**
|
|
221
|
-
*
|
|
235
|
+
* Internal manifest result including build-pipeline-only fields.
|
|
236
|
+
* Not part of the public API — use generateManifest() for the public surface.
|
|
237
|
+
*/
|
|
238
|
+
export interface FullManifest extends GeneratedManifest {
|
|
239
|
+
_routeAncestry: Record<string, string[]>;
|
|
240
|
+
_prerenderDefs?: Record<string, any>;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Generate manifest from UrlPatterns (public API).
|
|
222
245
|
*
|
|
223
|
-
*
|
|
224
|
-
*
|
|
225
|
-
*
|
|
246
|
+
* Returns only the public GeneratedManifest fields. Internal build pipeline
|
|
247
|
+
* consumers that need _routeAncestry or _prerenderDefs should use
|
|
248
|
+
* generateManifestFull() instead.
|
|
226
249
|
*
|
|
227
250
|
* @example
|
|
228
251
|
* ```typescript
|
|
@@ -240,7 +263,27 @@ function captureAncestry(
|
|
|
240
263
|
export function generateManifest<TEnv>(
|
|
241
264
|
urlpatterns: UrlPatterns<TEnv, any>,
|
|
242
265
|
mountIndex: number = 0,
|
|
243
|
-
): GeneratedManifest
|
|
266
|
+
): GeneratedManifest {
|
|
267
|
+
const {
|
|
268
|
+
_routeAncestry: _,
|
|
269
|
+
_prerenderDefs: __,
|
|
270
|
+
...publicManifest
|
|
271
|
+
} = generateManifestFull(urlpatterns, mountIndex);
|
|
272
|
+
return publicManifest;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* Generate manifest with internal build-pipeline fields.
|
|
277
|
+
*
|
|
278
|
+
* Used by the Vite plugin (discover-routers via dynamic import through
|
|
279
|
+
* @rangojs/router/build), manifest-init (direct import), and trie
|
|
280
|
+
* building. Not intended for external use.
|
|
281
|
+
*/
|
|
282
|
+
export function generateManifestFull<TEnv>(
|
|
283
|
+
urlpatterns: UrlPatterns<TEnv, any>,
|
|
284
|
+
mountIndex: number = 0,
|
|
285
|
+
options?: { urlPrefix?: string },
|
|
286
|
+
): FullManifest {
|
|
244
287
|
const routeManifest: Record<string, string> = {};
|
|
245
288
|
const routeAncestry: Record<string, string[]> = {};
|
|
246
289
|
const prefixTree: Record<string, PrefixTreeNode> = {};
|
|
@@ -250,6 +293,7 @@ export function generateManifest<TEnv>(
|
|
|
250
293
|
const patternsMap = new Map<string, string>();
|
|
251
294
|
const patternsByPrefix = new Map<string, Map<string, string>>();
|
|
252
295
|
const trailingSlashMap = new Map<string, TrailingSlashMode>();
|
|
296
|
+
const searchSchemasMap = new Map<string, Record<string, string>>();
|
|
253
297
|
const trackedIncludes: TrackedInclude[] = [];
|
|
254
298
|
|
|
255
299
|
RSCRouterContext.run(
|
|
@@ -258,11 +302,14 @@ export function generateManifest<TEnv>(
|
|
|
258
302
|
patterns: patternsMap,
|
|
259
303
|
patternsByPrefix,
|
|
260
304
|
trailingSlash: trailingSlashMap,
|
|
305
|
+
searchSchemas: searchSchemasMap,
|
|
261
306
|
namespace: "build",
|
|
262
307
|
parent: null,
|
|
263
308
|
counters: {},
|
|
264
309
|
mountIndex,
|
|
265
310
|
trackedIncludes, // Enable include tracking
|
|
311
|
+
// basename sets the initial URL prefix for all path() registrations
|
|
312
|
+
...(options?.urlPrefix ? { urlPrefix: options.urlPrefix } : {}),
|
|
266
313
|
},
|
|
267
314
|
() => {
|
|
268
315
|
const helpers = createRouteHelpers();
|
|
@@ -270,7 +317,7 @@ export function generateManifest<TEnv>(
|
|
|
270
317
|
helpers.layout(MapRootLayout, () => {
|
|
271
318
|
return urlpatterns.handler() as AllUseItems[];
|
|
272
319
|
});
|
|
273
|
-
}
|
|
320
|
+
},
|
|
274
321
|
);
|
|
275
322
|
|
|
276
323
|
// Collect root-level routes and trailing slash config
|
|
@@ -281,6 +328,10 @@ export function generateManifest<TEnv>(
|
|
|
281
328
|
for (const [name, mode] of trailingSlashMap.entries()) {
|
|
282
329
|
routeTrailingSlash[name] = mode;
|
|
283
330
|
}
|
|
331
|
+
const routeSearchSchemas: Record<string, Record<string, string>> = {};
|
|
332
|
+
for (const [name, schema] of searchSchemasMap.entries()) {
|
|
333
|
+
routeSearchSchemas[name] = schema;
|
|
334
|
+
}
|
|
284
335
|
|
|
285
336
|
// Capture ancestry from manifest entries' parent chains
|
|
286
337
|
captureAncestry(manifest, routeAncestry);
|
|
@@ -296,7 +347,7 @@ export function generateManifest<TEnv>(
|
|
|
296
347
|
if (entry.prerenderDef) {
|
|
297
348
|
prerenderDefs[name] = entry.prerenderDef;
|
|
298
349
|
}
|
|
299
|
-
if (entry.
|
|
350
|
+
if (entry.isPassthrough === true) {
|
|
300
351
|
passthroughRoutes.push(name);
|
|
301
352
|
}
|
|
302
353
|
}
|
|
@@ -323,6 +374,7 @@ export function generateManifest<TEnv>(
|
|
|
323
374
|
prerenderDefs,
|
|
324
375
|
passthroughRoutes,
|
|
325
376
|
responseTypeRoutes,
|
|
377
|
+
routeSearchSchemas,
|
|
326
378
|
);
|
|
327
379
|
|
|
328
380
|
const existing = prefixTree[include.fullPrefix];
|
|
@@ -337,15 +389,25 @@ export function generateManifest<TEnv>(
|
|
|
337
389
|
return {
|
|
338
390
|
prefixTree,
|
|
339
391
|
routeManifest,
|
|
340
|
-
routeTrailingSlash:
|
|
392
|
+
routeTrailingSlash:
|
|
393
|
+
Object.keys(routeTrailingSlash).length > 0
|
|
394
|
+
? routeTrailingSlash
|
|
395
|
+
: undefined,
|
|
341
396
|
prerenderRoutes: prerenderRoutes.length > 0 ? prerenderRoutes : undefined,
|
|
342
|
-
passthroughRoutes:
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
397
|
+
passthroughRoutes:
|
|
398
|
+
passthroughRoutes.length > 0 ? passthroughRoutes : undefined,
|
|
399
|
+
responseTypeRoutes:
|
|
400
|
+
Object.keys(responseTypeRoutes).length > 0
|
|
401
|
+
? responseTypeRoutes
|
|
402
|
+
: undefined,
|
|
403
|
+
routeSearchSchemas:
|
|
404
|
+
Object.keys(routeSearchSchemas).length > 0
|
|
405
|
+
? routeSearchSchemas
|
|
406
|
+
: undefined,
|
|
346
407
|
_routeAncestry: routeAncestry,
|
|
347
408
|
// Internal: prerender handler definitions for build-time getParams() access
|
|
348
|
-
_prerenderDefs:
|
|
409
|
+
_prerenderDefs:
|
|
410
|
+
Object.keys(prerenderDefs).length > 0 ? prerenderDefs : undefined,
|
|
349
411
|
};
|
|
350
412
|
}
|
|
351
413
|
|
|
@@ -359,13 +421,12 @@ export function generateManifest<TEnv>(
|
|
|
359
421
|
* ```
|
|
360
422
|
*/
|
|
361
423
|
export function generateManifestCode<TEnv>(
|
|
362
|
-
urlpatterns: UrlPatterns<TEnv, any
|
|
424
|
+
urlpatterns: UrlPatterns<TEnv, any>,
|
|
363
425
|
): string {
|
|
364
426
|
const manifest = generateManifest(urlpatterns);
|
|
365
427
|
|
|
366
428
|
return `/**
|
|
367
429
|
* Auto-generated route manifest
|
|
368
|
-
* Generated at: ${manifest.generatedAt}
|
|
369
430
|
*
|
|
370
431
|
* DO NOT EDIT - This file is generated by @rangojs/router
|
|
371
432
|
*/
|