@rangojs/router 0.0.0-experimental.117 → 0.0.0-experimental.119
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/__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/testing/vitest.js +82 -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 +8 -10
- 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 +1 -1
- package/skills/css/SKILL.md +76 -0
- package/skills/host-router/SKILL.md +21 -0
- package/skills/rango/SKILL.md +1 -0
- package/skills/tailwind/SKILL.md +27 -3
- package/src/browser/app-shell.ts +14 -27
- package/src/browser/navigation-bridge.ts +2 -51
- package/src/browser/navigation-client.ts +14 -0
- package/src/browser/navigation-store.ts +1 -25
- package/src/browser/partial-update.ts +19 -32
- package/src/browser/prefetch/cache.ts +39 -21
- package/src/browser/prefetch/fetch.ts +10 -1
- package/src/browser/rango-state.ts +6 -22
- package/src/browser/react/NavigationProvider.tsx +12 -9
- package/src/browser/react/use-router.ts +4 -3
- package/src/browser/response-adapter.ts +20 -0
- package/src/browser/rsc-router.tsx +15 -13
- package/src/browser/server-action-bridge.ts +21 -0
- package/src/browser/types.ts +4 -15
- package/src/cache/cache-runtime.ts +17 -5
- package/src/cache/cache-scope.ts +23 -7
- package/src/cache/cf/cf-cache-store.ts +25 -7
- package/src/cache/handle-snapshot.ts +103 -0
- package/src/cache/memory-segment-store.ts +3 -2
- package/src/cache/types.ts +10 -6
- package/src/prerender/store.ts +9 -7
- package/src/router/match-middleware/cache-lookup.ts +13 -4
- package/src/router/prerender-match.ts +39 -14
- package/src/router/request-classification.ts +36 -9
- package/src/router/router-interfaces.ts +6 -7
- package/src/router/segment-resolution/static-store.ts +19 -5
- package/src/rsc/handler.ts +30 -8
- package/src/rsc/origin-guard.ts +2 -0
- package/src/rsc/response-route-handler.ts +20 -1
- package/src/rsc/rsc-rendering.ts +10 -0
- package/src/rsc/server-action.ts +16 -2
- package/src/urls/path-helper-types.ts +6 -0
- package/src/vite/discovery/prerender-collection.ts +5 -5
- package/src/vite/router-discovery.ts +3 -4
|
@@ -241,3 +241,24 @@ export default regional;
|
|
|
241
241
|
// host-router.ts
|
|
242
242
|
router.host(["**.regional.example.com"]).lazy(() => import("./apps/regional"));
|
|
243
243
|
```
|
|
244
|
+
|
|
245
|
+
## Cross-app navigation is a full document load
|
|
246
|
+
|
|
247
|
+
A client-side navigation that crosses an app boundary (e.g. a `<Link>` or
|
|
248
|
+
intercepted `<a>` from the app at `/` into an app mounted at `/shop`) is a **hard
|
|
249
|
+
document navigation**, not a soft in-tree swap. When the server sees a partial
|
|
250
|
+
(SPA) request whose router id doesn't match the matched app, it returns
|
|
251
|
+
`X-RSC-Reload` and the client does a real document navigation to the target.
|
|
252
|
+
|
|
253
|
+
Why a reload rather than a soft swap: a soft swap can't faithfully re-establish
|
|
254
|
+
the target app's **document-level** state. Stylesheets shared across apps are
|
|
255
|
+
dropped by React 19's by-`href` resource dedup; and theme, warmup, and
|
|
256
|
+
prefetch-TTL are document-lifetime (captured once at load — see
|
|
257
|
+
`browser/app-shell.ts`), so the target app's config would never take effect. A
|
|
258
|
+
full document load re-establishes the target app's entire document — CSS, theme,
|
|
259
|
+
meta, everything — by construction. So you do **not** need to coordinate
|
|
260
|
+
stylesheet `href`s, `precedence`, theme config, etc. across independently-authored
|
|
261
|
+
apps; each app owns its own document.
|
|
262
|
+
|
|
263
|
+
**Within-app** navigation is unchanged — a normal soft SPA update (the document
|
|
264
|
+
stays mounted). Only crossing an app boundary triggers the reload.
|
package/skills/rango/SKILL.md
CHANGED
|
@@ -218,6 +218,7 @@ Grouped by concern — read when you need to…
|
|
|
218
218
|
| `/theme` | Light/dark mode with FOUC prevention |
|
|
219
219
|
| `/i18n` | Locale routing with `:locale?`, resolution chains, react-intl integration |
|
|
220
220
|
| `/fonts` | Load web fonts with preload hints |
|
|
221
|
+
| `/css` | Import CSS in the Document `<head>` (`?url` + managed `precedence` links) |
|
|
221
222
|
| `/tailwind` | Set up Tailwind CSS v4 with `?url` imports |
|
|
222
223
|
| `/view-transitions` | React View Transitions on layouts, routes, and parallel slots |
|
|
223
224
|
| `/breadcrumbs` | Built-in Breadcrumbs handle for breadcrumb navigation |
|
package/skills/tailwind/SKILL.md
CHANGED
|
@@ -37,7 +37,11 @@ export default defineConfig({
|
|
|
37
37
|
|
|
38
38
|
## Document Component
|
|
39
39
|
|
|
40
|
-
Import the CSS file with `?url` to get a hashed URL, then preload and link it in
|
|
40
|
+
Import the CSS file with `?url` to get a hashed URL, then preload and link it in
|
|
41
|
+
`<head>`. Give the `<link rel="stylesheet">` a `precedence` prop so React 19
|
|
42
|
+
manages it as a resource — de-duped by `href`, ordered, and loaded before paint
|
|
43
|
+
(no flash of unstyled content). See
|
|
44
|
+
[Stylesheets and cross-app navigation](#stylesheets-and-cross-app-navigation):
|
|
41
45
|
|
|
42
46
|
```tsx
|
|
43
47
|
// src/document.tsx
|
|
@@ -51,8 +55,8 @@ export function Document({ children }: { children: ReactNode }) {
|
|
|
51
55
|
return (
|
|
52
56
|
<html lang="en">
|
|
53
57
|
<head>
|
|
54
|
-
<link rel="preload" href={styles} as="style" />
|
|
55
|
-
<link rel="stylesheet" href={styles} />
|
|
58
|
+
<link rel="preload" href={styles} as="style" precedence="default" />
|
|
59
|
+
<link rel="stylesheet" href={styles} precedence="default" />
|
|
56
60
|
<MetaTags />
|
|
57
61
|
</head>
|
|
58
62
|
<body className="font-sans antialiased text-slate-900 bg-slate-50">
|
|
@@ -63,6 +67,26 @@ export function Document({ children }: { children: ReactNode }) {
|
|
|
63
67
|
}
|
|
64
68
|
```
|
|
65
69
|
|
|
70
|
+
## Stylesheets and cross-app navigation
|
|
71
|
+
|
|
72
|
+
The `precedence` prop opts a `<link rel="stylesheet">` into React 19's managed
|
|
73
|
+
stylesheet model — React de-duplicates it by `href`, orders it by precedence, and
|
|
74
|
+
loads it before paint (avoiding a flash of unstyled content). It is the
|
|
75
|
+
recommended way to render a stylesheet link, which is why the example above uses
|
|
76
|
+
it. (A bare side-effect `import "./index.css"` also produces managed CSS via
|
|
77
|
+
`@vitejs/plugin-rsc`, but carries an SSR-streaming caveat — prefer the `?url` +
|
|
78
|
+
`<link precedence>` form for document CSS. See `/css`.)
|
|
79
|
+
|
|
80
|
+
For **host-router** apps (`/host-router`), a client-side navigation that crosses
|
|
81
|
+
an app boundary is a **full document load**, not a soft swap — the framework
|
|
82
|
+
redirects on an app switch. So each app's document (its stylesheets, theme, meta)
|
|
83
|
+
is always re-established cleanly by the target app's own load; you do not have to
|
|
84
|
+
coordinate stylesheet `href`s or `precedence` across apps. (This replaced an
|
|
85
|
+
earlier soft cross-app swap, under which a stylesheet shared across apps — every
|
|
86
|
+
app's `@import "tailwindcss"` compiles to one hashed asset — could be dropped by
|
|
87
|
+
React's by-`href` resource dedup if the apps disagreed on `precedence`. The full
|
|
88
|
+
reload removes that footgun entirely.)
|
|
89
|
+
|
|
66
90
|
The `?url` suffix tells Vite to return the processed CSS file's URL instead of injecting it as a side effect. This gives you a stable, hashed asset path that works in both development and production.
|
|
67
91
|
|
|
68
92
|
## Customizing the Theme
|
package/src/browser/app-shell.ts
CHANGED
|
@@ -1,26 +1,17 @@
|
|
|
1
1
|
import type { ComponentType, ReactNode } from "react";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* App-shell metadata: the
|
|
5
|
-
*
|
|
6
|
-
* from the initial RSC payload and
|
|
7
|
-
*
|
|
4
|
+
* App-shell metadata: the per-router fields describing the "envelope" around
|
|
5
|
+
* the current app's segment tree — the rootLayout (Document), basename,
|
|
6
|
+
* version, and router identity. Set once from the initial RSC payload and read
|
|
7
|
+
* through the AppShellRef when rendering segments.
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* fallback), so carrying it here would be unreliable.
|
|
16
|
-
* - prefetchCacheTTL: the not-found full-render payload does not serialize
|
|
17
|
-
* it, so a cross-app nav into a 404 would silently erase the setting.
|
|
18
|
-
* Mutable shell fields must be serialized on EVERY full-render path,
|
|
19
|
-
* otherwise absent fields are indistinguishable from "new app has no
|
|
20
|
-
* value" and the old app's value is dropped.
|
|
21
|
-
*
|
|
22
|
-
* A new document navigation (hard reload) applies these fields from the
|
|
23
|
-
* target app's initial payload.
|
|
9
|
+
* This is a per-document value. A navigation that crosses a host-router app
|
|
10
|
+
* boundary is a full document load (the server returns X-RSC-Reload for it;
|
|
11
|
+
* see request-classification.ts, mode "app-switch"), so the target app's shell
|
|
12
|
+
* — along with everything else document-level (theme, warmup, prefetch-TTL) —
|
|
13
|
+
* is established fresh by the target app's own load. The shell is never swapped
|
|
14
|
+
* in place within a session.
|
|
24
15
|
*/
|
|
25
16
|
export interface AppShell {
|
|
26
17
|
/** Router identity. Used to namespace per-app client state (e.g. the
|
|
@@ -33,20 +24,16 @@ export interface AppShell {
|
|
|
33
24
|
}
|
|
34
25
|
|
|
35
26
|
/**
|
|
36
|
-
*
|
|
37
|
-
*
|
|
27
|
+
* Container for the active app shell. Read-through via `get()` so closures
|
|
28
|
+
* (e.g. the segment renderer) capture the ref and read the shell at call time
|
|
29
|
+
* rather than closing over a stale snapshot.
|
|
38
30
|
*/
|
|
39
31
|
export interface AppShellRef {
|
|
40
32
|
get(): AppShell;
|
|
41
|
-
update(next: AppShell): void;
|
|
42
33
|
}
|
|
43
34
|
|
|
44
35
|
export function createAppShellRef(initial: AppShell): AppShellRef {
|
|
45
|
-
let current = initial;
|
|
46
36
|
return {
|
|
47
|
-
get: () =>
|
|
48
|
-
update: (next) => {
|
|
49
|
-
current = next;
|
|
50
|
-
},
|
|
37
|
+
get: () => initial,
|
|
51
38
|
};
|
|
52
39
|
}
|
|
@@ -5,8 +5,6 @@ import type {
|
|
|
5
5
|
ResolvedSegment,
|
|
6
6
|
} from "./types.js";
|
|
7
7
|
import { setAppVersion } from "./app-version.js";
|
|
8
|
-
import { setRangoStateLocal } from "./rango-state.js";
|
|
9
|
-
import type { AppShell, AppShellRef } from "./app-shell.js";
|
|
10
8
|
import * as React from "react";
|
|
11
9
|
import { startTransition } from "react";
|
|
12
10
|
import {
|
|
@@ -50,13 +48,8 @@ export { createNavigationTransaction };
|
|
|
50
48
|
*/
|
|
51
49
|
export interface NavigationBridgeConfigWithController extends NavigationBridgeConfig {
|
|
52
50
|
eventController: EventController;
|
|
53
|
-
/** RSC version from initial payload metadata
|
|
51
|
+
/** RSC version from initial payload metadata. */
|
|
54
52
|
version?: string;
|
|
55
|
-
/**
|
|
56
|
-
* Live app-shell ref. When supplied, the bridge reads version/basename
|
|
57
|
-
* from this ref so cross-app navigations propagate correctly.
|
|
58
|
-
*/
|
|
59
|
-
appShellRef?: AppShellRef;
|
|
60
53
|
}
|
|
61
54
|
|
|
62
55
|
/**
|
|
@@ -75,46 +68,9 @@ export interface NavigationBridgeConfigWithController extends NavigationBridgeCo
|
|
|
75
68
|
export function createNavigationBridge(
|
|
76
69
|
config: NavigationBridgeConfigWithController,
|
|
77
70
|
): NavigationBridge {
|
|
78
|
-
const {
|
|
79
|
-
store,
|
|
80
|
-
client,
|
|
81
|
-
eventController,
|
|
82
|
-
onUpdate,
|
|
83
|
-
renderSegments,
|
|
84
|
-
appShellRef,
|
|
85
|
-
} = config;
|
|
71
|
+
const { store, client, eventController, onUpdate, renderSegments } = config;
|
|
86
72
|
let version = config.version;
|
|
87
73
|
|
|
88
|
-
/**
|
|
89
|
-
* Replace the active app-shell snapshot atomically. Called by the partial
|
|
90
|
-
* updater when a response's routerId indicates the navigation crossed
|
|
91
|
-
* into a different app. Runs the local-only side-effects tied to
|
|
92
|
-
* app-shell fields (app version, rango-state namespace) so the new app
|
|
93
|
-
* owns them after the swap. Theme, warmup, and prefetch TTL are
|
|
94
|
-
* document-lifetime and are NOT touched here.
|
|
95
|
-
*/
|
|
96
|
-
function applyAppShell(next: AppShell): void {
|
|
97
|
-
if (appShellRef) {
|
|
98
|
-
appShellRef.update(next);
|
|
99
|
-
}
|
|
100
|
-
if (next.version !== undefined) {
|
|
101
|
-
version = next.version;
|
|
102
|
-
setAppVersion(next.version);
|
|
103
|
-
// Use the local-only setter — initRangoState writes the shared
|
|
104
|
-
// localStorage key and fires a storage event in other tabs still in
|
|
105
|
-
// the old app. setRangoStateLocal only mutates this tab's in-memory
|
|
106
|
-
// cache and rebinds it to the target app's routerId-scoped key,
|
|
107
|
-
// preserving the "local-only, no broadcast/rotation" contract for
|
|
108
|
-
// smooth app-switch transitions.
|
|
109
|
-
setRangoStateLocal(next.version, next.routerId);
|
|
110
|
-
}
|
|
111
|
-
// Cross-app: prior cache entries belong to a different app's segments.
|
|
112
|
-
// Drop them locally only — do NOT broadcast invalidation or rotate the
|
|
113
|
-
// shared X-Rango-State token, since other tabs still in the old app are
|
|
114
|
-
// unaffected by this tab's transition.
|
|
115
|
-
store.clearHistoryCacheLocal();
|
|
116
|
-
}
|
|
117
|
-
|
|
118
74
|
// Create shared partial updater
|
|
119
75
|
const fetchPartialUpdate = createPartialUpdater({
|
|
120
76
|
store,
|
|
@@ -122,7 +78,6 @@ export function createNavigationBridge(
|
|
|
122
78
|
onUpdate,
|
|
123
79
|
renderSegments,
|
|
124
80
|
getVersion: () => version,
|
|
125
|
-
applyAppShell,
|
|
126
81
|
});
|
|
127
82
|
|
|
128
83
|
return {
|
|
@@ -716,10 +671,6 @@ export function createNavigationBridge(
|
|
|
716
671
|
setAppVersion(newVersion);
|
|
717
672
|
store.clearHistoryCache();
|
|
718
673
|
},
|
|
719
|
-
|
|
720
|
-
updateAppShell(next: AppShell): void {
|
|
721
|
-
applyAppShell(next);
|
|
722
|
-
},
|
|
723
674
|
};
|
|
724
675
|
}
|
|
725
676
|
|
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
emptyResponse,
|
|
18
18
|
handleReloadHeader,
|
|
19
19
|
teeWithCompletion,
|
|
20
|
+
isForeignRouterId,
|
|
20
21
|
} from "./response-adapter.js";
|
|
21
22
|
import {
|
|
22
23
|
buildPrefetchKey,
|
|
@@ -181,6 +182,19 @@ export function createNavigationClient(
|
|
|
181
182
|
throw new ServerRedirect(redirect.url, undefined);
|
|
182
183
|
}
|
|
183
184
|
|
|
185
|
+
// Integrity check (pre-decode): refuse a foreign app's content response
|
|
186
|
+
// before createFromFetch imports its chunks. Ordered AFTER the reload
|
|
187
|
+
// and redirect handlers — control responses are never stamped with
|
|
188
|
+
// X-RSC-Router-Id, so they are steered first and never reach here.
|
|
189
|
+
if (isForeignRouterId(response, routerId)) {
|
|
190
|
+
if (tx) {
|
|
191
|
+
browserDebugLog(tx, `router id mismatch, reloading (${source})`);
|
|
192
|
+
}
|
|
193
|
+
resolveStreamComplete();
|
|
194
|
+
window.location.href = targetUrl;
|
|
195
|
+
return new Promise<Response>(() => {});
|
|
196
|
+
}
|
|
197
|
+
|
|
184
198
|
return response;
|
|
185
199
|
};
|
|
186
200
|
|
|
@@ -12,10 +12,7 @@ import type {
|
|
|
12
12
|
ActionStateListener,
|
|
13
13
|
HandleData,
|
|
14
14
|
} from "./types.js";
|
|
15
|
-
import {
|
|
16
|
-
clearPrefetchCache,
|
|
17
|
-
clearPrefetchCacheLocal,
|
|
18
|
-
} from "./prefetch/cache.js";
|
|
15
|
+
import { clearPrefetchCache } from "./prefetch/cache.js";
|
|
19
16
|
|
|
20
17
|
/**
|
|
21
18
|
* Default action state (idle with no payload)
|
|
@@ -337,18 +334,6 @@ export function createNavigationStore(
|
|
|
337
334
|
clearPrefetchCache();
|
|
338
335
|
}
|
|
339
336
|
|
|
340
|
-
/**
|
|
341
|
-
* Drop this tab's navigation + prefetch caches without broadcasting or
|
|
342
|
-
* rotating shared state. Used when the local session changes in a way that
|
|
343
|
-
* doesn't affect other tabs — e.g. this tab crosses into a different app
|
|
344
|
-
* via a cross-router navigation. Other tabs in the old app keep their
|
|
345
|
-
* caches and their X-Rango-State token.
|
|
346
|
-
*/
|
|
347
|
-
function clearCacheInternalLocal(): void {
|
|
348
|
-
historyCache.length = 0;
|
|
349
|
-
clearPrefetchCacheLocal();
|
|
350
|
-
}
|
|
351
|
-
|
|
352
337
|
/**
|
|
353
338
|
* Mark all cache entries as stale (internal - does not broadcast)
|
|
354
339
|
*/
|
|
@@ -682,15 +667,6 @@ export function createNavigationStore(
|
|
|
682
667
|
clearCacheAndBroadcast();
|
|
683
668
|
},
|
|
684
669
|
|
|
685
|
-
/**
|
|
686
|
-
* Drop this tab's navigation + prefetch caches locally without
|
|
687
|
-
* broadcasting or rotating shared state. Intended for cross-app
|
|
688
|
-
* transitions where the session state diverges for this tab only.
|
|
689
|
-
*/
|
|
690
|
-
clearHistoryCacheLocal(): void {
|
|
691
|
-
clearCacheInternalLocal();
|
|
692
|
-
},
|
|
693
|
-
|
|
694
670
|
/**
|
|
695
671
|
* Mark cache as stale and broadcast to other tabs
|
|
696
672
|
* Called after server actions - allows SWR pattern for popstate
|
|
@@ -61,13 +61,6 @@ export interface PartialUpdateConfig {
|
|
|
61
61
|
) => Promise<ReactNode> | ReactNode;
|
|
62
62
|
/** RSC version getter — returns the current version (may change after HMR) */
|
|
63
63
|
getVersion?: () => string | undefined;
|
|
64
|
-
/**
|
|
65
|
-
* Replace the active app-shell when a cross-app navigation is detected.
|
|
66
|
-
* Called before the full-update tree replacement renders, so the new
|
|
67
|
-
* payload's rootLayout, basename, and version are picked up. Theme,
|
|
68
|
-
* warmup, and prefetch TTL are not part of the shell — see AppShell.
|
|
69
|
-
*/
|
|
70
|
-
applyAppShell?: (next: import("./app-shell.js").AppShell) => void;
|
|
71
64
|
}
|
|
72
65
|
|
|
73
66
|
/**
|
|
@@ -137,7 +130,6 @@ export function createPartialUpdater(
|
|
|
137
130
|
onUpdate,
|
|
138
131
|
renderSegments,
|
|
139
132
|
getVersion = () => undefined,
|
|
140
|
-
applyAppShell,
|
|
141
133
|
} = config;
|
|
142
134
|
|
|
143
135
|
/**
|
|
@@ -245,30 +237,25 @@ export function createPartialUpdater(
|
|
|
245
237
|
streamingToken.end();
|
|
246
238
|
});
|
|
247
239
|
|
|
248
|
-
//
|
|
249
|
-
//
|
|
250
|
-
//
|
|
251
|
-
//
|
|
252
|
-
//
|
|
253
|
-
//
|
|
254
|
-
//
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
basename: payload.metadata.basename,
|
|
268
|
-
version: payload.metadata.version,
|
|
269
|
-
});
|
|
270
|
-
}
|
|
271
|
-
store.setRouterId?.(payload.metadata.routerId);
|
|
240
|
+
// Integrity guard (defense in depth). The server redirects on a cross-app
|
|
241
|
+
// routerId mismatch (X-RSC-Reload), so a partial payload's routerId must
|
|
242
|
+
// match this client's. If it doesn't — a stale/edge cache keyed without the
|
|
243
|
+
// routerId, a proxy mixing app responses, or a server classification bug —
|
|
244
|
+
// do NOT splice a foreign app's segments and client references into this
|
|
245
|
+
// document. Force a full reload so the server re-establishes the
|
|
246
|
+
// authoritative document for this URL.
|
|
247
|
+
const currentRouterId = store.getRouterId?.();
|
|
248
|
+
if (
|
|
249
|
+
payload.metadata?.routerId &&
|
|
250
|
+
currentRouterId &&
|
|
251
|
+
payload.metadata.routerId !== currentRouterId
|
|
252
|
+
) {
|
|
253
|
+
console.error(
|
|
254
|
+
`[rango] Partial response router id "${payload.metadata.routerId}" does not ` +
|
|
255
|
+
`match this client ("${currentRouterId}"); discarding it and reloading to re-sync.`,
|
|
256
|
+
);
|
|
257
|
+
window.location.href = url;
|
|
258
|
+
return;
|
|
272
259
|
}
|
|
273
260
|
|
|
274
261
|
// Handle server-side redirect with state
|
|
@@ -109,6 +109,21 @@ const inflightPromises = new Map<string, Promise<DecodedPrefetch | null>>();
|
|
|
109
109
|
*/
|
|
110
110
|
const inflightAliases = new Map<string, string[]>();
|
|
111
111
|
|
|
112
|
+
/**
|
|
113
|
+
* Keys whose in-flight prefetch promise was adopted by a navigation (via
|
|
114
|
+
* `consumeInflightPrefetch`). A `DecodedPrefetch` carries a single-use
|
|
115
|
+
* `metadata.handles` async generator; the adopter drains it. The same entry is
|
|
116
|
+
* also published to the `cache` map by `storePrefetch` when the fetch resolves
|
|
117
|
+
* — which runs AFTER adoption (adoption only succeeds while the fetch is still
|
|
118
|
+
* in flight, so the entry is not yet cached). Without this guard the adopted,
|
|
119
|
+
* now-drained entry would be left in the cache and served to a later navigation
|
|
120
|
+
* whose handle generator yields nothing, silently dropping that route's
|
|
121
|
+
* breadcrumbs. Recording the adopted keys lets `storePrefetch` skip publishing
|
|
122
|
+
* them, keeping the existing one-time-consumption contract (a consumed prefetch
|
|
123
|
+
* is gone; the next navigation re-fetches).
|
|
124
|
+
*/
|
|
125
|
+
const adoptedKeys = new Set<string>();
|
|
126
|
+
|
|
112
127
|
// Generation counter incremented on each clearPrefetchCache(). Fetches that
|
|
113
128
|
// started before a clear carry a stale generation and must not store their
|
|
114
129
|
// response (the data may be stale due to a server action invalidation).
|
|
@@ -225,11 +240,16 @@ export function consumeInflightPrefetch(
|
|
|
225
240
|
const promise = inflightPromises.get(key);
|
|
226
241
|
if (!promise) return null;
|
|
227
242
|
// Remove the promise under every alias so a second consumer cannot
|
|
228
|
-
// adopt the same stream and race on the body
|
|
229
|
-
//
|
|
230
|
-
//
|
|
231
|
-
//
|
|
232
|
-
|
|
243
|
+
// adopt the same stream and race on the body, and mark every alias as
|
|
244
|
+
// adopted so the pending `storePrefetch` (which resolves later, after this
|
|
245
|
+
// adoption) does not leave the now-owned, single-use entry in the cache map.
|
|
246
|
+
// `inflightAliases` is intentionally preserved — `clearPrefetchInflight()` in
|
|
247
|
+
// the fetch's `.finally()` still needs it to clear every inflight flag and
|
|
248
|
+
// adopted marker; deleting here would strand the sibling's flag forever.
|
|
249
|
+
forEachAlias(key, (k) => {
|
|
250
|
+
inflightPromises.delete(k);
|
|
251
|
+
adoptedKeys.add(k);
|
|
252
|
+
});
|
|
233
253
|
return promise;
|
|
234
254
|
}
|
|
235
255
|
|
|
@@ -247,6 +267,16 @@ export function storePrefetch(
|
|
|
247
267
|
if (cacheTTL <= 0) return;
|
|
248
268
|
if (fetchGeneration !== generation) return;
|
|
249
269
|
|
|
270
|
+
// If a navigation already adopted this prefetch's in-flight promise, it owns
|
|
271
|
+
// the single-use entry (and has drained its handle generator). Do NOT also
|
|
272
|
+
// publish it to the cache map, or a later navigation would be served the
|
|
273
|
+
// exhausted entry and lose that route's handles. Clear the marker (under all
|
|
274
|
+
// aliases) now that the decision is made.
|
|
275
|
+
if (adoptedKeys.has(key)) {
|
|
276
|
+
forEachAlias(key, (k) => adoptedKeys.delete(k));
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
279
|
+
|
|
250
280
|
// Evict expired entries
|
|
251
281
|
const now = Date.now();
|
|
252
282
|
for (const [k, cached] of cache) {
|
|
@@ -307,6 +337,9 @@ export function clearPrefetchInflight(key: string): void {
|
|
|
307
337
|
inflight.delete(k);
|
|
308
338
|
inflightPromises.delete(k);
|
|
309
339
|
inflightAliases.delete(k);
|
|
340
|
+
// Clear any adopted marker too, so a fetch that failed before storePrefetch
|
|
341
|
+
// (the marker's normal consumer) does not strand it across the next prefetch.
|
|
342
|
+
adoptedKeys.delete(k);
|
|
310
343
|
});
|
|
311
344
|
}
|
|
312
345
|
|
|
@@ -323,23 +356,8 @@ export function clearPrefetchCache(): void {
|
|
|
323
356
|
inflight.clear();
|
|
324
357
|
inflightPromises.clear();
|
|
325
358
|
inflightAliases.clear();
|
|
359
|
+
adoptedKeys.clear();
|
|
326
360
|
cache.clear();
|
|
327
361
|
abortAllPrefetches();
|
|
328
362
|
invalidateRangoState();
|
|
329
363
|
}
|
|
330
|
-
|
|
331
|
-
/**
|
|
332
|
-
* Drop all in-memory prefetch state for this tab without rotating rango-state.
|
|
333
|
-
*
|
|
334
|
-
* Use for local-only invalidations (e.g. app switch in this tab) where
|
|
335
|
-
* other tabs should NOT observe a state rotation. Unlike clearPrefetchCache,
|
|
336
|
-
* does not call invalidateRangoState, so the shared X-Rango-State token
|
|
337
|
-
* stays intact and siblings in the old app keep their prefetches.
|
|
338
|
-
*/
|
|
339
|
-
export function clearPrefetchCacheLocal(): void {
|
|
340
|
-
generation++;
|
|
341
|
-
inflight.clear();
|
|
342
|
-
inflightPromises.clear();
|
|
343
|
-
cache.clear();
|
|
344
|
-
abortAllPrefetches();
|
|
345
|
-
}
|
|
@@ -30,7 +30,7 @@ import { getRangoState } from "../rango-state.js";
|
|
|
30
30
|
import { enqueuePrefetch } from "./queue.js";
|
|
31
31
|
import { shouldPrefetch } from "./policy.js";
|
|
32
32
|
import { debugLog } from "../logging.js";
|
|
33
|
-
import { teeWithCompletion } from "../response-adapter.js";
|
|
33
|
+
import { teeWithCompletion, isForeignRouterId } from "../response-adapter.js";
|
|
34
34
|
import type { RscPayload } from "../types.js";
|
|
35
35
|
|
|
36
36
|
/**
|
|
@@ -139,6 +139,7 @@ function executePrefetchFetch(
|
|
|
139
139
|
sourceKey: string,
|
|
140
140
|
fetchUrl: string,
|
|
141
141
|
forceSourceScope: boolean,
|
|
142
|
+
expectedRouterId?: string,
|
|
142
143
|
signal?: AbortSignal,
|
|
143
144
|
): Promise<DecodedPrefetch | null> {
|
|
144
145
|
const gen = currentGeneration();
|
|
@@ -166,6 +167,12 @@ function executePrefetchFetch(
|
|
|
166
167
|
) {
|
|
167
168
|
return null;
|
|
168
169
|
}
|
|
170
|
+
// Integrity check: never warm (or decode/import the chunks of) a foreign
|
|
171
|
+
// app's payload. A speculative prefetch must never reload — just drop it;
|
|
172
|
+
// navigation re-fetches and the server steers it.
|
|
173
|
+
if (isForeignRouterId(response, expectedRouterId)) {
|
|
174
|
+
return null;
|
|
175
|
+
}
|
|
169
176
|
|
|
170
177
|
const scope: "source" | "wildcard" =
|
|
171
178
|
forceSourceScope ||
|
|
@@ -282,6 +289,7 @@ export function prefetchDirect(
|
|
|
282
289
|
sourceKey,
|
|
283
290
|
targetUrl.toString(),
|
|
284
291
|
forceSourceScope,
|
|
292
|
+
routerId,
|
|
285
293
|
);
|
|
286
294
|
}
|
|
287
295
|
|
|
@@ -334,6 +342,7 @@ export function prefetchQueued(
|
|
|
334
342
|
sourceKey,
|
|
335
343
|
fetchUrlStr,
|
|
336
344
|
forceSourceScope,
|
|
345
|
+
routerId,
|
|
337
346
|
signal,
|
|
338
347
|
).then(() => {});
|
|
339
348
|
});
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
* Storage key is namespaced per routerId (`rango-state:{routerId}`) so
|
|
14
14
|
* tabs in different apps on the same origin do not collide. Two tabs in
|
|
15
15
|
* the same app share a key → one tab's invalidation is picked up by the
|
|
16
|
-
* other via the `storage` event.
|
|
17
|
-
*
|
|
18
|
-
*
|
|
16
|
+
* other via the `storage` event. The key is bound once at document init; a
|
|
17
|
+
* cross-app navigation is a full document load (X-RSC-Reload), so the target
|
|
18
|
+
* app's document binds its own key on load (tabs in the old app keep theirs).
|
|
19
19
|
*
|
|
20
20
|
* If no routerId is supplied, falls back to a single legacy key for
|
|
21
21
|
* backward compatibility (single-app deployments unaffected).
|
|
@@ -31,10 +31,9 @@ function buildStorageKey(routerId: string | undefined): string {
|
|
|
31
31
|
// Initialized from localStorage on first access or by initRangoState().
|
|
32
32
|
let cachedState: string | null = null;
|
|
33
33
|
|
|
34
|
-
// The localStorage key this tab is currently bound to.
|
|
35
|
-
// initRangoState (document boot)
|
|
36
|
-
//
|
|
37
|
-
// events from tabs in a different app are ignored.
|
|
34
|
+
// The localStorage key this tab is currently bound to. Bound on
|
|
35
|
+
// initRangoState (document boot). The storage listener filters cross-tab
|
|
36
|
+
// events by this key so events from tabs in a different app are ignored.
|
|
38
37
|
let currentStorageKey: string = LEGACY_STORAGE_KEY;
|
|
39
38
|
|
|
40
39
|
// Cross-tab sync: the `storage` event fires in OTHER tabs when one tab writes
|
|
@@ -114,21 +113,6 @@ export function getRangoState(): string {
|
|
|
114
113
|
return "0:0";
|
|
115
114
|
}
|
|
116
115
|
|
|
117
|
-
/**
|
|
118
|
-
* Update the in-memory rango-state to a new version WITHOUT writing
|
|
119
|
-
* localStorage. Intended for smooth cross-app transitions in this tab only:
|
|
120
|
-
* subsequent requests from this tab send the new token, but other tabs
|
|
121
|
-
* still in the previous app do not observe a storage event. Rebinds this
|
|
122
|
-
* tab's storage key to the target app's namespace (`rango-state:{routerId}`)
|
|
123
|
-
* so subsequent storage events only reflect the new app. On the next hard
|
|
124
|
-
* reload, initRangoState reconciles localStorage from the server's
|
|
125
|
-
* authoritative version.
|
|
126
|
-
*/
|
|
127
|
-
export function setRangoStateLocal(version: string, routerId?: string): void {
|
|
128
|
-
currentStorageKey = buildStorageKey(routerId);
|
|
129
|
-
cachedState = `${version}:${Date.now()}`;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
116
|
/**
|
|
133
117
|
* Invalidate the Rango state key. Called when server actions mutate data.
|
|
134
118
|
* Updates the timestamp portion while keeping the version prefix.
|
|
@@ -157,9 +157,11 @@ export interface NavigationProviderProps {
|
|
|
157
157
|
basename?: string;
|
|
158
158
|
|
|
159
159
|
/**
|
|
160
|
-
*
|
|
161
|
-
*
|
|
162
|
-
*
|
|
160
|
+
* App-shell ref. When provided, the context's `basename` and `version` are
|
|
161
|
+
* read through it (live getters) so they don't close over a stale snapshot or
|
|
162
|
+
* invalidate the memoized context value. The shell is set once at init and is
|
|
163
|
+
* not swapped within a session — a cross-app navigation is a full document
|
|
164
|
+
* load (X-RSC-Reload), so the target app establishes its own shell on load.
|
|
163
165
|
*/
|
|
164
166
|
appShellRef?: AppShellRef;
|
|
165
167
|
}
|
|
@@ -218,8 +220,9 @@ export function NavigationProvider({
|
|
|
218
220
|
}, []);
|
|
219
221
|
|
|
220
222
|
// basename/version are always read through a shell ref so the context value
|
|
221
|
-
// has a single shape: a supplied appShellRef
|
|
222
|
-
//
|
|
223
|
+
// has a single shape. Both are set once: a supplied appShellRef is seeded
|
|
224
|
+
// from the init payload (a cross-app navigation reloads, so it is not swapped
|
|
225
|
+
// in-session), and the standalone fallback wraps the mount-time props.
|
|
223
226
|
const fallbackShellRef = useRef<AppShellRef | null>(null);
|
|
224
227
|
if (!fallbackShellRef.current) {
|
|
225
228
|
fallbackShellRef.current = createAppShellRef({ basename, version });
|
|
@@ -436,10 +439,10 @@ export function NavigationProvider({
|
|
|
436
439
|
let content = <RootErrorBoundary>{root}</RootErrorBoundary>;
|
|
437
440
|
|
|
438
441
|
// Wrap with ThemeProvider when theme is enabled. The ThemeProvider is
|
|
439
|
-
// document-lifetime: its config comes from the initial load and
|
|
440
|
-
//
|
|
441
|
-
//
|
|
442
|
-
//
|
|
442
|
+
// document-lifetime: its config comes from the initial load and persists for
|
|
443
|
+
// the session. It sits above the segment tree and is not remounted in-session;
|
|
444
|
+
// a cross-app navigation is a full document load (X-RSC-Reload), so the target
|
|
445
|
+
// app's theme config takes effect on its own load.
|
|
443
446
|
if (themeConfig) {
|
|
444
447
|
content = (
|
|
445
448
|
<ThemeProvider config={themeConfig} initialTheme={initialTheme}>
|
|
@@ -13,9 +13,10 @@ import type { RouterInstance, RouterNavigateOptions } from "../types.js";
|
|
|
13
13
|
* useRouter() do not re-render on navigation state changes.
|
|
14
14
|
* For reactive navigation state, use useNavigation() instead.
|
|
15
15
|
*
|
|
16
|
-
* Methods read `basename` from the
|
|
17
|
-
*
|
|
18
|
-
*
|
|
16
|
+
* Methods read `basename` from the context on each call. It is set once from
|
|
17
|
+
* the initial payload and is stable within a session — a cross-app navigation
|
|
18
|
+
* is a full document load (X-RSC-Reload), so the target app mounts fresh with
|
|
19
|
+
* its own basename.
|
|
19
20
|
*
|
|
20
21
|
* @example
|
|
21
22
|
* ```tsx
|