@rangojs/router 0.0.0-experimental.c65e9248 → 0.0.0-experimental.c873df95
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 +3 -0
- package/dist/bin/rango.js.map +1 -0
- package/dist/browser/event-controller.d.ts +191 -0
- package/dist/browser/event-controller.d.ts.map +1 -0
- package/dist/browser/event-controller.js +559 -0
- package/dist/browser/event-controller.js.map +1 -0
- package/dist/browser/index.d.ts +2 -0
- package/dist/browser/index.d.ts.map +1 -0
- package/dist/browser/index.js +14 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/browser/link-interceptor.d.ts +38 -0
- package/dist/browser/link-interceptor.d.ts.map +1 -0
- package/dist/browser/link-interceptor.js +99 -0
- package/dist/browser/link-interceptor.js.map +1 -0
- package/dist/browser/logging.d.ts +10 -0
- package/dist/browser/logging.d.ts.map +1 -0
- package/dist/browser/logging.js +29 -0
- package/dist/browser/logging.js.map +1 -0
- package/dist/browser/lru-cache.d.ts +17 -0
- package/dist/browser/lru-cache.d.ts.map +1 -0
- package/dist/browser/lru-cache.js +50 -0
- package/dist/browser/lru-cache.js.map +1 -0
- package/dist/browser/merge-segment-loaders.d.ts +39 -0
- package/dist/browser/merge-segment-loaders.d.ts.map +1 -0
- package/dist/browser/merge-segment-loaders.js +102 -0
- package/dist/browser/merge-segment-loaders.js.map +1 -0
- package/dist/browser/navigation-bridge.d.ts +102 -0
- package/dist/browser/navigation-bridge.d.ts.map +1 -0
- package/dist/browser/navigation-bridge.js +708 -0
- package/dist/browser/navigation-bridge.js.map +1 -0
- package/dist/browser/navigation-client.d.ts +25 -0
- package/dist/browser/navigation-client.d.ts.map +1 -0
- package/dist/browser/navigation-client.js +157 -0
- package/dist/browser/navigation-client.js.map +1 -0
- package/dist/browser/navigation-store.d.ts +101 -0
- package/dist/browser/navigation-store.d.ts.map +1 -0
- package/dist/browser/navigation-store.js +625 -0
- package/dist/browser/navigation-store.js.map +1 -0
- package/dist/browser/partial-update.d.ts +75 -0
- package/dist/browser/partial-update.d.ts.map +1 -0
- package/dist/browser/partial-update.js +426 -0
- package/dist/browser/partial-update.js.map +1 -0
- package/dist/browser/react/Link.d.ts +86 -0
- package/dist/browser/react/Link.d.ts.map +1 -0
- package/dist/browser/react/Link.js +128 -0
- package/dist/browser/react/Link.js.map +1 -0
- package/dist/browser/react/NavigationProvider.d.ts +63 -0
- package/dist/browser/react/NavigationProvider.d.ts.map +1 -0
- package/dist/browser/react/NavigationProvider.js +216 -0
- package/dist/browser/react/NavigationProvider.js.map +1 -0
- package/dist/browser/react/ScrollRestoration.d.ts +75 -0
- package/dist/browser/react/ScrollRestoration.d.ts.map +1 -0
- package/dist/browser/react/ScrollRestoration.js +57 -0
- package/dist/browser/react/ScrollRestoration.js.map +1 -0
- package/dist/browser/react/context.d.ts +46 -0
- package/dist/browser/react/context.d.ts.map +1 -0
- package/dist/browser/react/context.js +10 -0
- package/dist/browser/react/context.js.map +1 -0
- package/dist/browser/react/index.d.ts +11 -0
- package/dist/browser/react/index.d.ts.map +1 -0
- package/dist/browser/react/index.js +22 -0
- package/dist/browser/react/index.js.map +1 -0
- package/dist/browser/react/location-state-shared.d.ts +63 -0
- package/dist/browser/react/location-state-shared.d.ts.map +1 -0
- package/dist/browser/react/location-state-shared.js +81 -0
- package/dist/browser/react/location-state-shared.js.map +1 -0
- package/dist/browser/react/location-state.d.ts +23 -0
- package/dist/browser/react/location-state.d.ts.map +1 -0
- package/dist/browser/react/location-state.js +29 -0
- package/dist/browser/react/location-state.js.map +1 -0
- package/dist/browser/react/mount-context.d.ts +24 -0
- package/dist/browser/react/mount-context.d.ts.map +1 -0
- package/dist/browser/react/mount-context.js +24 -0
- package/dist/browser/react/mount-context.js.map +1 -0
- package/dist/browser/react/use-action.d.ts +64 -0
- package/dist/browser/react/use-action.d.ts.map +1 -0
- package/dist/browser/react/use-action.js +134 -0
- package/dist/browser/react/use-action.js.map +1 -0
- package/dist/browser/react/use-client-cache.d.ts +41 -0
- package/dist/browser/react/use-client-cache.d.ts.map +1 -0
- package/dist/browser/react/use-client-cache.js +39 -0
- package/dist/browser/react/use-client-cache.js.map +1 -0
- package/dist/browser/react/use-handle.d.ts +31 -0
- package/dist/browser/react/use-handle.d.ts.map +1 -0
- package/dist/browser/react/use-handle.js +144 -0
- package/dist/browser/react/use-handle.js.map +1 -0
- package/dist/browser/react/use-href.d.ts +33 -0
- package/dist/browser/react/use-href.d.ts.map +1 -0
- package/dist/browser/react/use-href.js +39 -0
- package/dist/browser/react/use-href.js.map +1 -0
- package/dist/browser/react/use-link-status.d.ts +37 -0
- package/dist/browser/react/use-link-status.d.ts.map +1 -0
- package/dist/browser/react/use-link-status.js +99 -0
- package/dist/browser/react/use-link-status.js.map +1 -0
- package/dist/browser/react/use-mount.d.ts +25 -0
- package/dist/browser/react/use-mount.d.ts.map +1 -0
- package/dist/browser/react/use-mount.js +30 -0
- package/dist/browser/react/use-mount.js.map +1 -0
- package/dist/browser/react/use-navigation.d.ts +27 -0
- package/dist/browser/react/use-navigation.d.ts.map +1 -0
- package/dist/browser/react/use-navigation.js +87 -0
- package/dist/browser/react/use-navigation.js.map +1 -0
- package/dist/browser/react/use-segments.d.ts +38 -0
- package/dist/browser/react/use-segments.d.ts.map +1 -0
- package/dist/browser/react/use-segments.js +130 -0
- package/dist/browser/react/use-segments.js.map +1 -0
- package/dist/browser/request-controller.d.ts +26 -0
- package/dist/browser/request-controller.d.ts.map +1 -0
- package/dist/browser/request-controller.js +147 -0
- package/dist/browser/request-controller.js.map +1 -0
- package/dist/browser/rsc-router.d.ts +129 -0
- package/dist/browser/rsc-router.d.ts.map +1 -0
- package/dist/browser/rsc-router.js +195 -0
- package/dist/browser/rsc-router.js.map +1 -0
- package/dist/browser/scroll-restoration.d.ts +93 -0
- package/dist/browser/scroll-restoration.d.ts.map +1 -0
- package/dist/browser/scroll-restoration.js +321 -0
- package/dist/browser/scroll-restoration.js.map +1 -0
- package/dist/browser/segment-structure-assert.d.ts +17 -0
- package/dist/browser/segment-structure-assert.d.ts.map +1 -0
- package/dist/browser/segment-structure-assert.js +59 -0
- package/dist/browser/segment-structure-assert.js.map +1 -0
- package/dist/browser/server-action-bridge.d.ts +26 -0
- package/dist/browser/server-action-bridge.d.ts.map +1 -0
- package/dist/browser/server-action-bridge.js +668 -0
- package/dist/browser/server-action-bridge.js.map +1 -0
- package/dist/browser/shallow.d.ts +12 -0
- package/dist/browser/shallow.d.ts.map +1 -0
- package/dist/browser/shallow.js +34 -0
- package/dist/browser/shallow.js.map +1 -0
- package/dist/browser/types.d.ts +369 -0
- package/dist/browser/types.d.ts.map +1 -0
- package/dist/browser/types.js +2 -0
- package/dist/browser/types.js.map +1 -0
- package/dist/build/__tests__/generate-cli.test.d.ts +2 -0
- package/dist/build/__tests__/generate-cli.test.d.ts.map +1 -0
- package/dist/build/__tests__/generate-cli.test.js +237 -0
- package/dist/build/__tests__/generate-cli.test.js.map +1 -0
- package/dist/build/__tests__/generate-manifest.test.d.ts +2 -0
- package/dist/build/__tests__/generate-manifest.test.d.ts.map +1 -0
- package/dist/build/__tests__/generate-manifest.test.js +119 -0
- package/dist/build/__tests__/generate-manifest.test.js.map +1 -0
- package/dist/build/__tests__/generate-route-types.test.d.ts +2 -0
- package/dist/build/__tests__/generate-route-types.test.d.ts.map +1 -0
- package/dist/build/__tests__/generate-route-types.test.js +620 -0
- package/dist/build/__tests__/generate-route-types.test.js.map +1 -0
- package/dist/build/__tests__/per-router-manifest.test.d.ts +2 -0
- package/dist/build/__tests__/per-router-manifest.test.d.ts.map +1 -0
- package/dist/build/__tests__/per-router-manifest.test.js +308 -0
- package/dist/build/__tests__/per-router-manifest.test.js.map +1 -0
- package/dist/build/generate-manifest.d.ts +81 -0
- package/dist/build/generate-manifest.d.ts.map +1 -0
- package/dist/build/generate-manifest.js +276 -0
- package/dist/build/generate-manifest.js.map +1 -0
- package/dist/build/generate-route-types.d.ts +115 -0
- package/dist/build/generate-route-types.d.ts.map +1 -0
- package/dist/build/generate-route-types.js +740 -0
- package/dist/build/generate-route-types.js.map +1 -0
- package/dist/build/index.d.ts +21 -0
- package/dist/build/index.d.ts.map +1 -0
- package/dist/build/index.js +21 -0
- package/dist/build/index.js.map +1 -0
- package/dist/build/route-trie.d.ts +71 -0
- package/dist/build/route-trie.d.ts.map +1 -0
- package/dist/build/route-trie.js +175 -0
- package/dist/build/route-trie.js.map +1 -0
- package/dist/cache/__tests__/cache-scope.test.d.ts +2 -0
- package/dist/cache/__tests__/cache-scope.test.d.ts.map +1 -0
- package/dist/cache/__tests__/cache-scope.test.js +208 -0
- package/dist/cache/__tests__/cache-scope.test.js.map +1 -0
- package/dist/cache/__tests__/document-cache.test.d.ts +2 -0
- package/dist/cache/__tests__/document-cache.test.d.ts.map +1 -0
- package/dist/cache/__tests__/document-cache.test.js +345 -0
- package/dist/cache/__tests__/document-cache.test.js.map +1 -0
- package/dist/cache/__tests__/memory-segment-store.test.d.ts +2 -0
- package/dist/cache/__tests__/memory-segment-store.test.d.ts.map +1 -0
- package/dist/cache/__tests__/memory-segment-store.test.js +425 -0
- package/dist/cache/__tests__/memory-segment-store.test.js.map +1 -0
- package/dist/cache/__tests__/memory-store.test.d.ts +2 -0
- package/dist/cache/__tests__/memory-store.test.d.ts.map +1 -0
- package/dist/cache/__tests__/memory-store.test.js +367 -0
- package/dist/cache/__tests__/memory-store.test.js.map +1 -0
- package/dist/cache/cache-scope.d.ts +102 -0
- package/dist/cache/cache-scope.d.ts.map +1 -0
- package/dist/cache/cache-scope.js +440 -0
- package/dist/cache/cache-scope.js.map +1 -0
- package/dist/cache/cf/__tests__/cf-cache-store.test.d.ts +2 -0
- package/dist/cache/cf/__tests__/cf-cache-store.test.d.ts.map +1 -0
- package/dist/cache/cf/__tests__/cf-cache-store.test.js +330 -0
- package/dist/cache/cf/__tests__/cf-cache-store.test.js.map +1 -0
- package/dist/cache/cf/cf-cache-store.d.ts +165 -0
- package/dist/cache/cf/cf-cache-store.d.ts.map +1 -0
- package/dist/cache/cf/cf-cache-store.js +242 -0
- package/dist/cache/cf/cf-cache-store.js.map +1 -0
- package/dist/cache/cf/index.d.ts +14 -0
- package/dist/cache/cf/index.d.ts.map +1 -0
- package/dist/cache/cf/index.js +17 -0
- package/dist/cache/cf/index.js.map +1 -0
- package/dist/cache/document-cache.d.ts +64 -0
- package/dist/cache/document-cache.d.ts.map +1 -0
- package/dist/cache/document-cache.js +228 -0
- package/dist/cache/document-cache.js.map +1 -0
- package/dist/cache/index.d.ts +19 -0
- package/dist/cache/index.d.ts.map +1 -0
- package/dist/cache/index.js +21 -0
- package/dist/cache/index.js.map +1 -0
- package/dist/cache/memory-segment-store.d.ts +110 -0
- package/dist/cache/memory-segment-store.d.ts.map +1 -0
- package/dist/cache/memory-segment-store.js +117 -0
- package/dist/cache/memory-segment-store.js.map +1 -0
- package/dist/cache/memory-store.d.ts +41 -0
- package/dist/cache/memory-store.d.ts.map +1 -0
- package/dist/cache/memory-store.js +191 -0
- package/dist/cache/memory-store.js.map +1 -0
- package/dist/cache/types.d.ts +317 -0
- package/dist/cache/types.d.ts.map +1 -0
- package/dist/cache/types.js +12 -0
- package/dist/cache/types.js.map +1 -0
- package/dist/client.d.ts +248 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +367 -0
- package/dist/client.js.map +1 -0
- package/dist/client.rsc.d.ts +26 -0
- package/dist/client.rsc.d.ts.map +1 -0
- package/dist/client.rsc.js +46 -0
- package/dist/client.rsc.js.map +1 -0
- package/dist/component-utils.d.ts +36 -0
- package/dist/component-utils.d.ts.map +1 -0
- package/dist/component-utils.js +61 -0
- package/dist/component-utils.js.map +1 -0
- package/dist/components/DefaultDocument.d.ts +13 -0
- package/dist/components/DefaultDocument.d.ts.map +1 -0
- package/dist/components/DefaultDocument.js +15 -0
- package/dist/components/DefaultDocument.js.map +1 -0
- package/dist/debug.d.ts +58 -0
- package/dist/debug.d.ts.map +1 -0
- package/dist/debug.js +157 -0
- package/dist/debug.js.map +1 -0
- package/dist/default-error-boundary.d.ts +11 -0
- package/dist/default-error-boundary.d.ts.map +1 -0
- package/dist/default-error-boundary.js +45 -0
- package/dist/default-error-boundary.js.map +1 -0
- package/dist/deps/browser.d.ts +2 -0
- package/dist/deps/browser.d.ts.map +1 -0
- package/dist/deps/browser.js +3 -0
- package/dist/deps/browser.js.map +1 -0
- package/dist/deps/html-stream-client.d.ts +2 -0
- package/dist/deps/html-stream-client.d.ts.map +1 -0
- package/dist/deps/html-stream-client.js +3 -0
- package/dist/deps/html-stream-client.js.map +1 -0
- package/dist/deps/html-stream-server.d.ts +2 -0
- package/dist/deps/html-stream-server.d.ts.map +1 -0
- package/dist/deps/html-stream-server.js +3 -0
- package/dist/deps/html-stream-server.js.map +1 -0
- package/dist/deps/rsc.d.ts +2 -0
- package/dist/deps/rsc.d.ts.map +1 -0
- package/dist/deps/rsc.js +4 -0
- package/dist/deps/rsc.js.map +1 -0
- package/dist/deps/ssr.d.ts +2 -0
- package/dist/deps/ssr.d.ts.map +1 -0
- package/dist/deps/ssr.js +3 -0
- package/dist/deps/ssr.js.map +1 -0
- package/dist/errors.d.ts +174 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +241 -0
- package/dist/errors.js.map +1 -0
- package/dist/handle.d.ts +78 -0
- package/dist/handle.d.ts.map +1 -0
- package/dist/handle.js +82 -0
- package/dist/handle.js.map +1 -0
- package/dist/handles/MetaTags.d.ts +14 -0
- package/dist/handles/MetaTags.d.ts.map +1 -0
- package/dist/handles/MetaTags.js +136 -0
- package/dist/handles/MetaTags.js.map +1 -0
- package/dist/handles/index.d.ts +6 -0
- package/dist/handles/index.d.ts.map +1 -0
- package/dist/handles/index.js +6 -0
- package/dist/handles/index.js.map +1 -0
- package/dist/handles/meta.d.ts +39 -0
- package/dist/handles/meta.d.ts.map +1 -0
- package/dist/handles/meta.js +202 -0
- package/dist/handles/meta.js.map +1 -0
- package/dist/host/__tests__/errors.test.d.ts +2 -0
- package/dist/host/__tests__/errors.test.d.ts.map +1 -0
- package/dist/host/__tests__/errors.test.js +76 -0
- package/dist/host/__tests__/errors.test.js.map +1 -0
- package/dist/host/__tests__/pattern-comprehensive.test.d.ts +2 -0
- package/dist/host/__tests__/pattern-comprehensive.test.d.ts.map +1 -0
- package/dist/host/__tests__/pattern-comprehensive.test.js +732 -0
- package/dist/host/__tests__/pattern-comprehensive.test.js.map +1 -0
- package/dist/host/__tests__/pattern-matcher.test.d.ts +2 -0
- package/dist/host/__tests__/pattern-matcher.test.d.ts.map +1 -0
- package/dist/host/__tests__/pattern-matcher.test.js +251 -0
- package/dist/host/__tests__/pattern-matcher.test.js.map +1 -0
- package/dist/host/__tests__/router.test.d.ts +2 -0
- package/dist/host/__tests__/router.test.d.ts.map +1 -0
- package/dist/host/__tests__/router.test.js +241 -0
- package/dist/host/__tests__/router.test.js.map +1 -0
- package/dist/host/__tests__/testing.test.d.ts +2 -0
- package/dist/host/__tests__/testing.test.d.ts.map +1 -0
- package/dist/host/__tests__/testing.test.js +64 -0
- package/dist/host/__tests__/testing.test.js.map +1 -0
- package/dist/host/__tests__/utils.test.d.ts +2 -0
- package/dist/host/__tests__/utils.test.d.ts.map +1 -0
- package/dist/host/__tests__/utils.test.js +29 -0
- package/dist/host/__tests__/utils.test.js.map +1 -0
- package/dist/host/cookie-handler.d.ts +34 -0
- package/dist/host/cookie-handler.d.ts.map +1 -0
- package/dist/host/cookie-handler.js +124 -0
- package/dist/host/cookie-handler.js.map +1 -0
- package/dist/host/errors.d.ts +56 -0
- package/dist/host/errors.d.ts.map +1 -0
- package/dist/host/errors.js +79 -0
- package/dist/host/errors.js.map +1 -0
- package/dist/host/index.d.ts +29 -0
- package/dist/host/index.d.ts.map +1 -0
- package/dist/host/index.js +32 -0
- package/dist/host/index.js.map +1 -0
- package/dist/host/pattern-matcher.d.ts +36 -0
- package/dist/host/pattern-matcher.d.ts.map +1 -0
- package/dist/host/pattern-matcher.js +172 -0
- package/dist/host/pattern-matcher.js.map +1 -0
- package/dist/host/router.d.ts +26 -0
- package/dist/host/router.d.ts.map +1 -0
- package/dist/host/router.js +218 -0
- package/dist/host/router.js.map +1 -0
- package/dist/host/testing.d.ts +36 -0
- package/dist/host/testing.d.ts.map +1 -0
- package/dist/host/testing.js +55 -0
- package/dist/host/testing.js.map +1 -0
- package/dist/host/types.d.ts +115 -0
- package/dist/host/types.d.ts.map +1 -0
- package/dist/host/types.js +7 -0
- package/dist/host/types.js.map +1 -0
- package/dist/host/utils.d.ts +21 -0
- package/dist/host/utils.d.ts.map +1 -0
- package/dist/host/utils.js +23 -0
- package/dist/host/utils.js.map +1 -0
- package/dist/href-client.d.ts +131 -0
- package/dist/href-client.d.ts.map +1 -0
- package/dist/href-client.js +64 -0
- package/dist/href-client.js.map +1 -0
- package/dist/href-context.d.ts +29 -0
- package/dist/href-context.d.ts.map +1 -0
- package/dist/href-context.js +21 -0
- package/dist/href-context.js.map +1 -0
- package/dist/index.d.ts +73 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +91 -0
- package/dist/index.js.map +1 -0
- package/dist/index.rsc.d.ts +32 -0
- package/dist/index.rsc.d.ts.map +1 -0
- package/dist/index.rsc.js +40 -0
- package/dist/index.rsc.js.map +1 -0
- package/dist/internal-debug.d.ts +2 -0
- package/dist/internal-debug.d.ts.map +1 -0
- package/dist/internal-debug.js +5 -0
- package/dist/internal-debug.js.map +1 -0
- package/dist/loader.d.ts +14 -0
- package/dist/loader.d.ts.map +1 -0
- package/dist/loader.js +20 -0
- package/dist/loader.js.map +1 -0
- package/dist/loader.rsc.d.ts +19 -0
- package/dist/loader.rsc.d.ts.map +1 -0
- package/dist/loader.rsc.js +99 -0
- package/dist/loader.rsc.js.map +1 -0
- package/dist/network-error-thrower.d.ts +17 -0
- package/dist/network-error-thrower.d.ts.map +1 -0
- package/dist/network-error-thrower.js +14 -0
- package/dist/network-error-thrower.js.map +1 -0
- package/dist/outlet-context.d.ts +13 -0
- package/dist/outlet-context.d.ts.map +1 -0
- package/dist/outlet-context.js +3 -0
- package/dist/outlet-context.js.map +1 -0
- package/dist/prerender/__tests__/param-hash.test.d.ts +2 -0
- package/dist/prerender/__tests__/param-hash.test.d.ts.map +1 -0
- package/dist/prerender/__tests__/param-hash.test.js +148 -0
- package/dist/prerender/__tests__/param-hash.test.js.map +1 -0
- package/dist/prerender/param-hash.d.ts +16 -0
- package/dist/prerender/param-hash.d.ts.map +1 -0
- package/dist/prerender/param-hash.js +36 -0
- package/dist/prerender/param-hash.js.map +1 -0
- package/dist/prerender/store.d.ts +38 -0
- package/dist/prerender/store.d.ts.map +1 -0
- package/dist/prerender/store.js +61 -0
- package/dist/prerender/store.js.map +1 -0
- package/dist/prerender.d.ts +66 -0
- package/dist/prerender.d.ts.map +1 -0
- package/dist/prerender.js +57 -0
- package/dist/prerender.js.map +1 -0
- package/dist/reverse.d.ts +196 -0
- package/dist/reverse.d.ts.map +1 -0
- package/dist/reverse.js +78 -0
- package/dist/reverse.js.map +1 -0
- package/dist/root-error-boundary.d.ts +33 -0
- package/dist/root-error-boundary.d.ts.map +1 -0
- package/dist/root-error-boundary.js +165 -0
- package/dist/root-error-boundary.js.map +1 -0
- package/dist/route-content-wrapper.d.ts +46 -0
- package/dist/route-content-wrapper.d.ts.map +1 -0
- package/dist/route-content-wrapper.js +77 -0
- package/dist/route-content-wrapper.js.map +1 -0
- package/dist/route-definition.d.ts +421 -0
- package/dist/route-definition.d.ts.map +1 -0
- package/dist/route-definition.js +868 -0
- package/dist/route-definition.js.map +1 -0
- package/dist/route-map-builder.d.ts +155 -0
- package/dist/route-map-builder.d.ts.map +1 -0
- package/dist/route-map-builder.js +237 -0
- package/dist/route-map-builder.js.map +1 -0
- package/dist/route-types.d.ts +165 -0
- package/dist/route-types.d.ts.map +1 -0
- package/dist/route-types.js +7 -0
- package/dist/route-types.js.map +1 -0
- package/dist/router/__tests__/handler-context.test.d.ts +2 -0
- package/dist/router/__tests__/handler-context.test.d.ts.map +1 -0
- package/dist/router/__tests__/handler-context.test.js +65 -0
- package/dist/router/__tests__/handler-context.test.js.map +1 -0
- package/dist/router/__tests__/loader-cycle-detection.test.d.ts +2 -0
- package/dist/router/__tests__/loader-cycle-detection.test.d.ts.map +1 -0
- package/dist/router/__tests__/loader-cycle-detection.test.js +221 -0
- package/dist/router/__tests__/loader-cycle-detection.test.js.map +1 -0
- package/dist/router/__tests__/match-context.test.d.ts +2 -0
- package/dist/router/__tests__/match-context.test.d.ts.map +1 -0
- package/dist/router/__tests__/match-context.test.js +92 -0
- package/dist/router/__tests__/match-context.test.js.map +1 -0
- package/dist/router/__tests__/match-pipelines.test.d.ts +2 -0
- package/dist/router/__tests__/match-pipelines.test.d.ts.map +1 -0
- package/dist/router/__tests__/match-pipelines.test.js +417 -0
- package/dist/router/__tests__/match-pipelines.test.js.map +1 -0
- package/dist/router/__tests__/match-result.test.d.ts +2 -0
- package/dist/router/__tests__/match-result.test.d.ts.map +1 -0
- package/dist/router/__tests__/match-result.test.js +457 -0
- package/dist/router/__tests__/match-result.test.js.map +1 -0
- package/dist/router/__tests__/on-error.test.d.ts +2 -0
- package/dist/router/__tests__/on-error.test.d.ts.map +1 -0
- package/dist/router/__tests__/on-error.test.js +678 -0
- package/dist/router/__tests__/on-error.test.js.map +1 -0
- package/dist/router/__tests__/pattern-matching.test.d.ts +2 -0
- package/dist/router/__tests__/pattern-matching.test.d.ts.map +1 -0
- package/dist/router/__tests__/pattern-matching.test.js +629 -0
- package/dist/router/__tests__/pattern-matching.test.js.map +1 -0
- package/dist/router/__tests__/segment-resolution-parallel-loading.test.d.ts +2 -0
- package/dist/router/__tests__/segment-resolution-parallel-loading.test.d.ts.map +1 -0
- package/dist/router/__tests__/segment-resolution-parallel-loading.test.js +155 -0
- package/dist/router/__tests__/segment-resolution-parallel-loading.test.js.map +1 -0
- package/dist/router/error-handling.d.ts +77 -0
- package/dist/router/error-handling.d.ts.map +1 -0
- package/dist/router/error-handling.js +202 -0
- package/dist/router/error-handling.js.map +1 -0
- package/dist/router/handler-context.d.ts +20 -0
- package/dist/router/handler-context.d.ts.map +1 -0
- package/dist/router/handler-context.js +198 -0
- package/dist/router/handler-context.js.map +1 -0
- package/dist/router/intercept-resolution.d.ts +66 -0
- package/dist/router/intercept-resolution.d.ts.map +1 -0
- package/dist/router/intercept-resolution.js +246 -0
- package/dist/router/intercept-resolution.js.map +1 -0
- package/dist/router/loader-resolution.d.ts +64 -0
- package/dist/router/loader-resolution.d.ts.map +1 -0
- package/dist/router/loader-resolution.js +284 -0
- package/dist/router/loader-resolution.js.map +1 -0
- package/dist/router/logging.d.ts +15 -0
- package/dist/router/logging.d.ts.map +1 -0
- package/dist/router/logging.js +99 -0
- package/dist/router/logging.js.map +1 -0
- package/dist/router/manifest.d.ts +22 -0
- package/dist/router/manifest.d.ts.map +1 -0
- package/dist/router/manifest.js +181 -0
- package/dist/router/manifest.js.map +1 -0
- package/dist/router/match-api.d.ts +35 -0
- package/dist/router/match-api.d.ts.map +1 -0
- package/dist/router/match-api.js +406 -0
- package/dist/router/match-api.js.map +1 -0
- package/dist/router/match-context.d.ts +206 -0
- package/dist/router/match-context.d.ts.map +1 -0
- package/dist/router/match-context.js +17 -0
- package/dist/router/match-context.js.map +1 -0
- package/dist/router/match-middleware/background-revalidation.d.ts +127 -0
- package/dist/router/match-middleware/background-revalidation.d.ts.map +1 -0
- package/dist/router/match-middleware/background-revalidation.js +75 -0
- package/dist/router/match-middleware/background-revalidation.js.map +1 -0
- package/dist/router/match-middleware/cache-lookup.d.ts +112 -0
- package/dist/router/match-middleware/cache-lookup.d.ts.map +1 -0
- package/dist/router/match-middleware/cache-lookup.js +257 -0
- package/dist/router/match-middleware/cache-lookup.js.map +1 -0
- package/dist/router/match-middleware/cache-store.d.ts +113 -0
- package/dist/router/match-middleware/cache-store.d.ts.map +1 -0
- package/dist/router/match-middleware/cache-store.js +108 -0
- package/dist/router/match-middleware/cache-store.js.map +1 -0
- package/dist/router/match-middleware/index.d.ts +81 -0
- package/dist/router/match-middleware/index.d.ts.map +1 -0
- package/dist/router/match-middleware/index.js +80 -0
- package/dist/router/match-middleware/index.js.map +1 -0
- package/dist/router/match-middleware/intercept-resolution.d.ts +117 -0
- package/dist/router/match-middleware/intercept-resolution.d.ts.map +1 -0
- package/dist/router/match-middleware/intercept-resolution.js +134 -0
- package/dist/router/match-middleware/intercept-resolution.js.map +1 -0
- package/dist/router/match-middleware/segment-resolution.d.ts +99 -0
- package/dist/router/match-middleware/segment-resolution.d.ts.map +1 -0
- package/dist/router/match-middleware/segment-resolution.js +53 -0
- package/dist/router/match-middleware/segment-resolution.js.map +1 -0
- package/dist/router/match-pipelines.d.ts +147 -0
- package/dist/router/match-pipelines.d.ts.map +1 -0
- package/dist/router/match-pipelines.js +82 -0
- package/dist/router/match-pipelines.js.map +1 -0
- package/dist/router/match-result.d.ts +126 -0
- package/dist/router/match-result.d.ts.map +1 -0
- package/dist/router/match-result.js +93 -0
- package/dist/router/match-result.js.map +1 -0
- package/dist/router/metrics.d.ts +20 -0
- package/dist/router/metrics.d.ts.map +1 -0
- package/dist/router/metrics.js +47 -0
- package/dist/router/metrics.js.map +1 -0
- package/dist/router/middleware.d.ts +249 -0
- package/dist/router/middleware.d.ts.map +1 -0
- package/dist/router/middleware.js +434 -0
- package/dist/router/middleware.js.map +1 -0
- package/dist/router/middleware.test.d.ts +2 -0
- package/dist/router/middleware.test.d.ts.map +1 -0
- package/dist/router/middleware.test.js +816 -0
- package/dist/router/middleware.test.js.map +1 -0
- package/dist/router/pattern-matching.d.ts +149 -0
- package/dist/router/pattern-matching.d.ts.map +1 -0
- package/dist/router/pattern-matching.js +349 -0
- package/dist/router/pattern-matching.js.map +1 -0
- package/dist/router/revalidation.d.ts +44 -0
- package/dist/router/revalidation.d.ts.map +1 -0
- package/dist/router/revalidation.js +147 -0
- package/dist/router/revalidation.js.map +1 -0
- package/dist/router/router-context.d.ts +135 -0
- package/dist/router/router-context.d.ts.map +1 -0
- package/dist/router/router-context.js +36 -0
- package/dist/router/router-context.js.map +1 -0
- package/dist/router/segment-resolution.d.ts +127 -0
- package/dist/router/segment-resolution.d.ts.map +1 -0
- package/dist/router/segment-resolution.js +919 -0
- package/dist/router/segment-resolution.js.map +1 -0
- package/dist/router/trie-matching.d.ts +40 -0
- package/dist/router/trie-matching.d.ts.map +1 -0
- package/dist/router/trie-matching.js +127 -0
- package/dist/router/trie-matching.js.map +1 -0
- package/dist/router/types.d.ts +136 -0
- package/dist/router/types.d.ts.map +1 -0
- package/dist/router/types.js +7 -0
- package/dist/router/types.js.map +1 -0
- package/dist/router.d.ts +753 -0
- package/dist/router.d.ts.map +1 -0
- package/dist/router.gen.d.ts +6 -0
- package/dist/router.gen.d.ts.map +1 -0
- package/dist/router.gen.js +6 -0
- package/dist/router.gen.js.map +1 -0
- package/dist/router.js +1304 -0
- package/dist/router.js.map +1 -0
- package/dist/rsc/__tests__/helpers.test.d.ts +2 -0
- package/dist/rsc/__tests__/helpers.test.d.ts.map +1 -0
- package/dist/rsc/__tests__/helpers.test.js +140 -0
- package/dist/rsc/__tests__/helpers.test.js.map +1 -0
- package/dist/rsc/handler.d.ts +45 -0
- package/dist/rsc/handler.d.ts.map +1 -0
- package/dist/rsc/handler.js +1172 -0
- package/dist/rsc/handler.js.map +1 -0
- package/dist/rsc/helpers.d.ts +16 -0
- package/dist/rsc/helpers.d.ts.map +1 -0
- package/dist/rsc/helpers.js +55 -0
- package/dist/rsc/helpers.js.map +1 -0
- package/dist/rsc/index.d.ts +22 -0
- package/dist/rsc/index.d.ts.map +1 -0
- package/dist/rsc/index.js +23 -0
- package/dist/rsc/index.js.map +1 -0
- package/dist/rsc/nonce.d.ts +9 -0
- package/dist/rsc/nonce.d.ts.map +1 -0
- package/dist/rsc/nonce.js +18 -0
- package/dist/rsc/nonce.js.map +1 -0
- package/dist/rsc/types.d.ts +206 -0
- package/dist/rsc/types.d.ts.map +1 -0
- package/dist/rsc/types.js +8 -0
- package/dist/rsc/types.js.map +1 -0
- package/dist/search-params.d.ts +103 -0
- package/dist/search-params.d.ts.map +1 -0
- package/dist/search-params.js +74 -0
- package/dist/search-params.js.map +1 -0
- package/dist/segment-system.d.ts +75 -0
- package/dist/segment-system.d.ts.map +1 -0
- package/dist/segment-system.js +336 -0
- package/dist/segment-system.js.map +1 -0
- package/dist/server/context.d.ts +245 -0
- package/dist/server/context.d.ts.map +1 -0
- package/dist/server/context.js +197 -0
- package/dist/server/context.js.map +1 -0
- package/dist/server/fetchable-loader-store.d.ts +18 -0
- package/dist/server/fetchable-loader-store.d.ts.map +1 -0
- package/dist/server/fetchable-loader-store.js +18 -0
- package/dist/server/fetchable-loader-store.js.map +1 -0
- package/dist/server/handle-store.d.ts +85 -0
- package/dist/server/handle-store.d.ts.map +1 -0
- package/dist/server/handle-store.js +142 -0
- package/dist/server/handle-store.js.map +1 -0
- package/dist/server/loader-registry.d.ts +55 -0
- package/dist/server/loader-registry.d.ts.map +1 -0
- package/dist/server/loader-registry.js +132 -0
- package/dist/server/loader-registry.js.map +1 -0
- package/dist/server/request-context.d.ts +226 -0
- package/dist/server/request-context.d.ts.map +1 -0
- package/dist/server/request-context.js +290 -0
- package/dist/server/request-context.js.map +1 -0
- package/dist/server/root-layout.d.ts +4 -0
- package/dist/server/root-layout.d.ts.map +1 -0
- package/dist/server/root-layout.js +5 -0
- package/dist/server/root-layout.js.map +1 -0
- package/dist/server.d.ts +15 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +20 -0
- package/dist/server.js.map +1 -0
- package/dist/ssr/__tests__/ssr-handler.test.d.ts +2 -0
- package/dist/ssr/__tests__/ssr-handler.test.d.ts.map +1 -0
- package/dist/ssr/__tests__/ssr-handler.test.js +132 -0
- package/dist/ssr/__tests__/ssr-handler.test.js.map +1 -0
- package/dist/ssr/index.d.ts +98 -0
- package/dist/ssr/index.d.ts.map +1 -0
- package/dist/ssr/index.js +158 -0
- package/dist/ssr/index.js.map +1 -0
- package/dist/static-handler.d.ts +50 -0
- package/dist/static-handler.d.ts.map +1 -0
- package/dist/static-handler.gen.d.ts +5 -0
- package/dist/static-handler.gen.d.ts.map +1 -0
- package/dist/static-handler.gen.js +5 -0
- package/dist/static-handler.gen.js.map +1 -0
- package/dist/static-handler.js +29 -0
- package/dist/static-handler.js.map +1 -0
- package/dist/theme/ThemeProvider.d.ts +20 -0
- package/dist/theme/ThemeProvider.d.ts.map +1 -0
- package/dist/theme/ThemeProvider.js +240 -0
- package/dist/theme/ThemeProvider.js.map +1 -0
- package/dist/theme/ThemeScript.d.ts +48 -0
- package/dist/theme/ThemeScript.d.ts.map +1 -0
- package/dist/theme/ThemeScript.js +13 -0
- package/dist/theme/ThemeScript.js.map +1 -0
- package/dist/theme/__tests__/theme.test.d.ts +2 -0
- package/dist/theme/__tests__/theme.test.d.ts.map +1 -0
- package/dist/theme/__tests__/theme.test.js +103 -0
- package/dist/theme/__tests__/theme.test.js.map +1 -0
- package/dist/theme/constants.d.ts +29 -0
- package/dist/theme/constants.d.ts.map +1 -0
- package/dist/theme/constants.js +48 -0
- package/dist/theme/constants.js.map +1 -0
- package/dist/theme/index.d.ts +31 -0
- package/dist/theme/index.d.ts.map +1 -0
- package/dist/theme/index.js +36 -0
- package/dist/theme/index.js.map +1 -0
- package/dist/theme/theme-context.d.ts +40 -0
- package/dist/theme/theme-context.d.ts.map +1 -0
- package/dist/theme/theme-context.js +60 -0
- package/dist/theme/theme-context.js.map +1 -0
- package/dist/theme/theme-script.d.ts +27 -0
- package/dist/theme/theme-script.d.ts.map +1 -0
- package/dist/theme/theme-script.js +147 -0
- package/dist/theme/theme-script.js.map +1 -0
- package/dist/theme/types.d.ts +163 -0
- package/dist/theme/types.d.ts.map +1 -0
- package/dist/theme/types.js +11 -0
- package/dist/theme/types.js.map +1 -0
- package/dist/theme/use-theme.d.ts +12 -0
- package/dist/theme/use-theme.d.ts.map +1 -0
- package/dist/theme/use-theme.js +40 -0
- package/dist/theme/use-theme.js.map +1 -0
- package/dist/types.d.ts +1479 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +10 -0
- package/dist/types.js.map +1 -0
- package/dist/urls.d.ts +441 -0
- package/dist/urls.d.ts.map +1 -0
- package/dist/urls.gen.d.ts +8 -0
- package/dist/urls.gen.d.ts.map +1 -0
- package/dist/urls.gen.js +8 -0
- package/dist/urls.gen.js.map +1 -0
- package/dist/urls.js +443 -0
- package/dist/urls.js.map +1 -0
- package/dist/use-loader.d.ts +127 -0
- package/dist/use-loader.d.ts.map +1 -0
- package/dist/use-loader.js +237 -0
- package/dist/use-loader.js.map +1 -0
- package/dist/vite/__tests__/ast-handler-extract.test.d.ts +2 -0
- package/dist/vite/__tests__/ast-handler-extract.test.d.ts.map +1 -0
- package/dist/vite/__tests__/ast-handler-extract.test.js +294 -0
- package/dist/vite/__tests__/ast-handler-extract.test.js.map +1 -0
- package/dist/vite/__tests__/expose-id-utils.test.d.ts +2 -0
- package/dist/vite/__tests__/expose-id-utils.test.d.ts.map +1 -0
- package/dist/vite/__tests__/expose-id-utils.test.js +224 -0
- package/dist/vite/__tests__/expose-id-utils.test.js.map +1 -0
- package/dist/vite/__tests__/expose-internal-ids.test.d.ts +2 -0
- package/dist/vite/__tests__/expose-internal-ids.test.d.ts.map +1 -0
- package/dist/vite/__tests__/expose-internal-ids.test.js +647 -0
- package/dist/vite/__tests__/expose-internal-ids.test.js.map +1 -0
- package/dist/vite/__tests__/expose-router-id.test.d.ts +2 -0
- package/dist/vite/__tests__/expose-router-id.test.d.ts.map +1 -0
- package/dist/vite/__tests__/expose-router-id.test.js +39 -0
- package/dist/vite/__tests__/expose-router-id.test.js.map +1 -0
- package/dist/vite/ast-handler-extract.d.ts +49 -0
- package/dist/vite/ast-handler-extract.d.ts.map +1 -0
- package/dist/vite/ast-handler-extract.js +249 -0
- package/dist/vite/ast-handler-extract.js.map +1 -0
- package/dist/vite/expose-action-id.d.ts +19 -0
- package/dist/vite/expose-action-id.d.ts.map +1 -0
- package/dist/vite/expose-action-id.js +250 -0
- package/dist/vite/expose-action-id.js.map +1 -0
- package/dist/vite/expose-id-utils.d.ts +69 -0
- package/dist/vite/expose-id-utils.d.ts.map +1 -0
- package/dist/vite/expose-id-utils.js +289 -0
- package/dist/vite/expose-id-utils.js.map +1 -0
- package/dist/vite/expose-internal-ids.d.ts +22 -0
- package/dist/vite/expose-internal-ids.d.ts.map +1 -0
- package/dist/vite/expose-internal-ids.js +886 -0
- package/dist/vite/expose-internal-ids.js.map +1 -0
- package/dist/vite/index.d.ts +149 -0
- package/dist/vite/index.d.ts.map +1 -0
- package/dist/vite/index.js +7 -4
- 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/parallel/SKILL.md +59 -0
- package/src/browser/event-controller.ts +5 -0
- package/src/browser/navigation-client.ts +14 -27
- package/src/browser/partial-update.ts +11 -0
- package/src/browser/prefetch/cache.ts +6 -6
- package/src/browser/prefetch/fetch.ts +13 -14
- package/src/browser/rsc-router.tsx +22 -1
- package/src/browser/segment-reconciler.ts +6 -1
- package/src/cache/cache-runtime.ts +15 -11
- package/src/cache/document-cache.ts +17 -7
- package/src/debug.ts +2 -2
- package/src/route-definition/dsl-helpers.ts +32 -7
- package/src/router/lazy-includes.ts +2 -1
- package/src/router/logging.ts +1 -1
- package/src/router/manifest.ts +6 -2
- package/src/router/match-middleware/background-revalidation.ts +18 -1
- package/src/router/match-middleware/cache-lookup.ts +59 -9
- package/src/router/match-middleware/cache-store.ts +32 -6
- package/src/router/match-middleware/intercept-resolution.ts +9 -7
- package/src/router/match-middleware/segment-resolution.ts +7 -5
- package/src/router/match-result.ts +25 -15
- package/src/router/metrics.ts +6 -1
- package/src/router/segment-resolution/fresh.ts +122 -15
- package/src/router/segment-resolution/loader-cache.ts +1 -0
- package/src/router/segment-resolution/revalidation.ts +343 -289
- package/src/router.ts +1 -1
- package/src/segment-system.tsx +140 -4
- package/src/server/context.ts +90 -13
- package/src/ssr/index.tsx +1 -0
- package/src/types/handler-context.ts +103 -17
- package/src/types/segments.ts +2 -0
- package/src/urls/path-helper.ts +1 -1
- package/src/vite/plugins/version-plugin.ts +9 -0
- package/src/vite/utils/banner.ts +3 -3
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Package Resolution Utilities
|
|
3
|
+
*
|
|
4
|
+
* Handles detection of workspace vs npm install context and generates
|
|
5
|
+
* appropriate aliases and exclude lists for Vite configuration.
|
|
6
|
+
*/
|
|
7
|
+
import { existsSync } from "node:fs";
|
|
8
|
+
import { resolve } from "node:path";
|
|
9
|
+
import packageJson from "../../package.json" with { type: "json" };
|
|
10
|
+
/**
|
|
11
|
+
* The canonical name used in virtual entries (without scope)
|
|
12
|
+
*/
|
|
13
|
+
const VIRTUAL_PACKAGE_NAME = "@rangojs/router";
|
|
14
|
+
/**
|
|
15
|
+
* Get the published package name (e.g., "@rangojs/router")
|
|
16
|
+
*/
|
|
17
|
+
export function getPublishedPackageName() {
|
|
18
|
+
return packageJson.name;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Check if the package is installed from npm (scoped) vs workspace (unscoped)
|
|
22
|
+
*
|
|
23
|
+
* In workspace development:
|
|
24
|
+
* - Package is installed as "@rangojs/router" via pnpm workspace alias
|
|
25
|
+
* - The scoped name (@rangojs/router) doesn't exist in node_modules
|
|
26
|
+
*
|
|
27
|
+
* When installed from npm:
|
|
28
|
+
* - Package is installed as "@rangojs/router"
|
|
29
|
+
* - We need aliases to map "@rangojs/router/*" to "@rangojs/router/*"
|
|
30
|
+
*/
|
|
31
|
+
export function isInstalledFromNpm() {
|
|
32
|
+
const packageName = getPublishedPackageName();
|
|
33
|
+
// Check if the scoped package exists in node_modules
|
|
34
|
+
return existsSync(resolve(process.cwd(), "node_modules", packageName));
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Check if we're in a monorepo/workspace development context
|
|
38
|
+
*/
|
|
39
|
+
export function isWorkspaceDevelopment() {
|
|
40
|
+
return !isInstalledFromNpm();
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Subpaths that need to be excluded from Vite's dependency optimization
|
|
44
|
+
* and potentially aliased
|
|
45
|
+
*/
|
|
46
|
+
const PACKAGE_SUBPATHS = [
|
|
47
|
+
"",
|
|
48
|
+
"/browser",
|
|
49
|
+
"/client",
|
|
50
|
+
"/server",
|
|
51
|
+
"/rsc",
|
|
52
|
+
"/ssr",
|
|
53
|
+
"/internal/deps/browser",
|
|
54
|
+
"/internal/deps/html-stream-client",
|
|
55
|
+
"/internal/deps/ssr",
|
|
56
|
+
"/internal/deps/rsc",
|
|
57
|
+
];
|
|
58
|
+
/**
|
|
59
|
+
* Generate the list of modules to exclude from Vite's dependency optimization.
|
|
60
|
+
*
|
|
61
|
+
* We include both the published name and the virtual name because
|
|
62
|
+
* Vite's optimizer runs before alias resolution.
|
|
63
|
+
*/
|
|
64
|
+
export function getExcludeDeps() {
|
|
65
|
+
const packageName = getPublishedPackageName();
|
|
66
|
+
const excludes = [];
|
|
67
|
+
for (const subpath of PACKAGE_SUBPATHS) {
|
|
68
|
+
// Add scoped package paths
|
|
69
|
+
excludes.push(`${packageName}${subpath}`);
|
|
70
|
+
// Add virtual/aliased paths (before alias resolution)
|
|
71
|
+
if (packageName !== VIRTUAL_PACKAGE_NAME) {
|
|
72
|
+
excludes.push(`${VIRTUAL_PACKAGE_NAME}${subpath}`);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return excludes;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Subpaths that need aliasing (subset of PACKAGE_SUBPATHS)
|
|
79
|
+
*/
|
|
80
|
+
const ALIAS_SUBPATHS = [
|
|
81
|
+
"/internal/deps/browser",
|
|
82
|
+
"/internal/deps/ssr",
|
|
83
|
+
"/internal/deps/rsc",
|
|
84
|
+
"/internal/deps/html-stream-client",
|
|
85
|
+
"/internal/deps/html-stream-server",
|
|
86
|
+
"/browser",
|
|
87
|
+
"/client",
|
|
88
|
+
"/server",
|
|
89
|
+
"/rsc",
|
|
90
|
+
"/ssr",
|
|
91
|
+
];
|
|
92
|
+
/**
|
|
93
|
+
* Generate aliases to map virtual package paths to the actual published package.
|
|
94
|
+
*
|
|
95
|
+
* Only needed when installed from npm, where the package is under @rangojs/router
|
|
96
|
+
* but virtual entries import from rsc-router/*.
|
|
97
|
+
*
|
|
98
|
+
* Returns empty object in workspace development where rsc-router resolves directly.
|
|
99
|
+
*/
|
|
100
|
+
export function getPackageAliases() {
|
|
101
|
+
if (isWorkspaceDevelopment()) {
|
|
102
|
+
// No aliases needed - rsc-router resolves directly
|
|
103
|
+
return {};
|
|
104
|
+
}
|
|
105
|
+
const packageName = getPublishedPackageName();
|
|
106
|
+
const aliases = {};
|
|
107
|
+
for (const subpath of ALIAS_SUBPATHS) {
|
|
108
|
+
aliases[`${VIRTUAL_PACKAGE_NAME}${subpath}`] = `${packageName}${subpath}`;
|
|
109
|
+
}
|
|
110
|
+
return aliases;
|
|
111
|
+
}
|
|
112
|
+
//# sourceMappingURL=package-resolution.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-resolution.js","sourceRoot":"","sources":["../../src/vite/package-resolution.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,WAAW,MAAM,oBAAoB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAEnE;;GAEG;AACH,MAAM,oBAAoB,GAAG,iBAAiB,CAAC;AAE/C;;GAEG;AACH,MAAM,UAAU,uBAAuB;IACrC,OAAO,WAAW,CAAC,IAAI,CAAC;AAC1B,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,kBAAkB;IAChC,MAAM,WAAW,GAAG,uBAAuB,EAAE,CAAC;IAC9C,qDAAqD;IACrD,OAAO,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,cAAc,EAAE,WAAW,CAAC,CAAC,CAAC;AACzE,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,sBAAsB;IACpC,OAAO,CAAC,kBAAkB,EAAE,CAAC;AAC/B,CAAC;AAED;;;GAGG;AACH,MAAM,gBAAgB,GAAG;IACvB,EAAE;IACF,UAAU;IACV,SAAS;IACT,SAAS;IACT,MAAM;IACN,MAAM;IACN,wBAAwB;IACxB,mCAAmC;IACnC,oBAAoB;IACpB,oBAAoB;CACZ,CAAC;AAEX;;;;;GAKG;AACH,MAAM,UAAU,cAAc;IAC5B,MAAM,WAAW,GAAG,uBAAuB,EAAE,CAAC;IAC9C,MAAM,QAAQ,GAAa,EAAE,CAAC;IAE9B,KAAK,MAAM,OAAO,IAAI,gBAAgB,EAAE,CAAC;QACvC,2BAA2B;QAC3B,QAAQ,CAAC,IAAI,CAAC,GAAG,WAAW,GAAG,OAAO,EAAE,CAAC,CAAC;QAC1C,sDAAsD;QACtD,IAAI,WAAW,KAAK,oBAAoB,EAAE,CAAC;YACzC,QAAQ,CAAC,IAAI,CAAC,GAAG,oBAAoB,GAAG,OAAO,EAAE,CAAC,CAAC;QACrD,CAAC;IACH,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;GAEG;AACH,MAAM,cAAc,GAAG;IACrB,wBAAwB;IACxB,oBAAoB;IACpB,oBAAoB;IACpB,mCAAmC;IACnC,mCAAmC;IACnC,UAAU;IACV,SAAS;IACT,SAAS;IACT,MAAM;IACN,MAAM;CACE,CAAC;AAEX;;;;;;;GAOG;AACH,MAAM,UAAU,iBAAiB;IAC/B,IAAI,sBAAsB,EAAE,EAAE,CAAC;QAC7B,mDAAmD;QACnD,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,WAAW,GAAG,uBAAuB,EAAE,CAAC;IAC9C,MAAM,OAAO,GAA2B,EAAE,CAAC;IAE3C,KAAK,MAAM,OAAO,IAAI,cAAc,EAAE,CAAC;QACrC,OAAO,CAAC,GAAG,oBAAoB,GAAG,OAAO,EAAE,CAAC,GAAG,GAAG,WAAW,GAAG,OAAO,EAAE,CAAC;IAC5E,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default virtual entry file contents for rsc-router.
|
|
3
|
+
* These are used when users don't provide their own entry files.
|
|
4
|
+
*/
|
|
5
|
+
export declare const VIRTUAL_ENTRY_BROWSER: string;
|
|
6
|
+
export declare const VIRTUAL_ENTRY_SSR: string;
|
|
7
|
+
/**
|
|
8
|
+
* Generate the RSC entry content with the specified router path
|
|
9
|
+
*/
|
|
10
|
+
export declare function getVirtualEntryRSC(routerPath: string): string;
|
|
11
|
+
/**
|
|
12
|
+
* Virtual module IDs
|
|
13
|
+
*/
|
|
14
|
+
export declare const VIRTUAL_IDS: {
|
|
15
|
+
readonly browser: "virtual:rsc-router/entry.browser.js";
|
|
16
|
+
readonly ssr: "virtual:rsc-router/entry.ssr.js";
|
|
17
|
+
readonly rsc: "virtual:rsc-router/entry.rsc.js";
|
|
18
|
+
readonly version: "@rangojs/router:version";
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Virtual module content for version.
|
|
22
|
+
* Exports VERSION - a timestamp that changes on server restart (dev) or at build time (production).
|
|
23
|
+
*/
|
|
24
|
+
export declare function getVirtualVersionContent(version: string): string;
|
|
25
|
+
//# sourceMappingURL=virtual-entries.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"virtual-entries.d.ts","sourceRoot":"","sources":["../../src/vite/virtual-entries.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,MAAM,qBAAqB,EAAE,MA+B5B,CAAC;AAET,eAAO,MAAM,iBAAiB,EAAE,MAaxB,CAAC;AAET;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAuC7D;AAED;;GAEG;AACH,eAAO,MAAM,WAAW;;;;;CAKd,CAAC;AAEX;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEhE"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default virtual entry file contents for rsc-router.
|
|
3
|
+
* These are used when users don't provide their own entry files.
|
|
4
|
+
*/
|
|
5
|
+
export const VIRTUAL_ENTRY_BROWSER = `
|
|
6
|
+
import {
|
|
7
|
+
createFromReadableStream,
|
|
8
|
+
createFromFetch,
|
|
9
|
+
setServerCallback,
|
|
10
|
+
encodeReply,
|
|
11
|
+
createTemporaryReferenceSet,
|
|
12
|
+
} from "@rangojs/router/internal/deps/browser";
|
|
13
|
+
import { createElement, StrictMode } from "react";
|
|
14
|
+
import { hydrateRoot } from "react-dom/client";
|
|
15
|
+
import { rscStream } from "@rangojs/router/internal/deps/html-stream-client";
|
|
16
|
+
import { initBrowserApp, RSCRouter } from "@rangojs/router/browser";
|
|
17
|
+
|
|
18
|
+
async function initializeApp() {
|
|
19
|
+
const deps = {
|
|
20
|
+
createFromFetch,
|
|
21
|
+
createFromReadableStream,
|
|
22
|
+
encodeReply,
|
|
23
|
+
setServerCallback,
|
|
24
|
+
createTemporaryReferenceSet,
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
await initBrowserApp({ rscStream, deps });
|
|
28
|
+
|
|
29
|
+
hydrateRoot(
|
|
30
|
+
document,
|
|
31
|
+
createElement(StrictMode, null, createElement(RSCRouter))
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
initializeApp().catch(console.error);
|
|
36
|
+
`.trim();
|
|
37
|
+
export const VIRTUAL_ENTRY_SSR = `
|
|
38
|
+
import { createFromReadableStream } from "@rangojs/router/internal/deps/ssr";
|
|
39
|
+
import { renderToReadableStream } from "react-dom/server.edge";
|
|
40
|
+
import { injectRSCPayload } from "@rangojs/router/internal/deps/html-stream-server";
|
|
41
|
+
import { createSSRHandler } from "@rangojs/router/ssr";
|
|
42
|
+
|
|
43
|
+
export const renderHTML = createSSRHandler({
|
|
44
|
+
createFromReadableStream,
|
|
45
|
+
renderToReadableStream,
|
|
46
|
+
injectRSCPayload,
|
|
47
|
+
loadBootstrapScriptContent: () =>
|
|
48
|
+
import.meta.viteRsc.loadBootstrapScriptContent("index"),
|
|
49
|
+
});
|
|
50
|
+
`.trim();
|
|
51
|
+
/**
|
|
52
|
+
* Generate the RSC entry content with the specified router path
|
|
53
|
+
*/
|
|
54
|
+
export function getVirtualEntryRSC(routerPath) {
|
|
55
|
+
return `
|
|
56
|
+
import {
|
|
57
|
+
renderToReadableStream,
|
|
58
|
+
decodeReply,
|
|
59
|
+
createTemporaryReferenceSet,
|
|
60
|
+
loadServerAction,
|
|
61
|
+
decodeAction,
|
|
62
|
+
decodeFormState,
|
|
63
|
+
} from "@rangojs/router/internal/deps/rsc";
|
|
64
|
+
import { router } from "${routerPath}";
|
|
65
|
+
import { createRSCHandler } from "@rangojs/router/internal/rsc-handler";
|
|
66
|
+
import { VERSION } from "@rangojs/router:version";
|
|
67
|
+
|
|
68
|
+
// Import loader manifest to ensure all fetchable loaders are registered at startup
|
|
69
|
+
// This is critical for serverless/multi-process deployments where the loader module
|
|
70
|
+
// might not be imported before a GET request arrives
|
|
71
|
+
import "virtual:rsc-router/loader-manifest";
|
|
72
|
+
|
|
73
|
+
// Import pre-generated route manifest so href() works immediately on cold start.
|
|
74
|
+
// In build mode, this contains the full route map generated at build time.
|
|
75
|
+
// In dev mode, this is a no-op (manifest is populated in-memory by the discovery plugin).
|
|
76
|
+
import "virtual:rsc-router/routes-manifest";
|
|
77
|
+
|
|
78
|
+
export default createRSCHandler({
|
|
79
|
+
router,
|
|
80
|
+
version: VERSION,
|
|
81
|
+
deps: {
|
|
82
|
+
renderToReadableStream,
|
|
83
|
+
decodeReply,
|
|
84
|
+
createTemporaryReferenceSet,
|
|
85
|
+
loadServerAction,
|
|
86
|
+
decodeAction,
|
|
87
|
+
decodeFormState,
|
|
88
|
+
},
|
|
89
|
+
loadSSRModule: () =>
|
|
90
|
+
import.meta.viteRsc.loadModule("ssr", "index"),
|
|
91
|
+
});
|
|
92
|
+
`.trim();
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Virtual module IDs
|
|
96
|
+
*/
|
|
97
|
+
export const VIRTUAL_IDS = {
|
|
98
|
+
browser: "virtual:rsc-router/entry.browser.js",
|
|
99
|
+
ssr: "virtual:rsc-router/entry.ssr.js",
|
|
100
|
+
rsc: "virtual:rsc-router/entry.rsc.js",
|
|
101
|
+
version: "@rangojs/router:version",
|
|
102
|
+
};
|
|
103
|
+
/**
|
|
104
|
+
* Virtual module content for version.
|
|
105
|
+
* Exports VERSION - a timestamp that changes on server restart (dev) or at build time (production).
|
|
106
|
+
*/
|
|
107
|
+
export function getVirtualVersionContent(version) {
|
|
108
|
+
return `export const VERSION = ${JSON.stringify(version)};`;
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=virtual-entries.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"virtual-entries.js","sourceRoot":"","sources":["../../src/vite/virtual-entries.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,CAAC,MAAM,qBAAqB,GAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+B5C,CAAC,IAAI,EAAE,CAAC;AAET,MAAM,CAAC,MAAM,iBAAiB,GAAW;;;;;;;;;;;;;CAaxC,CAAC,IAAI,EAAE,CAAC;AAET;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,UAAkB;IACnD,OAAO;;;;;;;;;0BASiB,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4BnC,CAAC,IAAI,EAAE,CAAC;AACT,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,OAAO,EAAE,qCAAqC;IAC9C,GAAG,EAAE,iCAAiC;IACtC,GAAG,EAAE,iCAAiC;IACtC,OAAO,EAAE,yBAAyB;CAC1B,CAAC;AAEX;;;GAGG;AACH,MAAM,UAAU,wBAAwB,CAAC,OAAe;IACtD,OAAO,0BAA0B,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC;AAC9D,CAAC"}
|
package/package.json
CHANGED
package/skills/parallel/SKILL.md
CHANGED
|
@@ -109,6 +109,65 @@ parallel(
|
|
|
109
109
|
)
|
|
110
110
|
```
|
|
111
111
|
|
|
112
|
+
### Streaming Behavior
|
|
113
|
+
|
|
114
|
+
Parallels with `loading()` are **independent streaming units**. They don't
|
|
115
|
+
block the parent layout or sibling routes during SSR:
|
|
116
|
+
|
|
117
|
+
- **With `loading()`**: The skeleton renders immediately. The loader runs
|
|
118
|
+
in the background and streams data to the client when ready. The rest
|
|
119
|
+
of the page (layout, route content, other parallels) renders without
|
|
120
|
+
waiting.
|
|
121
|
+
- **Without `loading()`**: The parallel's loaders block the parent layout's
|
|
122
|
+
rendering. Use this when the data must be available before the page
|
|
123
|
+
paints (e.g., critical above-the-fold content).
|
|
124
|
+
- **SPA navigation**: Parallel loaders resolve in the background. The
|
|
125
|
+
existing parallel UI stays visible — no skeleton flash on route changes
|
|
126
|
+
within the same layout.
|
|
127
|
+
|
|
128
|
+
```typescript
|
|
129
|
+
// Sidebar streams independently — page renders immediately
|
|
130
|
+
parallel(
|
|
131
|
+
{ "@sidebar": () => <Sidebar /> },
|
|
132
|
+
() => [loader(SlowSidebarLoader), loading(<SidebarSkeleton />)]
|
|
133
|
+
)
|
|
134
|
+
|
|
135
|
+
// Cart data blocks layout — must be ready before paint
|
|
136
|
+
parallel(
|
|
137
|
+
{ "@cartBadge": () => <CartBadge /> },
|
|
138
|
+
() => [loader(CartCountLoader)] // No loading() = awaited
|
|
139
|
+
)
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
## Slot Override Semantics
|
|
143
|
+
|
|
144
|
+
When multiple `parallel()` calls define the same slot name, **the last
|
|
145
|
+
definition wins**. Earlier definitions of that slot are removed. Other
|
|
146
|
+
slots from the earlier call are preserved.
|
|
147
|
+
|
|
148
|
+
This enables composition patterns where included routes override
|
|
149
|
+
parent-defined slots:
|
|
150
|
+
|
|
151
|
+
```typescript
|
|
152
|
+
layout(DashboardLayout, () => [
|
|
153
|
+
// Base slots
|
|
154
|
+
parallel({
|
|
155
|
+
"@sidebar": () => <DefaultSidebar />,
|
|
156
|
+
"@footer": () => <Footer />,
|
|
157
|
+
}),
|
|
158
|
+
|
|
159
|
+
// Override just @sidebar — @footer is preserved
|
|
160
|
+
parallel({ "@sidebar": () => <CustomSidebar /> }),
|
|
161
|
+
|
|
162
|
+
path("/", DashboardIndex, { name: "index" }),
|
|
163
|
+
])
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
After resolution, the layout has two parallel entries:
|
|
167
|
+
|
|
168
|
+
- `{ "@footer": () => <Footer /> }` (first call, `@sidebar` removed)
|
|
169
|
+
- `{ "@sidebar": () => <CustomSidebar /> }` (second call, wins)
|
|
170
|
+
|
|
112
171
|
## Multiple Parallel Slots
|
|
113
172
|
|
|
114
173
|
```typescript
|
|
@@ -79,6 +79,8 @@ export interface DerivedNavigationState {
|
|
|
79
79
|
state: "idle" | "loading";
|
|
80
80
|
/** Whether any operation is streaming */
|
|
81
81
|
isStreaming: boolean;
|
|
82
|
+
/** Whether a navigation is active (fetching or streaming, before commit) */
|
|
83
|
+
isNavigating: boolean;
|
|
82
84
|
/** Current committed location */
|
|
83
85
|
location: NavigationLocation;
|
|
84
86
|
/** URL being navigated to (null if idle) */
|
|
@@ -389,6 +391,9 @@ export function createEventController(
|
|
|
389
391
|
return {
|
|
390
392
|
state,
|
|
391
393
|
isStreaming,
|
|
394
|
+
// True when a navigation is active (fetching or streaming, before
|
|
395
|
+
// commit). Broader than pendingUrl which clears during streaming.
|
|
396
|
+
isNavigating: currentNavigation !== null,
|
|
392
397
|
location,
|
|
393
398
|
// pendingUrl only during fetching phase - once streaming starts (URL changed), not pending.
|
|
394
399
|
// Background revalidations (skipLoadingState) don't expose a pending URL.
|
|
@@ -19,8 +19,8 @@ import {
|
|
|
19
19
|
} from "./response-adapter.js";
|
|
20
20
|
import {
|
|
21
21
|
buildPrefetchKey,
|
|
22
|
-
consumePrefetch,
|
|
23
22
|
consumeInflightPrefetch,
|
|
23
|
+
consumePrefetch,
|
|
24
24
|
} from "./prefetch/cache.js";
|
|
25
25
|
|
|
26
26
|
/**
|
|
@@ -89,22 +89,18 @@ export function createNavigationClient(
|
|
|
89
89
|
fetchUrl.searchParams.set("_rsc_v", version);
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
-
// Check in-memory prefetch cache before making a network request.
|
|
92
|
+
// Check completed in-memory prefetch cache before making a network request.
|
|
93
93
|
// The cache key includes the source URL (previousUrl) because the
|
|
94
94
|
// server's diff response depends on the source page context.
|
|
95
95
|
// Skip cache for stale revalidation (needs fresh data), HMR (needs
|
|
96
96
|
// fresh modules), and intercept contexts (source-dependent responses).
|
|
97
|
+
//
|
|
97
98
|
const canUsePrefetch = !staleRevalidation && !hmr && !interceptSourceUrl;
|
|
98
99
|
const cacheKey = buildPrefetchKey(previousUrl, fetchUrl);
|
|
99
100
|
const cachedResponse = canUsePrefetch ? consumePrefetch(cacheKey) : null;
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
const inflightPrefetch =
|
|
104
|
-
!cachedResponse && canUsePrefetch
|
|
105
|
-
? consumeInflightPrefetch(cacheKey)
|
|
106
|
-
: null;
|
|
107
|
-
|
|
101
|
+
const inflightResponsePromise = canUsePrefetch
|
|
102
|
+
? consumeInflightPrefetch(cacheKey)
|
|
103
|
+
: null;
|
|
108
104
|
// Track when the stream completes
|
|
109
105
|
let resolveStreamComplete: () => void;
|
|
110
106
|
const streamComplete = new Promise<void>((resolve) => {
|
|
@@ -195,33 +191,24 @@ export function createNavigationClient(
|
|
|
195
191
|
signal,
|
|
196
192
|
);
|
|
197
193
|
});
|
|
198
|
-
} else if (
|
|
194
|
+
} else if (inflightResponsePromise) {
|
|
199
195
|
if (tx) {
|
|
200
196
|
browserDebugLog(tx, "reusing inflight prefetch", { key: cacheKey });
|
|
201
197
|
}
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
// a fresh navigation fetch.
|
|
205
|
-
responsePromise = inflightPrefetch.then((prefetchResponse) => {
|
|
206
|
-
if (!prefetchResponse) {
|
|
198
|
+
responsePromise = inflightResponsePromise.then(async (response) => {
|
|
199
|
+
if (!response) {
|
|
207
200
|
if (tx) {
|
|
208
|
-
browserDebugLog(
|
|
209
|
-
tx,
|
|
210
|
-
"inflight prefetch failed, falling back to fetch",
|
|
211
|
-
);
|
|
201
|
+
browserDebugLog(tx, "inflight prefetch unavailable, refetching");
|
|
212
202
|
}
|
|
213
203
|
return doFreshFetch();
|
|
214
204
|
}
|
|
215
|
-
|
|
216
|
-
browserDebugLog(tx, "inflight prefetch resolved", {
|
|
217
|
-
key: cacheKey,
|
|
218
|
-
});
|
|
219
|
-
}
|
|
205
|
+
|
|
220
206
|
return teeWithCompletion(
|
|
221
|
-
|
|
207
|
+
response,
|
|
222
208
|
() => {
|
|
223
|
-
if (tx)
|
|
209
|
+
if (tx) {
|
|
224
210
|
browserDebugLog(tx, "stream complete (from inflight prefetch)");
|
|
211
|
+
}
|
|
225
212
|
resolveStreamComplete();
|
|
226
213
|
},
|
|
227
214
|
signal,
|
|
@@ -259,6 +259,17 @@ export function createPartialUpdater(
|
|
|
259
259
|
existingSegments,
|
|
260
260
|
);
|
|
261
261
|
|
|
262
|
+
// Fix: tx.commit() cached the source page's handleData because
|
|
263
|
+
// eventController hasn't been updated yet. Overwrite with the
|
|
264
|
+
// correct cached handleData to prevent cache corruption on
|
|
265
|
+
// subsequent navigations to this same URL.
|
|
266
|
+
if (mode.targetCacheHandleData) {
|
|
267
|
+
store.updateCacheHandleData(
|
|
268
|
+
store.getHistoryKey(),
|
|
269
|
+
mode.targetCacheHandleData,
|
|
270
|
+
);
|
|
271
|
+
}
|
|
272
|
+
|
|
262
273
|
// Include cachedHandleData in metadata so NavigationProvider can restore
|
|
263
274
|
// breadcrumbs and other handle data from cache.
|
|
264
275
|
// Remove `handles` from metadata to prevent NavigationProvider from
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Prefetch Cache
|
|
3
3
|
*
|
|
4
|
-
* In-memory cache storing
|
|
4
|
+
* In-memory cache storing prefetched Response objects for instant cache hits
|
|
5
5
|
* on subsequent navigation. Cache key is source-dependent (includes the
|
|
6
6
|
* current page URL) because the server's diff-based response depends on
|
|
7
7
|
* where the user navigates from.
|
|
8
8
|
*
|
|
9
|
-
* Also tracks in-flight prefetch promises
|
|
10
|
-
*
|
|
11
|
-
*
|
|
9
|
+
* Also tracks in-flight prefetch promises. Each promise resolves to the
|
|
10
|
+
* navigation branch of a tee'd Response, allowing navigation to adopt a
|
|
11
|
+
* still-downloading prefetch without reparsing or buffering the body.
|
|
12
12
|
*
|
|
13
13
|
* Replaces the previous browser HTTP cache approach which was unreliable
|
|
14
14
|
* due to response draining race conditions and browser inconsistencies.
|
|
@@ -130,8 +130,8 @@ export function consumeInflightPrefetch(
|
|
|
130
130
|
|
|
131
131
|
/**
|
|
132
132
|
* Store a prefetch response in the in-memory cache.
|
|
133
|
-
* The response
|
|
134
|
-
*
|
|
133
|
+
* The response should be a clone() of the original so the caller can
|
|
134
|
+
* still consume the body. The clone's body streams independently.
|
|
135
135
|
*
|
|
136
136
|
* Skips storage if the generation has changed since the fetch started
|
|
137
137
|
* (a server action invalidated the cache mid-flight).
|
|
@@ -55,10 +55,10 @@ function buildPrefetchUrl(
|
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
/**
|
|
58
|
-
* Core prefetch fetch logic. Fetches the response,
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
* in-flight
|
|
58
|
+
* Core prefetch fetch logic. Fetches the response, tees the body, and stores
|
|
59
|
+
* one branch in the in-memory cache. The returned Promise resolves to the
|
|
60
|
+
* sibling navigation branch (or null on failure) so navigation can safely
|
|
61
|
+
* reuse an in-flight prefetch via consumeInflightPrefetch().
|
|
62
62
|
*/
|
|
63
63
|
function executePrefetchFetch(
|
|
64
64
|
key: string,
|
|
@@ -77,20 +77,19 @@ function executePrefetchFetch(
|
|
|
77
77
|
"X-Rango-Prefetch": "1",
|
|
78
78
|
},
|
|
79
79
|
})
|
|
80
|
-
.then(
|
|
80
|
+
.then((response) => {
|
|
81
81
|
if (!response.ok) return null;
|
|
82
|
-
//
|
|
83
|
-
//
|
|
84
|
-
//
|
|
85
|
-
|
|
86
|
-
const
|
|
87
|
-
const cachedResponse = new Response(buffer, {
|
|
82
|
+
// Don't buffer with arrayBuffer() — that blocks until the entire
|
|
83
|
+
// body downloads, defeating streaming for slow loaders.
|
|
84
|
+
// Tee the body: one branch for navigation, one for cache storage.
|
|
85
|
+
const [navStream, cacheStream] = response.body!.tee();
|
|
86
|
+
const responseInit = {
|
|
88
87
|
headers: response.headers,
|
|
89
88
|
status: response.status,
|
|
90
89
|
statusText: response.statusText,
|
|
91
|
-
}
|
|
92
|
-
storePrefetch(key,
|
|
93
|
-
return
|
|
90
|
+
};
|
|
91
|
+
storePrefetch(key, new Response(cacheStream, responseInit), gen);
|
|
92
|
+
return new Response(navStream, responseInit);
|
|
94
93
|
})
|
|
95
94
|
.catch(() => null)
|
|
96
95
|
.finally(() => {
|
|
@@ -286,6 +286,18 @@ export async function initBrowserApp(
|
|
|
286
286
|
// Debounce: wait 200ms of quiet before fetching
|
|
287
287
|
hmrTimer = setTimeout(async () => {
|
|
288
288
|
hmrTimer = null;
|
|
289
|
+
|
|
290
|
+
// Don't interrupt an active user navigation — startNavigation()
|
|
291
|
+
// would abort it and refetch the old URL (window.location.href
|
|
292
|
+
// hasn't updated yet). The user's navigation will pick up the
|
|
293
|
+
// new server code when it completes. isNavigating covers the
|
|
294
|
+
// full lifecycle (fetching + streaming, before commit) without
|
|
295
|
+
// blocking on server actions.
|
|
296
|
+
if (eventController.getState().isNavigating) {
|
|
297
|
+
console.log("[RSCRouter] HMR: Skipping — navigation in progress");
|
|
298
|
+
return;
|
|
299
|
+
}
|
|
300
|
+
|
|
289
301
|
console.log("[RSCRouter] HMR: Server update, refetching RSC");
|
|
290
302
|
|
|
291
303
|
const abort = new AbortController();
|
|
@@ -310,6 +322,13 @@ export async function initBrowserApp(
|
|
|
310
322
|
|
|
311
323
|
if (abort.signal.aborted) return;
|
|
312
324
|
|
|
325
|
+
// If the server returned a non-RSC response (404, 500 without
|
|
326
|
+
// error boundary), the payload won't have valid metadata.
|
|
327
|
+
// Reload to recover rather than leaving the page stale.
|
|
328
|
+
if (!payload.metadata) {
|
|
329
|
+
throw new Error("HMR refetch returned invalid payload");
|
|
330
|
+
}
|
|
331
|
+
|
|
313
332
|
if (payload.metadata?.isPartial) {
|
|
314
333
|
const segments = payload.metadata.segments || [];
|
|
315
334
|
const matched = payload.metadata.matched || [];
|
|
@@ -352,7 +371,9 @@ export async function initBrowserApp(
|
|
|
352
371
|
console.log("[RSCRouter] HMR: RSC stream complete");
|
|
353
372
|
} catch (err) {
|
|
354
373
|
if (abort.signal.aborted) return;
|
|
355
|
-
|
|
374
|
+
console.warn("[RSCRouter] HMR: Refetch failed, reloading page", err);
|
|
375
|
+
window.location.reload();
|
|
376
|
+
return;
|
|
356
377
|
} finally {
|
|
357
378
|
if (hmrAbort === abort) hmrAbort = null;
|
|
358
379
|
streamingToken.end();
|
|
@@ -160,8 +160,13 @@ export function reconcileSegments(input: ReconcileInput): ReconcileResult {
|
|
|
160
160
|
|
|
161
161
|
// For non-action actors: cached segments the server decided not to re-render.
|
|
162
162
|
// - Preserve loading=false (suppressed boundary) to maintain tree structure
|
|
163
|
-
// -
|
|
163
|
+
// - Preserve parallel segment loading so renderSegments can reconstruct
|
|
164
|
+
// parallel-owned loader markers from the cached slot metadata
|
|
165
|
+
// - Clear other truthy loading values to prevent suspense on cached content
|
|
164
166
|
if (actor !== "action") {
|
|
167
|
+
if (fromCache.type === "parallel" && fromCache.loading !== undefined) {
|
|
168
|
+
return fromCache;
|
|
169
|
+
}
|
|
165
170
|
if (fromCache.loading !== undefined && fromCache.loading !== false) {
|
|
166
171
|
return { ...fromCache, loading: undefined };
|
|
167
172
|
}
|
|
@@ -214,11 +214,21 @@ export function registerCachedFunction<T extends (...args: any[]) => any>(
|
|
|
214
214
|
bgStopCapture = c.stop;
|
|
215
215
|
}
|
|
216
216
|
|
|
217
|
-
// Stamp tainted
|
|
218
|
-
//
|
|
219
|
-
//
|
|
220
|
-
//
|
|
221
|
-
//
|
|
217
|
+
// Stamp tainted ARGS only — not requestCtx. The args stamp guards
|
|
218
|
+
// direct ctx method calls (ctx.set, ctx.header, ctx.onResponse, etc.)
|
|
219
|
+
// which is sufficient for correctness.
|
|
220
|
+
//
|
|
221
|
+
// We intentionally skip stamping requestCtx here because:
|
|
222
|
+
// 1. runBackground starts the async task synchronously (before the
|
|
223
|
+
// first await), so stampCacheExec would pollute the shared
|
|
224
|
+
// requestCtx while the foreground pipeline is still running.
|
|
225
|
+
// This causes assertNotInsideCacheExec to fire when cache-store
|
|
226
|
+
// later calls requestCtx.onResponse().
|
|
227
|
+
// 2. requestCtx methods are closure-bound to the original ctx, so
|
|
228
|
+
// neither Object.create() nor a proxy can isolate the stamp.
|
|
229
|
+
// 3. The foreground miss path already stamps requestCtx and catches
|
|
230
|
+
// cookies()/headers() misuse on first execution. The background
|
|
231
|
+
// re-runs the same function with the same request.
|
|
222
232
|
const bgTaintedArgs: unknown[] = [];
|
|
223
233
|
for (const arg of args) {
|
|
224
234
|
if (isTainted(arg)) {
|
|
@@ -226,9 +236,6 @@ export function registerCachedFunction<T extends (...args: any[]) => any>(
|
|
|
226
236
|
bgTaintedArgs.push(arg);
|
|
227
237
|
}
|
|
228
238
|
}
|
|
229
|
-
if (requestCtx) {
|
|
230
|
-
stampCacheExec(requestCtx as object);
|
|
231
|
-
}
|
|
232
239
|
|
|
233
240
|
try {
|
|
234
241
|
const freshResult = await fn.apply(this, args);
|
|
@@ -249,9 +256,6 @@ export function registerCachedFunction<T extends (...args: any[]) => any>(
|
|
|
249
256
|
for (const arg of bgTaintedArgs) {
|
|
250
257
|
unstampCacheExec(arg as object);
|
|
251
258
|
}
|
|
252
|
-
if (requestCtx) {
|
|
253
|
-
unstampCacheExec(requestCtx as object);
|
|
254
|
-
}
|
|
255
259
|
// Restore original handle store
|
|
256
260
|
if (originalHandleStore && requestCtx) {
|
|
257
261
|
requestCtx._handleStore = originalHandleStore;
|