@rangojs/router 0.0.0-experimental.2 → 0.0.0-experimental.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +5 -0
- package/README.md +850 -4
- 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/{src/__mocks__/version.ts → dist/__mocks__/version.js} +1 -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 +1601 -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/{src/href-context.ts → dist/href-context.d.ts} +7 -11
- 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 +4583 -749
- 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/{src/vite/virtual-entries.ts → dist/vite/virtual-entries.js} +18 -17
- package/dist/vite/virtual-entries.js.map +1 -0
- package/package.json +82 -46
- package/skills/cache-guide/SKILL.md +262 -0
- package/skills/caching/SKILL.md +139 -238
- package/skills/composability/SKILL.md +172 -0
- package/skills/debug-manifest/SKILL.md +112 -0
- package/skills/document-cache/SKILL.md +87 -57
- package/skills/fonts/SKILL.md +167 -0
- package/skills/hooks/SKILL.md +403 -60
- package/skills/intercept/SKILL.md +224 -203
- package/skills/layout/SKILL.md +243 -149
- package/skills/links/SKILL.md +239 -0
- package/skills/loader/SKILL.md +444 -253
- package/skills/middleware/SKILL.md +222 -325
- package/skills/mime-routes/SKILL.md +128 -0
- package/skills/parallel/SKILL.md +220 -170
- package/skills/prerender/SKILL.md +643 -0
- package/skills/rango/SKILL.md +119 -0
- package/skills/response-routes/SKILL.md +411 -0
- package/skills/route/SKILL.md +334 -89
- package/skills/router-setup/SKILL.md +305 -274
- package/skills/tailwind/SKILL.md +129 -0
- package/skills/testing/SKILL.md +226 -0
- package/skills/theme/SKILL.md +36 -11
- package/skills/typesafety/SKILL.md +437 -168
- package/skills/use-cache/SKILL.md +324 -0
- package/src/__internal.ts +181 -0
- package/src/bin/rango.ts +321 -0
- package/src/browser/action-coordinator.ts +97 -0
- package/src/browser/action-response-classifier.ts +99 -0
- package/src/browser/event-controller.ts +87 -64
- package/src/browser/history-state.ts +80 -0
- package/src/browser/intercept-utils.ts +52 -0
- package/src/browser/link-interceptor.ts +20 -4
- package/src/browser/logging.ts +55 -0
- package/src/browser/merge-segment-loaders.ts +20 -12
- package/src/browser/navigation-bridge.ts +217 -549
- package/src/browser/navigation-client.ts +74 -46
- package/src/browser/navigation-store.ts +33 -50
- package/src/browser/navigation-transaction.ts +295 -0
- package/src/browser/network-error-handler.ts +61 -0
- package/src/browser/partial-update.ts +288 -297
- package/src/browser/prefetch/cache.ts +67 -0
- package/src/browser/prefetch/fetch.ts +137 -0
- package/src/browser/prefetch/observer.ts +65 -0
- package/src/browser/prefetch/policy.ts +42 -0
- package/src/browser/prefetch/queue.ts +88 -0
- package/src/browser/rango-state.ts +112 -0
- package/src/browser/react/Link.tsx +173 -73
- package/src/browser/react/NavigationProvider.tsx +138 -27
- package/src/browser/react/context.ts +6 -0
- package/src/browser/react/filter-segment-order.ts +11 -0
- package/src/browser/react/index.ts +12 -12
- package/src/browser/react/location-state-shared.ts +95 -53
- package/src/browser/react/location-state.ts +60 -15
- package/src/browser/react/mount-context.ts +37 -0
- package/src/browser/react/nonce-context.ts +23 -0
- package/src/browser/react/shallow-equal.ts +27 -0
- package/src/browser/react/use-action.ts +29 -51
- package/src/browser/react/use-client-cache.ts +5 -3
- package/src/browser/react/use-handle.ts +49 -65
- package/src/browser/react/use-href.tsx +20 -188
- package/src/browser/react/use-link-status.ts +6 -5
- package/src/browser/react/use-mount.ts +31 -0
- package/src/browser/react/use-navigation.ts +27 -78
- package/src/browser/react/use-params.ts +65 -0
- package/src/browser/react/use-pathname.ts +47 -0
- package/src/browser/react/use-router.ts +63 -0
- package/src/browser/react/use-search-params.ts +56 -0
- package/src/browser/react/use-segments.ts +80 -97
- package/src/browser/response-adapter.ts +73 -0
- package/src/browser/rsc-router.tsx +104 -34
- package/src/browser/scroll-restoration.ts +92 -16
- package/src/browser/segment-reconciler.ts +216 -0
- package/src/browser/segment-structure-assert.ts +83 -0
- package/src/browser/server-action-bridge.ts +504 -584
- package/src/browser/shallow.ts +6 -1
- package/src/browser/types.ts +107 -57
- package/src/browser/validate-redirect-origin.ts +29 -0
- package/src/build/generate-manifest.ts +438 -0
- package/src/build/generate-route-types.ts +36 -0
- package/src/build/index.ts +35 -0
- package/src/build/route-trie.ts +249 -0
- package/src/build/route-types/ast-helpers.ts +25 -0
- package/src/build/route-types/ast-route-extraction.ts +98 -0
- package/src/build/route-types/codegen.ts +102 -0
- package/src/build/route-types/include-resolution.ts +411 -0
- package/src/build/route-types/param-extraction.ts +48 -0
- package/src/build/route-types/per-module-writer.ts +128 -0
- package/src/build/route-types/router-processing.ts +469 -0
- package/src/build/route-types/scan-filter.ts +78 -0
- package/src/build/runtime-discovery.ts +231 -0
- package/src/cache/background-task.ts +34 -0
- package/src/cache/cache-key-utils.ts +44 -0
- package/src/cache/cache-policy.ts +125 -0
- package/src/cache/cache-runtime.ts +338 -0
- package/src/cache/cache-scope.ts +120 -303
- package/src/cache/cf/cf-cache-store.ts +119 -7
- package/src/cache/cf/index.ts +8 -2
- package/src/cache/document-cache.ts +101 -72
- package/src/cache/handle-capture.ts +81 -0
- package/src/cache/handle-snapshot.ts +41 -0
- package/src/cache/index.ts +0 -15
- package/src/cache/memory-segment-store.ts +191 -13
- package/src/cache/profile-registry.ts +73 -0
- package/src/cache/read-through-swr.ts +134 -0
- package/src/cache/segment-codec.ts +256 -0
- package/src/cache/taint.ts +98 -0
- package/src/cache/types.ts +76 -121
- package/src/client.rsc.tsx +10 -14
- package/src/client.tsx +114 -89
- package/src/component-utils.ts +4 -4
- package/src/components/DefaultDocument.tsx +6 -2
- package/src/context-var.ts +86 -0
- package/src/debug.ts +243 -0
- package/src/errors.ts +108 -2
- package/src/handle.ts +34 -19
- package/src/handles/MetaTags.tsx +76 -23
- package/src/handles/meta.ts +32 -15
- package/src/host/cookie-handler.ts +165 -0
- package/src/host/errors.ts +97 -0
- package/src/host/index.ts +56 -0
- package/src/host/pattern-matcher.ts +214 -0
- package/src/host/router.ts +352 -0
- package/src/host/testing.ts +79 -0
- package/src/host/types.ts +146 -0
- package/src/host/utils.ts +25 -0
- package/src/href-client.ts +141 -47
- package/src/index.rsc.ts +209 -23
- package/src/index.ts +256 -32
- package/src/internal-debug.ts +11 -0
- package/src/loader.rsc.ts +27 -142
- package/src/loader.ts +27 -10
- package/src/network-error-thrower.tsx +3 -1
- package/src/outlet-provider.tsx +45 -0
- package/src/prerender/param-hash.ts +37 -0
- package/src/prerender/store.ts +144 -0
- package/src/prerender.ts +463 -0
- package/src/reverse.ts +330 -0
- package/src/root-error-boundary.tsx +41 -29
- package/src/route-content-wrapper.tsx +9 -11
- package/src/route-definition/dsl-helpers.ts +934 -0
- package/src/route-definition/helper-factories.ts +200 -0
- package/src/route-definition/helpers-types.ts +430 -0
- package/src/route-definition/index.ts +55 -0
- package/src/route-definition/redirect.ts +93 -0
- package/src/route-definition/route-function.ts +119 -0
- package/src/route-definition.ts +1 -1371
- package/src/route-map-builder.ts +241 -112
- package/src/route-name.ts +53 -0
- package/src/route-types.ts +70 -9
- package/src/router/content-negotiation.ts +116 -0
- package/src/router/debug-manifest.ts +72 -0
- package/src/router/error-handling.ts +9 -9
- package/src/router/find-match.ts +158 -0
- package/src/router/handler-context.ts +348 -82
- package/src/router/intercept-resolution.ts +395 -0
- package/src/router/lazy-includes.ts +234 -0
- package/src/router/loader-resolution.ts +215 -121
- package/src/router/logging.ts +248 -0
- package/src/router/manifest.ts +172 -43
- package/src/router/match-api.ts +620 -0
- package/src/router/match-context.ts +6 -4
- package/src/router/match-handlers.ts +440 -0
- package/src/router/match-middleware/background-revalidation.ts +80 -93
- package/src/router/match-middleware/cache-lookup.ts +382 -9
- package/src/router/match-middleware/cache-store.ts +51 -22
- package/src/router/match-middleware/intercept-resolution.ts +55 -17
- package/src/router/match-middleware/segment-resolution.ts +24 -6
- package/src/router/match-pipelines.ts +10 -45
- package/src/router/match-result.ts +34 -20
- package/src/router/metrics.ts +3 -3
- package/src/router/middleware-cookies.ts +55 -0
- package/src/router/middleware-types.ts +179 -0
- package/src/router/middleware.ts +239 -328
- package/src/router/pattern-matching.ts +302 -26
- package/src/router/prerender-match.ts +398 -0
- package/src/router/preview-match.ts +170 -0
- package/src/router/revalidation.ts +112 -33
- package/src/router/router-context.ts +40 -23
- package/src/router/router-interfaces.ts +439 -0
- package/src/router/router-options.ts +587 -0
- package/src/router/router-registry.ts +24 -0
- package/src/router/segment-resolution/fresh.ts +552 -0
- package/src/router/segment-resolution/helpers.ts +263 -0
- package/src/router/segment-resolution/loader-cache.ts +198 -0
- package/src/router/segment-resolution/revalidation.ts +1226 -0
- package/src/router/segment-resolution/static-store.ts +67 -0
- package/src/router/segment-resolution.ts +21 -0
- package/src/router/segment-wrappers.ts +289 -0
- package/src/router/telemetry-otel.ts +299 -0
- package/src/router/telemetry.ts +300 -0
- package/src/router/timeout.ts +148 -0
- package/src/router/trie-matching.ts +221 -0
- package/src/router/types.ts +78 -4
- package/src/router.ts +672 -3566
- package/src/rsc/handler-context.ts +45 -0
- package/src/rsc/handler.ts +691 -757
- package/src/rsc/helpers.ts +140 -6
- package/src/rsc/index.ts +5 -5
- package/src/rsc/loader-fetch.ts +209 -0
- package/src/rsc/manifest-init.ts +86 -0
- package/src/rsc/nonce.ts +14 -0
- package/src/rsc/origin-guard.ts +141 -0
- package/src/rsc/progressive-enhancement.ts +366 -0
- package/src/rsc/response-error.ts +37 -0
- package/src/rsc/response-route-handler.ts +347 -0
- package/src/rsc/rsc-rendering.ts +250 -0
- package/src/rsc/runtime-warnings.ts +42 -0
- package/src/rsc/server-action.ts +344 -0
- package/src/rsc/types.ts +38 -14
- package/src/search-params.ts +227 -0
- package/src/segment-system.tsx +59 -61
- package/src/server/context.ts +217 -49
- package/src/server/cookie-store.ts +190 -0
- package/src/server/fetchable-loader-store.ts +37 -0
- package/src/server/handle-store.ts +98 -20
- package/src/server/loader-registry.ts +15 -56
- package/src/server/request-context.ts +406 -65
- package/src/server.ts +32 -133
- package/src/ssr/index.tsx +157 -26
- package/src/static-handler.ts +114 -0
- package/src/theme/ThemeProvider.tsx +21 -15
- package/src/theme/ThemeScript.tsx +5 -5
- package/src/theme/constants.ts +11 -4
- package/src/theme/index.ts +6 -7
- package/src/theme/theme-context.ts +5 -31
- package/src/theme/theme-script.ts +21 -18
- package/src/theme/types.ts +1 -1
- package/src/types/boundaries.ts +158 -0
- package/src/types/cache-types.ts +198 -0
- package/src/types/error-types.ts +192 -0
- package/src/types/global-namespace.ts +100 -0
- package/src/types/handler-context.ts +691 -0
- package/src/types/index.ts +88 -0
- package/src/types/loader-types.ts +183 -0
- package/src/types/route-config.ts +161 -0
- package/src/types/route-entry.ts +102 -0
- package/src/types/segments.ts +153 -0
- package/src/types.ts +1 -1561
- package/src/urls/include-helper.ts +197 -0
- package/src/urls/index.ts +53 -0
- package/src/urls/path-helper-types.ts +339 -0
- package/src/urls/path-helper.ts +329 -0
- package/src/urls/pattern-types.ts +95 -0
- package/src/urls/response-types.ts +106 -0
- package/src/urls/type-extraction.ts +372 -0
- package/src/urls/urls-function.ts +98 -0
- package/src/urls.ts +1 -726
- package/src/use-loader.tsx +85 -77
- package/src/vite/discovery/bundle-postprocess.ts +209 -0
- package/src/vite/discovery/discover-routers.ts +345 -0
- package/src/vite/discovery/prerender-collection.ts +365 -0
- package/src/vite/discovery/route-types-writer.ts +258 -0
- package/src/vite/discovery/self-gen-tracking.ts +47 -0
- package/src/vite/discovery/state.ts +113 -0
- package/src/vite/discovery/virtual-module-codegen.ts +203 -0
- package/src/vite/index.ts +10 -782
- package/src/vite/plugin-types.ts +131 -0
- package/src/vite/plugins/cjs-to-esm.ts +93 -0
- package/src/vite/plugins/client-ref-dedup.ts +115 -0
- package/src/vite/plugins/client-ref-hashing.ts +105 -0
- package/src/vite/{expose-action-id.ts → plugins/expose-action-id.ts} +72 -51
- package/src/vite/plugins/expose-id-utils.ts +287 -0
- package/src/vite/plugins/expose-ids/export-analysis.ts +296 -0
- package/src/vite/plugins/expose-ids/handler-transform.ts +179 -0
- package/src/vite/plugins/expose-ids/loader-transform.ts +74 -0
- package/src/vite/plugins/expose-ids/router-transform.ts +110 -0
- package/src/vite/plugins/expose-ids/types.ts +45 -0
- package/src/vite/plugins/expose-internal-ids.ts +569 -0
- package/src/vite/plugins/use-cache-transform.ts +323 -0
- package/src/vite/plugins/version-injector.ts +83 -0
- package/src/vite/plugins/version-plugin.ts +254 -0
- package/src/vite/plugins/virtual-entries.ts +123 -0
- package/src/vite/plugins/virtual-stub-plugin.ts +29 -0
- package/src/vite/rango.ts +510 -0
- package/src/vite/router-discovery.ts +781 -0
- package/src/vite/utils/ast-handler-extract.ts +517 -0
- package/src/vite/utils/banner.ts +36 -0
- package/src/vite/utils/bundle-analysis.ts +137 -0
- package/src/vite/utils/manifest-utils.ts +70 -0
- package/src/vite/{package-resolution.ts → utils/package-resolution.ts} +25 -29
- package/src/vite/utils/prerender-utils.ts +129 -0
- package/src/vite/utils/shared-utils.ts +169 -0
- package/CLAUDE.md +0 -7
- package/src/__tests__/component-utils.test.ts +0 -76
- package/src/__tests__/route-definition.test.ts +0 -63
- package/src/__tests__/urls.test.tsx +0 -436
- package/src/browser/lru-cache.ts +0 -69
- package/src/browser/request-controller.ts +0 -164
- package/src/cache/__tests__/document-cache.test.ts +0 -522
- package/src/cache/__tests__/memory-segment-store.test.ts +0 -487
- package/src/cache/__tests__/memory-store.test.ts +0 -484
- package/src/cache/cf/__tests__/cf-cache-store.test.ts +0 -428
- package/src/cache/memory-store.ts +0 -253
- package/src/href.ts +0 -177
- package/src/route-utils.ts +0 -89
- package/src/router/__tests__/match-context.test.ts +0 -104
- package/src/router/__tests__/match-pipelines.test.ts +0 -537
- package/src/router/__tests__/match-result.test.ts +0 -566
- package/src/router/__tests__/on-error.test.ts +0 -935
- package/src/router/__tests__/pattern-matching.test.ts +0 -577
- package/src/router/middleware.test.ts +0 -1355
- package/src/rsc/__tests__/helpers.test.ts +0 -175
- package/src/server/__tests__/request-context.test.ts +0 -171
- package/src/ssr/__tests__/ssr-handler.test.tsx +0 -188
- package/src/theme/__tests__/theme.test.ts +0 -120
- package/src/vite/__tests__/expose-loader-id.test.ts +0 -117
- package/src/vite/expose-handle-id.ts +0 -209
- package/src/vite/expose-loader-id.ts +0 -357
- package/src/vite/expose-location-state-id.ts +0 -177
- /package/src/vite/{version.d.ts → plugins/version.d.ts} +0 -0
|
@@ -5,14 +5,20 @@ import type {
|
|
|
5
5
|
ResolvedSegment,
|
|
6
6
|
} from "./types.js";
|
|
7
7
|
import type { ReactNode } from "react";
|
|
8
|
+
import * as React from "react";
|
|
8
9
|
import { startTransition } from "react";
|
|
10
|
+
|
|
11
|
+
// addTransitionType is only available in React experimental
|
|
12
|
+
const addTransitionType: ((type: string) => void) | undefined =
|
|
13
|
+
"addTransitionType" in React ? (React as any).addTransitionType : undefined;
|
|
9
14
|
import type { RenderSegmentsOptions } from "../segment-system.js";
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
} from "
|
|
15
|
-
import
|
|
15
|
+
import { reconcileSegments } from "./segment-reconciler.js";
|
|
16
|
+
import type { ReconcileActor } from "./segment-reconciler.js";
|
|
17
|
+
import { hasActiveIntercept as hasActiveInterceptSlots } from "./intercept-utils.js";
|
|
18
|
+
import type { BoundTransaction } from "./navigation-transaction.js";
|
|
19
|
+
import { ServerRedirect } from "../errors.js";
|
|
20
|
+
import { debugLog } from "./logging.js";
|
|
21
|
+
import { validateRedirectOrigin } from "./validate-redirect-origin.js";
|
|
16
22
|
|
|
17
23
|
/**
|
|
18
24
|
* Configuration for creating a partial updater
|
|
@@ -41,12 +47,30 @@ export interface CommitOverrides {
|
|
|
41
47
|
intercept?: boolean;
|
|
42
48
|
/** Source URL where intercept was triggered from */
|
|
43
49
|
interceptSourceUrl?: string;
|
|
50
|
+
/** Server-set location state to merge into history.pushState */
|
|
51
|
+
serverState?: Record<string, unknown>;
|
|
44
52
|
}
|
|
45
53
|
|
|
46
54
|
/**
|
|
47
|
-
*
|
|
48
|
-
* Transaction encapsulates all store mutations for atomic commit
|
|
55
|
+
* Discriminated update mode for partial updates.
|
|
49
56
|
*/
|
|
57
|
+
export type UpdateMode =
|
|
58
|
+
| {
|
|
59
|
+
type: "navigate";
|
|
60
|
+
/** Cached segments for the target URL. When provided, these are used to build
|
|
61
|
+
* the segment map instead of the current page's segments. This ensures consistency
|
|
62
|
+
* when we send cached segment IDs to the server - if the server returns empty diff,
|
|
63
|
+
* we use the same segments we told the server we have. */
|
|
64
|
+
targetCacheSegments?: ResolvedSegment[];
|
|
65
|
+
/** Cached handle data for the target URL. When server returns empty diff and we're
|
|
66
|
+
* rendering from cache, this is passed to the UI to restore breadcrumbs etc. */
|
|
67
|
+
targetCacheHandleData?: Record<string, Record<string, unknown[]>>;
|
|
68
|
+
/** Source URL for intercept restore (popstate cache miss) */
|
|
69
|
+
interceptSourceUrl?: string;
|
|
70
|
+
}
|
|
71
|
+
| { type: "leave-intercept" }
|
|
72
|
+
| { type: "stale-revalidation"; interceptSourceUrl?: string }
|
|
73
|
+
| { type: "action"; interceptSourceUrl?: string };
|
|
50
74
|
|
|
51
75
|
/**
|
|
52
76
|
* Type for the fetchPartialUpdate function
|
|
@@ -56,21 +80,9 @@ export type PartialUpdater = (
|
|
|
56
80
|
segmentIds: string[] | undefined,
|
|
57
81
|
isRetry: boolean,
|
|
58
82
|
signal: AbortSignal | undefined,
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
staleRevalidation?: boolean;
|
|
63
|
-
interceptSourceUrl?: string;
|
|
64
|
-
/** Cached segments for the target URL. When provided, these are used to build
|
|
65
|
-
* the segment map instead of the current page's segments. This ensures consistency
|
|
66
|
-
* when we send cached segment IDs to the server - if the server returns empty diff,
|
|
67
|
-
* we use the same segments we told the server we have. */
|
|
68
|
-
targetCacheSegments?: ResolvedSegment[];
|
|
69
|
-
/** Cached handle data for the target URL. When server returns empty diff and we're
|
|
70
|
-
* rendering from cache, this is passed to the UI to restore breadcrumbs etc. */
|
|
71
|
-
targetCacheHandleData?: Record<string, Record<string, unknown[]>>;
|
|
72
|
-
},
|
|
73
|
-
) => Promise<Promise<void>>;
|
|
83
|
+
tx: BoundTransaction,
|
|
84
|
+
mode?: UpdateMode,
|
|
85
|
+
) => Promise<void>;
|
|
74
86
|
|
|
75
87
|
/**
|
|
76
88
|
* Create a partial updater for fetching and applying RSC partial updates
|
|
@@ -80,18 +92,6 @@ export type PartialUpdater = (
|
|
|
80
92
|
*
|
|
81
93
|
* @param config - Partial update configuration
|
|
82
94
|
* @returns fetchPartialUpdate function
|
|
83
|
-
*
|
|
84
|
-
* @example
|
|
85
|
-
* ```typescript
|
|
86
|
-
* const fetchPartialUpdate = createPartialUpdater({
|
|
87
|
-
* store,
|
|
88
|
-
* client,
|
|
89
|
-
* onUpdate: (update) => store.emit(update),
|
|
90
|
-
* renderSegments,
|
|
91
|
-
* });
|
|
92
|
-
*
|
|
93
|
-
* await fetchPartialUpdate('/new-page');
|
|
94
|
-
* ```
|
|
95
95
|
*/
|
|
96
96
|
export function createPartialUpdater(
|
|
97
97
|
config: PartialUpdateConfig,
|
|
@@ -99,20 +99,16 @@ export function createPartialUpdater(
|
|
|
99
99
|
const { store, client, onUpdate, renderSegments, version } = config;
|
|
100
100
|
|
|
101
101
|
/**
|
|
102
|
-
*
|
|
102
|
+
* Get current page's cached segments as an array
|
|
103
103
|
*/
|
|
104
|
-
function
|
|
104
|
+
function getCurrentCachedSegments(): ResolvedSegment[] {
|
|
105
105
|
const currentKey = store.getHistoryKey();
|
|
106
106
|
const cached = store.getCachedSegments(currentKey);
|
|
107
|
-
|
|
108
|
-
const map = new Map<string, ResolvedSegment>();
|
|
109
|
-
cachedSegments.forEach((s) => map.set(s.id, s));
|
|
110
|
-
return map;
|
|
107
|
+
return cached?.segments || [];
|
|
111
108
|
}
|
|
112
109
|
|
|
113
110
|
/**
|
|
114
111
|
* Fetch partial update and trigger UI update
|
|
115
|
-
* Returns a promise that resolves when the RSC stream is fully consumed
|
|
116
112
|
*
|
|
117
113
|
* @param tx - Transaction for committing segment state (required)
|
|
118
114
|
* @param signal - AbortSignal to check if navigation is stale (not for aborting fetch)
|
|
@@ -123,102 +119,127 @@ export function createPartialUpdater(
|
|
|
123
119
|
isRetry: boolean,
|
|
124
120
|
signal: AbortSignal | undefined,
|
|
125
121
|
tx: BoundTransaction,
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
staleRevalidation?: boolean;
|
|
129
|
-
interceptSourceUrl?: string;
|
|
130
|
-
targetCacheSegments?: ResolvedSegment[];
|
|
131
|
-
targetCacheHandleData?: Record<string, Record<string, unknown[]>>;
|
|
132
|
-
},
|
|
133
|
-
): Promise<Promise<void>> {
|
|
134
|
-
const {
|
|
135
|
-
isAction = false,
|
|
136
|
-
staleRevalidation = false,
|
|
137
|
-
interceptSourceUrl,
|
|
138
|
-
targetCacheSegments,
|
|
139
|
-
targetCacheHandleData,
|
|
140
|
-
} = options || {};
|
|
122
|
+
mode: UpdateMode = { type: "navigate" },
|
|
123
|
+
): Promise<void> {
|
|
141
124
|
const segmentState = store.getSegmentState();
|
|
142
125
|
const url = targetUrl || window.location.href;
|
|
143
126
|
|
|
144
127
|
// Capture history key at start for stale revalidation consistency check
|
|
145
128
|
const historyKeyAtStart = store.getHistoryKey();
|
|
146
|
-
|
|
129
|
+
|
|
130
|
+
// Derive interceptSourceUrl from modes that carry it
|
|
131
|
+
const interceptSourceUrl =
|
|
132
|
+
mode.type === "stale-revalidation" ||
|
|
133
|
+
mode.type === "action" ||
|
|
134
|
+
mode.type === "navigate"
|
|
135
|
+
? mode.interceptSourceUrl
|
|
136
|
+
: undefined;
|
|
137
|
+
|
|
138
|
+
// When leaving intercept, filter out intercept-specific segments
|
|
139
|
+
let segments: string[];
|
|
140
|
+
if (mode.type === "leave-intercept") {
|
|
141
|
+
const currentSegments = segmentIds ?? segmentState.currentSegmentIds;
|
|
142
|
+
const currentCached = getCurrentCachedSegments();
|
|
143
|
+
const interceptIds = new Set(
|
|
144
|
+
currentCached
|
|
145
|
+
.filter((s) => s.namespace?.startsWith("intercept:"))
|
|
146
|
+
.map((s) => s.id),
|
|
147
|
+
);
|
|
148
|
+
segments = currentSegments.filter((id) => !interceptIds.has(id));
|
|
149
|
+
debugLog(
|
|
150
|
+
`[Browser] Leaving intercept - filtered segments: ${segments.join(", ")}`,
|
|
151
|
+
);
|
|
152
|
+
} else {
|
|
153
|
+
segments = segmentIds ?? segmentState.currentSegmentIds;
|
|
154
|
+
}
|
|
147
155
|
|
|
148
156
|
// For intercept revalidation, use the intercept source URL as previousUrl
|
|
149
|
-
// This tells the server the route should be treated as an intercept
|
|
150
157
|
const previousUrl =
|
|
151
158
|
interceptSourceUrl || tx.currentUrl || segmentState.currentUrl;
|
|
152
159
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
160
|
+
debugLog(`\n[Browser] >>> NAVIGATION`);
|
|
161
|
+
debugLog(`[Browser] From: ${previousUrl}`);
|
|
162
|
+
debugLog(`[Browser] To: ${url}`);
|
|
163
|
+
debugLog(`[Browser] Segments to send: ${segments.join(", ")}`);
|
|
157
164
|
if (interceptSourceUrl) {
|
|
158
|
-
|
|
165
|
+
debugLog(`[Browser] Intercept context from: ${interceptSourceUrl}`);
|
|
159
166
|
}
|
|
160
167
|
|
|
161
|
-
//
|
|
162
|
-
// When
|
|
163
|
-
// to ensure consistency - we use the same segments we told the server we have.
|
|
168
|
+
// Get cached segments for merging with server diff.
|
|
169
|
+
// When navigating with targetCacheSegments, use those for consistency.
|
|
164
170
|
// Otherwise fall back to current page's segments (for same-route revalidation).
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
// Mark navigation as streaming (response received, now parsing RSC)
|
|
173
|
-
// The token is ended when the stream completes
|
|
174
|
-
const streamingToken = tx.startStreaming();
|
|
171
|
+
const targetCache =
|
|
172
|
+
mode.type === "navigate" ? mode.targetCacheSegments : undefined;
|
|
173
|
+
const cachedSegs =
|
|
174
|
+
targetCache && targetCache.length > 0
|
|
175
|
+
? targetCache
|
|
176
|
+
: getCurrentCachedSegments();
|
|
177
|
+
|
|
175
178
|
// Fetch partial payload (no abort signal - RSC doesn't support it well)
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
179
|
+
let fetchResult: Awaited<ReturnType<NavigationClient["fetchPartial"]>>;
|
|
180
|
+
fetchResult = await client.fetchPartial({
|
|
181
|
+
targetUrl: url,
|
|
182
|
+
segmentIds: segments,
|
|
183
|
+
previousUrl,
|
|
184
|
+
// Mark stale when explicitly requested OR when no segments are sent
|
|
185
|
+
// (action redirect sends empty segments for a fresh render).
|
|
186
|
+
staleRevalidation:
|
|
187
|
+
mode.type === "stale-revalidation" || segments.length === 0,
|
|
188
|
+
version,
|
|
189
|
+
});
|
|
190
|
+
// Mark navigation as streaming (response received, now parsing RSC).
|
|
191
|
+
// Called after fetchPartial so pendingUrl stays set during the network wait,
|
|
192
|
+
// allowing useLinkStatus to show per-link pending indicators.
|
|
193
|
+
const streamingToken = tx.startStreaming();
|
|
194
|
+
const { payload, streamComplete: rawStreamComplete } = fetchResult;
|
|
195
|
+
debugLog("payload.metadata", payload.metadata);
|
|
185
196
|
|
|
186
197
|
const streamComplete = rawStreamComplete.then(() => {
|
|
187
198
|
streamingToken.end();
|
|
188
199
|
});
|
|
189
200
|
|
|
201
|
+
// Handle server-side redirect with state
|
|
202
|
+
if (payload.metadata?.redirect) {
|
|
203
|
+
if (signal?.aborted) {
|
|
204
|
+
debugLog("[Browser] Ignoring stale redirect (aborted)");
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
const redirectUrl = validateRedirectOrigin(
|
|
208
|
+
payload.metadata.redirect.url,
|
|
209
|
+
window.location.origin,
|
|
210
|
+
);
|
|
211
|
+
if (!redirectUrl) {
|
|
212
|
+
debugLog("[Browser] Ignoring blocked redirect payload");
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
const serverState = payload.metadata.locationState;
|
|
216
|
+
throw new ServerRedirect(redirectUrl, serverState);
|
|
217
|
+
}
|
|
218
|
+
|
|
190
219
|
if (payload.metadata?.isPartial) {
|
|
191
220
|
const { segments: newSegments, matched, diff } = payload.metadata;
|
|
192
221
|
|
|
193
222
|
// Check if this navigation is stale (a newer one started)
|
|
194
223
|
if (signal?.aborted) {
|
|
195
|
-
|
|
196
|
-
return
|
|
224
|
+
debugLog("[Browser] Ignoring stale navigation (aborted)");
|
|
225
|
+
return;
|
|
197
226
|
}
|
|
198
227
|
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
// Create lookup for new segments from server
|
|
203
|
-
const newSegmentMap = new Map<string, ResolvedSegment>();
|
|
204
|
-
(newSegments || []).forEach((s: ResolvedSegment) =>
|
|
205
|
-
newSegmentMap.set(s.id, s),
|
|
206
|
-
);
|
|
228
|
+
debugLog(`[Browser] Partial update - matched: ${matched?.join(", ")}`);
|
|
229
|
+
debugLog(`[Browser] Diff: ${diff?.join(", ")}`);
|
|
207
230
|
|
|
208
231
|
// If diff is empty, nothing changed on server side.
|
|
209
|
-
// However, if we're navigating with targetCacheSegments (to a different route),
|
|
210
|
-
// we still need to render those segments since the UI is showing the old route.
|
|
211
232
|
if (!diff || diff.length === 0) {
|
|
212
233
|
const matchedIds = matched || [];
|
|
234
|
+
const cacheMap = new Map(cachedSegs.map((s) => [s.id, s]));
|
|
213
235
|
const existingSegments = matchedIds
|
|
214
|
-
.map((id: string) =>
|
|
236
|
+
.map((id: string) => cacheMap.get(id))
|
|
215
237
|
.filter(Boolean) as ResolvedSegment[];
|
|
216
238
|
|
|
217
239
|
// When navigating with cached segments to a different route, render them.
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
`[Browser] No diff but navigating with cached segments - rendering target route`,
|
|
240
|
+
if (mode.type === "navigate" && targetCache && targetCache.length > 0) {
|
|
241
|
+
debugLog(
|
|
242
|
+
"[Browser] No diff but navigating with cached segments - rendering target route",
|
|
222
243
|
);
|
|
223
244
|
|
|
224
245
|
const newTree = await renderSegments(existingSegments, {
|
|
@@ -229,98 +250,86 @@ export function createPartialUpdater(
|
|
|
229
250
|
|
|
230
251
|
// Include cachedHandleData in metadata so NavigationProvider can restore
|
|
231
252
|
// breadcrumbs and other handle data from cache.
|
|
232
|
-
//
|
|
253
|
+
// Remove `handles` from metadata to prevent NavigationProvider from
|
|
233
254
|
// processing an empty handles stream, which would clear the cached breadcrumbs.
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
255
|
+
const { handles: _unusedHandles, ...metadataWithoutHandles } =
|
|
256
|
+
payload.metadata!;
|
|
257
|
+
const cachedUpdate = {
|
|
237
258
|
root: newTree,
|
|
238
259
|
metadata: {
|
|
239
260
|
...metadataWithoutHandles,
|
|
240
|
-
cachedHandleData: targetCacheHandleData,
|
|
261
|
+
cachedHandleData: mode.targetCacheHandleData,
|
|
241
262
|
},
|
|
263
|
+
};
|
|
264
|
+
|
|
265
|
+
const cachedHasTransition = existingSegments.some(
|
|
266
|
+
(s) => s.transition,
|
|
267
|
+
);
|
|
268
|
+
if (cachedHasTransition) {
|
|
269
|
+
startTransition(() => {
|
|
270
|
+
if (addTransitionType) {
|
|
271
|
+
addTransitionType("navigation");
|
|
272
|
+
}
|
|
273
|
+
onUpdate(cachedUpdate);
|
|
274
|
+
});
|
|
275
|
+
} else {
|
|
276
|
+
onUpdate(cachedUpdate);
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
debugLog("[Browser] Navigation complete (rendered from cache)");
|
|
280
|
+
return;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
// When leaving intercept, force re-render even with empty diff
|
|
284
|
+
if (mode.type === "leave-intercept") {
|
|
285
|
+
debugLog(
|
|
286
|
+
"[Browser] Leaving intercept - forcing re-render to remove modal",
|
|
287
|
+
);
|
|
288
|
+
|
|
289
|
+
const newTree = await renderSegments(existingSegments, {
|
|
290
|
+
forceAwait: true,
|
|
291
|
+
});
|
|
292
|
+
|
|
293
|
+
tx.commit(matchedIds, existingSegments);
|
|
294
|
+
|
|
295
|
+
onUpdate({
|
|
296
|
+
root: newTree,
|
|
297
|
+
metadata: payload.metadata,
|
|
242
298
|
});
|
|
243
299
|
|
|
244
|
-
|
|
245
|
-
return
|
|
300
|
+
debugLog("[Browser] Navigation complete (left intercept)");
|
|
301
|
+
return;
|
|
246
302
|
}
|
|
247
303
|
|
|
248
304
|
// Same route revalidation with no changes - skip UI update
|
|
249
|
-
|
|
250
|
-
|
|
305
|
+
debugLog(
|
|
306
|
+
"[Browser] No changes - all revalidations returned false, keeping existing UI",
|
|
251
307
|
);
|
|
252
308
|
tx.commit(matchedIds, existingSegments);
|
|
253
|
-
|
|
254
|
-
return
|
|
309
|
+
debugLog("[Browser] Navigation complete (no re-render)");
|
|
310
|
+
return;
|
|
255
311
|
}
|
|
256
312
|
|
|
257
|
-
//
|
|
258
|
-
// - New/changed segments from server response (diff)
|
|
259
|
-
// - Unchanged segments from current page's cache
|
|
313
|
+
// Reconcile server segments with cached segments (single source of truth)
|
|
260
314
|
const matchedIds = matched || [];
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
// First check server response (new/updated segments)
|
|
275
|
-
const fromServer = newSegmentMap.get(id);
|
|
276
|
-
if (fromServer) {
|
|
277
|
-
// For partial revalidation (stale or action), merge server's new loader data
|
|
278
|
-
// with cached loader data when server returns fewer loaders than cached
|
|
279
|
-
const fromCache = currentSegmentMap.get(id);
|
|
280
|
-
if (
|
|
281
|
-
(staleRevalidation || isAction) &&
|
|
282
|
-
needsLoaderMerge(fromServer, fromCache)
|
|
283
|
-
) {
|
|
284
|
-
return mergeSegmentLoaders(fromServer, fromCache);
|
|
285
|
-
}
|
|
286
|
-
// When server returns component: null for a layout segment, it means
|
|
287
|
-
// "this segment doesn't need re-rendering" - preserve the cached component
|
|
288
|
-
// to maintain the outlet chain and prevent React tree changes
|
|
289
|
-
if (
|
|
290
|
-
fromServer.component === null &&
|
|
291
|
-
fromServer.type === "layout" &&
|
|
292
|
-
fromCache?.component != null
|
|
293
|
-
) {
|
|
294
|
-
console.log(
|
|
295
|
-
`[Browser] Preserving cached component for layout ${id} (server returned null)`,
|
|
296
|
-
);
|
|
297
|
-
return { ...fromServer, component: fromCache.component };
|
|
298
|
-
}
|
|
299
|
-
return fromServer;
|
|
300
|
-
}
|
|
301
|
-
// Fall back to current page's cached segments
|
|
302
|
-
const fromCache = currentSegmentMap.get(id);
|
|
303
|
-
if (!fromCache) {
|
|
304
|
-
console.warn(`[Browser] Missing segment: ${id}`);
|
|
305
|
-
return fromCache;
|
|
306
|
-
}
|
|
307
|
-
// Clear loading for cached segments to prevent suspense - server decided
|
|
308
|
-
// this segment doesn't need re-rendering, so show content as-is
|
|
309
|
-
if (fromCache.loading !== undefined) {
|
|
310
|
-
return { ...fromCache, loading: undefined };
|
|
311
|
-
}
|
|
312
|
-
return fromCache;
|
|
313
|
-
})
|
|
314
|
-
.filter(Boolean) as ResolvedSegment[];
|
|
315
|
-
|
|
316
|
-
// Insert diff segments not in matchedIds (e.g., loader segments from consolidation fetch)
|
|
317
|
-
insertMissingDiffSegments(allSegments, diff, matchedIdSet, newSegmentMap);
|
|
315
|
+
const actor: ReconcileActor =
|
|
316
|
+
mode.type === "stale-revalidation" || mode.type === "action"
|
|
317
|
+
? "stale-revalidation"
|
|
318
|
+
: "navigation";
|
|
319
|
+
|
|
320
|
+
const reconciled = reconcileSegments({
|
|
321
|
+
actor,
|
|
322
|
+
matched: matchedIds,
|
|
323
|
+
diff: diff || [],
|
|
324
|
+
serverSegments: newSegments || [],
|
|
325
|
+
cachedSegments: cachedSegs,
|
|
326
|
+
insertMissingDiff: true,
|
|
327
|
+
});
|
|
318
328
|
|
|
319
329
|
// HMR RESILIENCE: Check if we're missing any matched segments
|
|
320
|
-
|
|
321
|
-
const allSegmentIdSet = new Set(allSegments.map((s) => s.id));
|
|
330
|
+
const reconciledIdSet = new Set(reconciled.segments.map((s) => s.id));
|
|
322
331
|
const missingIds = matchedIds.filter(
|
|
323
|
-
(id: string) => !
|
|
332
|
+
(id: string) => !reconciledIdSet.has(id),
|
|
324
333
|
);
|
|
325
334
|
|
|
326
335
|
if (missingIds.length > 0) {
|
|
@@ -333,52 +342,39 @@ export function createPartialUpdater(
|
|
|
333
342
|
);
|
|
334
343
|
}
|
|
335
344
|
if (signal?.aborted) {
|
|
336
|
-
|
|
337
|
-
|
|
345
|
+
debugLog(
|
|
346
|
+
"[Browser] Ignoring stale navigation (aborted during HMR retry)",
|
|
338
347
|
);
|
|
339
|
-
return
|
|
348
|
+
return;
|
|
340
349
|
}
|
|
341
|
-
if (
|
|
342
|
-
return
|
|
350
|
+
if (mode.type === "action") {
|
|
351
|
+
return;
|
|
343
352
|
}
|
|
344
353
|
console.warn(
|
|
345
354
|
`[Browser] HMR detected: Missing ${missingCount} segments. Refetching all...`,
|
|
346
355
|
);
|
|
347
356
|
|
|
348
357
|
// Refetch with empty segments = server sends everything
|
|
349
|
-
return fetchPartialUpdate(url, [], true, signal, tx,
|
|
358
|
+
return fetchPartialUpdate(url, [], true, signal, tx, mode);
|
|
350
359
|
}
|
|
351
360
|
|
|
352
|
-
// INTERCEPT HANDLING: Separate intercept segments for explicit injection
|
|
353
|
-
// Intercept segments have namespace starting with "intercept:" or ID containing .@
|
|
354
|
-
// This makes the flow clearer and easier to debug
|
|
355
|
-
const isInterceptSegment = (s: ResolvedSegment) =>
|
|
356
|
-
s.namespace?.startsWith("intercept:") ||
|
|
357
|
-
(s.type === "parallel" && s.id.includes(".@"));
|
|
358
|
-
|
|
359
|
-
const interceptSegments = allSegments.filter(isInterceptSegment);
|
|
360
|
-
const mainSegments = allSegments.filter((s) => !isInterceptSegment(s));
|
|
361
|
-
|
|
362
361
|
if (signal?.aborted) {
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
);
|
|
366
|
-
return streamComplete;
|
|
362
|
+
debugLog("[Browser] Ignoring stale navigation (aborted before render)");
|
|
363
|
+
return;
|
|
367
364
|
}
|
|
368
365
|
|
|
369
366
|
// Rebuild tree on client (await for loader data resolution)
|
|
370
|
-
// Race against abort signal to allow cancellation during loader awaiting
|
|
371
|
-
// Pass intercept segments separately for explicit handling
|
|
372
|
-
// For stale revalidation, use forceAwait to ensure no loading fallbacks
|
|
373
367
|
const renderOptions = {
|
|
374
|
-
isAction,
|
|
375
|
-
forceAwait:
|
|
368
|
+
isAction: mode.type === "action",
|
|
369
|
+
forceAwait: mode.type === "stale-revalidation",
|
|
376
370
|
interceptSegments:
|
|
377
|
-
interceptSegments.length > 0
|
|
371
|
+
reconciled.interceptSegments.length > 0
|
|
372
|
+
? reconciled.interceptSegments
|
|
373
|
+
: undefined,
|
|
378
374
|
};
|
|
379
375
|
const newTree = await (signal
|
|
380
376
|
? Promise.race([
|
|
381
|
-
renderSegments(mainSegments, renderOptions),
|
|
377
|
+
renderSegments(reconciled.mainSegments, renderOptions),
|
|
382
378
|
new Promise<never>((_, reject) => {
|
|
383
379
|
if (signal.aborted) {
|
|
384
380
|
reject(new DOMException("Navigation aborted", "AbortError"));
|
|
@@ -388,85 +384,79 @@ export function createPartialUpdater(
|
|
|
388
384
|
});
|
|
389
385
|
}),
|
|
390
386
|
])
|
|
391
|
-
: renderSegments(mainSegments, renderOptions));
|
|
387
|
+
: renderSegments(reconciled.mainSegments, renderOptions));
|
|
392
388
|
|
|
393
389
|
// Final abort check before committing - another navigation may have started
|
|
394
390
|
if (signal?.aborted) {
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
);
|
|
398
|
-
return streamComplete;
|
|
391
|
+
debugLog("[Browser] Ignoring stale navigation (aborted before commit)");
|
|
392
|
+
return;
|
|
399
393
|
}
|
|
400
394
|
|
|
401
395
|
// Check if this is an intercept response (any slot is active)
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
: false;
|
|
406
|
-
|
|
407
|
-
// BUG FIX: When navigating with cached target segments but receiving an intercept response,
|
|
408
|
-
// the background segments should come from the SOURCE page (where we navigated from),
|
|
409
|
-
// not the TARGET cache. This happens when:
|
|
410
|
-
// 1. User visits /product/xxx (detail page) - cached under key "/product/xxx"
|
|
411
|
-
// 2. User navigates back to /
|
|
412
|
-
// 3. User clicks product link → cache hit for "/product/xxx" (detail page)
|
|
413
|
-
// 4. But server returns intercept response (modal with index background)
|
|
414
|
-
// 5. Without this fix: background uses detail page segments (wrong!)
|
|
415
|
-
// 6. With this fix: rebuild currentSegmentMap from source page
|
|
416
|
-
if (hasActiveIntercept && targetCacheSegments) {
|
|
417
|
-
console.log(
|
|
418
|
-
`[Browser] Intercept response with target cache - rebuilding segment map from source page`,
|
|
419
|
-
);
|
|
420
|
-
currentSegmentMap = getCurrentSegmentMap();
|
|
421
|
-
}
|
|
396
|
+
const isInterceptResponse = hasActiveInterceptSlots(
|
|
397
|
+
payload.metadata?.slots,
|
|
398
|
+
);
|
|
422
399
|
|
|
423
|
-
// Track intercept context
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
400
|
+
// Track intercept context (only on navigation, not actions or stale revalidation)
|
|
401
|
+
// Use the authoritative source from mode/history state when restoring an
|
|
402
|
+
// intercept via popstate cache miss; fall back to the current URL for fresh
|
|
403
|
+
// intercept navigations.
|
|
404
|
+
const effectiveInterceptSource =
|
|
405
|
+
interceptSourceUrl || segmentState.currentUrl;
|
|
406
|
+
if (mode.type !== "action" && mode.type !== "stale-revalidation") {
|
|
407
|
+
if (isInterceptResponse) {
|
|
408
|
+
store.setInterceptSourceUrl(effectiveInterceptSource);
|
|
428
409
|
} else {
|
|
429
|
-
// Clear intercept context when navigating to a non-intercept route
|
|
430
410
|
store.setInterceptSourceUrl(null);
|
|
431
411
|
}
|
|
432
412
|
}
|
|
433
413
|
|
|
434
414
|
// Commit navigation - transaction handles all store mutations atomically
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
: undefined,
|
|
449
|
-
);
|
|
415
|
+
const allSegmentIds = reconciled.segments.map((s) => s.id);
|
|
416
|
+
const serverLocationState = payload.metadata?.locationState;
|
|
417
|
+
const overrides: CommitOverrides | undefined = isInterceptResponse
|
|
418
|
+
? {
|
|
419
|
+
scroll: false,
|
|
420
|
+
intercept: true,
|
|
421
|
+
interceptSourceUrl: effectiveInterceptSource,
|
|
422
|
+
...(serverLocationState && { serverState: serverLocationState }),
|
|
423
|
+
}
|
|
424
|
+
: serverLocationState
|
|
425
|
+
? { serverState: serverLocationState }
|
|
426
|
+
: undefined;
|
|
427
|
+
tx.commit(allSegmentIds, reconciled.segments, overrides);
|
|
450
428
|
|
|
451
429
|
// For stale revalidation: verify history key hasn't changed before updating UI
|
|
452
|
-
|
|
453
|
-
if (staleRevalidation) {
|
|
430
|
+
if (mode.type === "stale-revalidation") {
|
|
454
431
|
const historyKeyNow = store.getHistoryKey();
|
|
455
432
|
if (historyKeyNow !== historyKeyAtStart) {
|
|
456
|
-
|
|
433
|
+
debugLog(
|
|
457
434
|
`[Browser] Stale revalidation: history key changed (${historyKeyAtStart} -> ${historyKeyNow}), skipping UI update`,
|
|
458
435
|
);
|
|
459
|
-
return
|
|
436
|
+
return;
|
|
460
437
|
}
|
|
461
438
|
}
|
|
462
439
|
|
|
463
|
-
|
|
440
|
+
debugLog("[partial-update] updating document");
|
|
464
441
|
|
|
465
442
|
// Emit update to trigger React render
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
if (
|
|
443
|
+
const hasTransition = reconciled.mainSegments.some((s) => s.transition);
|
|
444
|
+
|
|
445
|
+
if (mode.type === "action" || mode.type === "stale-revalidation") {
|
|
446
|
+
startTransition(() => {
|
|
447
|
+
if (hasTransition && addTransitionType) {
|
|
448
|
+
addTransitionType("action");
|
|
449
|
+
}
|
|
450
|
+
onUpdate({
|
|
451
|
+
root: newTree,
|
|
452
|
+
metadata: payload.metadata!,
|
|
453
|
+
});
|
|
454
|
+
});
|
|
455
|
+
} else if (hasTransition) {
|
|
469
456
|
startTransition(() => {
|
|
457
|
+
if (addTransitionType) {
|
|
458
|
+
addTransitionType("navigation");
|
|
459
|
+
}
|
|
470
460
|
onUpdate({
|
|
471
461
|
root: newTree,
|
|
472
462
|
metadata: payload.metadata!,
|
|
@@ -479,77 +469,78 @@ export function createPartialUpdater(
|
|
|
479
469
|
});
|
|
480
470
|
}
|
|
481
471
|
|
|
482
|
-
|
|
483
|
-
return
|
|
472
|
+
debugLog("[Browser] Navigation complete");
|
|
473
|
+
return;
|
|
484
474
|
} else {
|
|
485
475
|
// Full update (fallback)
|
|
486
476
|
console.warn(`[Browser] Full update (fallback)`);
|
|
487
477
|
|
|
488
478
|
const segments = payload.metadata?.segments || [];
|
|
489
479
|
|
|
490
|
-
// Check if this navigation is stale (a newer one started)
|
|
491
480
|
if (signal?.aborted) {
|
|
492
|
-
|
|
493
|
-
return
|
|
494
|
-
}
|
|
495
|
-
|
|
496
|
-
// Await loader data from segments before committing URL
|
|
497
|
-
// This ensures URL only updates after loaders resolve
|
|
498
|
-
const loaderSegments = segments.filter(
|
|
499
|
-
(s: ResolvedSegment) =>
|
|
500
|
-
s.type === "loader" && s.loaderData !== undefined,
|
|
501
|
-
);
|
|
502
|
-
if (loaderSegments.length > 0) {
|
|
503
|
-
console.log(`[Browser] Awaiting ${loaderSegments.length} loader(s)...`);
|
|
504
|
-
await Promise.all(
|
|
505
|
-
loaderSegments.map((s: ResolvedSegment) =>
|
|
506
|
-
s.loaderData instanceof Promise
|
|
507
|
-
? s.loaderData
|
|
508
|
-
: Promise.resolve(s.loaderData),
|
|
509
|
-
),
|
|
510
|
-
);
|
|
511
|
-
console.log(`[Browser] Loaders resolved`);
|
|
481
|
+
debugLog("[Browser] Ignoring stale navigation (aborted)");
|
|
482
|
+
return;
|
|
512
483
|
}
|
|
513
484
|
|
|
514
485
|
const segmentIds = segments.map((s: ResolvedSegment) => s.id);
|
|
515
486
|
|
|
516
|
-
|
|
487
|
+
const newTree = await renderSegments(segments);
|
|
488
|
+
|
|
517
489
|
if (signal?.aborted) {
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
);
|
|
521
|
-
return streamComplete;
|
|
490
|
+
debugLog("[Browser] Ignoring stale navigation (aborted before commit)");
|
|
491
|
+
return;
|
|
522
492
|
}
|
|
523
493
|
|
|
524
|
-
|
|
525
|
-
|
|
494
|
+
const fullUpdateServerState = payload.metadata?.locationState;
|
|
495
|
+
if (fullUpdateServerState) {
|
|
496
|
+
tx.commit(segmentIds, segments, { serverState: fullUpdateServerState });
|
|
497
|
+
} else {
|
|
498
|
+
tx.commit(segmentIds, segments);
|
|
499
|
+
}
|
|
526
500
|
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
501
|
+
const fullHasTransition = segments.some(
|
|
502
|
+
(s: ResolvedSegment) => s.transition,
|
|
503
|
+
);
|
|
504
|
+
|
|
505
|
+
if (mode.type === "stale-revalidation") {
|
|
531
506
|
await rawStreamComplete;
|
|
532
507
|
startTransition(() => {
|
|
508
|
+
if (fullHasTransition && addTransitionType) {
|
|
509
|
+
addTransitionType("action");
|
|
510
|
+
}
|
|
533
511
|
onUpdate({
|
|
534
|
-
root:
|
|
512
|
+
root: newTree,
|
|
535
513
|
metadata: payload.metadata!,
|
|
536
514
|
});
|
|
537
515
|
});
|
|
538
|
-
} else if (
|
|
516
|
+
} else if (mode.type === "action") {
|
|
539
517
|
startTransition(async () => {
|
|
518
|
+
if (fullHasTransition && addTransitionType) {
|
|
519
|
+
addTransitionType("action");
|
|
520
|
+
}
|
|
521
|
+
onUpdate({
|
|
522
|
+
root: newTree,
|
|
523
|
+
metadata: payload.metadata!,
|
|
524
|
+
});
|
|
525
|
+
});
|
|
526
|
+
} else if (fullHasTransition) {
|
|
527
|
+
startTransition(() => {
|
|
528
|
+
if (addTransitionType) {
|
|
529
|
+
addTransitionType("navigation");
|
|
530
|
+
}
|
|
540
531
|
onUpdate({
|
|
541
|
-
root:
|
|
532
|
+
root: newTree,
|
|
542
533
|
metadata: payload.metadata!,
|
|
543
534
|
});
|
|
544
535
|
});
|
|
545
536
|
} else {
|
|
546
537
|
onUpdate({
|
|
547
|
-
root:
|
|
538
|
+
root: newTree,
|
|
548
539
|
metadata: payload.metadata!,
|
|
549
540
|
});
|
|
550
541
|
}
|
|
551
542
|
|
|
552
|
-
return
|
|
543
|
+
return;
|
|
553
544
|
}
|
|
554
545
|
}
|
|
555
546
|
|