@rangojs/router 0.0.0-experimental.116 → 0.0.0-experimental.118
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 +18 -17
- package/skills/css/SKILL.md +76 -0
- package/skills/host-router/SKILL.md +21 -0
- package/skills/loader/SKILL.md +17 -17
- 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 +70 -68
- package/src/browser/navigation-store.ts +1 -25
- package/src/browser/partial-update.ts +19 -32
- package/src/browser/prefetch/cache.ts +97 -48
- package/src/browser/prefetch/fetch.ts +101 -33
- 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 +27 -1
- package/src/browser/rsc-router.tsx +20 -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 +4 -4
- 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/lazy-includes.ts +1 -1
- package/src/router/loader-resolution.ts +63 -34
- package/src/router/manifest.ts +1 -1
- 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/server/context.ts +32 -0
- package/src/server/request-context.ts +47 -9
- package/src/types/loader-types.ts +6 -3
- 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
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: css
|
|
3
|
+
description: Import and apply CSS in a Rango app. Render document/app stylesheets in the Document `<head>` with Vite's `?url` import plus a `precedence`-managed `<link rel="stylesheet">` (React 19 resource model — deduped, ordered, loaded before paint). Use when wiring global/app CSS or a Document `<head>` stylesheet, or when deciding between `?url` + `<link>` and side-effect imports. Cross-app (host-router) navigation is a full document load, so each app's document CSS is always re-established by its own load.
|
|
4
|
+
argument-hint:
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# CSS imports
|
|
8
|
+
|
|
9
|
+
Document/app CSS in Rango lives in the Document `<head>`, loaded with Vite's
|
|
10
|
+
`?url` import and a `precedence`-managed `<link rel="stylesheet">`. This page is
|
|
11
|
+
the why and the one cross-app caveat; `/tailwind` is the concrete setup, `/theme`
|
|
12
|
+
is dark mode, `/fonts` is fonts.
|
|
13
|
+
|
|
14
|
+
## The pattern
|
|
15
|
+
|
|
16
|
+
```tsx
|
|
17
|
+
// document.tsx
|
|
18
|
+
"use client";
|
|
19
|
+
|
|
20
|
+
import type { ReactNode } from "react";
|
|
21
|
+
import { MetaTags } from "@rangojs/router/client";
|
|
22
|
+
import styles from "./index.css?url";
|
|
23
|
+
|
|
24
|
+
export function Document({ children }: { children: ReactNode }) {
|
|
25
|
+
return (
|
|
26
|
+
<html lang="en">
|
|
27
|
+
<head>
|
|
28
|
+
<link rel="preload" href={styles} as="style" precedence="default" />
|
|
29
|
+
<link rel="stylesheet" href={styles} precedence="default" />
|
|
30
|
+
<MetaTags />
|
|
31
|
+
</head>
|
|
32
|
+
<body>{children}</body>
|
|
33
|
+
</html>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
- **`?url`** returns the processed file's hashed URL instead of injecting it as a
|
|
39
|
+
side effect, giving a stable asset path that works in dev and production.
|
|
40
|
+
- **`precedence`** opts the `<link rel="stylesheet">` into React 19's managed
|
|
41
|
+
stylesheet model: React de-duplicates it by `href`, orders it by precedence
|
|
42
|
+
(any string value — it only decides cascade order relative to other managed
|
|
43
|
+
sheets), and loads it **before paint**, so there is no flash of unstyled
|
|
44
|
+
content. This is the recommended way to render a stylesheet link.
|
|
45
|
+
|
|
46
|
+
## Cross-app (host-router) navigation
|
|
47
|
+
|
|
48
|
+
You do **not** need to coordinate CSS across apps mounted under one host router.
|
|
49
|
+
A client-side navigation that crosses an app boundary is a **full document load**
|
|
50
|
+
(the server returns `X-RSC-Reload` on an app switch — see `/host-router`), so the
|
|
51
|
+
target app's entire document — its stylesheets, theme, meta — is re-established
|
|
52
|
+
by the target app's own load. Each app owns its document; how one app renders a
|
|
53
|
+
stylesheet has no effect on another.
|
|
54
|
+
|
|
55
|
+
(This replaced an earlier soft cross-app swap. Under it, a stylesheet shared
|
|
56
|
+
across apps by `href` — classically every app's `@import "tailwindcss"` compiling
|
|
57
|
+
to one hashed asset — could be silently dropped by React's by-`href` resource
|
|
58
|
+
dedup when the apps disagreed on `precedence` (one unmanaged, one managed). The
|
|
59
|
+
full reload removes that footgun entirely, which is the main reason cross-app
|
|
60
|
+
navigation is a hard boundary.)
|
|
61
|
+
|
|
62
|
+
## Side-effect imports vs `?url`
|
|
63
|
+
|
|
64
|
+
A bare `import "./index.css"` (no `?url`, no `<link>`) also produces _managed_ CSS
|
|
65
|
+
— `@vitejs/plugin-rsc` collects it via `import.meta.viteRsc.loadCss` and injects
|
|
66
|
+
it with a precedence. It is fine for **component-local** CSS that loads with its
|
|
67
|
+
client chunk. For **document-level** CSS, prefer the `?url` + `<link precedence>`
|
|
68
|
+
form above: a side-effect import is not guaranteed to be in the initial streamed
|
|
69
|
+
`<head>` (an SSR-streaming caveat), whereas the explicit `<link>` is.
|
|
70
|
+
|
|
71
|
+
## Related
|
|
72
|
+
|
|
73
|
+
- `/tailwind` — Tailwind v4 setup using this pattern.
|
|
74
|
+
- `/host-router` — multi-app routing; why cross-app navigation is a full reload.
|
|
75
|
+
- `/theme` — dark mode / theme attribute.
|
|
76
|
+
- `/fonts` — self-hosted fonts via `@fontsource`.
|
|
@@ -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/loader/SKILL.md
CHANGED
|
@@ -160,23 +160,23 @@ Loaders receive the same context shape as route handlers.
|
|
|
160
160
|
|
|
161
161
|
### Full field surface
|
|
162
162
|
|
|
163
|
-
| Field | Type | Notes
|
|
164
|
-
| -------------- | ------------------------------ |
|
|
165
|
-
| `params` | `TParams` | Merged route + explicit loader params; overridable by fetchable `load({ params })`.
|
|
166
|
-
| `routeParams` | `Record<string, string>` | Server-trusted route params from URL pattern matching; cannot be overridden.
|
|
167
|
-
| `request` | `Request` | The incoming `Request` (headers, method, body, `signal` for abort).
|
|
168
|
-
| `url` | `URL` | Parsed request URL.
|
|
169
|
-
| `pathname` | `string` | URL pathname (shortcut for `ctx.url.pathname`).
|
|
170
|
-
| `searchParams` | `URLSearchParams` | Shortcut for `ctx.url.searchParams`.
|
|
171
|
-
| `search` | `ResolveSearchSchema<TSearch>` | Typed query params when a search schema is declared on the route; `{}` otherwise.
|
|
172
|
-
| `env` | `TEnv` | Plain bindings from `createRouter<TEnv>()` (DB, KV, secrets, etc.).
|
|
173
|
-
| `get` | `(key \| ContextVar) => value` | Reads variables/context-vars set by middleware.
|
|
174
|
-
| `use` | `(loader \| handle) => T` | Access another loader's data (Promise) or a handle's collected data (after `await ctx.rendered()`).
|
|
175
|
-
| `rendered` | `() => Promise<void>` | **Experimental.** DSL loaders only — waits for non-loader segments before reading handle data.
|
|
176
|
-
| `method` | `string` | HTTP method. `"GET"` for SSR loader runs; reflects real method for fetchable loaders.
|
|
177
|
-
| `body` | `TBody \| undefined` | Parsed request body for fetchable POST/PUT/PATCH/DELETE calls.
|
|
178
|
-
| `formData` | `FormData \| undefined` | Present when a fetchable loader is invoked via form submission.
|
|
179
|
-
| `reverse` | `ScopedReverseFunction` | Generate type-checked URLs from route names (same scoped semantics as route handlers).
|
|
163
|
+
| Field | Type | Notes |
|
|
164
|
+
| -------------- | ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
165
|
+
| `params` | `TParams` | Merged route + explicit loader params; overridable by fetchable `load({ params })`. |
|
|
166
|
+
| `routeParams` | `Record<string, string>` | Server-trusted route params from URL pattern matching; cannot be overridden. |
|
|
167
|
+
| `request` | `Request` | The incoming `Request` (headers, method, body, `signal` for abort). |
|
|
168
|
+
| `url` | `URL` | Parsed request URL. |
|
|
169
|
+
| `pathname` | `string` | URL pathname (shortcut for `ctx.url.pathname`). |
|
|
170
|
+
| `searchParams` | `URLSearchParams` | Shortcut for `ctx.url.searchParams`. |
|
|
171
|
+
| `search` | `ResolveSearchSchema<TSearch>` | Typed query params when a search schema is declared on the route; `{}` otherwise. |
|
|
172
|
+
| `env` | `TEnv` | Plain bindings from `createRouter<TEnv>()` (DB, KV, secrets, etc.). |
|
|
173
|
+
| `get` | `(key \| ContextVar) => value` | Reads variables/context-vars set by middleware. |
|
|
174
|
+
| `use` | `(loader \| handle) => T` | Access another loader's data (Promise) or a handle's collected data (after `await ctx.rendered()`). |
|
|
175
|
+
| `rendered` | `() => Promise<void>` | **Experimental.** DSL loaders only — waits for all non-loader segments (including `loading()` streaming handlers) to settle before reading handle data. |
|
|
176
|
+
| `method` | `string` | HTTP method. `"GET"` for SSR loader runs; reflects real method for fetchable loaders. |
|
|
177
|
+
| `body` | `TBody \| undefined` | Parsed request body for fetchable POST/PUT/PATCH/DELETE calls. |
|
|
178
|
+
| `formData` | `FormData \| undefined` | Present when a fetchable loader is invoked via form submission. |
|
|
179
|
+
| `reverse` | `ScopedReverseFunction` | Generate type-checked URLs from route names (same scoped semantics as route handlers). |
|
|
180
180
|
|
|
181
181
|
### Example
|
|
182
182
|
|
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,12 +17,14 @@ import {
|
|
|
17
17
|
emptyResponse,
|
|
18
18
|
handleReloadHeader,
|
|
19
19
|
teeWithCompletion,
|
|
20
|
+
isForeignRouterId,
|
|
20
21
|
} from "./response-adapter.js";
|
|
21
22
|
import {
|
|
22
23
|
buildPrefetchKey,
|
|
23
24
|
buildSourceKey,
|
|
24
25
|
consumeInflightPrefetch,
|
|
25
26
|
consumePrefetch,
|
|
27
|
+
type DecodedPrefetch,
|
|
26
28
|
} from "./prefetch/cache.js";
|
|
27
29
|
|
|
28
30
|
/**
|
|
@@ -111,26 +113,26 @@ export function createNavigationClient(
|
|
|
111
113
|
const wildcardKey = buildPrefetchKey(rangoState, fetchUrl);
|
|
112
114
|
const cacheKey = buildSourceKey(rangoState, previousUrl, fetchUrl);
|
|
113
115
|
|
|
114
|
-
let
|
|
116
|
+
let cachedEntry: DecodedPrefetch | null = null;
|
|
115
117
|
let hitKey: string | null = null;
|
|
116
118
|
if (canUsePrefetch) {
|
|
117
|
-
|
|
118
|
-
if (
|
|
119
|
+
cachedEntry = consumePrefetch(cacheKey);
|
|
120
|
+
if (cachedEntry) {
|
|
119
121
|
hitKey = cacheKey;
|
|
120
122
|
} else {
|
|
121
|
-
|
|
122
|
-
if (
|
|
123
|
+
cachedEntry = consumePrefetch(wildcardKey);
|
|
124
|
+
if (cachedEntry) hitKey = wildcardKey;
|
|
123
125
|
}
|
|
124
126
|
}
|
|
125
127
|
|
|
126
|
-
let
|
|
127
|
-
if (canUsePrefetch && !
|
|
128
|
-
|
|
129
|
-
if (
|
|
128
|
+
let inflightEntryPromise: Promise<DecodedPrefetch | null> | null = null;
|
|
129
|
+
if (canUsePrefetch && !cachedEntry) {
|
|
130
|
+
inflightEntryPromise = consumeInflightPrefetch(cacheKey);
|
|
131
|
+
if (inflightEntryPromise) {
|
|
130
132
|
hitKey = cacheKey;
|
|
131
133
|
} else {
|
|
132
|
-
|
|
133
|
-
if (
|
|
134
|
+
inflightEntryPromise = consumeInflightPrefetch(wildcardKey);
|
|
135
|
+
if (inflightEntryPromise) hitKey = wildcardKey;
|
|
134
136
|
}
|
|
135
137
|
}
|
|
136
138
|
// Track when the stream completes
|
|
@@ -180,6 +182,19 @@ export function createNavigationClient(
|
|
|
180
182
|
throw new ServerRedirect(redirect.url, undefined);
|
|
181
183
|
}
|
|
182
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
|
+
|
|
183
198
|
return response;
|
|
184
199
|
};
|
|
185
200
|
|
|
@@ -217,29 +232,32 @@ export function createNavigationClient(
|
|
|
217
232
|
});
|
|
218
233
|
};
|
|
219
234
|
|
|
220
|
-
|
|
235
|
+
// A warm prefetch hit returns its eagerly-decoded payload directly: the
|
|
236
|
+
// route's chunks were imported during the prefetch, so this click runs
|
|
237
|
+
// no decode and no network. Only the fresh path runs createFromFetch and
|
|
238
|
+
// resolves the local streamComplete (via doFreshFetch's teeWithCompletion
|
|
239
|
+
// and the control-header short-circuits in validateRscHeaders).
|
|
240
|
+
const freshResult = (): {
|
|
241
|
+
payload: Promise<RscPayload>;
|
|
242
|
+
streamComplete: Promise<void>;
|
|
243
|
+
} => ({
|
|
244
|
+
payload: deps.createFromFetch<RscPayload>(doFreshFetch()),
|
|
245
|
+
streamComplete,
|
|
246
|
+
});
|
|
247
|
+
|
|
248
|
+
let payloadPromise: Promise<RscPayload>;
|
|
249
|
+
let streamCompletePromise: Promise<void>;
|
|
221
250
|
|
|
222
|
-
if (
|
|
251
|
+
if (cachedEntry) {
|
|
223
252
|
if (tx) {
|
|
224
|
-
browserDebugLog(tx, "prefetch cache hit", {
|
|
253
|
+
browserDebugLog(tx, "prefetch cache hit (warm)", {
|
|
225
254
|
key: hitKey,
|
|
226
255
|
wildcard: hitKey === wildcardKey,
|
|
227
256
|
});
|
|
228
257
|
}
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
return teeWithCompletion(
|
|
234
|
-
validated,
|
|
235
|
-
() => {
|
|
236
|
-
if (tx) browserDebugLog(tx, "stream complete (from cache)");
|
|
237
|
-
resolveStreamComplete();
|
|
238
|
-
},
|
|
239
|
-
signal,
|
|
240
|
-
);
|
|
241
|
-
});
|
|
242
|
-
} else if (inflightResponsePromise) {
|
|
258
|
+
payloadPromise = cachedEntry.payload;
|
|
259
|
+
streamCompletePromise = cachedEntry.streamComplete;
|
|
260
|
+
} else if (inflightEntryPromise) {
|
|
243
261
|
if (tx) {
|
|
244
262
|
browserDebugLog(tx, "reusing inflight prefetch", {
|
|
245
263
|
key: hitKey,
|
|
@@ -247,51 +265,35 @@ export function createNavigationClient(
|
|
|
247
265
|
});
|
|
248
266
|
}
|
|
249
267
|
const adoptedViaWildcard = hitKey === wildcardKey;
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
}
|
|
255
|
-
return doFreshFetch();
|
|
268
|
+
const entry = await inflightEntryPromise;
|
|
269
|
+
if (!entry) {
|
|
270
|
+
if (tx) {
|
|
271
|
+
browserDebugLog(tx, "inflight prefetch unavailable, refetching");
|
|
256
272
|
}
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
//
|
|
261
|
-
// a different source page. Discard and refetch.
|
|
262
|
-
if (
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
browserDebugLog(
|
|
268
|
-
tx,
|
|
269
|
-
"wildcard inflight turned out source-scoped, refetching",
|
|
270
|
-
);
|
|
271
|
-
}
|
|
272
|
-
return doFreshFetch();
|
|
273
|
+
({ payload: payloadPromise, streamComplete: streamCompletePromise } =
|
|
274
|
+
freshResult());
|
|
275
|
+
} else if (adoptedViaWildcard && entry.scope === "source") {
|
|
276
|
+
// A wildcard-adopted inflight that turned out source-scoped was
|
|
277
|
+
// built for a different source page. Discard and refetch.
|
|
278
|
+
if (tx) {
|
|
279
|
+
browserDebugLog(
|
|
280
|
+
tx,
|
|
281
|
+
"wildcard inflight turned out source-scoped, refetching",
|
|
282
|
+
);
|
|
273
283
|
}
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
() => {
|
|
281
|
-
if (tx) {
|
|
282
|
-
browserDebugLog(tx, "stream complete (from inflight prefetch)");
|
|
283
|
-
}
|
|
284
|
-
resolveStreamComplete();
|
|
285
|
-
},
|
|
286
|
-
signal,
|
|
287
|
-
);
|
|
288
|
-
});
|
|
284
|
+
({ payload: payloadPromise, streamComplete: streamCompletePromise } =
|
|
285
|
+
freshResult());
|
|
286
|
+
} else {
|
|
287
|
+
payloadPromise = entry.payload;
|
|
288
|
+
streamCompletePromise = entry.streamComplete;
|
|
289
|
+
}
|
|
289
290
|
} else {
|
|
290
|
-
|
|
291
|
+
({ payload: payloadPromise, streamComplete: streamCompletePromise } =
|
|
292
|
+
freshResult());
|
|
291
293
|
}
|
|
292
294
|
|
|
293
295
|
try {
|
|
294
|
-
const payload = await
|
|
296
|
+
const payload = await payloadPromise;
|
|
295
297
|
|
|
296
298
|
if (tx) {
|
|
297
299
|
browserDebugLog(tx, "response received", {
|
|
@@ -300,7 +302,7 @@ export function createNavigationClient(
|
|
|
300
302
|
diffCount: payload.metadata?.diff?.length ?? 0,
|
|
301
303
|
});
|
|
302
304
|
}
|
|
303
|
-
return { payload, streamComplete };
|
|
305
|
+
return { payload, streamComplete: streamCompletePromise };
|
|
304
306
|
} catch (error) {
|
|
305
307
|
// Convert network-level errors to NetworkError for proper handling
|
|
306
308
|
if (isNetworkError(error)) {
|
|
@@ -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
|