@rangojs/router 0.0.0-experimental.8bcfea43 → 0.0.0-experimental.8c0b0f1d
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/README.md +66 -1
- 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.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/dist/href-context.d.ts +29 -0
- 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 +1041 -465
- 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/dist/vite/package-resolution.js +112 -0
- package/dist/vite/package-resolution.js.map +1 -0
- package/dist/vite/virtual-entries.d.ts +25 -0
- package/dist/vite/virtual-entries.d.ts.map +1 -0
- package/dist/vite/virtual-entries.js +110 -0
- package/dist/vite/virtual-entries.js.map +1 -0
- package/package.json +2 -2
- package/skills/handler-use/SKILL.md +2 -0
- package/skills/hooks/SKILL.md +27 -1
- package/skills/i18n/SKILL.md +276 -0
- package/skills/intercept/SKILL.md +25 -0
- package/skills/layout/SKILL.md +2 -0
- package/skills/links/SKILL.md +162 -16
- package/skills/loader/SKILL.md +35 -1
- package/skills/middleware/SKILL.md +2 -0
- package/skills/migrate-nextjs/SKILL.md +3 -1
- package/skills/migrate-react-router/SKILL.md +4 -0
- package/skills/parallel/SKILL.md +9 -0
- package/skills/rango/SKILL.md +2 -0
- package/skills/route/SKILL.md +24 -0
- package/skills/server-actions/SKILL.md +739 -0
- package/skills/typesafety/SKILL.md +6 -0
- package/skills/view-transitions/SKILL.md +212 -0
- package/src/browser/event-controller.ts +44 -4
- package/src/browser/navigation-bridge.ts +79 -5
- package/src/browser/partial-update.ts +24 -9
- package/src/browser/react/NavigationProvider.tsx +45 -33
- package/src/browser/react/filter-segment-order.ts +51 -7
- package/src/browser/react/index.ts +3 -0
- package/src/browser/react/use-params.ts +8 -5
- package/src/browser/react/use-reverse.ts +99 -0
- package/src/browser/react/use-segments.ts +11 -8
- package/src/browser/scroll-restoration.ts +31 -28
- package/src/browser/types.ts +6 -0
- package/src/build/route-trie.ts +2 -1
- package/src/client.rsc.tsx +3 -0
- package/src/client.tsx +5 -1
- package/src/href-client.ts +4 -1
- package/src/reverse.ts +62 -40
- package/src/route-definition/helpers-types.ts +6 -1
- package/src/router/handler-context.ts +4 -41
- package/src/router/match-api.ts +1 -0
- package/src/router/match-handlers.ts +1 -0
- package/src/router/match-result.ts +21 -2
- package/src/router/middleware-types.ts +12 -3
- package/src/router/middleware.ts +22 -3
- package/src/router/pattern-matching.ts +44 -11
- package/src/router/revalidation.ts +15 -1
- package/src/router/segment-resolution/fresh.ts +8 -0
- package/src/router/segment-resolution/revalidation.ts +128 -100
- package/src/router/substitute-pattern-params.ts +56 -0
- package/src/router/trie-matching.ts +8 -9
- package/src/rsc/progressive-enhancement.ts +2 -0
- package/src/rsc/rsc-rendering.ts +3 -0
- package/src/rsc/server-action.ts +2 -0
- package/src/rsc/types.ts +6 -0
- package/src/segment-system.tsx +60 -9
- package/src/ssr/index.tsx +5 -1
- package/src/types/handler-context.ts +10 -5
- package/src/types/segments.ts +17 -0
- package/src/vite/debug.ts +140 -11
- package/src/vite/discovery/discover-routers.ts +31 -3
- package/src/vite/discovery/gate-state.ts +171 -0
- package/src/vite/discovery/prerender-collection.ts +48 -1
- package/src/vite/discovery/self-gen-tracking.ts +27 -1
- package/src/vite/plugins/cjs-to-esm.ts +5 -0
- package/src/vite/plugins/client-ref-dedup.ts +16 -0
- package/src/vite/plugins/client-ref-hashing.ts +16 -4
- package/src/vite/plugins/expose-action-id.ts +52 -28
- package/src/vite/plugins/expose-ids/router-transform.ts +20 -3
- package/src/vite/plugins/expose-internal-ids.ts +516 -486
- package/src/vite/plugins/performance-tracks.ts +16 -6
- package/src/vite/plugins/use-cache-transform.ts +56 -43
- package/src/vite/plugins/version-injector.ts +37 -11
- package/src/vite/rango.ts +2 -2
- package/src/vite/router-discovery.ts +423 -56
- package/src/vite/utils/prerender-utils.ts +5 -4
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: i18n
|
|
3
|
+
description: Locale-aware routing with `include("/:locale?", ...)`, locale resolution chains, and react-intl integration
|
|
4
|
+
argument-hint: "[topic]"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Internationalization (i18n) and Locale Routing
|
|
8
|
+
|
|
9
|
+
Rango doesn't ship an i18n module. The router gives you the URL primitives
|
|
10
|
+
(optional include prefixes, constraints, typed reverse) and you compose
|
|
11
|
+
them with whatever message library you use — `react-intl`, `lingui`,
|
|
12
|
+
`@formatjs/intl`, or hand-rolled.
|
|
13
|
+
|
|
14
|
+
This skill covers:
|
|
15
|
+
|
|
16
|
+
- Mounting routes under an optional locale prefix (`/`, `/en`, `/gb`)
|
|
17
|
+
- Constraining the prefix to a known locale set
|
|
18
|
+
- Resolving the active locale (URL → cookie → `Accept-Language` → default)
|
|
19
|
+
- Generating localized URLs via `reverse()` round-trip
|
|
20
|
+
- Wiring `react-intl` into an RSC route tree
|
|
21
|
+
|
|
22
|
+
## URL Shape: Optional Locale Prefix
|
|
23
|
+
|
|
24
|
+
Mount your localized routes under an optional include prefix so the
|
|
25
|
+
default locale lives at the bare URL and other locales get a prefix:
|
|
26
|
+
|
|
27
|
+
```typescript
|
|
28
|
+
// urls.tsx
|
|
29
|
+
import { urls } from "@rangojs/router";
|
|
30
|
+
import { menuRoutes } from "./menu";
|
|
31
|
+
|
|
32
|
+
export const urlpatterns = urls(({ include }) => [
|
|
33
|
+
include("/:locale?", menuRoutes, { name: "menu" }),
|
|
34
|
+
]);
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
URLs that match:
|
|
38
|
+
|
|
39
|
+
| URL | Matched route | `ctx.params.locale` |
|
|
40
|
+
| -------------- | --------------- | ------------------- |
|
|
41
|
+
| `/` | `menu.index` | `undefined` |
|
|
42
|
+
| `/en` | `menu.index` | `"en"` |
|
|
43
|
+
| `/c/breads` | `menu.category` | `undefined` |
|
|
44
|
+
| `/en/c/breads` | `menu.category` | `"en"` |
|
|
45
|
+
|
|
46
|
+
> **Constrain to known locales** when you want unknown locales to fall
|
|
47
|
+
> through to other routes (or 404) instead of being treated as a slug:
|
|
48
|
+
>
|
|
49
|
+
> ```typescript
|
|
50
|
+
> include("/:locale(en|gb|fr)?", menuRoutes, { name: "menu" });
|
|
51
|
+
> ```
|
|
52
|
+
>
|
|
53
|
+
> `/de` now 404s (constraint rejects `de`), and `/c/breads` continues to
|
|
54
|
+
> match `menu.category` with `locale: undefined`. Without the constraint,
|
|
55
|
+
> `/de` would match `menu.index` with `locale: "de"`.
|
|
56
|
+
|
|
57
|
+
## Reading the Locale in Handlers
|
|
58
|
+
|
|
59
|
+
Absent optionals are `undefined` (not `""`), so `??` coalesces correctly:
|
|
60
|
+
|
|
61
|
+
```typescript
|
|
62
|
+
import { Handler } from "@rangojs/router";
|
|
63
|
+
|
|
64
|
+
export const MenuIndex: Handler<"menu.index"> = (ctx) => {
|
|
65
|
+
// ctx.params.locale is `string | undefined`
|
|
66
|
+
const locale = resolveLocale(ctx);
|
|
67
|
+
return <Welcome locale={locale} />;
|
|
68
|
+
};
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
The `resolveLocale` helper below implements a typical fallback chain.
|
|
72
|
+
|
|
73
|
+
## Locale Resolution
|
|
74
|
+
|
|
75
|
+
URL is the strongest signal but you usually want a fallback chain:
|
|
76
|
+
|
|
77
|
+
1. **URL prefix** — if the user navigates to `/gb/...`, honor it
|
|
78
|
+
2. **Cookie** — sticky preference set by a previous language switcher
|
|
79
|
+
3. **`Accept-Language`** — browser hint
|
|
80
|
+
4. **Default** — your app default
|
|
81
|
+
|
|
82
|
+
Put it in a small helper that every locale-aware handler calls:
|
|
83
|
+
|
|
84
|
+
```typescript
|
|
85
|
+
// lib/locale.ts
|
|
86
|
+
import { cookies, headers } from "@rangojs/router";
|
|
87
|
+
|
|
88
|
+
export const SUPPORTED_LOCALES = ["en", "gb", "fr"] as const;
|
|
89
|
+
export type Locale = (typeof SUPPORTED_LOCALES)[number];
|
|
90
|
+
const DEFAULT_LOCALE: Locale = "en";
|
|
91
|
+
|
|
92
|
+
const isSupported = (v: string): v is Locale =>
|
|
93
|
+
(SUPPORTED_LOCALES as readonly string[]).includes(v);
|
|
94
|
+
|
|
95
|
+
export function resolveLocale(ctx: {
|
|
96
|
+
params: Record<string, string | undefined>;
|
|
97
|
+
}): Locale {
|
|
98
|
+
const fromUrl = ctx.params.locale;
|
|
99
|
+
if (fromUrl && isSupported(fromUrl)) return fromUrl;
|
|
100
|
+
|
|
101
|
+
const fromCookie = cookies().get("locale")?.value;
|
|
102
|
+
if (fromCookie && isSupported(fromCookie)) return fromCookie;
|
|
103
|
+
|
|
104
|
+
const accept = headers().get("accept-language") ?? "";
|
|
105
|
+
for (const tag of accept.split(",")) {
|
|
106
|
+
const code = tag.split(";")[0].trim().split("-")[0];
|
|
107
|
+
if (isSupported(code)) return code as Locale;
|
|
108
|
+
}
|
|
109
|
+
return DEFAULT_LOCALE;
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
If you want to redirect to the canonical URL when the resolved locale
|
|
114
|
+
doesn't match the URL (e.g., user has `gb` cookie but visits `/`), do
|
|
115
|
+
that in a global middleware so it covers actions too:
|
|
116
|
+
|
|
117
|
+
```typescript
|
|
118
|
+
import { redirect } from "@rangojs/router";
|
|
119
|
+
|
|
120
|
+
router.use("/*", async (ctx, next) => {
|
|
121
|
+
const fromUrl = ctx.params.locale;
|
|
122
|
+
const resolved = resolveLocale(ctx);
|
|
123
|
+
if (resolved !== DEFAULT_LOCALE && !fromUrl) {
|
|
124
|
+
return redirect(`/${resolved}${ctx.url.pathname}`);
|
|
125
|
+
}
|
|
126
|
+
await next();
|
|
127
|
+
});
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## Generating Localized URLs
|
|
131
|
+
|
|
132
|
+
`reverse()` treats `undefined` and `""` for an optional param as "absent"
|
|
133
|
+
and collapses the segment cleanly. The round-trip is symmetric with the
|
|
134
|
+
matcher:
|
|
135
|
+
|
|
136
|
+
```typescript
|
|
137
|
+
ctx.reverse("menu.index", { locale: "" }); // → "/"
|
|
138
|
+
ctx.reverse("menu.index", { locale: undefined }); // → "/"
|
|
139
|
+
ctx.reverse("menu.index", { locale: "en" }); // → "/en"
|
|
140
|
+
ctx.reverse("menu.category", { locale: "en", slug: "breads" }); // → "/en/c/breads"
|
|
141
|
+
ctx.reverse("menu.category", { slug: "breads" }); // → "/c/breads"
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
If the active locale is the app default and your URL strategy hides it
|
|
145
|
+
(`"en"` → `/`, others → `/<locale>`), normalize before calling reverse:
|
|
146
|
+
|
|
147
|
+
```typescript
|
|
148
|
+
const normalized = locale === DEFAULT_LOCALE ? undefined : locale;
|
|
149
|
+
const href = ctx.reverse("menu.category", { locale: normalized, slug });
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
## react-intl Integration
|
|
153
|
+
|
|
154
|
+
`react-intl` needs a `<IntlProvider>` wrapping the tree, with `locale`
|
|
155
|
+
and `messages` props. The cleanest split: load messages on the server
|
|
156
|
+
(handler or layout), pass them through to a client provider component.
|
|
157
|
+
|
|
158
|
+
### Messages loader
|
|
159
|
+
|
|
160
|
+
Load message bundles per locale. Keep them server-side so they stream
|
|
161
|
+
through the RSC payload and don't bloat the client bundle:
|
|
162
|
+
|
|
163
|
+
```typescript
|
|
164
|
+
// lib/messages.ts
|
|
165
|
+
import type { Locale } from "./locale";
|
|
166
|
+
|
|
167
|
+
const loaders: Record<Locale, () => Promise<Record<string, string>>> = {
|
|
168
|
+
en: () => import("../messages/en.json").then((m) => m.default),
|
|
169
|
+
gb: () => import("../messages/gb.json").then((m) => m.default),
|
|
170
|
+
fr: () => import("../messages/fr.json").then((m) => m.default),
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
export async function loadMessages(locale: Locale) {
|
|
174
|
+
return loaders[locale]();
|
|
175
|
+
}
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
### Server layout: hand off to the client provider
|
|
179
|
+
|
|
180
|
+
```tsx
|
|
181
|
+
// layouts/intl-layout.tsx (server component)
|
|
182
|
+
import type { ReactNode } from "react";
|
|
183
|
+
import { resolveLocale } from "../lib/locale";
|
|
184
|
+
import { loadMessages } from "../lib/messages";
|
|
185
|
+
import { IntlClientProvider } from "../components/intl-client-provider";
|
|
186
|
+
|
|
187
|
+
export async function IntlLayout({
|
|
188
|
+
ctx,
|
|
189
|
+
children,
|
|
190
|
+
}: {
|
|
191
|
+
ctx: any;
|
|
192
|
+
children: ReactNode;
|
|
193
|
+
}) {
|
|
194
|
+
const locale = resolveLocale(ctx);
|
|
195
|
+
const messages = await loadMessages(locale);
|
|
196
|
+
return (
|
|
197
|
+
<IntlClientProvider locale={locale} messages={messages}>
|
|
198
|
+
{children}
|
|
199
|
+
</IntlClientProvider>
|
|
200
|
+
);
|
|
201
|
+
}
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
### Client provider
|
|
205
|
+
|
|
206
|
+
```tsx
|
|
207
|
+
// components/intl-client-provider.tsx
|
|
208
|
+
"use client";
|
|
209
|
+
|
|
210
|
+
import { IntlProvider } from "react-intl";
|
|
211
|
+
import type { ReactNode } from "react";
|
|
212
|
+
|
|
213
|
+
export function IntlClientProvider({
|
|
214
|
+
locale,
|
|
215
|
+
messages,
|
|
216
|
+
children,
|
|
217
|
+
}: {
|
|
218
|
+
locale: string;
|
|
219
|
+
messages: Record<string, string>;
|
|
220
|
+
children: ReactNode;
|
|
221
|
+
}) {
|
|
222
|
+
return (
|
|
223
|
+
<IntlProvider
|
|
224
|
+
locale={locale}
|
|
225
|
+
defaultLocale="en"
|
|
226
|
+
messages={messages}
|
|
227
|
+
onError={(err) => {
|
|
228
|
+
if (err.code === "MISSING_TRANSLATION") return; // common, log only
|
|
229
|
+
console.error(err);
|
|
230
|
+
}}
|
|
231
|
+
>
|
|
232
|
+
{children}
|
|
233
|
+
</IntlProvider>
|
|
234
|
+
);
|
|
235
|
+
}
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
### Mounting
|
|
239
|
+
|
|
240
|
+
Wrap your localized routes with the layout:
|
|
241
|
+
|
|
242
|
+
```typescript
|
|
243
|
+
import { urls } from "@rangojs/router";
|
|
244
|
+
import { IntlLayout } from "./layouts/intl-layout";
|
|
245
|
+
import { menuRoutes } from "./menu";
|
|
246
|
+
|
|
247
|
+
export const urlpatterns = urls(({ layout, include }) => [
|
|
248
|
+
layout(IntlLayout, () => [
|
|
249
|
+
include("/:locale?", menuRoutes, { name: "menu" }),
|
|
250
|
+
]),
|
|
251
|
+
]);
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
`<FormattedMessage>`, `useIntl()`, etc. work in any client component
|
|
255
|
+
under the layout. Server components can use `formatjs`'s `createIntl()`
|
|
256
|
+
directly with the same `messages` map for static text.
|
|
257
|
+
|
|
258
|
+
## Common Pitfalls
|
|
259
|
+
|
|
260
|
+
| Pitfall | Fix |
|
|
261
|
+
| ------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
|
|
262
|
+
| `ctx.params.locale === ""` returns `false` | Absent optionals are `undefined`, not `""`. Use `=== undefined` or `??`. |
|
|
263
|
+
| `ctx.params.locale ?? "en"` returns `""` | Pre-fix behavior. After the include-prefix fix this works correctly. |
|
|
264
|
+
| Bare `/` 404s when mounted via `include("/:locale?", routes)` | Requires the all-optional pattern fix in `compilePattern` (shipped). |
|
|
265
|
+
| Unknown locale (e.g. `/de`) matches as `locale: "de"` | Add a constraint: `:locale(en\|gb\|fr)?`. Unknown values now 404. |
|
|
266
|
+
| Reverse produces `//c/breads` for absent locale | `reverse()` collapses `undefined`/`""` segments — should not happen. File a bug. |
|
|
267
|
+
| Locale switcher loses search params | Read `ctx.url.search` and pass to `reverse(..., undefined, parsedSearch)`. |
|
|
268
|
+
| Action middleware can't read `ctx.params.locale` | Route middleware doesn't wrap action execution. Use global `router.use()` for actions. |
|
|
269
|
+
|
|
270
|
+
## Cross-references
|
|
271
|
+
|
|
272
|
+
- `/route` — optional URL param syntax and runtime contract
|
|
273
|
+
- `/typesafety` — `RouteParams<"name">` typing for optionals
|
|
274
|
+
- `/middleware` — global vs route middleware scope (matters for actions)
|
|
275
|
+
- `/server-actions` — actions and the global-vs-route middleware boundary
|
|
276
|
+
- `/links` — `ctx.reverse()` and locale-aware URL generation
|
|
@@ -197,6 +197,31 @@ function ModalWrapper({ children }) {
|
|
|
197
197
|
}
|
|
198
198
|
```
|
|
199
199
|
|
|
200
|
+
## Interaction with View Transitions
|
|
201
|
+
|
|
202
|
+
A layout that owns the `@modal` slot can also configure `transition()` for page
|
|
203
|
+
fades — opening a modal does **not** fire the layout's view transition. Rango
|
|
204
|
+
narrows the layout's `<ViewTransition>` wrap to the layout's default outlet
|
|
205
|
+
content, so `<ParallelOutlet />` (the slot where the modal mounts) is a sibling
|
|
206
|
+
of the wrap, not inside its subtree. Form actions submitted from inside an open
|
|
207
|
+
modal also commit without firing the underlying layout's transition, and the
|
|
208
|
+
modal subtree identity is preserved across revalidation (no remount,
|
|
209
|
+
`useActionState` survives). Closing the modal restores the page without a
|
|
210
|
+
stray transition.
|
|
211
|
+
|
|
212
|
+
For a modal-only morph (e.g. when intercepted URLs change while the modal
|
|
213
|
+
stays open), use an element-level React `<ViewTransition>` inside the modal
|
|
214
|
+
component — `transition()` accepted on `intercept()` via the DSL is not
|
|
215
|
+
applied to slot rendering today.
|
|
216
|
+
|
|
217
|
+
Caveat: route-level `transition()` wraps the route component itself, so a
|
|
218
|
+
`<ParallelOutlet />` rendered directly inside that route component would still
|
|
219
|
+
be inside the route's VT subtree. Mount the slot in a layout instead when you
|
|
220
|
+
combine intercept modals with route-level transitions.
|
|
221
|
+
|
|
222
|
+
See [skills/view-transitions](../view-transitions/SKILL.md) for the full
|
|
223
|
+
contract and direction-aware examples.
|
|
224
|
+
|
|
200
225
|
## Interaction with Prerender
|
|
201
226
|
|
|
202
227
|
When the target route of an intercept uses `Prerender`, the intercept handler is
|
package/skills/layout/SKILL.md
CHANGED
|
@@ -118,6 +118,8 @@ function ShopLayout() {
|
|
|
118
118
|
}
|
|
119
119
|
```
|
|
120
120
|
|
|
121
|
+
A layout's `transition()` config wraps the content that flows through `<Outlet />` — not the layout chrome itself, and not sibling `<ParallelOutlet />` slots. Stacking transitions across nested layouts collapses around the deepest default outlet content. See [skills/view-transitions](../view-transitions/SKILL.md) for the full wrap rules and intercept-modal interaction.
|
|
122
|
+
|
|
121
123
|
## Named Outlets
|
|
122
124
|
|
|
123
125
|
For parallel routes, use named outlets:
|
package/skills/links/SKILL.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: links
|
|
3
|
-
description: URL generation with ctx.reverse (server default), href (client), useHref (mounted), useMount, and scopedReverse
|
|
4
|
-
argument-hint: [ctx.reverse|href|useHref|useMount|scopedReverse]
|
|
3
|
+
description: URL generation with ctx.reverse (server default), href (client), useHref (mounted), useMount, useReverse, and scopedReverse
|
|
4
|
+
argument-hint: [ctx.reverse|href|useHref|useMount|useReverse|scopedReverse]
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Links & URL Generation
|
|
@@ -10,7 +10,12 @@ argument-hint: [ctx.reverse|href|useHref|useMount|scopedReverse]
|
|
|
10
10
|
|
|
11
11
|
**Default server API: `ctx.reverse()`.** Generate URLs from the handler context — it's typed, auto-fills mount params, and resolves local (`.name`) and absolute (`name.sub`) names.
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
**On the client, two patterns:**
|
|
14
|
+
|
|
15
|
+
1. **Receive URLs as props / loader data / action return.** The default. The server has the full route manifest and handler context — generate URLs there and hand strings to client components.
|
|
16
|
+
2. **`useReverse(routes)`.** Import a generated `routes` map from a `urls()` module's `.gen.ts` and call `reverse(".name", params?)`. Mount-aware via `useMount()`, auto-fills params from `useParams()`, fully typed from the imported map. Use this when a client component needs to generate URLs into a known module without round-tripping through the server.
|
|
17
|
+
|
|
18
|
+
`ctx.reverse()` itself is **server-only** — it depends on the full route manifest and handler context. Client components never import or call it.
|
|
14
19
|
|
|
15
20
|
## Server: ctx.reverse()
|
|
16
21
|
|
|
@@ -127,9 +132,7 @@ path("/product/:slug", (ctx) => {
|
|
|
127
132
|
|
|
128
133
|
## Client components: receive URLs as props
|
|
129
134
|
|
|
130
|
-
`reverse()` is not available inside `"use client"` modules — there is no handler context
|
|
131
|
-
|
|
132
|
-
Three patterns, in order of preference:
|
|
135
|
+
`ctx.reverse()` is not available inside `"use client"` modules — there is no handler context in the browser bundle. For in-module names, prefer `useReverse(routes)` (see below) and import the relevant `urls/*.gen.js`. For cross-module URLs or one-off names, generate the URL on the server and hand it to the client component using one of these three patterns:
|
|
133
136
|
|
|
134
137
|
1. Pass as a prop from a server component:
|
|
135
138
|
|
|
@@ -187,6 +190,8 @@ export async function getProductUrl(slug: string) {
|
|
|
187
190
|
}
|
|
188
191
|
```
|
|
189
192
|
|
|
193
|
+
See `/server-actions` for the full action surface (`getRequestContext()` is the same context middleware and handlers use).
|
|
194
|
+
|
|
190
195
|
For static path strings (not named routes), client components can use `href()` — see below.
|
|
191
196
|
|
|
192
197
|
## Client: href()
|
|
@@ -254,18 +259,159 @@ function MountInfo() {
|
|
|
254
259
|
|
|
255
260
|
`useMount()` reads from `MountContext`, which is automatically set by `include()` in the segment tree.
|
|
256
261
|
|
|
257
|
-
##
|
|
262
|
+
## Client: useReverse(routes)
|
|
263
|
+
|
|
264
|
+
Hook that returns a typed local reverse function for a `routes` map imported from a generated `.gen.ts` next to a `urls()` module. The route map is the **exposure boundary** — `useReverse` only knows about names in that map, never the full app manifest.
|
|
265
|
+
|
|
266
|
+
```tsx
|
|
267
|
+
"use client";
|
|
268
|
+
import { Link, useReverse } from "@rangojs/router/client";
|
|
269
|
+
import { routes as blogRoutes } from "../urls/blog.gen.js";
|
|
270
|
+
|
|
271
|
+
export function BlogNav() {
|
|
272
|
+
const reverse = useReverse(blogRoutes);
|
|
273
|
+
|
|
274
|
+
return (
|
|
275
|
+
<nav>
|
|
276
|
+
<Link to={reverse(".index")}>Blog</Link>
|
|
277
|
+
<Link to={reverse(".post", { postId: "hello" })}>Post</Link>
|
|
278
|
+
</nav>
|
|
279
|
+
);
|
|
280
|
+
}
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
### How it resolves
|
|
258
284
|
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
285
|
+
1. Strips the leading `.` and looks up the name in the imported `routes` map.
|
|
286
|
+
2. Joins the local pattern with the surrounding `useMount()` value — the include's URL pattern.
|
|
287
|
+
3. Substitutes params: explicit params from the call, then auto-filled from `useParams()` for anything still unresolved (mount params like `:tenantId` flow in this way).
|
|
288
|
+
4. Appends a query string if a search object is passed and the route has a `search` schema.
|
|
289
|
+
|
|
290
|
+
### Mount-relativity
|
|
291
|
+
|
|
292
|
+
Patterns in the generated `routes` map are **mount-relative** — they're the patterns as defined inside the `urls()` module, _not_ the full app paths. Mount-joining happens at runtime via `useMount()`, so the same component works under any include:
|
|
293
|
+
|
|
294
|
+
```typescript
|
|
295
|
+
// urls/blog.tsx
|
|
296
|
+
export const blogPatterns = urls(({ path }) => [
|
|
297
|
+
path("/", BlogIndex, { name: "index" }),
|
|
298
|
+
path("/:postId", BlogPost, { name: "post" }),
|
|
299
|
+
]);
|
|
300
|
+
|
|
301
|
+
// Generated urls/blog.gen.ts
|
|
302
|
+
// export const routes = { index: "/", post: "/:postId" } as const;
|
|
303
|
+
|
|
304
|
+
// urls.tsx — same module mounted twice
|
|
305
|
+
include("/news", blogPatterns, { name: "news" }), // <BlogNav> renders /news, /news/hello
|
|
306
|
+
include("/journal", blogPatterns, { name: "diary" }), // <BlogNav> renders /journal, /journal/hello
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
The `/` pattern under a non-root mount collapses cleanly: under `/news`, `reverse(".index")` returns `/news` (no trailing slash), matching `ctx.reverse(".index")` on the server.
|
|
310
|
+
|
|
311
|
+
### Auto-filled params (mount params)
|
|
312
|
+
|
|
313
|
+
When the include itself carries `:params`, those are auto-filled from `useParams()` so the caller doesn't have to thread them through:
|
|
314
|
+
|
|
315
|
+
```typescript
|
|
316
|
+
// urls.tsx
|
|
317
|
+
include("/tenant/:tenantId", clientReversePatterns, { name: "tenant" });
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
```tsx
|
|
321
|
+
// At /tenant/acme/posts/p1, useParams() = { tenantId: "acme", postId: "p1" }
|
|
322
|
+
const reverse = useReverse(clientReverseRoutes);
|
|
323
|
+
|
|
324
|
+
reverse(".index"); // "/tenant/acme"
|
|
325
|
+
reverse(".post", { postId: "p2" }); // "/tenant/acme/posts/p2" (tenantId auto-filled)
|
|
326
|
+
reverse(".post", { tenantId: "other", postId: "p2" }); // "/tenant/other/posts/p2" (explicit override)
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
Auto-fill follows soft navigation — when the matched route changes, `useReverse` re-renders with the new params.
|
|
330
|
+
|
|
331
|
+
### Search schemas
|
|
332
|
+
|
|
333
|
+
Routes declared with a `search` schema accept a typed search object as the third argument:
|
|
334
|
+
|
|
335
|
+
```typescript
|
|
336
|
+
// urls/blog.tsx
|
|
337
|
+
path("/search", SearchPage, {
|
|
338
|
+
name: "search",
|
|
339
|
+
search: { q: "string", page: "number?" },
|
|
340
|
+
}),
|
|
341
|
+
|
|
342
|
+
// Generated as: search: { path: "/search", search: { q: "string", page: "number?" } }
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
```tsx
|
|
346
|
+
const reverse = useReverse(blogRoutes);
|
|
347
|
+
reverse(".search", {}, { q: "hello world", page: 2 });
|
|
348
|
+
// "/news/search?q=hello%20world&page=2"
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
### Errors
|
|
352
|
+
|
|
353
|
+
- Unknown name: throws `Unknown local route: ".not-a-route"`.
|
|
354
|
+
- Missing required param: throws `Missing param "postId" for route ".detail"`.
|
|
355
|
+
|
|
356
|
+
Both happen synchronously during `reverse()` — wrap calls in try/catch (or an ErrorBoundary if the throw happens during render) when you need to surface them as UI.
|
|
357
|
+
|
|
358
|
+
### Names are dot-only on the client
|
|
359
|
+
|
|
360
|
+
`useReverse` accepts only `.name` (and dotted variants like `.nested.index`). There is no global namespace on the client — the import IS the scope. To link into a different module, import that module's `routes`:
|
|
361
|
+
|
|
362
|
+
```tsx
|
|
363
|
+
import { routes as blogRoutes } from "../urls/blog.gen.js";
|
|
364
|
+
import { routes as shopRoutes } from "../urls/shop.gen.js";
|
|
365
|
+
|
|
366
|
+
function CrossNav() {
|
|
367
|
+
const blog = useReverse(blogRoutes);
|
|
368
|
+
const shop = useReverse(shopRoutes);
|
|
369
|
+
return (
|
|
370
|
+
<nav>
|
|
371
|
+
<Link to={blog(".index")}>Blog</Link>
|
|
372
|
+
<Link to={shop(".cart")}>Cart</Link>
|
|
373
|
+
</nav>
|
|
374
|
+
);
|
|
375
|
+
}
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
### Codegen
|
|
379
|
+
|
|
380
|
+
Each `urls()` module gets a sibling `.gen.ts` with the local route names and patterns, produced by `rango generate`:
|
|
381
|
+
|
|
382
|
+
```bash
|
|
383
|
+
pnpm exec rango generate src/urls/blog.tsx
|
|
384
|
+
# or generate everything under a directory:
|
|
385
|
+
pnpm exec rango generate src/urls --static
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
Don't edit the file by hand — re-run codegen when patterns change.
|
|
389
|
+
|
|
390
|
+
**Today the Vite plugin only regenerates the router-level `*.named-routes.gen.ts`.** Per-module `urls/*.gen.ts` files are emitted only by the CLI (or `writePerModuleRouteTypesForFile` programmatically). Commit the generated files and re-run `rango generate` whenever a `urls()` module's `path()`/`include()` shape changes. A common workflow is to wire it into a `predev` script:
|
|
391
|
+
|
|
392
|
+
```jsonc
|
|
393
|
+
// package.json
|
|
394
|
+
{
|
|
395
|
+
"scripts": {
|
|
396
|
+
"predev": "rango generate src",
|
|
397
|
+
"dev": "vite",
|
|
398
|
+
},
|
|
399
|
+
}
|
|
400
|
+
```
|
|
401
|
+
|
|
402
|
+
## When to use what
|
|
267
403
|
|
|
268
|
-
|
|
404
|
+
| Context | API | Resolves | Use for |
|
|
405
|
+
| ---------------- | -------------------------------------------------- | ----------------------------------------- | ---------------------------------------------------------------- |
|
|
406
|
+
| Server handler | `ctx.reverse("name")` | Named routes (local + absolute) | **Default** server-side URL generation |
|
|
407
|
+
| Server handler | `scopedReverse<T>(ctx.reverse)` | Same, with type safety | Type-safe server URLs |
|
|
408
|
+
| Client component | `useReverse(routes)` | Local names from an imported `routes` map | Typed in-module URL generation without round-tripping the server |
|
|
409
|
+
| Client component | (URL passed as prop / loader data / action return) | Named routes | Cross-module URLs or one-off names you don't want to import |
|
|
410
|
+
| Client component | `href("/path")` | Absolute paths (static strings) | Static navigation where no named-route lookup is needed |
|
|
411
|
+
| Client component | `useHref()` | Mount-prefixed paths | Local navigation inside `include()` |
|
|
412
|
+
| Client component | `useMount()` | Raw mount path | Custom mount-aware logic |
|
|
413
|
+
|
|
414
|
+
> `ctx.reverse()` is server-only. On the client, either generate URLs on the server and pass them in, or import the `routes` map and use `useReverse(routes)` for in-module names.
|
|
269
415
|
|
|
270
416
|
## Complete example: mounted module
|
|
271
417
|
|
package/skills/loader/SKILL.md
CHANGED
|
@@ -6,7 +6,10 @@ argument-hint: [loader]
|
|
|
6
6
|
|
|
7
7
|
# Data Loaders with loader()
|
|
8
8
|
|
|
9
|
-
Loaders fetch data on the server and stream it to the client.
|
|
9
|
+
Loaders fetch data on the server and stream it to the client. For mutations
|
|
10
|
+
(writes triggered by forms or buttons), use server actions instead — see
|
|
11
|
+
`/server-actions`. Loaders re-resolve after an action runs, so the typical
|
|
12
|
+
flow is _action mutates → loader re-reads → UI updates_.
|
|
10
13
|
|
|
11
14
|
## Creating a Loader
|
|
12
15
|
|
|
@@ -248,6 +251,37 @@ path("/product/:slug", ProductPage, { name: "product" }, () => [
|
|
|
248
251
|
]);
|
|
249
252
|
```
|
|
250
253
|
|
|
254
|
+
### `revalidate()` return shapes
|
|
255
|
+
|
|
256
|
+
A `revalidate(fn)` callback can return one of four shapes. The chain
|
|
257
|
+
processes revalidators in order; each call's return controls how the
|
|
258
|
+
chain continues:
|
|
259
|
+
|
|
260
|
+
```typescript
|
|
261
|
+
// 1) Hard decision — short-circuits the chain, used as the final answer.
|
|
262
|
+
revalidate(() => true);
|
|
263
|
+
revalidate(({ actionId }) => actionId?.includes("Cart") ?? false);
|
|
264
|
+
|
|
265
|
+
// 2) Soft decision — updates the running suggestion for downstream
|
|
266
|
+
// revalidators on the same segment, chain continues.
|
|
267
|
+
revalidate(({ defaultShouldRevalidate }) => ({
|
|
268
|
+
defaultShouldRevalidate: !defaultShouldRevalidate,
|
|
269
|
+
}));
|
|
270
|
+
|
|
271
|
+
// 3) Defer (no opinion) — leaves the running suggestion unchanged and
|
|
272
|
+
// continues to the next revalidator. Implicit return / null /
|
|
273
|
+
// undefined are all equivalent and consumer-friendly.
|
|
274
|
+
revalidate(({ actionId }) => {
|
|
275
|
+
if (actionId?.includes("Cart")) return true; // hard for this branch only
|
|
276
|
+
// implicit return — let downstream revalidators or the segment default decide
|
|
277
|
+
});
|
|
278
|
+
revalidate(() => undefined); // explicit defer
|
|
279
|
+
revalidate(() => null); // explicit defer
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
If every revalidator on a segment defers, the segment-type default
|
|
283
|
+
(e.g. params-changed for routes, `false` for parallels) is used.
|
|
284
|
+
|
|
251
285
|
### Revalidation Contracts for Loader Dependencies
|
|
252
286
|
|
|
253
287
|
If a loader reads `ctx.get()` data produced by an outer handler/layout, share
|
|
@@ -32,6 +32,8 @@ When the router has a `basename`, pattern-scoped `.use()` patterns are automatic
|
|
|
32
32
|
|
|
33
33
|
Registered inside `urls()` callback. Wraps **rendering only** -- it does NOT wrap server action execution. Actions run before route middleware, so when route middleware executes during post-action revalidation, it can observe state that the action set (cookies, context variables, headers).
|
|
34
34
|
|
|
35
|
+
> **Implication for auth:** route middleware cannot guard server actions. Use `router.use("/admin/*", requireAuth)` (global, scoped) for action protection, or check inside the action body. See `/server-actions` for action-side auth patterns.
|
|
36
|
+
|
|
35
37
|
```
|
|
36
38
|
Request flow (with action):
|
|
37
39
|
global mw -> action executes -> route mw -> layout -> handler -> loaders
|
|
@@ -225,7 +225,7 @@ Loaders are Rango's live data layer. Use them when you need:
|
|
|
225
225
|
|
|
226
226
|
- **Client-side data refresh** — `useLoader()` in client components for reactive data
|
|
227
227
|
- **Per-loader caching** — opt in with `loader(MyLoader, () => [cache({ ttl: 60 })])`; loaders stay live by default
|
|
228
|
-
- **Revalidation control** — `revalidate()` targets specific loaders after actions
|
|
228
|
+
- **Revalidation control** — `revalidate()` targets specific segments and loaders after actions
|
|
229
229
|
- **Loading skeletons** — `loading()` shows a Suspense fallback while loaders resolve
|
|
230
230
|
|
|
231
231
|
```typescript
|
|
@@ -463,6 +463,8 @@ Server actions work the same way — `"use server"` directive, `useActionState`,
|
|
|
463
463
|
|
|
464
464
|
Key difference: in Rango, route middleware does NOT wrap action execution. Actions only see global middleware context. Use `getRequestContext()` in actions to access `ctx.set()`/`ctx.get()`.
|
|
465
465
|
|
|
466
|
+
Next.js's `revalidatePath()` / `revalidateTag()` have no direct equivalent — Rango partially re-renders matched route segments (path/layout/parallel/intercept) and re-resolves their loaders, and you scope re-runs by attaching a `revalidate(({ actionId }) => ...)` rule to any segment or loader registration. See `/server-actions` for the full pattern (validation, error handling, file uploads) and `/loader` for revalidation rule semantics.
|
|
467
|
+
|
|
466
468
|
## 8. Metadata / Head
|
|
467
469
|
|
|
468
470
|
Rango uses the `Meta` handle + `<MetaTags />` client component:
|
|
@@ -483,6 +483,10 @@ Since Rango uses RSC server actions, all React action patterns work:
|
|
|
483
483
|
`useActionState`, `useOptimistic`, `useTransition`, `startTransition`,
|
|
484
484
|
and plain `<form action={serverAction}>`. No framework-specific hook needed.
|
|
485
485
|
|
|
486
|
+
For the full guide — defining actions, validation with Zod, error handling,
|
|
487
|
+
revalidation rules, file uploads, and progressive enhancement — see
|
|
488
|
+
`/server-actions`.
|
|
489
|
+
|
|
486
490
|
### clientLoader / clientAction (framework mode)
|
|
487
491
|
|
|
488
492
|
RR7 framework mode's `clientLoader` and `clientAction` run in the browser.
|
package/skills/parallel/SKILL.md
CHANGED
|
@@ -237,6 +237,8 @@ A slot's `loading()` (whether from `handler.use` or explicit) makes that slot an
|
|
|
237
237
|
|
|
238
238
|
The `parallel` mount site has the narrowest allow-list for `handler.use` items — slots cannot bring their own middleware or layout, only `revalidate`, `loader`, `loading`, `errorBoundary`, `notFoundBoundary`, and `transition`. See [skills/handler-use](../handler-use/SKILL.md) for the full table and merge rules.
|
|
239
239
|
|
|
240
|
+
`transition` is allowed in the slot allow-list, but slot-level rendering does **not** currently apply a `<ViewTransition>` wrapper — only the layout/route wraps take effect at render time. For a modal-only morph today, use an element-level React `<ViewTransition>` inside the slot's component. The reverse direction is the useful guarantee: a layout-level `transition()` fires when the layout's default outlet content changes but **not** when a `<ParallelOutlet />` mounts new content (modal opens are not subtree updates of the layout VT). See [skills/view-transitions](../view-transitions/SKILL.md) for the wrap rules and the intercept caveat.
|
|
241
|
+
|
|
240
242
|
### Two scopes for explicit `use`: shared (broadcast) and slot-local
|
|
241
243
|
|
|
242
244
|
`parallel({...slots}, () => [...use])` runs the shared `use()` callback **once per slot** ([dsl-helpers.ts](../../src/route-definition/dsl-helpers.ts)) — items in that callback land on every slot's entry. That's the right behavior for the items the parallel allow-list permits and that accumulate (`loader`, `revalidate`, `errorBoundary`, `notFoundBoundary`, `transition`). (Slots cannot bring `middleware` or `layout` — see the allowed-types note above.)
|
|
@@ -347,6 +349,13 @@ Revalidating only the parallel does not re-run outer handlers/layouts.
|
|
|
347
349
|
If the slot reads `ctx.get()` data established above it, opt the outer
|
|
348
350
|
segment into revalidation as well.
|
|
349
351
|
|
|
352
|
+
A `revalidate()` callback may return a hard `boolean`, a soft
|
|
353
|
+
`{ defaultShouldRevalidate }` object, or nothing (`void` / `null` /
|
|
354
|
+
`undefined`) to defer to the next revalidator. See
|
|
355
|
+
[loader/SKILL.md#revalidate-return-shapes](../loader/SKILL.md#revalidate-return-shapes)
|
|
356
|
+
for the full contract — it's the same across `loader()`, `path()`,
|
|
357
|
+
`layout()`, `parallel()`, and `intercept()`.
|
|
358
|
+
|
|
350
359
|
### Revalidation Contracts for Parallel Dependencies
|
|
351
360
|
|
|
352
361
|
Prefer named revalidation contracts shared by both the upstream producer and
|
package/skills/rango/SKILL.md
CHANGED
|
@@ -16,6 +16,8 @@ Django-inspired RSC router with composable URL patterns, type-safe href, and ser
|
|
|
16
16
|
| `/route` | Define routes with `urls()` and `path()` |
|
|
17
17
|
| `/layout` | Layouts that wrap child routes |
|
|
18
18
|
| `/loader` | Data loaders with `createLoader()` |
|
|
19
|
+
| `/server-actions` | Mutations with `"use server"`, useActionState, validation, revalidation |
|
|
20
|
+
| `/i18n` | Locale routing with `:locale?`, resolution chains, react-intl integration |
|
|
19
21
|
| `/middleware` | Request processing and authentication |
|
|
20
22
|
| `/intercept` | Modal/slide-over patterns for soft navigation |
|
|
21
23
|
| `/parallel` | Multi-column layouts and sidebars |
|