@rangojs/router 0.0.0-experimental.140 → 0.0.0-experimental.142
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +6 -10
- package/README.md +17 -0
- package/dist/__internal.d.ts +83 -0
- package/dist/__internal.d.ts.map +1 -0
- package/dist/__internal.js +19 -0
- package/dist/__internal.js.map +1 -0
- package/dist/__mocks__/version.d.ts +7 -0
- package/dist/__mocks__/version.d.ts.map +1 -0
- package/dist/__mocks__/version.js +7 -0
- package/dist/__mocks__/version.js.map +1 -0
- package/dist/__tests__/client-href.test.d.ts +2 -0
- package/dist/__tests__/client-href.test.d.ts.map +1 -0
- package/dist/__tests__/client-href.test.js +74 -0
- package/dist/__tests__/client-href.test.js.map +1 -0
- package/dist/__tests__/component-utils.test.d.ts +2 -0
- package/dist/__tests__/component-utils.test.d.ts.map +1 -0
- package/dist/__tests__/component-utils.test.js +51 -0
- package/dist/__tests__/component-utils.test.js.map +1 -0
- package/dist/__tests__/event-controller.test.d.ts +2 -0
- package/dist/__tests__/event-controller.test.d.ts.map +1 -0
- package/dist/__tests__/event-controller.test.js +538 -0
- package/dist/__tests__/event-controller.test.js.map +1 -0
- package/dist/__tests__/helpers/route-tree.d.ts +118 -0
- package/dist/__tests__/helpers/route-tree.d.ts.map +1 -0
- package/dist/__tests__/helpers/route-tree.js +374 -0
- package/dist/__tests__/helpers/route-tree.js.map +1 -0
- package/dist/__tests__/match-result.test.d.ts +2 -0
- package/dist/__tests__/match-result.test.d.ts.map +1 -0
- package/dist/__tests__/match-result.test.js +154 -0
- package/dist/__tests__/match-result.test.js.map +1 -0
- package/dist/__tests__/navigation-store.test.d.ts +2 -0
- package/dist/__tests__/navigation-store.test.d.ts.map +1 -0
- package/dist/__tests__/navigation-store.test.js +440 -0
- package/dist/__tests__/navigation-store.test.js.map +1 -0
- package/dist/__tests__/partial-update.test.d.ts +2 -0
- package/dist/__tests__/partial-update.test.d.ts.map +1 -0
- package/dist/__tests__/partial-update.test.js +1009 -0
- package/dist/__tests__/partial-update.test.js.map +1 -0
- package/dist/__tests__/reverse-types.test.d.ts +8 -0
- package/dist/__tests__/reverse-types.test.d.ts.map +1 -0
- package/dist/__tests__/reverse-types.test.js +656 -0
- package/dist/__tests__/reverse-types.test.js.map +1 -0
- package/dist/__tests__/route-definition.test.d.ts +2 -0
- package/dist/__tests__/route-definition.test.d.ts.map +1 -0
- package/dist/__tests__/route-definition.test.js +55 -0
- package/dist/__tests__/route-definition.test.js.map +1 -0
- package/dist/__tests__/router-helpers.test.d.ts +2 -0
- package/dist/__tests__/router-helpers.test.d.ts.map +1 -0
- package/dist/__tests__/router-helpers.test.js +377 -0
- package/dist/__tests__/router-helpers.test.js.map +1 -0
- package/dist/__tests__/router-integration-2.test.d.ts +2 -0
- package/dist/__tests__/router-integration-2.test.d.ts.map +1 -0
- package/dist/__tests__/router-integration-2.test.js +426 -0
- package/dist/__tests__/router-integration-2.test.js.map +1 -0
- package/dist/__tests__/router-integration.test.d.ts +2 -0
- package/dist/__tests__/router-integration.test.d.ts.map +1 -0
- package/dist/__tests__/router-integration.test.js +1051 -0
- package/dist/__tests__/router-integration.test.js.map +1 -0
- package/dist/__tests__/search-params.test.d.ts +5 -0
- package/dist/__tests__/search-params.test.d.ts.map +1 -0
- package/dist/__tests__/search-params.test.js +306 -0
- package/dist/__tests__/search-params.test.js.map +1 -0
- package/dist/__tests__/segment-system.test.d.ts +2 -0
- package/dist/__tests__/segment-system.test.d.ts.map +1 -0
- package/dist/__tests__/segment-system.test.js +627 -0
- package/dist/__tests__/segment-system.test.js.map +1 -0
- package/dist/__tests__/static-handler-types.test.d.ts +8 -0
- package/dist/__tests__/static-handler-types.test.d.ts.map +1 -0
- package/dist/__tests__/static-handler-types.test.js +63 -0
- package/dist/__tests__/static-handler-types.test.js.map +1 -0
- package/dist/__tests__/urls.test.d.ts +2 -0
- package/dist/__tests__/urls.test.d.ts.map +1 -0
- package/dist/__tests__/urls.test.js +421 -0
- package/dist/__tests__/urls.test.js.map +1 -0
- package/dist/__tests__/use-mount.test.d.ts +2 -0
- package/dist/__tests__/use-mount.test.d.ts.map +1 -0
- package/dist/__tests__/use-mount.test.js +35 -0
- package/dist/__tests__/use-mount.test.js.map +1 -0
- package/dist/bin/rango.d.ts +2 -0
- package/dist/bin/rango.d.ts.map +1 -0
- package/dist/bin/rango.js.map +1 -0
- package/dist/browser/event-controller.d.ts +191 -0
- package/dist/browser/event-controller.d.ts.map +1 -0
- package/dist/browser/event-controller.js +559 -0
- package/dist/browser/event-controller.js.map +1 -0
- package/dist/browser/index.d.ts +2 -0
- package/dist/browser/index.d.ts.map +1 -0
- package/dist/browser/index.js +14 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/browser/link-interceptor.d.ts +38 -0
- package/dist/browser/link-interceptor.d.ts.map +1 -0
- package/dist/browser/link-interceptor.js +99 -0
- package/dist/browser/link-interceptor.js.map +1 -0
- package/dist/browser/logging.d.ts +10 -0
- package/dist/browser/logging.d.ts.map +1 -0
- package/dist/browser/logging.js +29 -0
- package/dist/browser/logging.js.map +1 -0
- package/dist/browser/lru-cache.d.ts +17 -0
- package/dist/browser/lru-cache.d.ts.map +1 -0
- package/dist/browser/lru-cache.js +50 -0
- package/dist/browser/lru-cache.js.map +1 -0
- package/dist/browser/merge-segment-loaders.d.ts +39 -0
- package/dist/browser/merge-segment-loaders.d.ts.map +1 -0
- package/dist/browser/merge-segment-loaders.js +102 -0
- package/dist/browser/merge-segment-loaders.js.map +1 -0
- package/dist/browser/navigation-bridge.d.ts +102 -0
- package/dist/browser/navigation-bridge.d.ts.map +1 -0
- package/dist/browser/navigation-bridge.js +708 -0
- package/dist/browser/navigation-bridge.js.map +1 -0
- package/dist/browser/navigation-client.d.ts +25 -0
- package/dist/browser/navigation-client.d.ts.map +1 -0
- package/dist/browser/navigation-client.js +157 -0
- package/dist/browser/navigation-client.js.map +1 -0
- package/dist/browser/navigation-store.d.ts +101 -0
- package/dist/browser/navigation-store.d.ts.map +1 -0
- package/dist/browser/navigation-store.js +625 -0
- package/dist/browser/navigation-store.js.map +1 -0
- package/dist/browser/partial-update.d.ts +75 -0
- package/dist/browser/partial-update.d.ts.map +1 -0
- package/dist/browser/partial-update.js +426 -0
- package/dist/browser/partial-update.js.map +1 -0
- package/dist/browser/react/Link.d.ts +86 -0
- package/dist/browser/react/Link.d.ts.map +1 -0
- package/dist/browser/react/Link.js +128 -0
- package/dist/browser/react/Link.js.map +1 -0
- package/dist/browser/react/NavigationProvider.d.ts +63 -0
- package/dist/browser/react/NavigationProvider.d.ts.map +1 -0
- package/dist/browser/react/NavigationProvider.js +216 -0
- package/dist/browser/react/NavigationProvider.js.map +1 -0
- package/dist/browser/react/ScrollRestoration.d.ts +75 -0
- package/dist/browser/react/ScrollRestoration.d.ts.map +1 -0
- package/dist/browser/react/ScrollRestoration.js +57 -0
- package/dist/browser/react/ScrollRestoration.js.map +1 -0
- package/dist/browser/react/context.d.ts +46 -0
- package/dist/browser/react/context.d.ts.map +1 -0
- package/dist/browser/react/context.js +10 -0
- package/dist/browser/react/context.js.map +1 -0
- package/dist/browser/react/index.d.ts +11 -0
- package/dist/browser/react/index.d.ts.map +1 -0
- package/dist/browser/react/index.js +22 -0
- package/dist/browser/react/index.js.map +1 -0
- package/dist/browser/react/location-state-shared.d.ts +63 -0
- package/dist/browser/react/location-state-shared.d.ts.map +1 -0
- package/dist/browser/react/location-state-shared.js +81 -0
- package/dist/browser/react/location-state-shared.js.map +1 -0
- package/dist/browser/react/location-state.d.ts +23 -0
- package/dist/browser/react/location-state.d.ts.map +1 -0
- package/dist/browser/react/location-state.js +29 -0
- package/dist/browser/react/location-state.js.map +1 -0
- package/dist/browser/react/mount-context.d.ts +24 -0
- package/dist/browser/react/mount-context.d.ts.map +1 -0
- package/dist/browser/react/mount-context.js +24 -0
- package/dist/browser/react/mount-context.js.map +1 -0
- package/dist/browser/react/use-action.d.ts +64 -0
- package/dist/browser/react/use-action.d.ts.map +1 -0
- package/dist/browser/react/use-action.js +134 -0
- package/dist/browser/react/use-action.js.map +1 -0
- package/dist/browser/react/use-client-cache.d.ts +41 -0
- package/dist/browser/react/use-client-cache.d.ts.map +1 -0
- package/dist/browser/react/use-client-cache.js +39 -0
- package/dist/browser/react/use-client-cache.js.map +1 -0
- package/dist/browser/react/use-handle.d.ts +31 -0
- package/dist/browser/react/use-handle.d.ts.map +1 -0
- package/dist/browser/react/use-handle.js +144 -0
- package/dist/browser/react/use-handle.js.map +1 -0
- package/dist/browser/react/use-href.d.ts +33 -0
- package/dist/browser/react/use-href.d.ts.map +1 -0
- package/dist/browser/react/use-href.js +39 -0
- package/dist/browser/react/use-href.js.map +1 -0
- package/dist/browser/react/use-link-status.d.ts +37 -0
- package/dist/browser/react/use-link-status.d.ts.map +1 -0
- package/dist/browser/react/use-link-status.js +99 -0
- package/dist/browser/react/use-link-status.js.map +1 -0
- package/dist/browser/react/use-mount.d.ts +25 -0
- package/dist/browser/react/use-mount.d.ts.map +1 -0
- package/dist/browser/react/use-mount.js +30 -0
- package/dist/browser/react/use-mount.js.map +1 -0
- package/dist/browser/react/use-navigation.d.ts +27 -0
- package/dist/browser/react/use-navigation.d.ts.map +1 -0
- package/dist/browser/react/use-navigation.js +87 -0
- package/dist/browser/react/use-navigation.js.map +1 -0
- package/dist/browser/react/use-segments.d.ts +38 -0
- package/dist/browser/react/use-segments.d.ts.map +1 -0
- package/dist/browser/react/use-segments.js +130 -0
- package/dist/browser/react/use-segments.js.map +1 -0
- package/dist/browser/request-controller.d.ts +26 -0
- package/dist/browser/request-controller.d.ts.map +1 -0
- package/dist/browser/request-controller.js +147 -0
- package/dist/browser/request-controller.js.map +1 -0
- package/dist/browser/rsc-router.d.ts +129 -0
- package/dist/browser/rsc-router.d.ts.map +1 -0
- package/dist/browser/rsc-router.js +195 -0
- package/dist/browser/rsc-router.js.map +1 -0
- package/dist/browser/scroll-restoration.d.ts +93 -0
- package/dist/browser/scroll-restoration.d.ts.map +1 -0
- package/dist/browser/scroll-restoration.js +321 -0
- package/dist/browser/scroll-restoration.js.map +1 -0
- package/dist/browser/segment-structure-assert.d.ts +17 -0
- package/dist/browser/segment-structure-assert.d.ts.map +1 -0
- package/dist/browser/segment-structure-assert.js +59 -0
- package/dist/browser/segment-structure-assert.js.map +1 -0
- package/dist/browser/server-action-bridge.d.ts +26 -0
- package/dist/browser/server-action-bridge.d.ts.map +1 -0
- package/dist/browser/server-action-bridge.js +668 -0
- package/dist/browser/server-action-bridge.js.map +1 -0
- package/dist/browser/shallow.d.ts +12 -0
- package/dist/browser/shallow.d.ts.map +1 -0
- package/dist/browser/shallow.js +34 -0
- package/dist/browser/shallow.js.map +1 -0
- package/dist/browser/types.d.ts +369 -0
- package/dist/browser/types.d.ts.map +1 -0
- package/dist/browser/types.js +2 -0
- package/dist/browser/types.js.map +1 -0
- package/dist/build/__tests__/generate-cli.test.d.ts +2 -0
- package/dist/build/__tests__/generate-cli.test.d.ts.map +1 -0
- package/dist/build/__tests__/generate-cli.test.js +237 -0
- package/dist/build/__tests__/generate-cli.test.js.map +1 -0
- package/dist/build/__tests__/generate-manifest.test.d.ts +2 -0
- package/dist/build/__tests__/generate-manifest.test.d.ts.map +1 -0
- package/dist/build/__tests__/generate-manifest.test.js +119 -0
- package/dist/build/__tests__/generate-manifest.test.js.map +1 -0
- package/dist/build/__tests__/generate-route-types.test.d.ts +2 -0
- package/dist/build/__tests__/generate-route-types.test.d.ts.map +1 -0
- package/dist/build/__tests__/generate-route-types.test.js +620 -0
- package/dist/build/__tests__/generate-route-types.test.js.map +1 -0
- package/dist/build/__tests__/per-router-manifest.test.d.ts +2 -0
- package/dist/build/__tests__/per-router-manifest.test.d.ts.map +1 -0
- package/dist/build/__tests__/per-router-manifest.test.js +308 -0
- package/dist/build/__tests__/per-router-manifest.test.js.map +1 -0
- package/dist/build/generate-manifest.d.ts +81 -0
- package/dist/build/generate-manifest.d.ts.map +1 -0
- package/dist/build/generate-manifest.js +276 -0
- package/dist/build/generate-manifest.js.map +1 -0
- package/dist/build/generate-route-types.d.ts +115 -0
- package/dist/build/generate-route-types.d.ts.map +1 -0
- package/dist/build/generate-route-types.js +740 -0
- package/dist/build/generate-route-types.js.map +1 -0
- package/dist/build/index.d.ts +21 -0
- package/dist/build/index.d.ts.map +1 -0
- package/dist/build/index.js +21 -0
- package/dist/build/index.js.map +1 -0
- package/dist/build/route-trie.d.ts +71 -0
- package/dist/build/route-trie.d.ts.map +1 -0
- package/dist/build/route-trie.js +175 -0
- package/dist/build/route-trie.js.map +1 -0
- package/dist/cache/__tests__/cache-scope.test.d.ts +2 -0
- package/dist/cache/__tests__/cache-scope.test.d.ts.map +1 -0
- package/dist/cache/__tests__/cache-scope.test.js +208 -0
- package/dist/cache/__tests__/cache-scope.test.js.map +1 -0
- package/dist/cache/__tests__/document-cache.test.d.ts +2 -0
- package/dist/cache/__tests__/document-cache.test.d.ts.map +1 -0
- package/dist/cache/__tests__/document-cache.test.js +345 -0
- package/dist/cache/__tests__/document-cache.test.js.map +1 -0
- package/dist/cache/__tests__/memory-segment-store.test.d.ts +2 -0
- package/dist/cache/__tests__/memory-segment-store.test.d.ts.map +1 -0
- package/dist/cache/__tests__/memory-segment-store.test.js +425 -0
- package/dist/cache/__tests__/memory-segment-store.test.js.map +1 -0
- package/dist/cache/__tests__/memory-store.test.d.ts +2 -0
- package/dist/cache/__tests__/memory-store.test.d.ts.map +1 -0
- package/dist/cache/__tests__/memory-store.test.js +367 -0
- package/dist/cache/__tests__/memory-store.test.js.map +1 -0
- package/dist/cache/cache-scope.d.ts +102 -0
- package/dist/cache/cache-scope.d.ts.map +1 -0
- package/dist/cache/cache-scope.js +440 -0
- package/dist/cache/cache-scope.js.map +1 -0
- package/dist/cache/cf/__tests__/cf-cache-store.test.d.ts +2 -0
- package/dist/cache/cf/__tests__/cf-cache-store.test.d.ts.map +1 -0
- package/dist/cache/cf/__tests__/cf-cache-store.test.js +330 -0
- package/dist/cache/cf/__tests__/cf-cache-store.test.js.map +1 -0
- package/dist/cache/cf/cf-cache-store.d.ts +165 -0
- package/dist/cache/cf/cf-cache-store.d.ts.map +1 -0
- package/dist/cache/cf/cf-cache-store.js +242 -0
- package/dist/cache/cf/cf-cache-store.js.map +1 -0
- package/dist/cache/cf/index.d.ts +14 -0
- package/dist/cache/cf/index.d.ts.map +1 -0
- package/dist/cache/cf/index.js +17 -0
- package/dist/cache/cf/index.js.map +1 -0
- package/dist/cache/document-cache.d.ts +64 -0
- package/dist/cache/document-cache.d.ts.map +1 -0
- package/dist/cache/document-cache.js +228 -0
- package/dist/cache/document-cache.js.map +1 -0
- package/dist/cache/index.d.ts +19 -0
- package/dist/cache/index.d.ts.map +1 -0
- package/dist/cache/index.js +21 -0
- package/dist/cache/index.js.map +1 -0
- package/dist/cache/memory-segment-store.d.ts +110 -0
- package/dist/cache/memory-segment-store.d.ts.map +1 -0
- package/dist/cache/memory-segment-store.js +117 -0
- package/dist/cache/memory-segment-store.js.map +1 -0
- package/dist/cache/memory-store.d.ts +41 -0
- package/dist/cache/memory-store.d.ts.map +1 -0
- package/dist/cache/memory-store.js +191 -0
- package/dist/cache/memory-store.js.map +1 -0
- package/dist/cache/types.d.ts +317 -0
- package/dist/cache/types.d.ts.map +1 -0
- package/dist/cache/types.js +12 -0
- package/dist/cache/types.js.map +1 -0
- package/dist/client.d.ts +248 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +367 -0
- package/dist/client.js.map +1 -0
- package/dist/client.rsc.d.ts +26 -0
- package/dist/client.rsc.d.ts.map +1 -0
- package/dist/client.rsc.js +46 -0
- package/dist/client.rsc.js.map +1 -0
- package/dist/component-utils.d.ts +36 -0
- package/dist/component-utils.d.ts.map +1 -0
- package/dist/component-utils.js +61 -0
- package/dist/component-utils.js.map +1 -0
- package/dist/components/DefaultDocument.d.ts +13 -0
- package/dist/components/DefaultDocument.d.ts.map +1 -0
- package/dist/components/DefaultDocument.js +15 -0
- package/dist/components/DefaultDocument.js.map +1 -0
- package/dist/debug.d.ts +58 -0
- package/dist/debug.d.ts.map +1 -0
- package/dist/debug.js +157 -0
- package/dist/debug.js.map +1 -0
- package/dist/default-error-boundary.d.ts +11 -0
- package/dist/default-error-boundary.d.ts.map +1 -0
- package/dist/default-error-boundary.js +45 -0
- package/dist/default-error-boundary.js.map +1 -0
- package/dist/deps/browser.d.ts +2 -0
- package/dist/deps/browser.d.ts.map +1 -0
- package/dist/deps/browser.js +3 -0
- package/dist/deps/browser.js.map +1 -0
- package/dist/deps/html-stream-client.d.ts +2 -0
- package/dist/deps/html-stream-client.d.ts.map +1 -0
- package/dist/deps/html-stream-client.js +3 -0
- package/dist/deps/html-stream-client.js.map +1 -0
- package/dist/deps/html-stream-server.d.ts +2 -0
- package/dist/deps/html-stream-server.d.ts.map +1 -0
- package/dist/deps/html-stream-server.js +3 -0
- package/dist/deps/html-stream-server.js.map +1 -0
- package/dist/deps/rsc.d.ts +2 -0
- package/dist/deps/rsc.d.ts.map +1 -0
- package/dist/deps/rsc.js +4 -0
- package/dist/deps/rsc.js.map +1 -0
- package/dist/deps/ssr.d.ts +2 -0
- package/dist/deps/ssr.d.ts.map +1 -0
- package/dist/deps/ssr.js +3 -0
- package/dist/deps/ssr.js.map +1 -0
- package/dist/errors.d.ts +174 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +241 -0
- package/dist/errors.js.map +1 -0
- package/dist/handle.d.ts +78 -0
- package/dist/handle.d.ts.map +1 -0
- package/dist/handle.js +82 -0
- package/dist/handle.js.map +1 -0
- package/dist/handles/MetaTags.d.ts +14 -0
- package/dist/handles/MetaTags.d.ts.map +1 -0
- package/dist/handles/MetaTags.js +136 -0
- package/dist/handles/MetaTags.js.map +1 -0
- package/dist/handles/index.d.ts +6 -0
- package/dist/handles/index.d.ts.map +1 -0
- package/dist/handles/index.js +6 -0
- package/dist/handles/index.js.map +1 -0
- package/dist/handles/meta.d.ts +39 -0
- package/dist/handles/meta.d.ts.map +1 -0
- package/dist/handles/meta.js +202 -0
- package/dist/handles/meta.js.map +1 -0
- package/dist/host/__tests__/errors.test.d.ts +2 -0
- package/dist/host/__tests__/errors.test.d.ts.map +1 -0
- package/dist/host/__tests__/errors.test.js +76 -0
- package/dist/host/__tests__/errors.test.js.map +1 -0
- package/dist/host/__tests__/pattern-comprehensive.test.d.ts +2 -0
- package/dist/host/__tests__/pattern-comprehensive.test.d.ts.map +1 -0
- package/dist/host/__tests__/pattern-comprehensive.test.js +732 -0
- package/dist/host/__tests__/pattern-comprehensive.test.js.map +1 -0
- package/dist/host/__tests__/pattern-matcher.test.d.ts +2 -0
- package/dist/host/__tests__/pattern-matcher.test.d.ts.map +1 -0
- package/dist/host/__tests__/pattern-matcher.test.js +251 -0
- package/dist/host/__tests__/pattern-matcher.test.js.map +1 -0
- package/dist/host/__tests__/router.test.d.ts +2 -0
- package/dist/host/__tests__/router.test.d.ts.map +1 -0
- package/dist/host/__tests__/router.test.js +241 -0
- package/dist/host/__tests__/router.test.js.map +1 -0
- package/dist/host/__tests__/testing.test.d.ts +2 -0
- package/dist/host/__tests__/testing.test.d.ts.map +1 -0
- package/dist/host/__tests__/testing.test.js +64 -0
- package/dist/host/__tests__/testing.test.js.map +1 -0
- package/dist/host/__tests__/utils.test.d.ts +2 -0
- package/dist/host/__tests__/utils.test.d.ts.map +1 -0
- package/dist/host/__tests__/utils.test.js +29 -0
- package/dist/host/__tests__/utils.test.js.map +1 -0
- package/dist/host/cookie-handler.d.ts +34 -0
- package/dist/host/cookie-handler.d.ts.map +1 -0
- package/dist/host/cookie-handler.js +124 -0
- package/dist/host/cookie-handler.js.map +1 -0
- package/dist/host/errors.d.ts +56 -0
- package/dist/host/errors.d.ts.map +1 -0
- package/dist/host/errors.js +79 -0
- package/dist/host/errors.js.map +1 -0
- package/dist/host/index.d.ts +29 -0
- package/dist/host/index.d.ts.map +1 -0
- package/dist/host/index.js +32 -0
- package/dist/host/index.js.map +1 -0
- package/dist/host/pattern-matcher.d.ts +36 -0
- package/dist/host/pattern-matcher.d.ts.map +1 -0
- package/dist/host/pattern-matcher.js +172 -0
- package/dist/host/pattern-matcher.js.map +1 -0
- package/dist/host/router.d.ts +26 -0
- package/dist/host/router.d.ts.map +1 -0
- package/dist/host/router.js +218 -0
- package/dist/host/router.js.map +1 -0
- package/dist/host/testing.d.ts +36 -0
- package/dist/host/testing.d.ts.map +1 -0
- package/dist/host/testing.js +55 -0
- package/dist/host/testing.js.map +1 -0
- package/dist/host/types.d.ts +115 -0
- package/dist/host/types.d.ts.map +1 -0
- package/dist/host/types.js +7 -0
- package/dist/host/types.js.map +1 -0
- package/dist/host/utils.d.ts +21 -0
- package/dist/host/utils.d.ts.map +1 -0
- package/dist/host/utils.js +23 -0
- package/dist/host/utils.js.map +1 -0
- package/dist/href-client.d.ts +131 -0
- package/dist/href-client.d.ts.map +1 -0
- package/dist/href-client.js +64 -0
- package/dist/href-client.js.map +1 -0
- package/dist/href-context.d.ts +29 -0
- package/dist/href-context.d.ts.map +1 -0
- package/dist/href-context.js +21 -0
- package/dist/href-context.js.map +1 -0
- package/dist/index.d.ts +73 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +91 -0
- package/dist/index.js.map +1 -0
- package/dist/index.rsc.d.ts +32 -0
- package/dist/index.rsc.d.ts.map +1 -0
- package/dist/index.rsc.js +40 -0
- package/dist/index.rsc.js.map +1 -0
- package/dist/internal-debug.d.ts +2 -0
- package/dist/internal-debug.d.ts.map +1 -0
- package/dist/internal-debug.js +5 -0
- package/dist/internal-debug.js.map +1 -0
- package/dist/loader.d.ts +14 -0
- package/dist/loader.d.ts.map +1 -0
- package/dist/loader.js +20 -0
- package/dist/loader.js.map +1 -0
- package/dist/loader.rsc.d.ts +19 -0
- package/dist/loader.rsc.d.ts.map +1 -0
- package/dist/loader.rsc.js +99 -0
- package/dist/loader.rsc.js.map +1 -0
- package/dist/network-error-thrower.d.ts +17 -0
- package/dist/network-error-thrower.d.ts.map +1 -0
- package/dist/network-error-thrower.js +14 -0
- package/dist/network-error-thrower.js.map +1 -0
- package/dist/outlet-context.d.ts +13 -0
- package/dist/outlet-context.d.ts.map +1 -0
- package/dist/outlet-context.js +3 -0
- package/dist/outlet-context.js.map +1 -0
- package/dist/prerender/__tests__/param-hash.test.d.ts +2 -0
- package/dist/prerender/__tests__/param-hash.test.d.ts.map +1 -0
- package/dist/prerender/__tests__/param-hash.test.js +148 -0
- package/dist/prerender/__tests__/param-hash.test.js.map +1 -0
- package/dist/prerender/param-hash.d.ts +16 -0
- package/dist/prerender/param-hash.d.ts.map +1 -0
- package/dist/prerender/param-hash.js +36 -0
- package/dist/prerender/param-hash.js.map +1 -0
- package/dist/prerender/store.d.ts +38 -0
- package/dist/prerender/store.d.ts.map +1 -0
- package/dist/prerender/store.js +61 -0
- package/dist/prerender/store.js.map +1 -0
- package/dist/prerender.d.ts +66 -0
- package/dist/prerender.d.ts.map +1 -0
- package/dist/prerender.js +57 -0
- package/dist/prerender.js.map +1 -0
- package/dist/reverse.d.ts +196 -0
- package/dist/reverse.d.ts.map +1 -0
- package/dist/reverse.js +78 -0
- package/dist/reverse.js.map +1 -0
- package/dist/root-error-boundary.d.ts +33 -0
- package/dist/root-error-boundary.d.ts.map +1 -0
- package/dist/root-error-boundary.js +165 -0
- package/dist/root-error-boundary.js.map +1 -0
- package/dist/route-content-wrapper.d.ts +46 -0
- package/dist/route-content-wrapper.d.ts.map +1 -0
- package/dist/route-content-wrapper.js +77 -0
- package/dist/route-content-wrapper.js.map +1 -0
- package/dist/route-definition.d.ts +421 -0
- package/dist/route-definition.d.ts.map +1 -0
- package/dist/route-definition.js +868 -0
- package/dist/route-definition.js.map +1 -0
- package/dist/route-map-builder.d.ts +155 -0
- package/dist/route-map-builder.d.ts.map +1 -0
- package/dist/route-map-builder.js +237 -0
- package/dist/route-map-builder.js.map +1 -0
- package/dist/route-types.d.ts +165 -0
- package/dist/route-types.d.ts.map +1 -0
- package/dist/route-types.js +7 -0
- package/dist/route-types.js.map +1 -0
- package/dist/router/__tests__/handler-context.test.d.ts +2 -0
- package/dist/router/__tests__/handler-context.test.d.ts.map +1 -0
- package/dist/router/__tests__/handler-context.test.js +65 -0
- package/dist/router/__tests__/handler-context.test.js.map +1 -0
- package/dist/router/__tests__/loader-cycle-detection.test.d.ts +2 -0
- package/dist/router/__tests__/loader-cycle-detection.test.d.ts.map +1 -0
- package/dist/router/__tests__/loader-cycle-detection.test.js +221 -0
- package/dist/router/__tests__/loader-cycle-detection.test.js.map +1 -0
- package/dist/router/__tests__/match-context.test.d.ts +2 -0
- package/dist/router/__tests__/match-context.test.d.ts.map +1 -0
- package/dist/router/__tests__/match-context.test.js +92 -0
- package/dist/router/__tests__/match-context.test.js.map +1 -0
- package/dist/router/__tests__/match-pipelines.test.d.ts +2 -0
- package/dist/router/__tests__/match-pipelines.test.d.ts.map +1 -0
- package/dist/router/__tests__/match-pipelines.test.js +417 -0
- package/dist/router/__tests__/match-pipelines.test.js.map +1 -0
- package/dist/router/__tests__/match-result.test.d.ts +2 -0
- package/dist/router/__tests__/match-result.test.d.ts.map +1 -0
- package/dist/router/__tests__/match-result.test.js +457 -0
- package/dist/router/__tests__/match-result.test.js.map +1 -0
- package/dist/router/__tests__/on-error.test.d.ts +2 -0
- package/dist/router/__tests__/on-error.test.d.ts.map +1 -0
- package/dist/router/__tests__/on-error.test.js +678 -0
- package/dist/router/__tests__/on-error.test.js.map +1 -0
- package/dist/router/__tests__/pattern-matching.test.d.ts +2 -0
- package/dist/router/__tests__/pattern-matching.test.d.ts.map +1 -0
- package/dist/router/__tests__/pattern-matching.test.js +629 -0
- package/dist/router/__tests__/pattern-matching.test.js.map +1 -0
- package/dist/router/__tests__/segment-resolution-parallel-loading.test.d.ts +2 -0
- package/dist/router/__tests__/segment-resolution-parallel-loading.test.d.ts.map +1 -0
- package/dist/router/__tests__/segment-resolution-parallel-loading.test.js +155 -0
- package/dist/router/__tests__/segment-resolution-parallel-loading.test.js.map +1 -0
- package/dist/router/error-handling.d.ts +77 -0
- package/dist/router/error-handling.d.ts.map +1 -0
- package/dist/router/error-handling.js +202 -0
- package/dist/router/error-handling.js.map +1 -0
- package/dist/router/handler-context.d.ts +20 -0
- package/dist/router/handler-context.d.ts.map +1 -0
- package/dist/router/handler-context.js +198 -0
- package/dist/router/handler-context.js.map +1 -0
- package/dist/router/intercept-resolution.d.ts +66 -0
- package/dist/router/intercept-resolution.d.ts.map +1 -0
- package/dist/router/intercept-resolution.js +246 -0
- package/dist/router/intercept-resolution.js.map +1 -0
- package/dist/router/loader-resolution.d.ts +64 -0
- package/dist/router/loader-resolution.d.ts.map +1 -0
- package/dist/router/loader-resolution.js +284 -0
- package/dist/router/loader-resolution.js.map +1 -0
- package/dist/router/logging.d.ts +15 -0
- package/dist/router/logging.d.ts.map +1 -0
- package/dist/router/logging.js +99 -0
- package/dist/router/logging.js.map +1 -0
- package/dist/router/manifest.d.ts +22 -0
- package/dist/router/manifest.d.ts.map +1 -0
- package/dist/router/manifest.js +181 -0
- package/dist/router/manifest.js.map +1 -0
- package/dist/router/match-api.d.ts +35 -0
- package/dist/router/match-api.d.ts.map +1 -0
- package/dist/router/match-api.js +406 -0
- package/dist/router/match-api.js.map +1 -0
- package/dist/router/match-context.d.ts +206 -0
- package/dist/router/match-context.d.ts.map +1 -0
- package/dist/router/match-context.js +17 -0
- package/dist/router/match-context.js.map +1 -0
- package/dist/router/match-middleware/background-revalidation.d.ts +127 -0
- package/dist/router/match-middleware/background-revalidation.d.ts.map +1 -0
- package/dist/router/match-middleware/background-revalidation.js +75 -0
- package/dist/router/match-middleware/background-revalidation.js.map +1 -0
- package/dist/router/match-middleware/cache-lookup.d.ts +112 -0
- package/dist/router/match-middleware/cache-lookup.d.ts.map +1 -0
- package/dist/router/match-middleware/cache-lookup.js +257 -0
- package/dist/router/match-middleware/cache-lookup.js.map +1 -0
- package/dist/router/match-middleware/cache-store.d.ts +113 -0
- package/dist/router/match-middleware/cache-store.d.ts.map +1 -0
- package/dist/router/match-middleware/cache-store.js +108 -0
- package/dist/router/match-middleware/cache-store.js.map +1 -0
- package/dist/router/match-middleware/index.d.ts +81 -0
- package/dist/router/match-middleware/index.d.ts.map +1 -0
- package/dist/router/match-middleware/index.js +80 -0
- package/dist/router/match-middleware/index.js.map +1 -0
- package/dist/router/match-middleware/intercept-resolution.d.ts +117 -0
- package/dist/router/match-middleware/intercept-resolution.d.ts.map +1 -0
- package/dist/router/match-middleware/intercept-resolution.js +134 -0
- package/dist/router/match-middleware/intercept-resolution.js.map +1 -0
- package/dist/router/match-middleware/segment-resolution.d.ts +99 -0
- package/dist/router/match-middleware/segment-resolution.d.ts.map +1 -0
- package/dist/router/match-middleware/segment-resolution.js +53 -0
- package/dist/router/match-middleware/segment-resolution.js.map +1 -0
- package/dist/router/match-pipelines.d.ts +147 -0
- package/dist/router/match-pipelines.d.ts.map +1 -0
- package/dist/router/match-pipelines.js +82 -0
- package/dist/router/match-pipelines.js.map +1 -0
- package/dist/router/match-result.d.ts +126 -0
- package/dist/router/match-result.d.ts.map +1 -0
- package/dist/router/match-result.js +93 -0
- package/dist/router/match-result.js.map +1 -0
- package/dist/router/metrics.d.ts +20 -0
- package/dist/router/metrics.d.ts.map +1 -0
- package/dist/router/metrics.js +47 -0
- package/dist/router/metrics.js.map +1 -0
- package/dist/router/middleware.d.ts +249 -0
- package/dist/router/middleware.d.ts.map +1 -0
- package/dist/router/middleware.js +434 -0
- package/dist/router/middleware.js.map +1 -0
- package/dist/router/middleware.test.d.ts +2 -0
- package/dist/router/middleware.test.d.ts.map +1 -0
- package/dist/router/middleware.test.js +816 -0
- package/dist/router/middleware.test.js.map +1 -0
- package/dist/router/pattern-matching.d.ts +149 -0
- package/dist/router/pattern-matching.d.ts.map +1 -0
- package/dist/router/pattern-matching.js +349 -0
- package/dist/router/pattern-matching.js.map +1 -0
- package/dist/router/revalidation.d.ts +44 -0
- package/dist/router/revalidation.d.ts.map +1 -0
- package/dist/router/revalidation.js +147 -0
- package/dist/router/revalidation.js.map +1 -0
- package/dist/router/router-context.d.ts +135 -0
- package/dist/router/router-context.d.ts.map +1 -0
- package/dist/router/router-context.js +36 -0
- package/dist/router/router-context.js.map +1 -0
- package/dist/router/segment-resolution.d.ts +127 -0
- package/dist/router/segment-resolution.d.ts.map +1 -0
- package/dist/router/segment-resolution.js +919 -0
- package/dist/router/segment-resolution.js.map +1 -0
- package/dist/router/trie-matching.d.ts +40 -0
- package/dist/router/trie-matching.d.ts.map +1 -0
- package/dist/router/trie-matching.js +127 -0
- package/dist/router/trie-matching.js.map +1 -0
- package/dist/router/types.d.ts +136 -0
- package/dist/router/types.d.ts.map +1 -0
- package/dist/router/types.js +7 -0
- package/dist/router/types.js.map +1 -0
- package/dist/router.d.ts +753 -0
- package/dist/router.d.ts.map +1 -0
- package/dist/router.gen.d.ts +6 -0
- package/dist/router.gen.d.ts.map +1 -0
- package/dist/router.gen.js +6 -0
- package/dist/router.gen.js.map +1 -0
- package/dist/router.js +1304 -0
- package/dist/router.js.map +1 -0
- package/dist/rsc/__tests__/helpers.test.d.ts +2 -0
- package/dist/rsc/__tests__/helpers.test.d.ts.map +1 -0
- package/dist/rsc/__tests__/helpers.test.js +140 -0
- package/dist/rsc/__tests__/helpers.test.js.map +1 -0
- package/dist/rsc/handler.d.ts +45 -0
- package/dist/rsc/handler.d.ts.map +1 -0
- package/dist/rsc/handler.js +1172 -0
- package/dist/rsc/handler.js.map +1 -0
- package/dist/rsc/helpers.d.ts +16 -0
- package/dist/rsc/helpers.d.ts.map +1 -0
- package/dist/rsc/helpers.js +55 -0
- package/dist/rsc/helpers.js.map +1 -0
- package/dist/rsc/index.d.ts +22 -0
- package/dist/rsc/index.d.ts.map +1 -0
- package/dist/rsc/index.js +23 -0
- package/dist/rsc/index.js.map +1 -0
- package/dist/rsc/nonce.d.ts +9 -0
- package/dist/rsc/nonce.d.ts.map +1 -0
- package/dist/rsc/nonce.js +18 -0
- package/dist/rsc/nonce.js.map +1 -0
- package/dist/rsc/types.d.ts +206 -0
- package/dist/rsc/types.d.ts.map +1 -0
- package/dist/rsc/types.js +8 -0
- package/dist/rsc/types.js.map +1 -0
- package/dist/search-params.d.ts +103 -0
- package/dist/search-params.d.ts.map +1 -0
- package/dist/search-params.js +74 -0
- package/dist/search-params.js.map +1 -0
- package/dist/segment-system.d.ts +75 -0
- package/dist/segment-system.d.ts.map +1 -0
- package/dist/segment-system.js +336 -0
- package/dist/segment-system.js.map +1 -0
- package/dist/server/context.d.ts +245 -0
- package/dist/server/context.d.ts.map +1 -0
- package/dist/server/context.js +197 -0
- package/dist/server/context.js.map +1 -0
- package/dist/server/fetchable-loader-store.d.ts +18 -0
- package/dist/server/fetchable-loader-store.d.ts.map +1 -0
- package/dist/server/fetchable-loader-store.js +18 -0
- package/dist/server/fetchable-loader-store.js.map +1 -0
- package/dist/server/handle-store.d.ts +85 -0
- package/dist/server/handle-store.d.ts.map +1 -0
- package/dist/server/handle-store.js +142 -0
- package/dist/server/handle-store.js.map +1 -0
- package/dist/server/loader-registry.d.ts +55 -0
- package/dist/server/loader-registry.d.ts.map +1 -0
- package/dist/server/loader-registry.js +132 -0
- package/dist/server/loader-registry.js.map +1 -0
- package/dist/server/request-context.d.ts +226 -0
- package/dist/server/request-context.d.ts.map +1 -0
- package/dist/server/request-context.js +290 -0
- package/dist/server/request-context.js.map +1 -0
- package/dist/server/root-layout.d.ts +4 -0
- package/dist/server/root-layout.d.ts.map +1 -0
- package/dist/server/root-layout.js +5 -0
- package/dist/server/root-layout.js.map +1 -0
- package/dist/server.d.ts +15 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +20 -0
- package/dist/server.js.map +1 -0
- package/dist/ssr/__tests__/ssr-handler.test.d.ts +2 -0
- package/dist/ssr/__tests__/ssr-handler.test.d.ts.map +1 -0
- package/dist/ssr/__tests__/ssr-handler.test.js +132 -0
- package/dist/ssr/__tests__/ssr-handler.test.js.map +1 -0
- package/dist/ssr/index.d.ts +98 -0
- package/dist/ssr/index.d.ts.map +1 -0
- package/dist/ssr/index.js +158 -0
- package/dist/ssr/index.js.map +1 -0
- package/dist/static-handler.d.ts +50 -0
- package/dist/static-handler.d.ts.map +1 -0
- package/dist/static-handler.gen.d.ts +5 -0
- package/dist/static-handler.gen.d.ts.map +1 -0
- package/dist/static-handler.gen.js +5 -0
- package/dist/static-handler.gen.js.map +1 -0
- package/dist/static-handler.js +29 -0
- package/dist/static-handler.js.map +1 -0
- package/dist/theme/ThemeProvider.d.ts +20 -0
- package/dist/theme/ThemeProvider.d.ts.map +1 -0
- package/dist/theme/ThemeProvider.js +240 -0
- package/dist/theme/ThemeProvider.js.map +1 -0
- package/dist/theme/ThemeScript.d.ts +48 -0
- package/dist/theme/ThemeScript.d.ts.map +1 -0
- package/dist/theme/ThemeScript.js +13 -0
- package/dist/theme/ThemeScript.js.map +1 -0
- package/dist/theme/__tests__/theme.test.d.ts +2 -0
- package/dist/theme/__tests__/theme.test.d.ts.map +1 -0
- package/dist/theme/__tests__/theme.test.js +103 -0
- package/dist/theme/__tests__/theme.test.js.map +1 -0
- package/dist/theme/constants.d.ts +29 -0
- package/dist/theme/constants.d.ts.map +1 -0
- package/dist/theme/constants.js +48 -0
- package/dist/theme/constants.js.map +1 -0
- package/dist/theme/index.d.ts +31 -0
- package/dist/theme/index.d.ts.map +1 -0
- package/dist/theme/index.js +36 -0
- package/dist/theme/index.js.map +1 -0
- package/dist/theme/theme-context.d.ts +40 -0
- package/dist/theme/theme-context.d.ts.map +1 -0
- package/dist/theme/theme-context.js +60 -0
- package/dist/theme/theme-context.js.map +1 -0
- package/dist/theme/theme-script.d.ts +27 -0
- package/dist/theme/theme-script.d.ts.map +1 -0
- package/dist/theme/theme-script.js +147 -0
- package/dist/theme/theme-script.js.map +1 -0
- package/dist/theme/types.d.ts +163 -0
- package/dist/theme/types.d.ts.map +1 -0
- package/dist/theme/types.js +11 -0
- package/dist/theme/types.js.map +1 -0
- package/dist/theme/use-theme.d.ts +12 -0
- package/dist/theme/use-theme.d.ts.map +1 -0
- package/dist/theme/use-theme.js +40 -0
- package/dist/theme/use-theme.js.map +1 -0
- package/dist/types.d.ts +1479 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +10 -0
- package/dist/types.js.map +1 -0
- package/dist/urls.d.ts +441 -0
- package/dist/urls.d.ts.map +1 -0
- package/dist/urls.gen.d.ts +8 -0
- package/dist/urls.gen.d.ts.map +1 -0
- package/dist/urls.gen.js +8 -0
- package/dist/urls.gen.js.map +1 -0
- package/dist/urls.js +443 -0
- package/dist/urls.js.map +1 -0
- package/dist/use-loader.d.ts +127 -0
- package/dist/use-loader.d.ts.map +1 -0
- package/dist/use-loader.js +237 -0
- package/dist/use-loader.js.map +1 -0
- package/dist/vite/__tests__/ast-handler-extract.test.d.ts +2 -0
- package/dist/vite/__tests__/ast-handler-extract.test.d.ts.map +1 -0
- package/dist/vite/__tests__/ast-handler-extract.test.js +294 -0
- package/dist/vite/__tests__/ast-handler-extract.test.js.map +1 -0
- package/dist/vite/__tests__/expose-id-utils.test.d.ts +2 -0
- package/dist/vite/__tests__/expose-id-utils.test.d.ts.map +1 -0
- package/dist/vite/__tests__/expose-id-utils.test.js +224 -0
- package/dist/vite/__tests__/expose-id-utils.test.js.map +1 -0
- package/dist/vite/__tests__/expose-internal-ids.test.d.ts +2 -0
- package/dist/vite/__tests__/expose-internal-ids.test.d.ts.map +1 -0
- package/dist/vite/__tests__/expose-internal-ids.test.js +647 -0
- package/dist/vite/__tests__/expose-internal-ids.test.js.map +1 -0
- package/dist/vite/__tests__/expose-router-id.test.d.ts +2 -0
- package/dist/vite/__tests__/expose-router-id.test.d.ts.map +1 -0
- package/dist/vite/__tests__/expose-router-id.test.js +39 -0
- package/dist/vite/__tests__/expose-router-id.test.js.map +1 -0
- package/dist/vite/ast-handler-extract.d.ts +49 -0
- package/dist/vite/ast-handler-extract.d.ts.map +1 -0
- package/dist/vite/ast-handler-extract.js +249 -0
- package/dist/vite/ast-handler-extract.js.map +1 -0
- package/dist/vite/expose-action-id.d.ts +19 -0
- package/dist/vite/expose-action-id.d.ts.map +1 -0
- package/dist/vite/expose-action-id.js +250 -0
- package/dist/vite/expose-action-id.js.map +1 -0
- package/dist/vite/expose-id-utils.d.ts +69 -0
- package/dist/vite/expose-id-utils.d.ts.map +1 -0
- package/dist/vite/expose-id-utils.js +289 -0
- package/dist/vite/expose-id-utils.js.map +1 -0
- package/dist/vite/expose-internal-ids.d.ts +22 -0
- package/dist/vite/expose-internal-ids.d.ts.map +1 -0
- package/dist/vite/expose-internal-ids.js +886 -0
- package/dist/vite/expose-internal-ids.js.map +1 -0
- package/dist/vite/index.d.ts +149 -0
- package/dist/vite/index.d.ts.map +1 -0
- package/dist/vite/index.js +82 -15
- package/dist/vite/index.js.bak +5448 -0
- package/dist/vite/index.js.map +1 -0
- package/dist/vite/index.named-routes.gen.ts +103 -0
- package/dist/vite/package-resolution.d.ts +43 -0
- package/dist/vite/package-resolution.d.ts.map +1 -0
- package/dist/vite/package-resolution.js +112 -0
- package/dist/vite/package-resolution.js.map +1 -0
- package/dist/vite/virtual-entries.d.ts +25 -0
- package/dist/vite/virtual-entries.d.ts.map +1 -0
- package/dist/vite/virtual-entries.js +110 -0
- package/dist/vite/virtual-entries.js.map +1 -0
- package/package.json +19 -18
- package/skills/api-client/SKILL.md +1 -1
- package/skills/breadcrumbs/SKILL.md +1 -1
- package/skills/cache-guide/SKILL.md +1 -1
- package/skills/caching/SKILL.md +17 -1
- package/skills/catalog.json +265 -0
- package/skills/comparison/references/framework-comparison.md +1 -1
- package/skills/composability/SKILL.md +1 -1
- package/skills/debug-manifest/SKILL.md +1 -1
- package/skills/document-cache/SKILL.md +9 -1
- package/skills/fonts/SKILL.md +1 -1
- package/skills/handler-use/SKILL.md +1 -1
- package/skills/hooks/SKILL.md +54 -892
- package/skills/hooks/data.md +273 -0
- package/skills/hooks/handle-and-actions.md +103 -0
- package/skills/hooks/navigation.md +110 -0
- package/skills/hooks/outlets.md +41 -0
- package/skills/hooks/state.md +228 -0
- package/skills/hooks/urls.md +135 -0
- package/skills/host-router/SKILL.md +1 -1
- package/skills/i18n/SKILL.md +1 -1
- package/skills/intercept/SKILL.md +8 -1
- package/skills/layout/SKILL.md +1 -1
- package/skills/links/SKILL.md +1 -1
- package/skills/loader/SKILL.md +8 -1
- package/skills/middleware/SKILL.md +1 -1
- package/skills/migrate-nextjs/SKILL.md +133 -1
- package/skills/migrate-react-router/SKILL.md +42 -816
- package/skills/migrate-react-router/cloudflare-workers.md +129 -0
- package/skills/migrate-react-router/component-migration.md +196 -0
- package/skills/migrate-react-router/data-and-actions.md +225 -0
- package/skills/migrate-react-router/route-mapping.md +271 -0
- package/skills/mime-routes/SKILL.md +1 -1
- package/skills/observability/SKILL.md +1 -1
- package/skills/parallel/SKILL.md +8 -1
- package/skills/ppr/SKILL.md +448 -348
- package/skills/prerender/SKILL.md +8 -1
- package/skills/rango/SKILL.md +14 -14
- package/skills/response-routes/SKILL.md +1 -1
- package/skills/route/SKILL.md +1 -1
- package/skills/router-setup/SKILL.md +1 -1
- package/skills/scripts/SKILL.md +1 -1
- package/skills/server-actions/SKILL.md +3 -2
- package/skills/shell-manifest/SKILL.md +1 -1
- package/skills/streams-and-websockets/SKILL.md +1 -1
- package/skills/tailwind/SKILL.md +1 -1
- package/skills/testing/SKILL.md +1 -1
- package/skills/theme/SKILL.md +1 -1
- package/skills/typesafety/SKILL.md +44 -919
- package/skills/typesafety/env-and-bindings.md +254 -0
- package/skills/typesafety/generated-files-and-cli.md +305 -0
- package/skills/typesafety/params-and-search.md +153 -0
- package/skills/typesafety/route-types.md +209 -0
- package/skills/use-cache/SKILL.md +7 -1
- package/skills/vercel/SKILL.md +1 -1
- package/skills/view-transitions/SKILL.md +1 -1
- package/src/browser/event-controller.ts +41 -10
- package/src/browser/logging.ts +10 -0
- package/src/browser/merge-segment-loaders.ts +6 -4
- package/src/browser/navigation-client.ts +5 -1
- package/src/browser/navigation-store.ts +46 -6
- package/src/browser/partial-update.ts +27 -15
- package/src/browser/prefetch/cache.ts +26 -4
- package/src/browser/prefetch/fetch.ts +27 -17
- package/src/browser/react/Link.tsx +13 -3
- package/src/browser/react/NavigationProvider.tsx +21 -19
- package/src/browser/scroll-restoration.ts +7 -5
- package/src/browser/segment-reconciler.ts +31 -21
- package/src/browser/types.ts +12 -0
- package/src/cache/cache-runtime.ts +203 -23
- package/src/cache/cf/cf-cache-store.ts +8 -0
- package/src/cache/document-cache.ts +20 -9
- package/src/cache/index.ts +0 -5
- package/src/cache/memory-segment-store.ts +53 -2
- package/src/cache/segment-codec.ts +4 -4
- package/src/cache/shell-snapshot.ts +417 -0
- package/src/cache/types.ts +86 -0
- package/src/cache/vercel/vercel-cache-store.ts +143 -108
- package/src/index.rsc.ts +1 -5
- package/src/index.ts +1 -17
- package/src/router/manifest.ts +13 -5
- package/src/router/match-api.ts +70 -30
- package/src/router/match-handlers.ts +6 -2
- package/src/router/match-result.ts +35 -15
- package/src/router/middleware.ts +10 -3
- package/src/router/request-classification.ts +20 -7
- package/src/router/route-snapshot.ts +10 -0
- package/src/router/segment-resolution/fresh.ts +25 -4
- package/src/router/segment-resolution/loader-cache.ts +57 -8
- package/src/router/segment-resolution/loader-mask.ts +26 -3
- package/src/router/segment-resolution/loader-snapshot.ts +170 -0
- package/src/rsc/nonce.ts +10 -1
- package/src/rsc/rsc-rendering.ts +310 -89
- package/src/rsc/shell-capture.ts +707 -66
- package/src/rsc/shell-serve.ts +150 -0
- package/src/server/context.ts +7 -0
- package/src/server/cookie-store.ts +6 -0
- package/src/server/request-context.ts +85 -46
- package/src/ssr/index.tsx +45 -6
- package/src/theme/ThemeProvider.tsx +36 -26
- package/src/urls/index.ts +1 -0
- package/src/urls/path-helper.ts +5 -0
- package/src/urls/pattern-types.ts +36 -0
- package/src/vite/discovery/dev-prerender-cache.ts +117 -0
- package/src/vite/router-discovery.ts +78 -15
- package/src/cache/shell-cache.ts +0 -386
- package/src/server/live.ts +0 -130
|
@@ -39,6 +39,7 @@ import type {
|
|
|
39
39
|
CacheItemResult,
|
|
40
40
|
CacheItemOptions,
|
|
41
41
|
ShellCacheEntry,
|
|
42
|
+
ShellSnapshotRecord,
|
|
42
43
|
} from "../types.js";
|
|
43
44
|
import type { RequestContext } from "../../server/request-context.js";
|
|
44
45
|
import { isPerClientSignalHeader } from "../../browser/cookie-name.js";
|
|
@@ -155,7 +156,7 @@ interface VercelResponseEnvelope {
|
|
|
155
156
|
s: number;
|
|
156
157
|
/** expiresAt (ms since epoch). */
|
|
157
158
|
e: number;
|
|
158
|
-
/** Tags, preserved so a
|
|
159
|
+
/** Tags, preserved so a background revalidation re-write keeps them. */
|
|
159
160
|
t?: string[];
|
|
160
161
|
}
|
|
161
162
|
|
|
@@ -173,8 +174,12 @@ interface VercelShellEnvelope {
|
|
|
173
174
|
s: number;
|
|
174
175
|
/** expiresAt (ms since epoch). */
|
|
175
176
|
e: number;
|
|
176
|
-
/** Tags, preserved so a
|
|
177
|
+
/** Tags, preserved so a background revalidation re-write keeps them. */
|
|
177
178
|
t?: string[];
|
|
179
|
+
/** initialTheme the capture render was built with (resume theme fidelity). */
|
|
180
|
+
i?: string;
|
|
181
|
+
/** Capture data snapshot: recorded cache-store hits/writes for HIT parity. */
|
|
182
|
+
sn?: ShellSnapshotRecord[];
|
|
178
183
|
}
|
|
179
184
|
|
|
180
185
|
/** Read-path outcome for the debug sink. */
|
|
@@ -221,9 +226,9 @@ export interface VercelCacheStoreOptions<TEnv = unknown> {
|
|
|
221
226
|
cache: VercelRuntimeCache;
|
|
222
227
|
|
|
223
228
|
/**
|
|
224
|
-
* `waitUntil` from `@vercel/functions`. Used only to run the stale-read
|
|
225
|
-
*
|
|
226
|
-
* backgrounds the actual writes. When omitted, the
|
|
229
|
+
* `waitUntil` from `@vercel/functions`. Used only to run the stale-read lock
|
|
230
|
+
* write (herd dampening) off the response path - the router already
|
|
231
|
+
* backgrounds the actual writes. When omitted, the lock write runs detached
|
|
227
232
|
* (fire-and-forget) instead.
|
|
228
233
|
*/
|
|
229
234
|
waitUntil?: (promise: Promise<unknown>) => void;
|
|
@@ -388,7 +393,7 @@ export class VercelCacheStore<
|
|
|
388
393
|
this.emitDebug({ op: "get", key, outcome: "miss", readMs });
|
|
389
394
|
return null;
|
|
390
395
|
}
|
|
391
|
-
const env = this.asSegmentEnvelope(raw);
|
|
396
|
+
const env = this.asSegmentEnvelope(this.decodeRaw(raw));
|
|
392
397
|
if (!env) {
|
|
393
398
|
reportCacheError(
|
|
394
399
|
new Error("malformed segment envelope"),
|
|
@@ -415,35 +420,19 @@ export class VercelCacheStore<
|
|
|
415
420
|
}
|
|
416
421
|
|
|
417
422
|
const isStale = env.s > 0 && now > env.s;
|
|
418
|
-
|
|
419
|
-
this.
|
|
420
|
-
|
|
421
|
-
env,
|
|
422
|
-
env.d.tags,
|
|
423
|
-
"[VercelCacheStore] get",
|
|
424
|
-
);
|
|
425
|
-
this.emitDebug({
|
|
426
|
-
op: "get",
|
|
427
|
-
key,
|
|
428
|
-
outcome: "stale-revalidate",
|
|
429
|
-
shouldRevalidate: true,
|
|
430
|
-
staleAt: env.s,
|
|
431
|
-
expiresAt: env.e,
|
|
432
|
-
readMs,
|
|
433
|
-
});
|
|
434
|
-
return { data: env.d, shouldRevalidate: true };
|
|
435
|
-
}
|
|
436
|
-
|
|
423
|
+
const shouldRevalidate = isStale
|
|
424
|
+
? await this.claimRevalidation(storeKey, env.e, "[VercelCacheStore] get")
|
|
425
|
+
: false;
|
|
437
426
|
this.emitDebug({
|
|
438
427
|
op: "get",
|
|
439
428
|
key,
|
|
440
|
-
outcome: "fresh",
|
|
441
|
-
shouldRevalidate
|
|
429
|
+
outcome: shouldRevalidate ? "stale-revalidate" : "fresh",
|
|
430
|
+
shouldRevalidate,
|
|
442
431
|
staleAt: env.s,
|
|
443
432
|
expiresAt: env.e,
|
|
444
433
|
readMs,
|
|
445
434
|
});
|
|
446
|
-
return { data: env.d, shouldRevalidate
|
|
435
|
+
return { data: env.d, shouldRevalidate };
|
|
447
436
|
}
|
|
448
437
|
|
|
449
438
|
async set(
|
|
@@ -457,8 +446,7 @@ export class VercelCacheStore<
|
|
|
457
446
|
const { staleAt, expiresAt } = computeExpiration(ttl, swrWindow);
|
|
458
447
|
// Embed the CLAMPED tags, like putResponse/setItem: the segment family
|
|
459
448
|
// carries its tags inside `d`, and a raw list would resurface dropped
|
|
460
|
-
// tags into recordRequestTags on every hit
|
|
461
|
-
// spurious cache-write report) by markRevalidating on every stale read.
|
|
449
|
+
// tags into recordRequestTags on every hit.
|
|
462
450
|
const safeTags = this.clampTagsForWrite(
|
|
463
451
|
data.tags,
|
|
464
452
|
"[VercelCacheStore] set",
|
|
@@ -512,7 +500,7 @@ export class VercelCacheStore<
|
|
|
512
500
|
this.emitDebug({ op: "getResponse", key, outcome: "miss", readMs });
|
|
513
501
|
return null;
|
|
514
502
|
}
|
|
515
|
-
const env = this.asResponseEnvelope(raw);
|
|
503
|
+
const env = this.asResponseEnvelope(this.decodeRaw(raw));
|
|
516
504
|
if (!env) {
|
|
517
505
|
reportCacheError(
|
|
518
506
|
new Error("malformed response envelope"),
|
|
@@ -538,11 +526,11 @@ export class VercelCacheStore<
|
|
|
538
526
|
return null;
|
|
539
527
|
}
|
|
540
528
|
|
|
541
|
-
// Reconstruct the Response BEFORE
|
|
542
|
-
// invalid base64 from base64ToBuffer, or bad header entries) would
|
|
543
|
-
// throw out of getResponse — breaking the fail-open contract — and
|
|
544
|
-
//
|
|
545
|
-
// a corrupt entry: report, evict, and miss.
|
|
529
|
+
// Reconstruct the Response BEFORE claiming revalidation. A corrupt body
|
|
530
|
+
// (e.g. invalid base64 from base64ToBuffer, or bad header entries) would
|
|
531
|
+
// otherwise throw out of getResponse — breaking the fail-open contract — and
|
|
532
|
+
// a stale read would have written a lock for an entry it then evicts. Treat a
|
|
533
|
+
// reconstruction failure as a corrupt entry: report, evict, and miss.
|
|
546
534
|
let response: Response;
|
|
547
535
|
try {
|
|
548
536
|
response = new Response(base64ToBuffer(env.b), {
|
|
@@ -561,24 +549,23 @@ export class VercelCacheStore<
|
|
|
561
549
|
}
|
|
562
550
|
|
|
563
551
|
const isStale = env.s > 0 && now > env.s;
|
|
564
|
-
|
|
565
|
-
this.
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
}
|
|
552
|
+
const shouldRevalidate = isStale
|
|
553
|
+
? await this.claimRevalidation(
|
|
554
|
+
storeKey,
|
|
555
|
+
env.e,
|
|
556
|
+
"[VercelCacheStore] getResponse",
|
|
557
|
+
)
|
|
558
|
+
: false;
|
|
572
559
|
this.emitDebug({
|
|
573
560
|
op: "getResponse",
|
|
574
561
|
key,
|
|
575
|
-
outcome:
|
|
576
|
-
shouldRevalidate
|
|
562
|
+
outcome: shouldRevalidate ? "stale-revalidate" : "fresh",
|
|
563
|
+
shouldRevalidate,
|
|
577
564
|
staleAt: env.s,
|
|
578
565
|
expiresAt: env.e,
|
|
579
566
|
readMs,
|
|
580
567
|
});
|
|
581
|
-
return { response, shouldRevalidate
|
|
568
|
+
return { response, shouldRevalidate };
|
|
582
569
|
}
|
|
583
570
|
|
|
584
571
|
async putResponse(
|
|
@@ -645,7 +632,7 @@ export class VercelCacheStore<
|
|
|
645
632
|
this.emitDebug({ op: "getItem", key, outcome: "miss", readMs });
|
|
646
633
|
return null;
|
|
647
634
|
}
|
|
648
|
-
const env = this.asItemEnvelope(raw);
|
|
635
|
+
const env = this.asItemEnvelope(this.decodeRaw(raw));
|
|
649
636
|
if (!env) {
|
|
650
637
|
reportCacheError(
|
|
651
638
|
new Error("malformed item envelope"),
|
|
@@ -672,14 +659,18 @@ export class VercelCacheStore<
|
|
|
672
659
|
}
|
|
673
660
|
|
|
674
661
|
const isStale = env.s > 0 && now > env.s;
|
|
675
|
-
|
|
676
|
-
this.
|
|
677
|
-
|
|
662
|
+
const shouldRevalidate = isStale
|
|
663
|
+
? await this.claimRevalidation(
|
|
664
|
+
storeKey,
|
|
665
|
+
env.e,
|
|
666
|
+
"[VercelCacheStore] getItem",
|
|
667
|
+
)
|
|
668
|
+
: false;
|
|
678
669
|
this.emitDebug({
|
|
679
670
|
op: "getItem",
|
|
680
671
|
key,
|
|
681
|
-
outcome:
|
|
682
|
-
shouldRevalidate
|
|
672
|
+
outcome: shouldRevalidate ? "stale-revalidate" : "fresh",
|
|
673
|
+
shouldRevalidate,
|
|
683
674
|
staleAt: env.s,
|
|
684
675
|
expiresAt: env.e,
|
|
685
676
|
readMs,
|
|
@@ -687,7 +678,7 @@ export class VercelCacheStore<
|
|
|
687
678
|
return {
|
|
688
679
|
value: env.v,
|
|
689
680
|
handles: env.h,
|
|
690
|
-
shouldRevalidate
|
|
681
|
+
shouldRevalidate,
|
|
691
682
|
tags: env.t,
|
|
692
683
|
};
|
|
693
684
|
}
|
|
@@ -747,7 +738,7 @@ export class VercelCacheStore<
|
|
|
747
738
|
this.emitDebug({ op: "getShell", key, outcome: "miss", readMs });
|
|
748
739
|
return null;
|
|
749
740
|
}
|
|
750
|
-
const env = this.asShellEnvelope(raw);
|
|
741
|
+
const env = this.asShellEnvelope(this.decodeRaw(raw));
|
|
751
742
|
if (!env) {
|
|
752
743
|
reportCacheError(
|
|
753
744
|
new Error("malformed shell envelope"),
|
|
@@ -774,19 +765,18 @@ export class VercelCacheStore<
|
|
|
774
765
|
}
|
|
775
766
|
|
|
776
767
|
const isStale = env.s > 0 && now > env.s;
|
|
777
|
-
|
|
778
|
-
this.
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
}
|
|
768
|
+
const shouldRevalidate = isStale
|
|
769
|
+
? await this.claimRevalidation(
|
|
770
|
+
storeKey,
|
|
771
|
+
env.e,
|
|
772
|
+
"[VercelCacheStore] getShell",
|
|
773
|
+
)
|
|
774
|
+
: false;
|
|
785
775
|
this.emitDebug({
|
|
786
776
|
op: "getShell",
|
|
787
777
|
key,
|
|
788
|
-
outcome:
|
|
789
|
-
shouldRevalidate
|
|
778
|
+
outcome: shouldRevalidate ? "stale-revalidate" : "fresh",
|
|
779
|
+
shouldRevalidate,
|
|
790
780
|
staleAt: env.s,
|
|
791
781
|
expiresAt: env.e,
|
|
792
782
|
readMs,
|
|
@@ -796,9 +786,11 @@ export class VercelCacheStore<
|
|
|
796
786
|
prelude: env.p,
|
|
797
787
|
postponed: env.po,
|
|
798
788
|
reactVersion: env.rv,
|
|
789
|
+
initialTheme: env.i,
|
|
790
|
+
snapshot: env.sn,
|
|
799
791
|
createdAt: env.c,
|
|
800
792
|
},
|
|
801
|
-
shouldRevalidate
|
|
793
|
+
shouldRevalidate,
|
|
802
794
|
};
|
|
803
795
|
}
|
|
804
796
|
|
|
@@ -827,6 +819,8 @@ export class VercelCacheStore<
|
|
|
827
819
|
s: staleAt,
|
|
828
820
|
e: expiresAt,
|
|
829
821
|
t: safeTags.length > 0 ? safeTags : undefined,
|
|
822
|
+
i: entry.initialTheme,
|
|
823
|
+
sn: entry.snapshot,
|
|
830
824
|
};
|
|
831
825
|
// write() enforces the 2 MB per-item ceiling (withinSizeLimit): an
|
|
832
826
|
// oversized shell prelude is reported and skipped (fail-open to a full
|
|
@@ -892,68 +886,107 @@ export class VercelCacheStore<
|
|
|
892
886
|
tags: string[] | undefined,
|
|
893
887
|
label: string,
|
|
894
888
|
): Promise<void> {
|
|
895
|
-
|
|
889
|
+
// Serialize the envelope exactly ONCE: the same string measures the entry
|
|
890
|
+
// against the size cap AND is what we hand the platform. The Vercel client
|
|
891
|
+
// JSON-serializes whatever value it is given, so passing the raw object here
|
|
892
|
+
// would walk and stringify the (potentially large) envelope a SECOND time.
|
|
893
|
+
// Entries written this way are JSON strings; the read path (decodeRaw)
|
|
894
|
+
// parses them back, and still accepts the legacy object shape written before
|
|
895
|
+
// this change.
|
|
896
|
+
let serialized: string | undefined;
|
|
897
|
+
try {
|
|
898
|
+
serialized = JSON.stringify(value);
|
|
899
|
+
} catch {
|
|
900
|
+
// Unserializable value: fall back to letting the platform serialize it
|
|
901
|
+
// (best-effort — matches the prior "cannot measure -> allow the write").
|
|
902
|
+
serialized = undefined;
|
|
903
|
+
}
|
|
904
|
+
if (serialized !== undefined && !this.withinSizeLimit(serialized, label)) {
|
|
905
|
+
return;
|
|
906
|
+
}
|
|
896
907
|
const safeTags = this.clampTagsForWrite(tags, label);
|
|
897
908
|
const options: { ttl: number; tags?: string[]; name?: string } = {
|
|
898
909
|
ttl: Math.max(1, Math.ceil(totalTtlSeconds)),
|
|
899
910
|
};
|
|
900
911
|
if (safeTags.length > 0) options.tags = safeTags;
|
|
901
912
|
if (this.name) options.name = this.name;
|
|
902
|
-
await this.cache.set(storeKey, value, options);
|
|
913
|
+
await this.cache.set(storeKey, serialized ?? value, options);
|
|
903
914
|
}
|
|
904
915
|
|
|
905
916
|
/**
|
|
906
|
-
*
|
|
907
|
-
*
|
|
908
|
-
*
|
|
909
|
-
*
|
|
917
|
+
* Normalize a value read back from the cache. Entries written by this store
|
|
918
|
+
* are pre-serialized JSON strings (see write()); legacy entries (written
|
|
919
|
+
* before that change, or by a client that deserializes for us) come back as
|
|
920
|
+
* objects. Parse strings, pass objects through, and treat a non-JSON string
|
|
921
|
+
* as corrupt (returns undefined, so the caller reports + evicts).
|
|
922
|
+
*/
|
|
923
|
+
private decodeRaw(raw: unknown): unknown {
|
|
924
|
+
if (typeof raw !== "string") return raw;
|
|
925
|
+
try {
|
|
926
|
+
return JSON.parse(raw);
|
|
927
|
+
} catch {
|
|
928
|
+
return undefined;
|
|
929
|
+
}
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
/**
|
|
933
|
+
* Stale-read herd dampening via a tiny companion lock key. On a stale read,
|
|
934
|
+
* check `{storeKey}:lock`; if absent, claim it (write a short-TTL marker) and
|
|
935
|
+
* return true so THIS reader triggers revalidation. If present, another
|
|
936
|
+
* same-region reader already claimed it, so return false and serve the stale
|
|
937
|
+
* entry as fresh without piling on. Best-effort and non-blocking; never throws.
|
|
938
|
+
*
|
|
939
|
+
* Only the STALE path pays the extra lock read; the fresh-hit path takes no
|
|
940
|
+
* lock round trip. Unlike the prior whole-envelope re-stamp, a stale read now
|
|
941
|
+
* writes only the tiny lock, never the (potentially large) payload.
|
|
910
942
|
*
|
|
911
|
-
*
|
|
912
|
-
*
|
|
913
|
-
*
|
|
914
|
-
*
|
|
915
|
-
* the re-stamp. Both self-heal within REVALIDATION_LOCK_MS (the re-stamped
|
|
916
|
-
* copy is then re-read as stale and revalidated again, or re-deleted). The
|
|
917
|
-
* window is narrow and the cost is at most one extra revalidation / one brief
|
|
918
|
-
* stale serve; a read-compare would not close it atomically without CAS.
|
|
943
|
+
* Non-atomic (getCache has no compare-and-set): two readers can both find no
|
|
944
|
+
* lock and both revalidate. The window is REVALIDATION_LOCK_MS wide, after
|
|
945
|
+
* which the lock expires and the entry is re-claimed (or a fresh write has
|
|
946
|
+
* superseded it). A read-compare would not close the race without CAS.
|
|
919
947
|
*/
|
|
920
|
-
private
|
|
948
|
+
private async claimRevalidation(
|
|
921
949
|
storeKey: string,
|
|
922
|
-
|
|
923
|
-
tags: string[] | undefined,
|
|
950
|
+
expiresAt: number,
|
|
924
951
|
label: string,
|
|
925
|
-
):
|
|
926
|
-
const
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
952
|
+
): Promise<boolean> {
|
|
953
|
+
const lockKey = `${storeKey}:lock`;
|
|
954
|
+
let lock: unknown;
|
|
955
|
+
try {
|
|
956
|
+
lock = await this.cache.get(lockKey);
|
|
957
|
+
} catch {
|
|
958
|
+
// A lock-read failure must not break the read path: treat as unlocked.
|
|
959
|
+
lock = null;
|
|
960
|
+
}
|
|
961
|
+
if (lock != null) return false;
|
|
962
|
+
|
|
963
|
+
const remainingSeconds = Math.ceil((expiresAt - Date.now()) / 1000);
|
|
964
|
+
const lockTtl = Math.max(
|
|
965
|
+
1,
|
|
966
|
+
Math.min(Math.ceil(REVALIDATION_LOCK_MS / 1000), remainingSeconds),
|
|
967
|
+
);
|
|
933
968
|
const task = (): Promise<void> =>
|
|
934
|
-
this.
|
|
969
|
+
this.cache.set(lockKey, 1, { ttl: lockTtl });
|
|
935
970
|
if (this.waitUntil) {
|
|
936
971
|
this.waitUntil(reportingAsync(task, "cache-write", label));
|
|
937
972
|
} else {
|
|
938
973
|
void reportingAsync(task, "cache-write", label);
|
|
939
974
|
}
|
|
975
|
+
return true;
|
|
940
976
|
}
|
|
941
977
|
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
}
|
|
955
|
-
} catch {
|
|
956
|
-
// If the value cannot be measured, allow the write (best-effort).
|
|
978
|
+
/** Measure a pre-serialized entry against the per-item size cap (see write). */
|
|
979
|
+
private withinSizeLimit(serialized: string, label: string): boolean {
|
|
980
|
+
const bytes = new TextEncoder().encode(serialized).length;
|
|
981
|
+
if (bytes >= this.maxItemBytes) {
|
|
982
|
+
reportCacheError(
|
|
983
|
+
new Error(
|
|
984
|
+
`entry is ${bytes}B, at/above the ${this.maxItemBytes}B cap; not cached`,
|
|
985
|
+
),
|
|
986
|
+
"cache-write",
|
|
987
|
+
label,
|
|
988
|
+
);
|
|
989
|
+
return false;
|
|
957
990
|
}
|
|
958
991
|
return true;
|
|
959
992
|
}
|
|
@@ -1068,7 +1101,7 @@ export class VercelCacheStore<
|
|
|
1068
1101
|
|
|
1069
1102
|
private asShellEnvelope(raw: unknown): VercelShellEnvelope | null {
|
|
1070
1103
|
if (!isRecord(raw)) return null;
|
|
1071
|
-
const { p, po, rv, c, s, e, t } = raw;
|
|
1104
|
+
const { p, po, rv, c, s, e, t, i, sn } = raw;
|
|
1072
1105
|
if (typeof p !== "string" || typeof rv !== "string") return null;
|
|
1073
1106
|
if (po !== null && typeof po !== "string") return null;
|
|
1074
1107
|
if (typeof c !== "number") return null;
|
|
@@ -1081,6 +1114,8 @@ export class VercelCacheStore<
|
|
|
1081
1114
|
s,
|
|
1082
1115
|
e,
|
|
1083
1116
|
t: Array.isArray(t) ? (t as string[]) : undefined,
|
|
1117
|
+
i: typeof i === "string" ? i : undefined,
|
|
1118
|
+
sn: Array.isArray(sn) ? (sn as ShellSnapshotRecord[]) : undefined,
|
|
1084
1119
|
};
|
|
1085
1120
|
}
|
|
1086
1121
|
|
package/src/index.rsc.ts
CHANGED
|
@@ -157,6 +157,7 @@ export {
|
|
|
157
157
|
urls,
|
|
158
158
|
type PathHelpers,
|
|
159
159
|
type PathOptions,
|
|
160
|
+
type PartialPrerenderProps,
|
|
160
161
|
type UrlPatterns,
|
|
161
162
|
type IncludeOptions,
|
|
162
163
|
type IncludeItem,
|
|
@@ -219,11 +220,6 @@ export {
|
|
|
219
220
|
type ReadonlyHeaders,
|
|
220
221
|
} from "./server/cookie-store.js";
|
|
221
222
|
|
|
222
|
-
// live() — the deterministic PPR hole primitive. Real (capture-aware)
|
|
223
|
-
// implementation under the react-server condition; index.ts ships a client/SSR
|
|
224
|
-
// passthrough (there is no shell capture off this condition).
|
|
225
|
-
export { live } from "./server/live.js";
|
|
226
|
-
|
|
227
223
|
// Cache tag APIs (server-only)
|
|
228
224
|
// cacheTag: tag the current "use cache" entry at runtime.
|
|
229
225
|
// updateTag: read-your-own-writes invalidation (awaitable, for Server Actions).
|
package/src/index.ts
CHANGED
|
@@ -110,6 +110,7 @@ export type {
|
|
|
110
110
|
TextResponsePathFn,
|
|
111
111
|
RouteResponse,
|
|
112
112
|
ProblemDetails,
|
|
113
|
+
PartialPrerenderProps,
|
|
113
114
|
} from "./urls.js";
|
|
114
115
|
|
|
115
116
|
// Middleware context types
|
|
@@ -228,23 +229,6 @@ export function headers(): never {
|
|
|
228
229
|
throw serverOnlyStubError("headers");
|
|
229
230
|
}
|
|
230
231
|
|
|
231
|
-
/**
|
|
232
|
-
* Client/SSR passthrough for `live()` (the PPR hole primitive). Unlike the
|
|
233
|
-
* cookies()/headers() stubs this is a REAL function: there is no shell capture
|
|
234
|
-
* off the react-server condition, so live() simply runs the thunk (or returns
|
|
235
|
-
* the promise). The capture-aware implementation lives in index.rsc.ts
|
|
236
|
-
* (./server/live.js). See docs/design/ppr-shell-resume.md.
|
|
237
|
-
*/
|
|
238
|
-
export function live<T>(fn: () => Promise<T> | T): Promise<T>;
|
|
239
|
-
export function live<T>(promise: Promise<T>): Promise<T>;
|
|
240
|
-
export function live<T>(
|
|
241
|
-
input: (() => Promise<T> | T) | Promise<T>,
|
|
242
|
-
): Promise<T> {
|
|
243
|
-
return typeof input === "function"
|
|
244
|
-
? Promise.resolve((input as () => Promise<T> | T)())
|
|
245
|
-
: input;
|
|
246
|
-
}
|
|
247
|
-
|
|
248
232
|
/**
|
|
249
233
|
* Client implementation of `invalidateClientCache()`. Unlike the server-only
|
|
250
234
|
* stubs above this is a REAL function under the `default` condition (it marks
|
package/src/router/manifest.ts
CHANGED
|
@@ -82,10 +82,14 @@ export async function loadManifest(
|
|
|
82
82
|
Store.mountIndex = mountIndex;
|
|
83
83
|
Store.isSSR = isSSR;
|
|
84
84
|
if (metricsStore) Store.metrics = metricsStore;
|
|
85
|
-
//
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
85
|
+
// Alias the request-scoped Store to the cached Map instead of copying it
|
|
86
|
+
// entry-by-entry. At request time this Store is throwaway (no ambient
|
|
87
|
+
// RangoContext store spans classify->match->render, so getOrCreateStore
|
|
88
|
+
// returns a fresh detached store here), so nothing mutates it in place after
|
|
89
|
+
// loadManifest returns. The fresh path below REASSIGNS Store.manifest rather
|
|
90
|
+
// than clearing it in place, so a later fresh load sharing this Store cannot
|
|
91
|
+
// poison the cached Map.
|
|
92
|
+
Store.manifest = cached;
|
|
89
93
|
pushMetric?.("manifest:cache-hit", cacheStart);
|
|
90
94
|
return cached.get(routeKey)!;
|
|
91
95
|
}
|
|
@@ -103,7 +107,11 @@ export async function loadManifest(
|
|
|
103
107
|
pushMetric?.("manifest:store-setup", storeSetupStart);
|
|
104
108
|
|
|
105
109
|
const clearStart = performance.now();
|
|
106
|
-
|
|
110
|
+
// Reassign rather than clear() in place: a prior cache-hit may have aliased
|
|
111
|
+
// Store.manifest to a shared module-cache Map (see cache-hit branch above),
|
|
112
|
+
// and clearing it in place would poison that cache. A fresh Map isolates this
|
|
113
|
+
// build; the cache still receives an independent copy at the end.
|
|
114
|
+
Store.manifest = new Map();
|
|
107
115
|
pushMetric?.("manifest:clear", clearStart);
|
|
108
116
|
|
|
109
117
|
try {
|
package/src/router/match-api.ts
CHANGED
|
@@ -26,6 +26,7 @@ import type { MatchContext } from "./match-context.js";
|
|
|
26
26
|
import type { MatchApiDeps, ActionContext } from "./types.js";
|
|
27
27
|
import {
|
|
28
28
|
getRequestContext,
|
|
29
|
+
_getRequestContext,
|
|
29
30
|
setRequestContextPrevRouteKey,
|
|
30
31
|
} from "../server/request-context.js";
|
|
31
32
|
import { isAutoGeneratedRouteName } from "../route-name.js";
|
|
@@ -47,31 +48,67 @@ export async function createMatchContextForFull<TEnv>(
|
|
|
47
48
|
deps: MatchApiDeps<TEnv>,
|
|
48
49
|
findInterceptForRoute: MatchApiDeps<TEnv>["findInterceptForRoute"],
|
|
49
50
|
): Promise<MatchContext<TEnv> | { type: "redirect"; redirectUrl: string }> {
|
|
50
|
-
const
|
|
51
|
-
const
|
|
51
|
+
const reqCtx = _getRequestContext();
|
|
52
|
+
const cleanUrl = reqCtx?.url ?? stripInternalParams(new URL(request.url));
|
|
53
|
+
const pathname = cleanUrl.pathname;
|
|
52
54
|
|
|
53
55
|
const metricsStore = deps.getMetricsStore();
|
|
54
56
|
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
57
|
+
const isHmr = !!request.headers.get("X-RSC-HMR");
|
|
58
|
+
// HMR: clear the manifest cache so stale handler references are discarded.
|
|
59
|
+
if (isHmr) {
|
|
60
|
+
clearManifestCache();
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// Reuse the snapshot classifyRequest already resolved when it is a full-render
|
|
64
|
+
// snapshot (isSSR:true) and HMR has not invalidated it — mirrors the partial
|
|
65
|
+
// path. A partial-mode snapshot (isSSR:false) carries the wrong loading()
|
|
66
|
+
// entries and lives in a different manifest partition, so it is NOT reusable.
|
|
67
|
+
const classified = reqCtx?._classifiedRoute;
|
|
68
|
+
const classifiedRoute =
|
|
69
|
+
!isHmr && classified?.isSSR === true ? classified : undefined;
|
|
70
|
+
|
|
71
|
+
// On the reuse path, findMatch + manifest-loading already ran during
|
|
72
|
+
// classifyRequest (which carries no metricsStore), so only the cheap
|
|
73
|
+
// entries/cacheScope materialization is timed here under a distinct label. On
|
|
74
|
+
// the fresh path, resolveRoute emits route-matching + manifest-loading as usual.
|
|
75
|
+
const routeMatchStart = metricsStore ? performance.now() : 0;
|
|
60
76
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
77
|
+
let snapshot: RouteSnapshot<TEnv>;
|
|
78
|
+
if (classifiedRoute && classifiedRoute.manifestEntry) {
|
|
79
|
+
snapshot = ensureFullRouteSnapshot(classifiedRoute);
|
|
80
|
+
if (metricsStore) {
|
|
81
|
+
metricsStore.metrics.push({
|
|
82
|
+
label: "route-matching:reuse",
|
|
83
|
+
duration: performance.now() - routeMatchStart,
|
|
84
|
+
startTime: routeMatchStart - metricsStore.requestStart,
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
} else {
|
|
88
|
+
const result = await resolveRoute<TEnv>(pathname, {
|
|
89
|
+
findMatch: (p) => deps.findMatch(p, metricsStore),
|
|
90
|
+
metricsStore,
|
|
91
|
+
isSSR: true,
|
|
64
92
|
});
|
|
65
|
-
}
|
|
66
93
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
}
|
|
94
|
+
if (!result) {
|
|
95
|
+
throw new RouteNotFoundError(`No route matched for ${pathname}`, {
|
|
96
|
+
cause: { pathname, method: request.method },
|
|
97
|
+
});
|
|
98
|
+
}
|
|
73
99
|
|
|
74
|
-
|
|
100
|
+
if (result.type === "redirect") {
|
|
101
|
+
// Preserve the raw query string (including internal _rsc* params) on the
|
|
102
|
+
// redirect target, matching the pre-reuse behavior of `url.search`.
|
|
103
|
+
const rawSearch = (reqCtx?.originalUrl ?? new URL(request.url)).search;
|
|
104
|
+
return {
|
|
105
|
+
type: "redirect",
|
|
106
|
+
redirectUrl: result.redirectTo + rawSearch,
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
snapshot = result.snapshot;
|
|
111
|
+
}
|
|
75
112
|
|
|
76
113
|
const { matched } = snapshot;
|
|
77
114
|
|
|
@@ -79,8 +116,6 @@ export async function createMatchContextForFull<TEnv>(
|
|
|
79
116
|
matched.pt = true;
|
|
80
117
|
}
|
|
81
118
|
|
|
82
|
-
const cleanUrl = stripInternalParams(url);
|
|
83
|
-
|
|
84
119
|
const handlerContext = createHandlerContext(
|
|
85
120
|
matched.params,
|
|
86
121
|
request,
|
|
@@ -164,8 +199,13 @@ export async function createMatchContextForPartial<TEnv>(
|
|
|
164
199
|
findInterceptForRoute: MatchApiDeps<TEnv>["findInterceptForRoute"],
|
|
165
200
|
actionContext?: ActionContext,
|
|
166
201
|
): Promise<MatchContext<TEnv> | null> {
|
|
167
|
-
const
|
|
168
|
-
|
|
202
|
+
const reqCtx = _getRequestContext();
|
|
203
|
+
// resolveNavigation needs the raw URL (reads internal _rsc_segments /
|
|
204
|
+
// _rsc_stale params that stripInternalParams removes); the clean URL feeds the
|
|
205
|
+
// handler context. Both come off the request context when present.
|
|
206
|
+
const rawUrl = reqCtx?.originalUrl ?? new URL(request.url);
|
|
207
|
+
const cleanUrl = reqCtx?.url ?? stripInternalParams(rawUrl);
|
|
208
|
+
const pathname = cleanUrl.pathname;
|
|
169
209
|
|
|
170
210
|
const metricsStore = deps.getMetricsStore();
|
|
171
211
|
|
|
@@ -177,11 +217,13 @@ export async function createMatchContextForPartial<TEnv>(
|
|
|
177
217
|
}
|
|
178
218
|
|
|
179
219
|
// Reuse the classified snapshot when available and not invalidated by HMR.
|
|
180
|
-
// classifyRequest
|
|
181
|
-
//
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
220
|
+
// classifyRequest resolves a partial request with isSSR=false, matching this
|
|
221
|
+
// path. Never reuse an isSSR:true (full-render) snapshot — its loading()
|
|
222
|
+
// entries and manifest partition are wrong here. On HMR, discard to pick up
|
|
223
|
+
// manifest changes.
|
|
224
|
+
const classified = reqCtx?._classifiedRoute;
|
|
225
|
+
const classifiedRoute =
|
|
226
|
+
!isHmr && classified?.isSSR !== true ? classified : undefined;
|
|
185
227
|
|
|
186
228
|
// Time route matching. On the reuse path, only nav findMatch calls are new
|
|
187
229
|
// (current-route findMatch and manifest-loading were already timed during
|
|
@@ -220,7 +262,7 @@ export async function createMatchContextForPartial<TEnv>(
|
|
|
220
262
|
matched.pt = true;
|
|
221
263
|
}
|
|
222
264
|
|
|
223
|
-
const nav = await resolveNavigation(request,
|
|
265
|
+
const nav = await resolveNavigation(request, rawUrl, matched.routeKey, {
|
|
224
266
|
findMatch: deps.findMatch,
|
|
225
267
|
});
|
|
226
268
|
if (!nav) {
|
|
@@ -243,8 +285,6 @@ export async function createMatchContextForPartial<TEnv>(
|
|
|
243
285
|
});
|
|
244
286
|
}
|
|
245
287
|
|
|
246
|
-
const cleanUrl = stripInternalParams(url);
|
|
247
|
-
|
|
248
288
|
const handlerContext = createHandlerContext(
|
|
249
289
|
matched.params,
|
|
250
290
|
request,
|