@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,153 @@
|
|
|
1
|
+
# Params and Search Types
|
|
2
|
+
|
|
3
|
+
## Typed Search Params
|
|
4
|
+
|
|
5
|
+
Add a `search` schema to `path()` options for type-safe query parameters:
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
// Route definition with search schema
|
|
9
|
+
path("/search", SearchPage, {
|
|
10
|
+
name: "search",
|
|
11
|
+
search: { q: "string", page: "number?", sort: "string?" },
|
|
12
|
+
});
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
### Handler with typed search params
|
|
16
|
+
|
|
17
|
+
`Handler<"name">` automatically resolves route params and search params from the
|
|
18
|
+
global `GeneratedRouteMap` (the gen file). No explicit route map import needed:
|
|
19
|
+
|
|
20
|
+
```typescript
|
|
21
|
+
// pages/search.tsx
|
|
22
|
+
import type { Handler } from "@rangojs/router";
|
|
23
|
+
|
|
24
|
+
export const SearchPage: Handler<"search"> = (ctx) => {
|
|
25
|
+
// ctx.search is typed: { q: string; page?: number; sort?: string }
|
|
26
|
+
const { q, page, sort } = ctx.search;
|
|
27
|
+
return <SearchResults q={q} page={page} sort={sort} />;
|
|
28
|
+
};
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
This avoids circular references because `Handler` defaults to `GeneratedRouteMap`
|
|
32
|
+
(from `router.named-routes.gen.ts`) instead of `RegisteredRoutes` (which depends on `router.tsx`).
|
|
33
|
+
|
|
34
|
+
You can also pass an explicit route map for per-module isolation (opt-in,
|
|
35
|
+
after running `npx rango generate`). With a local map, the route name is
|
|
36
|
+
**dot-prefixed** so params and search resolve from `routes`, not the global map:
|
|
37
|
+
|
|
38
|
+
```typescript
|
|
39
|
+
import type { Handler } from "@rangojs/router";
|
|
40
|
+
import type { routes } from "./urls.gen.js";
|
|
41
|
+
|
|
42
|
+
export const SearchPage: Handler<".search", routes> = (ctx) => { ... };
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Note the difference: `Handler<"search">` (no dot) resolves against the global
|
|
46
|
+
`GeneratedRouteMap`; `Handler<".search", routes>` resolves against the local
|
|
47
|
+
`routes` map. Mixing them — `Handler<"search", routes>` — silently ignores
|
|
48
|
+
`routes` for param/search inference and only uses it for local `ctx.reverse(".x")`.
|
|
49
|
+
|
|
50
|
+
Supported types: `"string"`, `"number"`, `"boolean"`, with `?` suffix for optional.
|
|
51
|
+
Values are automatically coerced from query string (e.g., `"2"` becomes `2` for numbers).
|
|
52
|
+
Routes without a `search` schema keep the standard `URLSearchParams` behavior.
|
|
53
|
+
|
|
54
|
+
### RouteSearchParams and RouteParams utility types
|
|
55
|
+
|
|
56
|
+
Extract typed params by route name for use in component props, return types, or anywhere:
|
|
57
|
+
|
|
58
|
+
```typescript
|
|
59
|
+
import type { RouteSearchParams, RouteParams } from "@rangojs/router";
|
|
60
|
+
|
|
61
|
+
// RouteSearchParams<"name"> resolves the search schema to a typed object
|
|
62
|
+
type SP = RouteSearchParams<"search">;
|
|
63
|
+
// { q: string | undefined; page?: number; sort?: string }
|
|
64
|
+
|
|
65
|
+
// RouteParams<"name"> resolves URL params from the route pattern
|
|
66
|
+
type P = RouteParams<"blogPost">;
|
|
67
|
+
// { slug: string }
|
|
68
|
+
|
|
69
|
+
// Optional URL params (`:slug?`) resolve to `string | undefined`
|
|
70
|
+
// because absent segments are omitted from `ctx.params` at runtime.
|
|
71
|
+
type C = RouteParams<"checkout">;
|
|
72
|
+
// { step?: string }
|
|
73
|
+
// → ctx.params.step is `string | undefined`; use `?? "default"` to coalesce.
|
|
74
|
+
|
|
75
|
+
// Use in component props
|
|
76
|
+
interface SearchResultsProps {
|
|
77
|
+
params: RouteSearchParams<"search">;
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Both default to the global route map (`RegisteredRoutes` or `GeneratedRouteMap`).
|
|
82
|
+
Pass an explicit route map as the second type argument when needed:
|
|
83
|
+
|
|
84
|
+
```typescript
|
|
85
|
+
import type { routes } from "./urls.gen.js";
|
|
86
|
+
|
|
87
|
+
type SP = RouteSearchParams<"search", routes>;
|
|
88
|
+
type P = RouteParams<"blogPost", routes>;
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Generated route types
|
|
92
|
+
|
|
93
|
+
In the generated `router.named-routes.gen.ts`, routes with search schemas
|
|
94
|
+
use `{ path, search }` objects:
|
|
95
|
+
|
|
96
|
+
```typescript
|
|
97
|
+
// router.named-routes.gen.ts (auto-generated)
|
|
98
|
+
export const NamedRoutes = {
|
|
99
|
+
"search.index": {
|
|
100
|
+
path: "/search",
|
|
101
|
+
search: { q: "string", page: "number?", sort: "string?" },
|
|
102
|
+
},
|
|
103
|
+
"home.index": "/", // No search schema -> plain string
|
|
104
|
+
} as const;
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
You never open a `.gen.ts` by hand. Treat the generated types as call-site
|
|
108
|
+
honesty checks, not modules to read:
|
|
109
|
+
|
|
110
|
+
- **Do not import `router.named-routes.gen.ts` directly**, and don't reach for
|
|
111
|
+
`Rango.GeneratedRouteMap`. It is the whole-app manifest, auto-wired
|
|
112
|
+
globally — `Handler<"name">` and `ctx.reverse("name")` already see it.
|
|
113
|
+
- **Per-module `*.gen.ts` imports are fine** — they are the opt-in local-route
|
|
114
|
+
pattern for `useReverse(routes)` and explicit local handler typing
|
|
115
|
+
(`Handler<".name", routes>`). See `/links`.
|
|
116
|
+
|
|
117
|
+
If a type error points at a generated map instead of your call site, that's a
|
|
118
|
+
smell — fix the call site (or regenerate), never edit the generated file.
|
|
119
|
+
|
|
120
|
+
## Loader Type Safety
|
|
121
|
+
|
|
122
|
+
Loaders have typed return values:
|
|
123
|
+
|
|
124
|
+
```typescript
|
|
125
|
+
// loaders/product.ts
|
|
126
|
+
export const ProductLoader = createLoader(async (ctx) => {
|
|
127
|
+
return {
|
|
128
|
+
id: ctx.params.slug,
|
|
129
|
+
name: "Widget",
|
|
130
|
+
price: 99,
|
|
131
|
+
};
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
// In server component - type is inferred
|
|
135
|
+
import { useLoader } from "@rangojs/router/client";
|
|
136
|
+
|
|
137
|
+
async function ProductPage() {
|
|
138
|
+
const product = await useLoader(ProductLoader);
|
|
139
|
+
// product: { id: string; name: string; price: number }
|
|
140
|
+
return <h1>{product.name}</h1>;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// In client component - same type
|
|
144
|
+
"use client";
|
|
145
|
+
import { useLoader } from "@rangojs/router/client";
|
|
146
|
+
|
|
147
|
+
function ProductPrice() {
|
|
148
|
+
const { data } = useLoader(ProductLoader);
|
|
149
|
+
// data: { id: string; name: string; price: number }
|
|
150
|
+
const product = data;
|
|
151
|
+
return <span>${product.price}</span>;
|
|
152
|
+
}
|
|
153
|
+
```
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
# Route Types
|
|
2
|
+
|
|
3
|
+
## Route Definition with Type-Safe Names
|
|
4
|
+
|
|
5
|
+
```typescript
|
|
6
|
+
// urls.tsx
|
|
7
|
+
import { urls } from "@rangojs/router";
|
|
8
|
+
|
|
9
|
+
export const urlpatterns = urls(({ path, layout }) => [
|
|
10
|
+
path("/", HomePage, { name: "home" }),
|
|
11
|
+
path("/products", ProductsPage, { name: "products" }),
|
|
12
|
+
path("/product/:slug", ProductPage, { name: "product" }),
|
|
13
|
+
path("/cart", CartPage, { name: "cart" }),
|
|
14
|
+
path("/checkout/:step?", CheckoutPage, { name: "checkout" }),
|
|
15
|
+
]);
|
|
16
|
+
|
|
17
|
+
// Route names are inferred from the { name } option
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Type-Safe href()
|
|
21
|
+
|
|
22
|
+
### Server: ctx.reverse with route names
|
|
23
|
+
|
|
24
|
+
In route handlers, `ctx.reverse()` uses two namespaces:
|
|
25
|
+
|
|
26
|
+
- **`.name`** — local route, resolved within the current `include()` scope
|
|
27
|
+
- **`name`** — global route, from the named-routes definition
|
|
28
|
+
|
|
29
|
+
```typescript
|
|
30
|
+
import type { Handler } from "@rangojs/router";
|
|
31
|
+
|
|
32
|
+
export const ProductHandler: Handler<"shop.product"> = (ctx) => {
|
|
33
|
+
ctx.reverse(".cart"); // Local: /shop/cart
|
|
34
|
+
ctx.reverse(".product", { slug: "widget" }); // Local: /shop/product/widget
|
|
35
|
+
ctx.reverse("blog.post", { slug: "1" }); // Global: /blog/1
|
|
36
|
+
};
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
For type-safe local names, generate a route types file with `npx rango generate urls/shop.tsx`
|
|
40
|
+
and pass it as the second generic to `Handler` or `Prerender`:
|
|
41
|
+
|
|
42
|
+
```typescript
|
|
43
|
+
import type { Handler } from "@rangojs/router";
|
|
44
|
+
import type { routes } from "./shop.gen.js";
|
|
45
|
+
|
|
46
|
+
export const ProductHandler: Handler<"shop.product", routes> = (ctx) => {
|
|
47
|
+
ctx.reverse(".cart"); // Type-safe local name
|
|
48
|
+
ctx.reverse(".product", { slug: "widget" }); // Type-safe local with params
|
|
49
|
+
ctx.reverse("blog.post", { slug: "hi" }); // Type-safe global name
|
|
50
|
+
};
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Client: href + useHref
|
|
54
|
+
|
|
55
|
+
On the client, `href()` validates paths against registered route patterns at compile time:
|
|
56
|
+
|
|
57
|
+
```typescript
|
|
58
|
+
"use client";
|
|
59
|
+
import { href, useHref, Link } from "@rangojs/router/client";
|
|
60
|
+
|
|
61
|
+
// href() validates absolute paths via PatternToPath types
|
|
62
|
+
href("/about"); // Valid path
|
|
63
|
+
href("/blog/hello"); // Matches /blog/:slug
|
|
64
|
+
|
|
65
|
+
// useHref() auto-prefixes with include() mount
|
|
66
|
+
function ShopNav() {
|
|
67
|
+
const href = useHref();
|
|
68
|
+
return <Link to={href("/cart")}>Cart</Link>; // "/shop/cart"
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
`href()` and the `Rango.Path` type read from `RegisteredRoutes` when you augment
|
|
73
|
+
it, otherwise from the auto-generated `GeneratedRouteMap` — so `rango generate`
|
|
74
|
+
alone type-checks `href()` paths with no manual augmentation. The augmentation
|
|
75
|
+
below is only needed for **`Rango.PathResponse`** (response-payload inference), which
|
|
76
|
+
`GeneratedRouteMap` cannot provide:
|
|
77
|
+
|
|
78
|
+
```typescript
|
|
79
|
+
declare global {
|
|
80
|
+
namespace Rango {
|
|
81
|
+
interface RegisteredRoutes extends typeof router.routeMap {}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
For wrapper helpers, type the path parameter as `Rango.Path`. It is ambient (no
|
|
87
|
+
import) and shares `href()`'s compile-time path checking, so a wrapper stays in
|
|
88
|
+
sync with your routes automatically:
|
|
89
|
+
|
|
90
|
+
```typescript
|
|
91
|
+
import { href } from "@rangojs/router/client";
|
|
92
|
+
|
|
93
|
+
export const appHref = (path: Rango.Path): string => href(path);
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
For response-route payloads, `Rango.PathResponse<T>` is the ambient lookup. It
|
|
97
|
+
accepts a route _pattern_ **or** a concrete path, so it also serves as the return
|
|
98
|
+
type of a typed `fetch` wrapper. It only resolves once `RegisteredRoutes` carries
|
|
99
|
+
response metadata:
|
|
100
|
+
|
|
101
|
+
```typescript
|
|
102
|
+
import { href } from "@rangojs/router/client";
|
|
103
|
+
|
|
104
|
+
type Product = Rango.PathResponse<"/api/products/:id">; // by pattern
|
|
105
|
+
type Same = Rango.PathResponse<"/api/products/42">; // by concrete path
|
|
106
|
+
|
|
107
|
+
// Response inferred from the concrete path passed in:
|
|
108
|
+
async function get<T extends Rango.Path>(
|
|
109
|
+
path: T,
|
|
110
|
+
): Promise<Rango.PathResponse<T>> {
|
|
111
|
+
return fetch(href(path)).then((r) => r.json());
|
|
112
|
+
}
|
|
113
|
+
const product = await get("/api/products/42"); // Product (bare value)
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Pattern keys (`/:id`) match exactly; a concrete path under a _nested_ dynamic
|
|
117
|
+
route can match several patterns and union their responses.
|
|
118
|
+
|
|
119
|
+
`Rango.PathResponse` describes the JSON **wire** shape, not the handler's raw
|
|
120
|
+
return. A `path.json()` handler returning `{ createdAt: Date }` resolves here to
|
|
121
|
+
`{ createdAt: string }` (bare value), matching what `r.json()` yields. This
|
|
122
|
+
is applied via the ambient `Rango.JsonSerialize<T>` transform (`Date -> string`,
|
|
123
|
+
honors `toJSON()`, drops functions/`undefined`, `bigint -> never`). A separate
|
|
124
|
+
`Rango.FlightSerialize<T>` models the higher-fidelity RSC Flight boundary
|
|
125
|
+
(loaders / RSC props, where `Date` is preserved) — do **not** use it for
|
|
126
|
+
`path.json()`.
|
|
127
|
+
|
|
128
|
+
### Overriding serialization globally
|
|
129
|
+
|
|
130
|
+
For your own types, the zero-config way to control the JSON wire shape is a
|
|
131
|
+
`toJSON()` method — `Rango.JsonSerialize` honors it, and it matches the runtime
|
|
132
|
+
exactly (`JSON.stringify` calls `toJSON()`):
|
|
133
|
+
|
|
134
|
+
```typescript
|
|
135
|
+
class Money {
|
|
136
|
+
constructor(private cents: number) {}
|
|
137
|
+
toJSON(): number {
|
|
138
|
+
return this.cents;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
// Rango.JsonSerialize<Money> is number; Rango.PathResponse reflects it.
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
To override a transform for types you **don't** own (or for the Flight boundary,
|
|
145
|
+
which has no `toJSON()`), augment its override slot. Because `Rango.JsonSerialize`
|
|
146
|
+
/ `Rango.FlightSerialize` are type _aliases_ (TS can't merge those), you provide a
|
|
147
|
+
single member that is your **complete** transform, delegating to the built-in for
|
|
148
|
+
the cases you don't change:
|
|
149
|
+
|
|
150
|
+
```typescript
|
|
151
|
+
declare global {
|
|
152
|
+
namespace Rango {
|
|
153
|
+
interface JsonSerializeOverride<T> {
|
|
154
|
+
app: T extends Decimal ? string : Rango.JsonSerializeBuiltin<T>;
|
|
155
|
+
}
|
|
156
|
+
interface FlightSerializeOverride<T> {
|
|
157
|
+
app: T extends Money ? number : Rango.FlightSerializeBuiltin<T>;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
// Rango.JsonSerialize<Decimal> -> string; Rango.FlightSerialize<Money> -> number;
|
|
162
|
+
// everything else stays on the built-in, recursively (nested fields too).
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
Rules: provide **exactly one** member (the slot is read as
|
|
166
|
+
`Override<T>[keyof Override<T>]`, so multiple members union and conflict).
|
|
167
|
+
Overrides win over `toJSON()` and apply at every nesting level. Caveat for JSON:
|
|
168
|
+
the `path.json()` runtime is plain `JSON.stringify`, which only honors `toJSON()`,
|
|
169
|
+
so a `JsonSerializeOverride` that disagrees with what the runtime emits will lie —
|
|
170
|
+
prefer `toJSON()` for your own types and use the slot only for types you can't
|
|
171
|
+
modify.
|
|
172
|
+
|
|
173
|
+
See `/links` for full URL generation guide.
|
|
174
|
+
|
|
175
|
+
## Stable identity: `path#export`
|
|
176
|
+
|
|
177
|
+
Loaders, handles, cached functions (`functionId`), and server actions
|
|
178
|
+
(`actionId`) all share one identity scheme: `{modulePath}#{exportName}`,
|
|
179
|
+
injected at build by the `exposeInternalIds` and `exposeActionId` Vite plugins.
|
|
180
|
+
This is also the identity React server actions carry across the Flight boundary,
|
|
181
|
+
which is why a `revalidate()` predicate sees an action as a `path#export` string:
|
|
182
|
+
|
|
183
|
+
```typescript
|
|
184
|
+
revalidate(
|
|
185
|
+
({ actionId }) => actionId === "src/actions/cart.ts#addToCart" || undefined,
|
|
186
|
+
);
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
`actionId` is the only stable reference React exposes across the Flight boundary,
|
|
190
|
+
so it stays as the floor and escape hatch. The hand-written-string surface
|
|
191
|
+
(`actionId?.includes("cart.ts#")`) is brittle: a renamed action or moved file
|
|
192
|
+
silently stops matching with no compile error. Prefer **`ctx.isAction()`** in a
|
|
193
|
+
revalidate predicate — it resolves the action's id from an imported reference, so
|
|
194
|
+
a rename is a type error in one place instead of silent drift:
|
|
195
|
+
|
|
196
|
+
```ts
|
|
197
|
+
import { addToCart, removeFromCart } from "./actions/cart";
|
|
198
|
+
import * as CartActions from "./actions/cart";
|
|
199
|
+
|
|
200
|
+
revalidate((ctx) => ctx.isAction(addToCart) || undefined); // one action
|
|
201
|
+
revalidate((ctx) => ctx.isAction(addToCart, removeFromCart) || undefined); // several
|
|
202
|
+
revalidate((ctx) => ctx.isAction(CartActions) || undefined); // any action in the module
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
`ctx.isAction()` (only available on the revalidate predicate's context) returns a
|
|
206
|
+
raw boolean — combine with `|| undefined` for the "revalidate on match, else
|
|
207
|
+
defer" intent. It resolves the reference the same way the router derives
|
|
208
|
+
`actionId` (`$id` in production, `$$id` in dev), so matching
|
|
209
|
+
works in both modes. `actionId` stays available for advanced cases.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: use-cache
|
|
3
|
-
description: Function-level caching with "use cache" directive for RSC data functions and components
|
|
3
|
+
description: Function-level caching with the "use cache" directive for RSC data functions and components in @rangojs/router. Use when a single function or component should memoize its own output, not a whole route/segment subtree or HTTP response.
|
|
4
4
|
argument-hint: [profile-name]
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -10,6 +10,12 @@ Function-level caching for async server functions and RSC components. Caches
|
|
|
10
10
|
return values with TTL + stale-while-revalidate. Complementary to the route-level
|
|
11
11
|
`cache()` DSL and build-time `Static()`/`Prerender()`.
|
|
12
12
|
|
|
13
|
+
## Not this skill if…
|
|
14
|
+
|
|
15
|
+
- You want to cache a whole route or a rendered subtree of segments — that is
|
|
16
|
+
the segment-level `cache()` DSL: see `/caching`.
|
|
17
|
+
- You are unsure which cache layer you need — start at `/cache-guide`.
|
|
18
|
+
|
|
13
19
|
## Basic Usage
|
|
14
20
|
|
|
15
21
|
### File-level (all exports cached with default profile)
|
package/skills/vercel/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: vercel
|
|
3
|
-
description: Deploy a Rango app to Vercel Functions (Build Output API v3)
|
|
3
|
+
description: Deploy a Rango app to Vercel Functions (Build Output API v3). Use when deploying a Rango app to Vercel, or asking how the router works with Vercel Functions and the Build Output API.
|
|
4
4
|
argument-hint:
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: view-transitions
|
|
3
|
-
description: Configure React View Transitions on layouts, routes, and parallel slots in @rangojs/router
|
|
3
|
+
description: Configure React View Transitions on layouts, routes, and parallel slots in @rangojs/router. Use when navigation should animate smoothly between pages, or wiring up React View Transitions on a route or layout.
|
|
4
4
|
argument-hint: [layout|route|parallel|intercept]
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -277,6 +277,13 @@ const DEFAULT_ACTION_STATE: TrackedActionState = {
|
|
|
277
277
|
result: null,
|
|
278
278
|
};
|
|
279
279
|
|
|
280
|
+
// Shared empty inflight-actions list. getState() hands back this exact reference
|
|
281
|
+
// whenever no action is inflight (the overwhelmingly common case), so the derived
|
|
282
|
+
// snapshot's `inflightActions` is referentially stable across notifies instead of
|
|
283
|
+
// a fresh [] each call. Read-only by contract (consumers only read length/spread),
|
|
284
|
+
// same as the shared DEFAULT_ACTION_STATE.
|
|
285
|
+
const EMPTY_INFLIGHT_ACTIONS: InflightAction[] = [];
|
|
286
|
+
|
|
280
287
|
/**
|
|
281
288
|
* Check if a subscription ID matches an action's full ID.
|
|
282
289
|
*
|
|
@@ -371,7 +378,19 @@ export function createEventController(
|
|
|
371
378
|
const actionListeners = new Map<string, Set<ActionStateListener>>();
|
|
372
379
|
const handleListeners = new Set<HandleListener>();
|
|
373
380
|
|
|
374
|
-
const
|
|
381
|
+
const notifyStateListeners = makeDebouncedNotifier(stateListeners);
|
|
382
|
+
|
|
383
|
+
// Memoized derived snapshot. Every state mutation already funnels through
|
|
384
|
+
// notify(), so invalidating here (synchronously, before the debounced fire)
|
|
385
|
+
// means a getState() call between two mutations reuses the same object — an
|
|
386
|
+
// unchanged state returns the SAME reference — while any real change recomputes
|
|
387
|
+
// on the next read. Kept null when dirty.
|
|
388
|
+
let cachedDerivedState: DerivedNavigationState | null = null;
|
|
389
|
+
|
|
390
|
+
function notify(): void {
|
|
391
|
+
cachedDerivedState = null;
|
|
392
|
+
notifyStateListeners();
|
|
393
|
+
}
|
|
375
394
|
|
|
376
395
|
const actionNotifyTimeouts = new Map<string, ReturnType<typeof setTimeout>>();
|
|
377
396
|
|
|
@@ -397,14 +416,21 @@ export function createEventController(
|
|
|
397
416
|
const notifyHandles = makeDebouncedNotifier(handleListeners);
|
|
398
417
|
|
|
399
418
|
function getState(): DerivedNavigationState {
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
419
|
+
if (cachedDerivedState) return cachedDerivedState;
|
|
420
|
+
|
|
421
|
+
// Skip the spread/filter/map entirely when idle — the common case — and hand
|
|
422
|
+
// back the shared frozen empty list for referential stability.
|
|
423
|
+
const inflightActionsList: InflightAction[] =
|
|
424
|
+
inflightActions.size === 0
|
|
425
|
+
? EMPTY_INFLIGHT_ACTIONS
|
|
426
|
+
: [...inflightActions.values()]
|
|
427
|
+
.filter((a) => a.phase !== "settling")
|
|
428
|
+
.map((a) => ({
|
|
429
|
+
id: a.id,
|
|
430
|
+
actionId: a.actionId,
|
|
431
|
+
payload: a.payload,
|
|
432
|
+
startedAt: a.startedAt,
|
|
433
|
+
}));
|
|
408
434
|
|
|
409
435
|
const hasActiveActions = inflightActionsList.length > 0;
|
|
410
436
|
const isVisibleNavigation =
|
|
@@ -414,7 +440,7 @@ export function createEventController(
|
|
|
414
440
|
|
|
415
441
|
const isStreaming = activeStreamCount > 0 || state === "loading";
|
|
416
442
|
|
|
417
|
-
|
|
443
|
+
cachedDerivedState = {
|
|
418
444
|
state,
|
|
419
445
|
isStreaming,
|
|
420
446
|
// True when a navigation is active (fetching or streaming, before
|
|
@@ -430,9 +456,14 @@ export function createEventController(
|
|
|
430
456
|
: null,
|
|
431
457
|
inflightActions: inflightActionsList,
|
|
432
458
|
};
|
|
459
|
+
return cachedDerivedState;
|
|
433
460
|
}
|
|
434
461
|
|
|
435
462
|
function getActionState(actionId: string): TrackedActionState {
|
|
463
|
+
// Nothing inflight — skip building/scanning the list and return the shared
|
|
464
|
+
// idle snapshot (the same reference use-action falls back to).
|
|
465
|
+
if (inflightActions.size === 0) return DEFAULT_ACTION_STATE;
|
|
466
|
+
|
|
436
467
|
const entry = [...inflightActions.values()]
|
|
437
468
|
.filter((a) => matchesActionId(actionId, a.actionId))
|
|
438
469
|
.reduce<ActionEntry | undefined>((best, a) => {
|
package/src/browser/logging.ts
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import { INTERNAL_RANGO_DEBUG } from "../internal-debug.js";
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Module-level debug flag for guarding call sites whose debug arguments do
|
|
5
|
+
* non-trivial work (joins, maps, spreads, object literals). Because the Vite
|
|
6
|
+
* transform folds INTERNAL_RANGO_DEBUG to a literal, an `if (IS_BROWSER_DEBUG)`
|
|
7
|
+
* guard is minifier-DCE-able — the whole block drops from the production bundle.
|
|
8
|
+
* Prefer this over isBrowserDebugEnabled() at hot call sites: a const guard folds
|
|
9
|
+
* where a function call may not.
|
|
10
|
+
*/
|
|
11
|
+
export const IS_BROWSER_DEBUG: boolean = INTERNAL_RANGO_DEBUG;
|
|
12
|
+
|
|
3
13
|
interface BrowserLogContext {
|
|
4
14
|
requestId: string;
|
|
5
15
|
txId: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ResolvedSegment } from "./types.js";
|
|
2
|
-
import { debugLog } from "./logging.js";
|
|
2
|
+
import { debugLog, IS_BROWSER_DEBUG } from "./logging.js";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Merge partial loader data from server with cached loader data.
|
|
@@ -19,9 +19,11 @@ export function mergeSegmentLoaders(
|
|
|
19
19
|
const serverLoaderIds = fromServer.loaderIds || [];
|
|
20
20
|
const cachedLoaderIds = fromCache.loaderIds || [];
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
if (IS_BROWSER_DEBUG) {
|
|
23
|
+
debugLog(
|
|
24
|
+
`[Browser] Merging partial loaders: server has ${serverLoaderIds.join(", ")}, cache has ${cachedLoaderIds.join(", ")}`,
|
|
25
|
+
);
|
|
26
|
+
}
|
|
25
27
|
|
|
26
28
|
return {
|
|
27
29
|
...fromCache,
|
|
@@ -223,7 +223,11 @@ export function createNavigationClient(
|
|
|
223
223
|
...(isActionFenceActive() && { cache: "no-store" as RequestCache }),
|
|
224
224
|
headers: {
|
|
225
225
|
"X-RSC-Router-Client-Path": previousUrl,
|
|
226
|
-
|
|
226
|
+
// Reuse the single per-operation read (see rangoState above): the
|
|
227
|
+
// cache-key lookup and this header must agree on one value, and the
|
|
228
|
+
// cookie read has side effects (external-rotation notify) we do not
|
|
229
|
+
// want to fire twice per navigation.
|
|
230
|
+
"X-Rango-State": rangoState,
|
|
227
231
|
...(tx && { "X-RSC-Router-Request-Id": tx.requestId }),
|
|
228
232
|
...(interceptSourceUrl && {
|
|
229
233
|
"X-RSC-Router-Intercept-Source": interceptSourceUrl,
|
|
@@ -53,18 +53,24 @@ type HistoryCacheEntry = [
|
|
|
53
53
|
];
|
|
54
54
|
|
|
55
55
|
/**
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
56
|
+
* Clone the handleData CONTAINERS (the handle-name map and each segment map) so
|
|
57
|
+
* a cache entry is decoupled from the live map that eventController mutates — it
|
|
58
|
+
* adds/deletes segment keys and REPLACES bucket arrays in place. The bucket
|
|
59
|
+
* arrays themselves are shared by reference, NOT copied: a bucket array is only
|
|
60
|
+
* ever replaced wholesale (eventController.setHandleData reassigns it,
|
|
61
|
+
* resolveDeferredHandleValues builds a fresh one) and collect functions read it
|
|
62
|
+
* without mutating, so sharing is safe and skips an O(elements) copy on every
|
|
63
|
+
* cache write — the per-yield streaming hot path. This also preserves any
|
|
64
|
+
* non-serializable bucket contents (React elements, functions, etc.).
|
|
60
65
|
*/
|
|
61
66
|
export function cloneHandleData(handleData: HandleData): HandleData {
|
|
62
67
|
const cloned: HandleData = {};
|
|
63
68
|
for (const [handleKey, segmentMap] of Object.entries(handleData)) {
|
|
64
|
-
|
|
69
|
+
const clonedMap: Record<string, unknown[]> = {};
|
|
65
70
|
for (const [segmentId, dataArray] of Object.entries(segmentMap)) {
|
|
66
|
-
|
|
71
|
+
clonedMap[segmentId] = dataArray;
|
|
67
72
|
}
|
|
73
|
+
cloned[handleKey] = clonedMap;
|
|
68
74
|
}
|
|
69
75
|
return cloned;
|
|
70
76
|
}
|
|
@@ -737,6 +743,40 @@ export function createNavigationStore(
|
|
|
737
743
|
}
|
|
738
744
|
},
|
|
739
745
|
|
|
746
|
+
/**
|
|
747
|
+
* Owner-guarded handle-data write: locate the entry, and write ONLY when it
|
|
748
|
+
* is still owned by `ownerInstance` (the nav-instance token that seeded it).
|
|
749
|
+
* Folds the streaming hot path's separate getCacheEntryInstance() ownership
|
|
750
|
+
* probe and updateCacheHandleData() write into a SINGLE historyCache scan
|
|
751
|
+
* (processHandles calls this per yield). Semantics otherwise match
|
|
752
|
+
* updateCacheHandleData: no-op on a missing entry, clone the handleData
|
|
753
|
+
* containers, and preserve stale / handlesPending when the flag is omitted.
|
|
754
|
+
*/
|
|
755
|
+
updateCacheHandleDataIfOwned(
|
|
756
|
+
historyKey: string,
|
|
757
|
+
handleData: HandleData,
|
|
758
|
+
ownerInstance: number,
|
|
759
|
+
stale?: boolean,
|
|
760
|
+
handlesPending?: boolean,
|
|
761
|
+
): void {
|
|
762
|
+
const existingIndex = historyCache.findIndex(
|
|
763
|
+
([key]) => key === historyKey,
|
|
764
|
+
);
|
|
765
|
+
if (existingIndex === -1) return;
|
|
766
|
+
const entry = historyCache[existingIndex];
|
|
767
|
+
if (entry[5] !== ownerInstance) return;
|
|
768
|
+
const clonedHandleData = cloneHandleData(handleData);
|
|
769
|
+
historyCache[existingIndex] = [
|
|
770
|
+
entry[0],
|
|
771
|
+
entry[1],
|
|
772
|
+
stale ?? entry[2],
|
|
773
|
+
clonedHandleData,
|
|
774
|
+
entry[4],
|
|
775
|
+
entry[5],
|
|
776
|
+
handlesPending ?? entry[6],
|
|
777
|
+
];
|
|
778
|
+
},
|
|
779
|
+
|
|
740
780
|
/**
|
|
741
781
|
* Mark all cache entries as stale
|
|
742
782
|
* Called after server actions to indicate data may be outdated
|