@rangojs/router 0.0.0-experimental.140 → 0.0.0-experimental.142
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 +6 -10
- package/README.md +17 -0
- 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 +82 -15
- 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 +19 -18
- package/skills/api-client/SKILL.md +1 -1
- package/skills/breadcrumbs/SKILL.md +1 -1
- package/skills/cache-guide/SKILL.md +1 -1
- package/skills/caching/SKILL.md +17 -1
- package/skills/catalog.json +265 -0
- package/skills/comparison/references/framework-comparison.md +1 -1
- package/skills/composability/SKILL.md +1 -1
- package/skills/debug-manifest/SKILL.md +1 -1
- package/skills/document-cache/SKILL.md +9 -1
- package/skills/fonts/SKILL.md +1 -1
- package/skills/handler-use/SKILL.md +1 -1
- package/skills/hooks/SKILL.md +54 -892
- package/skills/hooks/data.md +273 -0
- package/skills/hooks/handle-and-actions.md +103 -0
- package/skills/hooks/navigation.md +110 -0
- package/skills/hooks/outlets.md +41 -0
- package/skills/hooks/state.md +228 -0
- package/skills/hooks/urls.md +135 -0
- package/skills/host-router/SKILL.md +1 -1
- package/skills/i18n/SKILL.md +1 -1
- package/skills/intercept/SKILL.md +8 -1
- package/skills/layout/SKILL.md +1 -1
- package/skills/links/SKILL.md +1 -1
- package/skills/loader/SKILL.md +8 -1
- package/skills/middleware/SKILL.md +1 -1
- package/skills/migrate-nextjs/SKILL.md +133 -1
- package/skills/migrate-react-router/SKILL.md +42 -816
- package/skills/migrate-react-router/cloudflare-workers.md +129 -0
- package/skills/migrate-react-router/component-migration.md +196 -0
- package/skills/migrate-react-router/data-and-actions.md +225 -0
- package/skills/migrate-react-router/route-mapping.md +271 -0
- package/skills/mime-routes/SKILL.md +1 -1
- package/skills/observability/SKILL.md +1 -1
- package/skills/parallel/SKILL.md +8 -1
- package/skills/ppr/SKILL.md +448 -348
- package/skills/prerender/SKILL.md +8 -1
- package/skills/rango/SKILL.md +14 -14
- package/skills/response-routes/SKILL.md +1 -1
- package/skills/route/SKILL.md +1 -1
- package/skills/router-setup/SKILL.md +1 -1
- package/skills/scripts/SKILL.md +1 -1
- package/skills/server-actions/SKILL.md +3 -2
- package/skills/shell-manifest/SKILL.md +1 -1
- package/skills/streams-and-websockets/SKILL.md +1 -1
- package/skills/tailwind/SKILL.md +1 -1
- package/skills/testing/SKILL.md +1 -1
- package/skills/theme/SKILL.md +1 -1
- package/skills/typesafety/SKILL.md +44 -919
- package/skills/typesafety/env-and-bindings.md +254 -0
- package/skills/typesafety/generated-files-and-cli.md +305 -0
- package/skills/typesafety/params-and-search.md +153 -0
- package/skills/typesafety/route-types.md +209 -0
- package/skills/use-cache/SKILL.md +7 -1
- package/skills/vercel/SKILL.md +1 -1
- package/skills/view-transitions/SKILL.md +1 -1
- package/src/browser/event-controller.ts +41 -10
- package/src/browser/logging.ts +10 -0
- package/src/browser/merge-segment-loaders.ts +6 -4
- package/src/browser/navigation-client.ts +5 -1
- package/src/browser/navigation-store.ts +46 -6
- package/src/browser/partial-update.ts +27 -15
- package/src/browser/prefetch/cache.ts +26 -4
- package/src/browser/prefetch/fetch.ts +27 -17
- package/src/browser/react/Link.tsx +13 -3
- package/src/browser/react/NavigationProvider.tsx +21 -19
- package/src/browser/scroll-restoration.ts +7 -5
- package/src/browser/segment-reconciler.ts +31 -21
- package/src/browser/types.ts +12 -0
- package/src/cache/cache-runtime.ts +203 -23
- package/src/cache/cf/cf-cache-store.ts +8 -0
- package/src/cache/document-cache.ts +20 -9
- package/src/cache/index.ts +0 -5
- package/src/cache/memory-segment-store.ts +53 -2
- package/src/cache/segment-codec.ts +4 -4
- package/src/cache/shell-snapshot.ts +417 -0
- package/src/cache/types.ts +86 -0
- package/src/cache/vercel/vercel-cache-store.ts +143 -108
- package/src/index.rsc.ts +1 -5
- package/src/index.ts +1 -17
- package/src/router/manifest.ts +13 -5
- package/src/router/match-api.ts +70 -30
- package/src/router/match-handlers.ts +6 -2
- package/src/router/match-result.ts +35 -15
- package/src/router/middleware.ts +10 -3
- package/src/router/request-classification.ts +20 -7
- package/src/router/route-snapshot.ts +10 -0
- package/src/router/segment-resolution/fresh.ts +25 -4
- package/src/router/segment-resolution/loader-cache.ts +57 -8
- package/src/router/segment-resolution/loader-mask.ts +26 -3
- package/src/router/segment-resolution/loader-snapshot.ts +170 -0
- package/src/rsc/nonce.ts +10 -1
- package/src/rsc/rsc-rendering.ts +310 -89
- package/src/rsc/shell-capture.ts +707 -66
- package/src/rsc/shell-serve.ts +150 -0
- package/src/server/context.ts +7 -0
- package/src/server/cookie-store.ts +6 -0
- package/src/server/request-context.ts +85 -46
- package/src/ssr/index.tsx +45 -6
- package/src/theme/ThemeProvider.tsx +36 -26
- package/src/urls/index.ts +1 -0
- package/src/urls/path-helper.ts +5 -0
- package/src/urls/pattern-types.ts +36 -0
- package/src/vite/discovery/dev-prerender-cache.ts +117 -0
- package/src/vite/router-discovery.ts +78 -15
- package/src/cache/shell-cache.ts +0 -386
- package/src/server/live.ts +0 -130
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
# State and Cache Control Hooks
|
|
2
|
+
|
|
3
|
+
## State Hooks
|
|
4
|
+
|
|
5
|
+
### useLocationState()
|
|
6
|
+
|
|
7
|
+
Read type-safe state from history:
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
"use client";
|
|
11
|
+
import { useLocationState, createLocationState } from "@rangojs/router/client";
|
|
12
|
+
|
|
13
|
+
// Define typed state (all export patterns supported)
|
|
14
|
+
// Keys are auto-injected by the Vite plugin -- no manual key needed.
|
|
15
|
+
export const ProductState = createLocationState<{
|
|
16
|
+
name: string;
|
|
17
|
+
price: number;
|
|
18
|
+
}>();
|
|
19
|
+
|
|
20
|
+
// Also valid: const ProductState = createLocationState<...>();
|
|
21
|
+
// export { ProductState };
|
|
22
|
+
// Also valid: export { ProductState as MyState };
|
|
23
|
+
|
|
24
|
+
function ProductHeader() {
|
|
25
|
+
const state = useLocationState(ProductState);
|
|
26
|
+
// { name: string; price: number } | undefined
|
|
27
|
+
|
|
28
|
+
if (state) {
|
|
29
|
+
return (
|
|
30
|
+
<h1>
|
|
31
|
+
{state.name} - ${state.price}
|
|
32
|
+
</h1>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
return <h1>Loading...</h1>;
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Pass state through Link:
|
|
40
|
+
|
|
41
|
+
```tsx
|
|
42
|
+
import { Link } from "@rangojs/router/client";
|
|
43
|
+
import { ProductState } from "./state";
|
|
44
|
+
|
|
45
|
+
<Link to="/product/123" state={[ProductState({ name: "Widget", price: 99 })]}>
|
|
46
|
+
View Product
|
|
47
|
+
</Link>;
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Pass typed state just in time (getter evaluated at click time, not render time):
|
|
51
|
+
|
|
52
|
+
```tsx
|
|
53
|
+
"use client"; // JIT state requires a client component (getter can't cross RSC boundary)
|
|
54
|
+
|
|
55
|
+
import { Link } from "@rangojs/router/client";
|
|
56
|
+
import { ProductState } from "./state";
|
|
57
|
+
|
|
58
|
+
// The getter is stored lazily and only called when the user clicks the link.
|
|
59
|
+
// This is useful for capturing values that change after render (e.g., scroll
|
|
60
|
+
// position, form state, ref values).
|
|
61
|
+
<Link
|
|
62
|
+
to="/product/123"
|
|
63
|
+
state={[ProductState(() => ({ name: product.name, price: product.price }))]}
|
|
64
|
+
>
|
|
65
|
+
View Product
|
|
66
|
+
</Link>;
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Plain state can also be evaluated just in time (also requires a client component):
|
|
70
|
+
|
|
71
|
+
```tsx
|
|
72
|
+
<Link to="/product/123" state={() => ({ from: window.location.pathname })}>
|
|
73
|
+
View Product
|
|
74
|
+
</Link>
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Flash State (read-once)
|
|
78
|
+
|
|
79
|
+
Create a location state with `{ flash: true }` for read-once state that
|
|
80
|
+
auto-clears after first render. Ideal for flash messages (success/error
|
|
81
|
+
notifications after redirect):
|
|
82
|
+
|
|
83
|
+
```tsx
|
|
84
|
+
// location-states.ts
|
|
85
|
+
import { createLocationState } from "@rangojs/router";
|
|
86
|
+
|
|
87
|
+
export const FlashMessage = createLocationState<{ text: string }>({
|
|
88
|
+
flash: true,
|
|
89
|
+
});
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Read flash state with `useLocationState` (same hook as persistent state):
|
|
93
|
+
|
|
94
|
+
```tsx
|
|
95
|
+
"use client";
|
|
96
|
+
import { useLocationState } from "@rangojs/router/client";
|
|
97
|
+
import { FlashMessage } from "../location-states";
|
|
98
|
+
|
|
99
|
+
function FlashBanner() {
|
|
100
|
+
const flash = useLocationState(FlashMessage);
|
|
101
|
+
// { text: string } | undefined
|
|
102
|
+
|
|
103
|
+
if (!flash) return null;
|
|
104
|
+
return <div className="flash">{flash.text}</div>;
|
|
105
|
+
}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Flash behavior is determined by the definition (`{ flash: true }`), not by which
|
|
109
|
+
hook reads it. `useLocationState` reads the value synchronously during render,
|
|
110
|
+
then clears it from `history.state` via `replaceState` in a `useEffect`.
|
|
111
|
+
Multiple components reading the same flash definition all see the value.
|
|
112
|
+
Pressing back/forward will not re-show the flash since it was cleared.
|
|
113
|
+
|
|
114
|
+
Set flash state from the server via `redirect()` with state:
|
|
115
|
+
|
|
116
|
+
```tsx
|
|
117
|
+
// In a route handler
|
|
118
|
+
import { redirect, createLocationState } from "@rangojs/router";
|
|
119
|
+
|
|
120
|
+
export const FlashMessage = createLocationState<{ text: string }>({
|
|
121
|
+
flash: true,
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
// Handler
|
|
125
|
+
(ctx) => {
|
|
126
|
+
return redirect("/dashboard", {
|
|
127
|
+
state: [FlashMessage({ text: "Item saved!" })],
|
|
128
|
+
});
|
|
129
|
+
};
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Or via `ctx.setLocationState()` on any response:
|
|
133
|
+
|
|
134
|
+
```tsx
|
|
135
|
+
(ctx) => {
|
|
136
|
+
ctx.setLocationState(FlashMessage({ text: "Welcome back!" }));
|
|
137
|
+
return <Dashboard />;
|
|
138
|
+
};
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### .read() (non-hook access)
|
|
142
|
+
|
|
143
|
+
Read current location state outside React components (client-side only):
|
|
144
|
+
|
|
145
|
+
```tsx
|
|
146
|
+
import { FlashMessage, ProductState } from "../location-states";
|
|
147
|
+
|
|
148
|
+
// Returns TState | undefined. Returns undefined during SSR.
|
|
149
|
+
const flash = FlashMessage.read();
|
|
150
|
+
const product = ProductState.read();
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
> **Hydration:** `.read()` returns `undefined` on the server but may return
|
|
154
|
+
> a real value on the first client render (history state survives reload).
|
|
155
|
+
> Do not call `.read()` directly during the initial render of a component;
|
|
156
|
+
> call it from an event handler or inside a `useEffect` post-mount. For
|
|
157
|
+
> reactive hydration-safe access, use `useLocationState()` instead.
|
|
158
|
+
|
|
159
|
+
### .write() / .delete() (static, non-reactive)
|
|
160
|
+
|
|
161
|
+
Static counterparts to `.read()`. Both mutate the current history entry's
|
|
162
|
+
`history.state` via `replaceState`, preserving any other keys (router
|
|
163
|
+
bookkeeping, other location state slots). Both are client-only; they throw
|
|
164
|
+
when called on the server.
|
|
165
|
+
|
|
166
|
+
Neither dispatches an event, so components reading via `useLocationState`
|
|
167
|
+
will NOT re-render until the next navigation/popstate. Pair with `.read()`
|
|
168
|
+
(or a fresh mount via back/forward/reload) instead.
|
|
169
|
+
|
|
170
|
+
```tsx
|
|
171
|
+
"use client";
|
|
172
|
+
import { ProductState } from "./state";
|
|
173
|
+
|
|
174
|
+
// Persisted across hard refresh and back/forward of this entry.
|
|
175
|
+
ProductState.write({ name: "Widget", price: 9.99 });
|
|
176
|
+
|
|
177
|
+
// Read later (or on next mount).
|
|
178
|
+
const current = ProductState.read();
|
|
179
|
+
|
|
180
|
+
// Manually clear the slot. Idempotent if it isn't set.
|
|
181
|
+
ProductState.delete();
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
| Method | Updates `history.state` | Fires `useLocationState` rerender | SSR behavior |
|
|
185
|
+
| ----------- | ----------------------- | --------------------------------- | ------------------- |
|
|
186
|
+
| `.read()` | no | n/a (returns snapshot) | returns `undefined` |
|
|
187
|
+
| `.write()` | yes (replace this slot) | no | throws |
|
|
188
|
+
| `.delete()` | yes (remove this slot) | no | throws |
|
|
189
|
+
|
|
190
|
+
## Cache Control
|
|
191
|
+
|
|
192
|
+
### invalidateClientCache()
|
|
193
|
+
|
|
194
|
+
Force the client's caches to miss after a mutation the router can't see (a REST
|
|
195
|
+
call, a WebSocket push, a login). It is a plain function, not a hook, so it works
|
|
196
|
+
from module-level callbacks too. Imported from the root entry `@rangojs/router`,
|
|
197
|
+
it is selected by export conditions: in a client component it marks the caches
|
|
198
|
+
stale immediately; from a handler/server component it writes a rotated
|
|
199
|
+
`Set-Cookie` for the responding client.
|
|
200
|
+
|
|
201
|
+
```tsx
|
|
202
|
+
"use client";
|
|
203
|
+
import { invalidateClientCache } from "@rangojs/router";
|
|
204
|
+
|
|
205
|
+
function SaveButton() {
|
|
206
|
+
const handleSave = async () => {
|
|
207
|
+
await fetch("/api/data", {
|
|
208
|
+
method: "POST",
|
|
209
|
+
body: JSON.stringify(data),
|
|
210
|
+
});
|
|
211
|
+
|
|
212
|
+
// Invalidate the client's caches after the mutation
|
|
213
|
+
invalidateClientCache();
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
return <button onClick={handleSave}>Save</button>;
|
|
217
|
+
}
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
A module-level subscription works the same way (no component needed):
|
|
221
|
+
|
|
222
|
+
```ts
|
|
223
|
+
import { invalidateClientCache } from "@rangojs/router";
|
|
224
|
+
|
|
225
|
+
socket.on("catalog-updated", () => invalidateClientCache());
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
**Use cases**: REST API mutations, WebSocket updates, non-RSC data changes.
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
# URL Hooks
|
|
2
|
+
|
|
3
|
+
### useParams()
|
|
4
|
+
|
|
5
|
+
Access route params from the current URL:
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
"use client";
|
|
9
|
+
import { useParams } from "@rangojs/router/client";
|
|
10
|
+
|
|
11
|
+
// Route: /product/:productId
|
|
12
|
+
function ProductPage() {
|
|
13
|
+
const params = useParams();
|
|
14
|
+
// { productId: "123" }
|
|
15
|
+
|
|
16
|
+
return <h1>Product {params.productId}</h1>;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// Annotate the expected shape via a generic
|
|
20
|
+
function ProductPageTyped() {
|
|
21
|
+
const { productId } = useParams<{ productId: string }>();
|
|
22
|
+
return <h1>Product {productId}</h1>;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// With selector for performance (re-renders only when selected value changes)
|
|
26
|
+
function ProductId() {
|
|
27
|
+
const productId = useParams((p) => p.productId);
|
|
28
|
+
return <span>ID: {productId}</span>;
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Returns merged params from all matched route segments as a `Readonly<T>` map. Updates on navigation commit (not during pending navigation).
|
|
33
|
+
|
|
34
|
+
### usePathname()
|
|
35
|
+
|
|
36
|
+
Access the current URL pathname:
|
|
37
|
+
|
|
38
|
+
```tsx
|
|
39
|
+
"use client";
|
|
40
|
+
import { usePathname } from "@rangojs/router/client";
|
|
41
|
+
|
|
42
|
+
function CurrentPage() {
|
|
43
|
+
const pathname = usePathname();
|
|
44
|
+
// "/product/123" (no search params)
|
|
45
|
+
|
|
46
|
+
return <span>Current path: {pathname}</span>;
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Returns the pathname string without search params or hash. Updates on navigation commit.
|
|
51
|
+
|
|
52
|
+
### useSearchParams()
|
|
53
|
+
|
|
54
|
+
Access the current URL search params:
|
|
55
|
+
|
|
56
|
+
```tsx
|
|
57
|
+
"use client";
|
|
58
|
+
import { useSearchParams } from "@rangojs/router/client";
|
|
59
|
+
|
|
60
|
+
function SearchResults() {
|
|
61
|
+
const searchParams = useSearchParams();
|
|
62
|
+
const query = searchParams.get("q"); // "react"
|
|
63
|
+
const page = searchParams.get("page"); // "2"
|
|
64
|
+
|
|
65
|
+
return (
|
|
66
|
+
<div>
|
|
67
|
+
Searching for: {query}, page {page}
|
|
68
|
+
</div>
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Returns a `ReadonlyURLSearchParams` (URLSearchParams without mutation methods). During SSR, returns empty params and syncs from the browser URL on mount.
|
|
74
|
+
|
|
75
|
+
### useHref()
|
|
76
|
+
|
|
77
|
+
Mount-aware href for client components inside `include()` scopes:
|
|
78
|
+
|
|
79
|
+
```tsx
|
|
80
|
+
"use client";
|
|
81
|
+
import { useHref, href, Link } from "@rangojs/router/client";
|
|
82
|
+
|
|
83
|
+
// Inside include("/shop", shopPatterns)
|
|
84
|
+
function ShopNav() {
|
|
85
|
+
const href = useHref();
|
|
86
|
+
|
|
87
|
+
return (
|
|
88
|
+
<>
|
|
89
|
+
{/* Local paths - auto-prefixed with /shop */}
|
|
90
|
+
<Link to={href("/cart")}>Cart</Link>
|
|
91
|
+
<Link to={href("/product/widget")}>Widget</Link>
|
|
92
|
+
</>
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Use `useHref()` for local navigation. Use the bare `href()` function for absolute paths.
|
|
98
|
+
|
|
99
|
+
### useMount()
|
|
100
|
+
|
|
101
|
+
Returns the current `include()` mount path:
|
|
102
|
+
|
|
103
|
+
```tsx
|
|
104
|
+
"use client";
|
|
105
|
+
import { useMount } from "@rangojs/router/client";
|
|
106
|
+
|
|
107
|
+
function MountInfo() {
|
|
108
|
+
const mount = useMount(); // "/shop" inside include("/shop", ...)
|
|
109
|
+
return <span>Mounted at: {mount}</span>;
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### useReverse(routes)
|
|
114
|
+
|
|
115
|
+
Mount-aware local reverse for client components. Import the generated `routes` map from a `urls()` module's `.gen.ts` and call `reverse("name", params?)` — the leading dot is optional. Auto-fills params from `useParams()`; explicit params override.
|
|
116
|
+
|
|
117
|
+
> Per-module `*.gen.ts` files are **CLI opt-in and not Vite-watched** — run `rango generate <urls-file>` (or wire it into `predev`) and re-run it whenever the module's routes change. See `/links` for the full generated-file setup and exposure-boundary rules.
|
|
118
|
+
|
|
119
|
+
```tsx
|
|
120
|
+
"use client";
|
|
121
|
+
import { Link, useReverse } from "@rangojs/router/client";
|
|
122
|
+
import { routes as blogRoutes } from "../urls/blog.gen.js";
|
|
123
|
+
|
|
124
|
+
function BlogNav() {
|
|
125
|
+
const reverse = useReverse(blogRoutes);
|
|
126
|
+
return (
|
|
127
|
+
<nav>
|
|
128
|
+
<Link to={reverse("index")}>Blog</Link>
|
|
129
|
+
<Link to={reverse("post", { postId: "hello" })}>Post</Link>
|
|
130
|
+
</nav>
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
See `/links` for the full URL generation guide. `ctx.reverse()` is server-only; on the client, prefer `useReverse(routes)` for in-module names and pass URLs as props for cross-module ones.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: host-router
|
|
3
|
-
description: Multi-app host routing with domain/subdomain patterns
|
|
3
|
+
description: Multi-app host routing with domain/subdomain patterns. Use when running multiple apps behind one domain or across subdomains, or routing requests to different apps based on hostname.
|
|
4
4
|
argument-hint:
|
|
5
5
|
---
|
|
6
6
|
|
package/skills/i18n/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: i18n
|
|
3
|
-
description: Locale-aware routing with `include("/:locale?", ...)`, locale resolution chains, and react-intl integration
|
|
3
|
+
description: Locale-aware routing with `include("/:locale?", ...)`, locale resolution chains, and react-intl integration. Use when building a multi-language app, routes need a locale segment, or wiring up react-intl translations.
|
|
4
4
|
argument-hint: "[topic]"
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: intercept
|
|
3
|
-
description: Define intercept routes for modals, slide-overs, and soft navigation patterns in @rangojs/router
|
|
3
|
+
description: Define intercept routes for modals, slide-overs, and soft navigation patterns in @rangojs/router. Use when opening a route as a modal/overlay on top of the current page while keeping the URL shareable, or asking "how do I show this page in a modal".
|
|
4
4
|
argument-hint: [@slot-name] [route-to-intercept]
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -8,6 +8,13 @@ argument-hint: [@slot-name] [route-to-intercept]
|
|
|
8
8
|
|
|
9
9
|
Intercept routes render a different component during soft navigation (client-side) while preserving the background route. Hard navigation (direct URL) shows the full page.
|
|
10
10
|
|
|
11
|
+
## Not this skill if…
|
|
12
|
+
|
|
13
|
+
- You want a slot that ALWAYS renders alongside the page (sidebar, multi-column
|
|
14
|
+
layout) — that is a permanent `parallel()` slot: see `/parallel`.
|
|
15
|
+
- You want the same component regardless of soft vs hard navigation —
|
|
16
|
+
intercepts only swap on soft navigation; see `/parallel`.
|
|
17
|
+
|
|
11
18
|
## Basic Intercept
|
|
12
19
|
|
|
13
20
|
```typescript
|
package/skills/layout/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: layout
|
|
3
|
-
description: Define layout routes that wrap child routes in @rangojs/router
|
|
3
|
+
description: Define layout routes that wrap child routes in @rangojs/router. Use when sharing a persistent UI shell (nav, sidebar) across nested routes, or asking how to wrap child pages with a common layout.
|
|
4
4
|
argument-hint: [component]
|
|
5
5
|
---
|
|
6
6
|
|
package/skills/links/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: links
|
|
3
|
-
description: URL generation with ctx.reverse (server default), href (client), useHref (mounted), useMount, useReverse, and scopedReverse
|
|
3
|
+
description: URL generation with ctx.reverse (server default), href (client), useHref (mounted), useMount, useReverse, and scopedReverse. Use when generating a link to a route by name instead of hardcoding a path, or a link breaks after routes move or get mounted elsewhere.
|
|
4
4
|
argument-hint: [ctx.reverse|href|useHref|useMount|useReverse|scopedReverse]
|
|
5
5
|
---
|
|
6
6
|
|
package/skills/loader/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: loader
|
|
3
|
-
description: Define data loaders for fetching data in routes with createLoader
|
|
3
|
+
description: Define data loaders for fetching data in routes with createLoader. Use when pages need per-request data that stays fresh, data should stream while the page renders, or client components need reactive server data.
|
|
4
4
|
argument-hint: [loader]
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -11,6 +11,13 @@ Loaders fetch data on the server and stream it to the client. For mutations
|
|
|
11
11
|
`/server-actions`. Loaders re-resolve after an action runs, so the typical
|
|
12
12
|
flow is _action mutates → loader re-reads → UI updates_.
|
|
13
13
|
|
|
14
|
+
## Not this skill if…
|
|
15
|
+
|
|
16
|
+
- You want to mutate state — mutations are `"use server"` actions: see
|
|
17
|
+
`/server-actions`. Loaders read per-request live data.
|
|
18
|
+
- You want to cache a function's return value — loaders are fresh every request
|
|
19
|
+
by default; caching one function is `"use cache"`: see `/use-cache`.
|
|
20
|
+
|
|
14
21
|
## Creating a Loader
|
|
15
22
|
|
|
16
23
|
```typescript
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: middleware
|
|
3
|
-
description: Define middleware for authentication, logging, and request processing in @rangojs/router
|
|
3
|
+
description: Define middleware for authentication, logging, and request processing in @rangojs/router. Use when gating routes behind auth checks, logging requests, or running shared logic before a handler runs.
|
|
4
4
|
argument-hint: [middleware-name]
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -32,6 +32,10 @@ Common reasons to migrate:
|
|
|
32
32
|
- **Build-time rendering** — `Static()` and `Prerender()` provide explicit
|
|
33
33
|
build-time rendering instead of mixing rendering and caching behind conventions.
|
|
34
34
|
See: `/prerender`
|
|
35
|
+
- **Partial prerendering, shipped** — the `ppr` path option caches a page's
|
|
36
|
+
HTML shell and resumes only the live holes on each request; loaders stay
|
|
37
|
+
fresh. The equivalent of Next's `experimental_ppr`, stable and per-route.
|
|
38
|
+
See: `/ppr`
|
|
35
39
|
- **Composable route tree** — layouts, includes, middleware, parallels, and
|
|
36
40
|
intercepts compose directly in the route definition.
|
|
37
41
|
See: `/composability`, `/parallel`, `/intercept`
|
|
@@ -43,6 +47,34 @@ Common reasons to migrate:
|
|
|
43
47
|
|
|
44
48
|
Work route-by-route, bottom-up. Start with leaf pages, then layouts, then middleware. Verify each route works before moving to the next.
|
|
45
49
|
|
|
50
|
+
## Replace imports, never shim Next
|
|
51
|
+
|
|
52
|
+
Do NOT create mock `next/*` modules, Vite aliases for `next/*`, or compatibility
|
|
53
|
+
wrapper components (a local `Link` that forwards `href` to `to`, a fake
|
|
54
|
+
`useRouter`, a stubbed `next/headers`). Shims freeze Next semantics into the
|
|
55
|
+
app, hide unsupported behavior until runtime, and keep `next` in the dependency
|
|
56
|
+
graph — the migration looks done but isn't. Replace every `next/*` import at
|
|
57
|
+
its call site with the real Rango API:
|
|
58
|
+
|
|
59
|
+
| Next import | Replace with |
|
|
60
|
+
| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
|
|
61
|
+
| `next/link` `Link` | `Link` from `@rangojs/router/client` — rename `href` to `to` (see §6) |
|
|
62
|
+
| `next/navigation` `useRouter`, `usePathname`, `useSearchParams`, `useParams` | same names from `@rangojs/router/client` |
|
|
63
|
+
| `next/navigation` `redirect`, `notFound` | `redirect`, `notFound` from `@rangojs/router` |
|
|
64
|
+
| `next/headers` `cookies`, `headers` | `cookies()`, `headers()` from `@rangojs/router` (server-only) |
|
|
65
|
+
| `next/cache` `revalidateTag`, `unstable_cache` | `updateTag`/`revalidateTag` from `@rangojs/router`; `"use cache"` (see §3 and `/use-cache`) |
|
|
66
|
+
| `next/server` `NextResponse`, `NextRequest` | web-standard `Response`/`Request`; middleware via `router.use()` (see §4) |
|
|
67
|
+
| `next/image` `Image` | plain `<img>` (keep explicit `width`/`height`) or your CDN's image URL — no built-in optimizer |
|
|
68
|
+
| `next/font` | see `/fonts` |
|
|
69
|
+
| `next/script` `Script` | see `/scripts` |
|
|
70
|
+
| `next-themes` | `theme: true` in `createRouter` (see §10) |
|
|
71
|
+
|
|
72
|
+
If an import has no row here and no obvious Rango equivalent, stop and surface
|
|
73
|
+
it to the user — do not mock it to keep the build green.
|
|
74
|
+
|
|
75
|
+
Done means: `grep -rn "from ['\"]next" src/ app/` returns nothing, and `next`
|
|
76
|
+
is gone from `package.json`.
|
|
77
|
+
|
|
46
78
|
## 1. Project Setup
|
|
47
79
|
|
|
48
80
|
Replace Next.js tooling with Vite + Rango:
|
|
@@ -315,6 +347,100 @@ export const Product = Passthrough(ProductDef, async (ctx) => {
|
|
|
315
347
|
Use `Passthrough()` whenever the Next.js route has `dynamicParams: true` (the
|
|
316
348
|
default) or serves an open-ended param space. See `/prerender` for full API.
|
|
317
349
|
|
|
350
|
+
### Rendering-mode segment config
|
|
351
|
+
|
|
352
|
+
Next.js route segment config maps onto Rango's explicit primitives:
|
|
353
|
+
|
|
354
|
+
| Next.js segment config | Rango |
|
|
355
|
+
| --------------------------------------------------- | ------------------------------------------------------------ |
|
|
356
|
+
| `dynamic = "force-static"` + `generateStaticParams` | `Static()` / `Prerender()` (see `/prerender`) |
|
|
357
|
+
| `revalidate = 60` (ISR) | `cache({ ttl: 60, swr: ... })` on the route (see `/caching`) |
|
|
358
|
+
| `dynamic = "force-dynamic"` | the default — routes are dynamic unless you cache them |
|
|
359
|
+
| `dynamicParams = true` | `Passthrough()` (above) |
|
|
360
|
+
| `experimental_ppr = true` | the `ppr` path option (below, and `/ppr`) |
|
|
361
|
+
|
|
362
|
+
### Partial prerendering → the `ppr` path option
|
|
363
|
+
|
|
364
|
+
Next.js PPR statically prerenders a shell at build time and streams the parts
|
|
365
|
+
inside `<Suspense>` at request time. Rango ships the same model as a path
|
|
366
|
+
option — the shell is captured at runtime into the app cache store and resumed
|
|
367
|
+
on later requests, with the holes rendered fresh per request:
|
|
368
|
+
|
|
369
|
+
```typescript
|
|
370
|
+
// Next.js: app/products/[id]/page.tsx
|
|
371
|
+
export const experimental_ppr = true;
|
|
372
|
+
export default async function Page({ params }) {
|
|
373
|
+
return (
|
|
374
|
+
<ProductShell>
|
|
375
|
+
<Suspense fallback={<PriceSkeleton />}>
|
|
376
|
+
<LivePrice id={params.id} />
|
|
377
|
+
</Suspense>
|
|
378
|
+
</ProductShell>
|
|
379
|
+
);
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
// Rango, step 1 — direct carry-over. Your Suspense tree IS the hole model:
|
|
383
|
+
// hand the un-awaited promise down, keep the boundary, add the ppr option.
|
|
384
|
+
// No loader, no loading(), no restructuring.
|
|
385
|
+
function ProductPage(ctx: HandlerContext) {
|
|
386
|
+
const price = fetchPrice(ctx.params.id); // pending promise — NOT awaited
|
|
387
|
+
return (
|
|
388
|
+
<ProductShell>
|
|
389
|
+
<Suspense fallback={<PriceSkeleton />}>
|
|
390
|
+
<LivePrice price={price} /> {/* use(price) inside */}
|
|
391
|
+
</Suspense>
|
|
392
|
+
</ProductShell>
|
|
393
|
+
);
|
|
394
|
+
}
|
|
395
|
+
path("/products/:id", ProductPage, {
|
|
396
|
+
name: "product",
|
|
397
|
+
ppr: { ttl: 600, swr: 120 }, // or ppr: true (default ttl 300s)
|
|
398
|
+
});
|
|
399
|
+
|
|
400
|
+
// Rango, step 2 (optional refinement) — promote the fetch to a loader for a
|
|
401
|
+
// GUARANTEED hole: loaders are masked at capture and fresh on every serve,
|
|
402
|
+
// even when the value resolves instantly (a raw promise that settles fast
|
|
403
|
+
// would bake into the shell). loading() is the loader's hole boundary.
|
|
404
|
+
path(
|
|
405
|
+
"/products/:id",
|
|
406
|
+
ProductPage,
|
|
407
|
+
{ name: "product", ppr: { ttl: 600, swr: 120 } },
|
|
408
|
+
() => [loader(LivePriceLoader), loading(<PriceSkeleton />)],
|
|
409
|
+
),
|
|
410
|
+
```
|
|
411
|
+
|
|
412
|
+
Differences that matter during migration:
|
|
413
|
+
|
|
414
|
+
- **The Suspense/promise model carries over.** As in Next, a still-pending
|
|
415
|
+
promise handed to a component that suspends under its own `<Suspense>`
|
|
416
|
+
postpones at capture and becomes a hole — existing Next PPR trees keep
|
|
417
|
+
working as-is, no `loading()` required. One container rule everywhere
|
|
418
|
+
(handlers, handles, loaders): awaited/settled data bakes into the shell; a
|
|
419
|
+
promise nested inside your data stays a live hole. For loaders, `loading()`
|
|
420
|
+
selects the lane: present = guaranteed live (masked at capture, fresh every
|
|
421
|
+
serve, immune to fast resolution — prefer it for per-request data); absent =
|
|
422
|
+
the bake lane (the settled container bakes and is snapshot-pinned per shell,
|
|
423
|
+
nested promises stay live). Identity reads (`cookies()`/`headers()`) where
|
|
424
|
+
the value would bake refuse the capture by construction.
|
|
425
|
+
- **Shell freshness is explicit.** Next's PPR shell is fixed until the next
|
|
426
|
+
build; Rango's has `ttl`/`swr`/`tags` per route, and `updateTag()` /
|
|
427
|
+
`revalidateTag()` drop the shell (`revalidate()` does not — it is a data
|
|
428
|
+
lever and never touches shell HTML).
|
|
429
|
+
- **`cookies()`/`headers()` in shell material THROW during capture** (in Next
|
|
430
|
+
they silently force dynamic rendering). Per-user reads must move behind a
|
|
431
|
+
`loading()` boundary (the live loader lane) or into a nested promise — the
|
|
432
|
+
refusal surfaces at migration time, which is the point.
|
|
433
|
+
- **A store is required.** PPR needs the app-level `createRouter({ cache })`
|
|
434
|
+
store to implement the shell family (`MemorySegmentCacheStore`,
|
|
435
|
+
`CFCacheStore`, `VercelCacheStore`). Without one the route quietly stays
|
|
436
|
+
fully dynamic with a once-per-key warning.
|
|
437
|
+
- **Middleware still guards every serve.** Auth middleware (global or route
|
|
438
|
+
DSL) runs before any shell byte on HIT and MISS alike — no Next-style "PPR
|
|
439
|
+
bypasses middleware" caveats to migrate around.
|
|
440
|
+
|
|
441
|
+
A route without `ppr` pays zero cost. See `/ppr` for the full execution matrix,
|
|
442
|
+
hole rules, and pitfalls.
|
|
443
|
+
|
|
318
444
|
### Revalidation: two distinct axes
|
|
319
445
|
|
|
320
446
|
Next.js conflates two things under "revalidation." Rango separates them — and
|
|
@@ -608,4 +734,10 @@ See `/theme` for full API including system detection and cookie persistence.
|
|
|
608
734
|
10. [ ] Migrate API routes to `path.json()` / `path.text()`
|
|
609
735
|
11. [ ] Update metadata to use `Meta` handle + `<MetaTags />` in document head
|
|
610
736
|
12. [ ] Replace `next-themes` with `theme: true` in createRouter (see `/theme`)
|
|
611
|
-
13. [ ]
|
|
737
|
+
13. [ ] Map rendering-mode segment config: `revalidate = N` → `cache({ ttl })`,
|
|
738
|
+
`force-static` → `Static()`/`Prerender()`, `experimental_ppr` → the
|
|
739
|
+
`ppr` path option (loader + `loading()` as the hole)
|
|
740
|
+
14. [ ] Run `npx rango generate src/` to generate route types
|
|
741
|
+
15. [ ] Verify no shims: `grep -rn "from ['\"]next" src/ app/` returns nothing,
|
|
742
|
+
no mock `next/*` modules or aliases exist, and `next` is out of
|
|
743
|
+
`package.json`
|