@rangojs/router 0.10.0 → 0.11.0
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 +1 -1
- package/LICENSE +21 -0
- package/README.md +17 -15
- package/dist/types/browser/partial-update.d.ts +1 -0
- package/dist/types/cache/cf/cf-cache-constants.d.ts +1 -1
- package/dist/types/cache/cf/cf-cache-store.d.ts +1 -1
- package/dist/types/client-urls/navigation.d.ts +11 -0
- package/dist/types/client-urls/revalidate-chain.d.ts +33 -0
- package/dist/types/client-urls/types.d.ts +41 -14
- package/dist/types/client.d.ts +2 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.rsc.d.ts +1 -1
- package/dist/types/router/is-action.d.ts +34 -0
- package/dist/types/rsc/shell-capture-constants.d.ts +1 -1
- package/dist/types/testing/index.d.ts +3 -1
- package/dist/types/testing/run-client-revalidate.d.ts +43 -0
- package/dist/types/testing/to-url.d.ts +2 -0
- package/dist/types/types/handler-context.d.ts +12 -5
- package/dist/types/types/index.d.ts +1 -1
- package/dist/types/vite/plugins/expose-action-id.d.ts +14 -0
- package/dist/vite/index.js +19 -6
- package/package.json +6 -5
- package/skills/bundle-analysis/SKILL.md +1 -1
- package/skills/client-urls/SKILL.md +26 -4
- package/skills/loader/SKILL.md +1 -0
- package/skills/testing/SKILL.md +2 -1
- package/skills/testing/bindings.md +1 -1
- package/skills/testing/cache-prerender.md +1 -1
- package/skills/testing/client-components.md +1 -1
- package/skills/testing/e2e-parity.md +1 -1
- package/skills/testing/flight.md +1 -1
- package/skills/testing/handles.md +1 -1
- package/skills/testing/loader.md +1 -1
- package/skills/testing/middleware.md +1 -1
- package/skills/testing/render-handler.md +1 -1
- package/skills/testing/response-routes.md +1 -1
- package/skills/testing/reverse-and-types.md +1 -1
- package/skills/testing/server-actions.md +1 -1
- package/skills/testing/server-tree.md +1 -1
- package/skills/testing/setup.md +1 -1
- package/skills/typesafety/route-types.md +1 -0
- package/src/browser/partial-update.ts +11 -2
- package/src/browser/server-action-bridge.ts +9 -2
- package/src/cache/cache-runtime.ts +2 -2
- package/src/cache/cf/cf-cache-constants.ts +1 -1
- package/src/cache/cf/cf-cache-store.ts +1 -1
- package/src/client-urls/navigation.ts +40 -42
- package/src/client-urls/revalidate-chain.ts +83 -0
- package/src/client-urls/types.ts +41 -13
- package/src/client.tsx +5 -0
- package/src/index.rsc.ts +1 -0
- package/src/index.ts +1 -0
- package/src/router/is-action.ts +100 -0
- package/src/router/revalidation.ts +5 -48
- package/src/rsc/server-action.ts +2 -4
- package/src/rsc/shell-capture-constants.ts +1 -1
- package/src/rsc/shell-capture.ts +2 -2
- package/src/testing/index.ts +4 -1
- package/src/testing/run-client-revalidate.ts +108 -0
- package/src/testing/run-transition-when.ts +1 -3
- package/src/testing/to-url.ts +5 -0
- package/src/types/handler-context.ts +13 -5
- package/src/types/index.ts +1 -0
- package/src/vite/plugins/expose-action-id.ts +29 -1
- package/dist/__internal.d.ts +0 -83
- package/dist/__internal.d.ts.map +0 -1
- package/dist/__internal.js +0 -19
- package/dist/__internal.js.map +0 -1
- package/dist/__mocks__/version.d.ts +0 -7
- package/dist/__mocks__/version.d.ts.map +0 -1
- package/dist/__mocks__/version.js +0 -7
- package/dist/__mocks__/version.js.map +0 -1
- package/dist/__tests__/client-href.test.d.ts +0 -2
- package/dist/__tests__/client-href.test.d.ts.map +0 -1
- package/dist/__tests__/client-href.test.js +0 -74
- package/dist/__tests__/client-href.test.js.map +0 -1
- package/dist/__tests__/component-utils.test.d.ts +0 -2
- package/dist/__tests__/component-utils.test.d.ts.map +0 -1
- package/dist/__tests__/component-utils.test.js +0 -51
- package/dist/__tests__/component-utils.test.js.map +0 -1
- package/dist/__tests__/event-controller.test.d.ts +0 -2
- package/dist/__tests__/event-controller.test.d.ts.map +0 -1
- package/dist/__tests__/event-controller.test.js +0 -538
- package/dist/__tests__/event-controller.test.js.map +0 -1
- package/dist/__tests__/helpers/route-tree.d.ts +0 -118
- package/dist/__tests__/helpers/route-tree.d.ts.map +0 -1
- package/dist/__tests__/helpers/route-tree.js +0 -374
- package/dist/__tests__/helpers/route-tree.js.map +0 -1
- package/dist/__tests__/match-result.test.d.ts +0 -2
- package/dist/__tests__/match-result.test.d.ts.map +0 -1
- package/dist/__tests__/match-result.test.js +0 -154
- package/dist/__tests__/match-result.test.js.map +0 -1
- package/dist/__tests__/navigation-store.test.d.ts +0 -2
- package/dist/__tests__/navigation-store.test.d.ts.map +0 -1
- package/dist/__tests__/navigation-store.test.js +0 -440
- package/dist/__tests__/navigation-store.test.js.map +0 -1
- package/dist/__tests__/partial-update.test.d.ts +0 -2
- package/dist/__tests__/partial-update.test.d.ts.map +0 -1
- package/dist/__tests__/partial-update.test.js +0 -1009
- package/dist/__tests__/partial-update.test.js.map +0 -1
- package/dist/__tests__/reverse-types.test.d.ts +0 -8
- package/dist/__tests__/reverse-types.test.d.ts.map +0 -1
- package/dist/__tests__/reverse-types.test.js +0 -656
- package/dist/__tests__/reverse-types.test.js.map +0 -1
- package/dist/__tests__/route-definition.test.d.ts +0 -2
- package/dist/__tests__/route-definition.test.d.ts.map +0 -1
- package/dist/__tests__/route-definition.test.js +0 -55
- package/dist/__tests__/route-definition.test.js.map +0 -1
- package/dist/__tests__/router-helpers.test.d.ts +0 -2
- package/dist/__tests__/router-helpers.test.d.ts.map +0 -1
- package/dist/__tests__/router-helpers.test.js +0 -377
- package/dist/__tests__/router-helpers.test.js.map +0 -1
- package/dist/__tests__/router-integration-2.test.d.ts +0 -2
- package/dist/__tests__/router-integration-2.test.d.ts.map +0 -1
- package/dist/__tests__/router-integration-2.test.js +0 -426
- package/dist/__tests__/router-integration-2.test.js.map +0 -1
- package/dist/__tests__/router-integration.test.d.ts +0 -2
- package/dist/__tests__/router-integration.test.d.ts.map +0 -1
- package/dist/__tests__/router-integration.test.js +0 -1051
- package/dist/__tests__/router-integration.test.js.map +0 -1
- package/dist/__tests__/search-params.test.d.ts +0 -5
- package/dist/__tests__/search-params.test.d.ts.map +0 -1
- package/dist/__tests__/search-params.test.js +0 -306
- package/dist/__tests__/search-params.test.js.map +0 -1
- package/dist/__tests__/segment-system.test.d.ts +0 -2
- package/dist/__tests__/segment-system.test.d.ts.map +0 -1
- package/dist/__tests__/segment-system.test.js +0 -627
- package/dist/__tests__/segment-system.test.js.map +0 -1
- package/dist/__tests__/static-handler-types.test.d.ts +0 -8
- package/dist/__tests__/static-handler-types.test.d.ts.map +0 -1
- package/dist/__tests__/static-handler-types.test.js +0 -63
- package/dist/__tests__/static-handler-types.test.js.map +0 -1
- package/dist/__tests__/urls.test.d.ts +0 -2
- package/dist/__tests__/urls.test.d.ts.map +0 -1
- package/dist/__tests__/urls.test.js +0 -421
- package/dist/__tests__/urls.test.js.map +0 -1
- package/dist/__tests__/use-mount.test.d.ts +0 -2
- package/dist/__tests__/use-mount.test.d.ts.map +0 -1
- package/dist/__tests__/use-mount.test.js +0 -35
- package/dist/__tests__/use-mount.test.js.map +0 -1
- package/dist/bin/rango.d.ts +0 -2
- package/dist/bin/rango.d.ts.map +0 -1
- package/dist/bin/rango.js.map +0 -1
- package/dist/browser/event-controller.d.ts +0 -191
- package/dist/browser/event-controller.d.ts.map +0 -1
- package/dist/browser/event-controller.js +0 -559
- package/dist/browser/event-controller.js.map +0 -1
- package/dist/browser/index.d.ts +0 -2
- package/dist/browser/index.d.ts.map +0 -1
- package/dist/browser/index.js +0 -14
- package/dist/browser/index.js.map +0 -1
- package/dist/browser/link-interceptor.d.ts +0 -38
- package/dist/browser/link-interceptor.d.ts.map +0 -1
- package/dist/browser/link-interceptor.js +0 -99
- package/dist/browser/link-interceptor.js.map +0 -1
- package/dist/browser/logging.d.ts +0 -10
- package/dist/browser/logging.d.ts.map +0 -1
- package/dist/browser/logging.js +0 -29
- package/dist/browser/logging.js.map +0 -1
- package/dist/browser/lru-cache.d.ts +0 -17
- package/dist/browser/lru-cache.d.ts.map +0 -1
- package/dist/browser/lru-cache.js +0 -50
- package/dist/browser/lru-cache.js.map +0 -1
- package/dist/browser/merge-segment-loaders.d.ts +0 -39
- package/dist/browser/merge-segment-loaders.d.ts.map +0 -1
- package/dist/browser/merge-segment-loaders.js +0 -102
- package/dist/browser/merge-segment-loaders.js.map +0 -1
- package/dist/browser/navigation-bridge.d.ts +0 -102
- package/dist/browser/navigation-bridge.d.ts.map +0 -1
- package/dist/browser/navigation-bridge.js +0 -708
- package/dist/browser/navigation-bridge.js.map +0 -1
- package/dist/browser/navigation-client.d.ts +0 -25
- package/dist/browser/navigation-client.d.ts.map +0 -1
- package/dist/browser/navigation-client.js +0 -157
- package/dist/browser/navigation-client.js.map +0 -1
- package/dist/browser/navigation-store.d.ts +0 -101
- package/dist/browser/navigation-store.d.ts.map +0 -1
- package/dist/browser/navigation-store.js +0 -625
- package/dist/browser/navigation-store.js.map +0 -1
- package/dist/browser/partial-update.d.ts +0 -75
- package/dist/browser/partial-update.d.ts.map +0 -1
- package/dist/browser/partial-update.js +0 -426
- package/dist/browser/partial-update.js.map +0 -1
- package/dist/browser/react/Link.d.ts +0 -86
- package/dist/browser/react/Link.d.ts.map +0 -1
- package/dist/browser/react/Link.js +0 -128
- package/dist/browser/react/Link.js.map +0 -1
- package/dist/browser/react/NavigationProvider.d.ts +0 -63
- package/dist/browser/react/NavigationProvider.d.ts.map +0 -1
- package/dist/browser/react/NavigationProvider.js +0 -216
- package/dist/browser/react/NavigationProvider.js.map +0 -1
- package/dist/browser/react/ScrollRestoration.d.ts +0 -75
- package/dist/browser/react/ScrollRestoration.d.ts.map +0 -1
- package/dist/browser/react/ScrollRestoration.js +0 -57
- package/dist/browser/react/ScrollRestoration.js.map +0 -1
- package/dist/browser/react/context.d.ts +0 -46
- package/dist/browser/react/context.d.ts.map +0 -1
- package/dist/browser/react/context.js +0 -10
- package/dist/browser/react/context.js.map +0 -1
- package/dist/browser/react/index.d.ts +0 -11
- package/dist/browser/react/index.d.ts.map +0 -1
- package/dist/browser/react/index.js +0 -22
- package/dist/browser/react/index.js.map +0 -1
- package/dist/browser/react/location-state-shared.d.ts +0 -63
- package/dist/browser/react/location-state-shared.d.ts.map +0 -1
- package/dist/browser/react/location-state-shared.js +0 -81
- package/dist/browser/react/location-state-shared.js.map +0 -1
- package/dist/browser/react/location-state.d.ts +0 -23
- package/dist/browser/react/location-state.d.ts.map +0 -1
- package/dist/browser/react/location-state.js +0 -29
- package/dist/browser/react/location-state.js.map +0 -1
- package/dist/browser/react/mount-context.d.ts +0 -24
- package/dist/browser/react/mount-context.d.ts.map +0 -1
- package/dist/browser/react/mount-context.js +0 -24
- package/dist/browser/react/mount-context.js.map +0 -1
- package/dist/browser/react/use-action.d.ts +0 -64
- package/dist/browser/react/use-action.d.ts.map +0 -1
- package/dist/browser/react/use-action.js +0 -134
- package/dist/browser/react/use-action.js.map +0 -1
- package/dist/browser/react/use-client-cache.d.ts +0 -41
- package/dist/browser/react/use-client-cache.d.ts.map +0 -1
- package/dist/browser/react/use-client-cache.js +0 -39
- package/dist/browser/react/use-client-cache.js.map +0 -1
- package/dist/browser/react/use-handle.d.ts +0 -31
- package/dist/browser/react/use-handle.d.ts.map +0 -1
- package/dist/browser/react/use-handle.js +0 -144
- package/dist/browser/react/use-handle.js.map +0 -1
- package/dist/browser/react/use-href.d.ts +0 -33
- package/dist/browser/react/use-href.d.ts.map +0 -1
- package/dist/browser/react/use-href.js +0 -39
- package/dist/browser/react/use-href.js.map +0 -1
- package/dist/browser/react/use-link-status.d.ts +0 -37
- package/dist/browser/react/use-link-status.d.ts.map +0 -1
- package/dist/browser/react/use-link-status.js +0 -99
- package/dist/browser/react/use-link-status.js.map +0 -1
- package/dist/browser/react/use-mount.d.ts +0 -25
- package/dist/browser/react/use-mount.d.ts.map +0 -1
- package/dist/browser/react/use-mount.js +0 -30
- package/dist/browser/react/use-mount.js.map +0 -1
- package/dist/browser/react/use-navigation.d.ts +0 -27
- package/dist/browser/react/use-navigation.d.ts.map +0 -1
- package/dist/browser/react/use-navigation.js +0 -87
- package/dist/browser/react/use-navigation.js.map +0 -1
- package/dist/browser/react/use-segments.d.ts +0 -38
- package/dist/browser/react/use-segments.d.ts.map +0 -1
- package/dist/browser/react/use-segments.js +0 -130
- package/dist/browser/react/use-segments.js.map +0 -1
- package/dist/browser/request-controller.d.ts +0 -26
- package/dist/browser/request-controller.d.ts.map +0 -1
- package/dist/browser/request-controller.js +0 -147
- package/dist/browser/request-controller.js.map +0 -1
- package/dist/browser/rsc-router.d.ts +0 -129
- package/dist/browser/rsc-router.d.ts.map +0 -1
- package/dist/browser/rsc-router.js +0 -195
- package/dist/browser/rsc-router.js.map +0 -1
- package/dist/browser/scroll-restoration.d.ts +0 -93
- package/dist/browser/scroll-restoration.d.ts.map +0 -1
- package/dist/browser/scroll-restoration.js +0 -321
- package/dist/browser/scroll-restoration.js.map +0 -1
- package/dist/browser/segment-structure-assert.d.ts +0 -17
- package/dist/browser/segment-structure-assert.d.ts.map +0 -1
- package/dist/browser/segment-structure-assert.js +0 -59
- package/dist/browser/segment-structure-assert.js.map +0 -1
- package/dist/browser/server-action-bridge.d.ts +0 -26
- package/dist/browser/server-action-bridge.d.ts.map +0 -1
- package/dist/browser/server-action-bridge.js +0 -668
- package/dist/browser/server-action-bridge.js.map +0 -1
- package/dist/browser/shallow.d.ts +0 -12
- package/dist/browser/shallow.d.ts.map +0 -1
- package/dist/browser/shallow.js +0 -34
- package/dist/browser/shallow.js.map +0 -1
- package/dist/browser/types.d.ts +0 -369
- package/dist/browser/types.d.ts.map +0 -1
- package/dist/browser/types.js +0 -2
- package/dist/browser/types.js.map +0 -1
- package/dist/build/__tests__/generate-cli.test.d.ts +0 -2
- package/dist/build/__tests__/generate-cli.test.d.ts.map +0 -1
- package/dist/build/__tests__/generate-cli.test.js +0 -237
- package/dist/build/__tests__/generate-cli.test.js.map +0 -1
- package/dist/build/__tests__/generate-manifest.test.d.ts +0 -2
- package/dist/build/__tests__/generate-manifest.test.d.ts.map +0 -1
- package/dist/build/__tests__/generate-manifest.test.js +0 -119
- package/dist/build/__tests__/generate-manifest.test.js.map +0 -1
- package/dist/build/__tests__/generate-route-types.test.d.ts +0 -2
- package/dist/build/__tests__/generate-route-types.test.d.ts.map +0 -1
- package/dist/build/__tests__/generate-route-types.test.js +0 -620
- package/dist/build/__tests__/generate-route-types.test.js.map +0 -1
- package/dist/build/__tests__/per-router-manifest.test.d.ts +0 -2
- package/dist/build/__tests__/per-router-manifest.test.d.ts.map +0 -1
- package/dist/build/__tests__/per-router-manifest.test.js +0 -308
- package/dist/build/__tests__/per-router-manifest.test.js.map +0 -1
- package/dist/build/generate-manifest.d.ts +0 -81
- package/dist/build/generate-manifest.d.ts.map +0 -1
- package/dist/build/generate-manifest.js +0 -276
- package/dist/build/generate-manifest.js.map +0 -1
- package/dist/build/generate-route-types.d.ts +0 -115
- package/dist/build/generate-route-types.d.ts.map +0 -1
- package/dist/build/generate-route-types.js +0 -740
- package/dist/build/generate-route-types.js.map +0 -1
- package/dist/build/index.d.ts +0 -21
- package/dist/build/index.d.ts.map +0 -1
- package/dist/build/index.js +0 -21
- package/dist/build/index.js.map +0 -1
- package/dist/build/route-trie.d.ts +0 -71
- package/dist/build/route-trie.d.ts.map +0 -1
- package/dist/build/route-trie.js +0 -175
- package/dist/build/route-trie.js.map +0 -1
- package/dist/cache/__tests__/cache-scope.test.d.ts +0 -2
- package/dist/cache/__tests__/cache-scope.test.d.ts.map +0 -1
- package/dist/cache/__tests__/cache-scope.test.js +0 -208
- package/dist/cache/__tests__/cache-scope.test.js.map +0 -1
- package/dist/cache/__tests__/document-cache.test.d.ts +0 -2
- package/dist/cache/__tests__/document-cache.test.d.ts.map +0 -1
- package/dist/cache/__tests__/document-cache.test.js +0 -345
- package/dist/cache/__tests__/document-cache.test.js.map +0 -1
- package/dist/cache/__tests__/memory-segment-store.test.d.ts +0 -2
- package/dist/cache/__tests__/memory-segment-store.test.d.ts.map +0 -1
- package/dist/cache/__tests__/memory-segment-store.test.js +0 -425
- package/dist/cache/__tests__/memory-segment-store.test.js.map +0 -1
- package/dist/cache/__tests__/memory-store.test.d.ts +0 -2
- package/dist/cache/__tests__/memory-store.test.d.ts.map +0 -1
- package/dist/cache/__tests__/memory-store.test.js +0 -367
- package/dist/cache/__tests__/memory-store.test.js.map +0 -1
- package/dist/cache/cache-scope.d.ts +0 -102
- package/dist/cache/cache-scope.d.ts.map +0 -1
- package/dist/cache/cache-scope.js +0 -440
- package/dist/cache/cache-scope.js.map +0 -1
- package/dist/cache/cf/__tests__/cf-cache-store.test.d.ts +0 -2
- package/dist/cache/cf/__tests__/cf-cache-store.test.d.ts.map +0 -1
- package/dist/cache/cf/__tests__/cf-cache-store.test.js +0 -330
- package/dist/cache/cf/__tests__/cf-cache-store.test.js.map +0 -1
- package/dist/cache/cf/cf-cache-store.d.ts +0 -165
- package/dist/cache/cf/cf-cache-store.d.ts.map +0 -1
- package/dist/cache/cf/cf-cache-store.js +0 -242
- package/dist/cache/cf/cf-cache-store.js.map +0 -1
- package/dist/cache/cf/index.d.ts +0 -14
- package/dist/cache/cf/index.d.ts.map +0 -1
- package/dist/cache/cf/index.js +0 -17
- package/dist/cache/cf/index.js.map +0 -1
- package/dist/cache/document-cache.d.ts +0 -64
- package/dist/cache/document-cache.d.ts.map +0 -1
- package/dist/cache/document-cache.js +0 -228
- package/dist/cache/document-cache.js.map +0 -1
- package/dist/cache/index.d.ts +0 -19
- package/dist/cache/index.d.ts.map +0 -1
- package/dist/cache/index.js +0 -21
- package/dist/cache/index.js.map +0 -1
- package/dist/cache/memory-segment-store.d.ts +0 -110
- package/dist/cache/memory-segment-store.d.ts.map +0 -1
- package/dist/cache/memory-segment-store.js +0 -117
- package/dist/cache/memory-segment-store.js.map +0 -1
- package/dist/cache/memory-store.d.ts +0 -41
- package/dist/cache/memory-store.d.ts.map +0 -1
- package/dist/cache/memory-store.js +0 -191
- package/dist/cache/memory-store.js.map +0 -1
- package/dist/cache/types.d.ts +0 -317
- package/dist/cache/types.d.ts.map +0 -1
- package/dist/cache/types.js +0 -12
- package/dist/cache/types.js.map +0 -1
- package/dist/client.d.ts +0 -248
- package/dist/client.d.ts.map +0 -1
- package/dist/client.js +0 -367
- package/dist/client.js.map +0 -1
- package/dist/client.rsc.d.ts +0 -26
- package/dist/client.rsc.d.ts.map +0 -1
- package/dist/client.rsc.js +0 -46
- package/dist/client.rsc.js.map +0 -1
- package/dist/component-utils.d.ts +0 -36
- package/dist/component-utils.d.ts.map +0 -1
- package/dist/component-utils.js +0 -61
- package/dist/component-utils.js.map +0 -1
- package/dist/components/DefaultDocument.d.ts +0 -13
- package/dist/components/DefaultDocument.d.ts.map +0 -1
- package/dist/components/DefaultDocument.js +0 -15
- package/dist/components/DefaultDocument.js.map +0 -1
- package/dist/debug.d.ts +0 -58
- package/dist/debug.d.ts.map +0 -1
- package/dist/debug.js +0 -157
- package/dist/debug.js.map +0 -1
- package/dist/default-error-boundary.d.ts +0 -11
- package/dist/default-error-boundary.d.ts.map +0 -1
- package/dist/default-error-boundary.js +0 -45
- package/dist/default-error-boundary.js.map +0 -1
- package/dist/deps/browser.d.ts +0 -2
- package/dist/deps/browser.d.ts.map +0 -1
- package/dist/deps/browser.js +0 -3
- package/dist/deps/browser.js.map +0 -1
- package/dist/deps/html-stream-client.d.ts +0 -2
- package/dist/deps/html-stream-client.d.ts.map +0 -1
- package/dist/deps/html-stream-client.js +0 -3
- package/dist/deps/html-stream-client.js.map +0 -1
- package/dist/deps/html-stream-server.d.ts +0 -2
- package/dist/deps/html-stream-server.d.ts.map +0 -1
- package/dist/deps/html-stream-server.js +0 -3
- package/dist/deps/html-stream-server.js.map +0 -1
- package/dist/deps/rsc.d.ts +0 -2
- package/dist/deps/rsc.d.ts.map +0 -1
- package/dist/deps/rsc.js +0 -4
- package/dist/deps/rsc.js.map +0 -1
- package/dist/deps/ssr.d.ts +0 -2
- package/dist/deps/ssr.d.ts.map +0 -1
- package/dist/deps/ssr.js +0 -3
- package/dist/deps/ssr.js.map +0 -1
- package/dist/errors.d.ts +0 -174
- package/dist/errors.d.ts.map +0 -1
- package/dist/errors.js +0 -241
- package/dist/errors.js.map +0 -1
- package/dist/handle.d.ts +0 -78
- package/dist/handle.d.ts.map +0 -1
- package/dist/handle.js +0 -82
- package/dist/handle.js.map +0 -1
- package/dist/handles/MetaTags.d.ts +0 -14
- package/dist/handles/MetaTags.d.ts.map +0 -1
- package/dist/handles/MetaTags.js +0 -136
- package/dist/handles/MetaTags.js.map +0 -1
- package/dist/handles/index.d.ts +0 -6
- package/dist/handles/index.d.ts.map +0 -1
- package/dist/handles/index.js +0 -6
- package/dist/handles/index.js.map +0 -1
- package/dist/handles/meta.d.ts +0 -39
- package/dist/handles/meta.d.ts.map +0 -1
- package/dist/handles/meta.js +0 -202
- package/dist/handles/meta.js.map +0 -1
- package/dist/host/__tests__/errors.test.d.ts +0 -2
- package/dist/host/__tests__/errors.test.d.ts.map +0 -1
- package/dist/host/__tests__/errors.test.js +0 -76
- package/dist/host/__tests__/errors.test.js.map +0 -1
- package/dist/host/__tests__/pattern-comprehensive.test.d.ts +0 -2
- package/dist/host/__tests__/pattern-comprehensive.test.d.ts.map +0 -1
- package/dist/host/__tests__/pattern-comprehensive.test.js +0 -732
- package/dist/host/__tests__/pattern-comprehensive.test.js.map +0 -1
- package/dist/host/__tests__/pattern-matcher.test.d.ts +0 -2
- package/dist/host/__tests__/pattern-matcher.test.d.ts.map +0 -1
- package/dist/host/__tests__/pattern-matcher.test.js +0 -251
- package/dist/host/__tests__/pattern-matcher.test.js.map +0 -1
- package/dist/host/__tests__/router.test.d.ts +0 -2
- package/dist/host/__tests__/router.test.d.ts.map +0 -1
- package/dist/host/__tests__/router.test.js +0 -241
- package/dist/host/__tests__/router.test.js.map +0 -1
- package/dist/host/__tests__/testing.test.d.ts +0 -2
- package/dist/host/__tests__/testing.test.d.ts.map +0 -1
- package/dist/host/__tests__/testing.test.js +0 -64
- package/dist/host/__tests__/testing.test.js.map +0 -1
- package/dist/host/__tests__/utils.test.d.ts +0 -2
- package/dist/host/__tests__/utils.test.d.ts.map +0 -1
- package/dist/host/__tests__/utils.test.js +0 -29
- package/dist/host/__tests__/utils.test.js.map +0 -1
- package/dist/host/cookie-handler.d.ts +0 -34
- package/dist/host/cookie-handler.d.ts.map +0 -1
- package/dist/host/cookie-handler.js +0 -124
- package/dist/host/cookie-handler.js.map +0 -1
- package/dist/host/errors.d.ts +0 -56
- package/dist/host/errors.d.ts.map +0 -1
- package/dist/host/errors.js +0 -79
- package/dist/host/errors.js.map +0 -1
- package/dist/host/index.d.ts +0 -29
- package/dist/host/index.d.ts.map +0 -1
- package/dist/host/index.js +0 -32
- package/dist/host/index.js.map +0 -1
- package/dist/host/pattern-matcher.d.ts +0 -36
- package/dist/host/pattern-matcher.d.ts.map +0 -1
- package/dist/host/pattern-matcher.js +0 -172
- package/dist/host/pattern-matcher.js.map +0 -1
- package/dist/host/router.d.ts +0 -26
- package/dist/host/router.d.ts.map +0 -1
- package/dist/host/router.js +0 -218
- package/dist/host/router.js.map +0 -1
- package/dist/host/testing.d.ts +0 -36
- package/dist/host/testing.d.ts.map +0 -1
- package/dist/host/testing.js +0 -55
- package/dist/host/testing.js.map +0 -1
- package/dist/host/types.d.ts +0 -115
- package/dist/host/types.d.ts.map +0 -1
- package/dist/host/types.js +0 -7
- package/dist/host/types.js.map +0 -1
- package/dist/host/utils.d.ts +0 -21
- package/dist/host/utils.d.ts.map +0 -1
- package/dist/host/utils.js +0 -23
- package/dist/host/utils.js.map +0 -1
- package/dist/href-client.d.ts +0 -131
- package/dist/href-client.d.ts.map +0 -1
- package/dist/href-client.js +0 -64
- package/dist/href-client.js.map +0 -1
- package/dist/href-context.d.ts +0 -29
- package/dist/href-context.d.ts.map +0 -1
- package/dist/href-context.js +0 -21
- package/dist/href-context.js.map +0 -1
- package/dist/index.d.ts +0 -73
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -91
- package/dist/index.js.map +0 -1
- package/dist/index.rsc.d.ts +0 -32
- package/dist/index.rsc.d.ts.map +0 -1
- package/dist/index.rsc.js +0 -40
- package/dist/index.rsc.js.map +0 -1
- package/dist/internal-debug.d.ts +0 -2
- package/dist/internal-debug.d.ts.map +0 -1
- package/dist/internal-debug.js +0 -5
- package/dist/internal-debug.js.map +0 -1
- package/dist/loader.d.ts +0 -14
- package/dist/loader.d.ts.map +0 -1
- package/dist/loader.js +0 -20
- package/dist/loader.js.map +0 -1
- package/dist/loader.rsc.d.ts +0 -19
- package/dist/loader.rsc.d.ts.map +0 -1
- package/dist/loader.rsc.js +0 -99
- package/dist/loader.rsc.js.map +0 -1
- package/dist/network-error-thrower.d.ts +0 -17
- package/dist/network-error-thrower.d.ts.map +0 -1
- package/dist/network-error-thrower.js +0 -14
- package/dist/network-error-thrower.js.map +0 -1
- package/dist/outlet-context.d.ts +0 -13
- package/dist/outlet-context.d.ts.map +0 -1
- package/dist/outlet-context.js +0 -3
- package/dist/outlet-context.js.map +0 -1
- package/dist/prerender/__tests__/param-hash.test.d.ts +0 -2
- package/dist/prerender/__tests__/param-hash.test.d.ts.map +0 -1
- package/dist/prerender/__tests__/param-hash.test.js +0 -148
- package/dist/prerender/__tests__/param-hash.test.js.map +0 -1
- package/dist/prerender/param-hash.d.ts +0 -16
- package/dist/prerender/param-hash.d.ts.map +0 -1
- package/dist/prerender/param-hash.js +0 -36
- package/dist/prerender/param-hash.js.map +0 -1
- package/dist/prerender/store.d.ts +0 -38
- package/dist/prerender/store.d.ts.map +0 -1
- package/dist/prerender/store.js +0 -61
- package/dist/prerender/store.js.map +0 -1
- package/dist/prerender.d.ts +0 -66
- package/dist/prerender.d.ts.map +0 -1
- package/dist/prerender.js +0 -57
- package/dist/prerender.js.map +0 -1
- package/dist/reverse.d.ts +0 -196
- package/dist/reverse.d.ts.map +0 -1
- package/dist/reverse.js +0 -78
- package/dist/reverse.js.map +0 -1
- package/dist/root-error-boundary.d.ts +0 -33
- package/dist/root-error-boundary.d.ts.map +0 -1
- package/dist/root-error-boundary.js +0 -165
- package/dist/root-error-boundary.js.map +0 -1
- package/dist/route-content-wrapper.d.ts +0 -46
- package/dist/route-content-wrapper.d.ts.map +0 -1
- package/dist/route-content-wrapper.js +0 -77
- package/dist/route-content-wrapper.js.map +0 -1
- package/dist/route-definition.d.ts +0 -421
- package/dist/route-definition.d.ts.map +0 -1
- package/dist/route-definition.js +0 -868
- package/dist/route-definition.js.map +0 -1
- package/dist/route-map-builder.d.ts +0 -155
- package/dist/route-map-builder.d.ts.map +0 -1
- package/dist/route-map-builder.js +0 -237
- package/dist/route-map-builder.js.map +0 -1
- package/dist/route-types.d.ts +0 -165
- package/dist/route-types.d.ts.map +0 -1
- package/dist/route-types.js +0 -7
- package/dist/route-types.js.map +0 -1
- package/dist/router/__tests__/handler-context.test.d.ts +0 -2
- package/dist/router/__tests__/handler-context.test.d.ts.map +0 -1
- package/dist/router/__tests__/handler-context.test.js +0 -65
- package/dist/router/__tests__/handler-context.test.js.map +0 -1
- package/dist/router/__tests__/loader-cycle-detection.test.d.ts +0 -2
- package/dist/router/__tests__/loader-cycle-detection.test.d.ts.map +0 -1
- package/dist/router/__tests__/loader-cycle-detection.test.js +0 -221
- package/dist/router/__tests__/loader-cycle-detection.test.js.map +0 -1
- package/dist/router/__tests__/match-context.test.d.ts +0 -2
- package/dist/router/__tests__/match-context.test.d.ts.map +0 -1
- package/dist/router/__tests__/match-context.test.js +0 -92
- package/dist/router/__tests__/match-context.test.js.map +0 -1
- package/dist/router/__tests__/match-pipelines.test.d.ts +0 -2
- package/dist/router/__tests__/match-pipelines.test.d.ts.map +0 -1
- package/dist/router/__tests__/match-pipelines.test.js +0 -417
- package/dist/router/__tests__/match-pipelines.test.js.map +0 -1
- package/dist/router/__tests__/match-result.test.d.ts +0 -2
- package/dist/router/__tests__/match-result.test.d.ts.map +0 -1
- package/dist/router/__tests__/match-result.test.js +0 -457
- package/dist/router/__tests__/match-result.test.js.map +0 -1
- package/dist/router/__tests__/on-error.test.d.ts +0 -2
- package/dist/router/__tests__/on-error.test.d.ts.map +0 -1
- package/dist/router/__tests__/on-error.test.js +0 -678
- package/dist/router/__tests__/on-error.test.js.map +0 -1
- package/dist/router/__tests__/pattern-matching.test.d.ts +0 -2
- package/dist/router/__tests__/pattern-matching.test.d.ts.map +0 -1
- package/dist/router/__tests__/pattern-matching.test.js +0 -629
- package/dist/router/__tests__/pattern-matching.test.js.map +0 -1
- package/dist/router/__tests__/segment-resolution-parallel-loading.test.d.ts +0 -2
- package/dist/router/__tests__/segment-resolution-parallel-loading.test.d.ts.map +0 -1
- package/dist/router/__tests__/segment-resolution-parallel-loading.test.js +0 -155
- package/dist/router/__tests__/segment-resolution-parallel-loading.test.js.map +0 -1
- package/dist/router/error-handling.d.ts +0 -77
- package/dist/router/error-handling.d.ts.map +0 -1
- package/dist/router/error-handling.js +0 -202
- package/dist/router/error-handling.js.map +0 -1
- package/dist/router/handler-context.d.ts +0 -20
- package/dist/router/handler-context.d.ts.map +0 -1
- package/dist/router/handler-context.js +0 -198
- package/dist/router/handler-context.js.map +0 -1
- package/dist/router/intercept-resolution.d.ts +0 -66
- package/dist/router/intercept-resolution.d.ts.map +0 -1
- package/dist/router/intercept-resolution.js +0 -246
- package/dist/router/intercept-resolution.js.map +0 -1
- package/dist/router/loader-resolution.d.ts +0 -64
- package/dist/router/loader-resolution.d.ts.map +0 -1
- package/dist/router/loader-resolution.js +0 -284
- package/dist/router/loader-resolution.js.map +0 -1
- package/dist/router/logging.d.ts +0 -15
- package/dist/router/logging.d.ts.map +0 -1
- package/dist/router/logging.js +0 -99
- package/dist/router/logging.js.map +0 -1
- package/dist/router/manifest.d.ts +0 -22
- package/dist/router/manifest.d.ts.map +0 -1
- package/dist/router/manifest.js +0 -181
- package/dist/router/manifest.js.map +0 -1
- package/dist/router/match-api.d.ts +0 -35
- package/dist/router/match-api.d.ts.map +0 -1
- package/dist/router/match-api.js +0 -406
- package/dist/router/match-api.js.map +0 -1
- package/dist/router/match-context.d.ts +0 -206
- package/dist/router/match-context.d.ts.map +0 -1
- package/dist/router/match-context.js +0 -17
- package/dist/router/match-context.js.map +0 -1
- package/dist/router/match-middleware/background-revalidation.d.ts +0 -127
- package/dist/router/match-middleware/background-revalidation.d.ts.map +0 -1
- package/dist/router/match-middleware/background-revalidation.js +0 -75
- package/dist/router/match-middleware/background-revalidation.js.map +0 -1
- package/dist/router/match-middleware/cache-lookup.d.ts +0 -112
- package/dist/router/match-middleware/cache-lookup.d.ts.map +0 -1
- package/dist/router/match-middleware/cache-lookup.js +0 -257
- package/dist/router/match-middleware/cache-lookup.js.map +0 -1
- package/dist/router/match-middleware/cache-store.d.ts +0 -113
- package/dist/router/match-middleware/cache-store.d.ts.map +0 -1
- package/dist/router/match-middleware/cache-store.js +0 -108
- package/dist/router/match-middleware/cache-store.js.map +0 -1
- package/dist/router/match-middleware/index.d.ts +0 -81
- package/dist/router/match-middleware/index.d.ts.map +0 -1
- package/dist/router/match-middleware/index.js +0 -80
- package/dist/router/match-middleware/index.js.map +0 -1
- package/dist/router/match-middleware/intercept-resolution.d.ts +0 -117
- package/dist/router/match-middleware/intercept-resolution.d.ts.map +0 -1
- package/dist/router/match-middleware/intercept-resolution.js +0 -134
- package/dist/router/match-middleware/intercept-resolution.js.map +0 -1
- package/dist/router/match-middleware/segment-resolution.d.ts +0 -99
- package/dist/router/match-middleware/segment-resolution.d.ts.map +0 -1
- package/dist/router/match-middleware/segment-resolution.js +0 -53
- package/dist/router/match-middleware/segment-resolution.js.map +0 -1
- package/dist/router/match-pipelines.d.ts +0 -147
- package/dist/router/match-pipelines.d.ts.map +0 -1
- package/dist/router/match-pipelines.js +0 -82
- package/dist/router/match-pipelines.js.map +0 -1
- package/dist/router/match-result.d.ts +0 -126
- package/dist/router/match-result.d.ts.map +0 -1
- package/dist/router/match-result.js +0 -93
- package/dist/router/match-result.js.map +0 -1
- package/dist/router/metrics.d.ts +0 -20
- package/dist/router/metrics.d.ts.map +0 -1
- package/dist/router/metrics.js +0 -47
- package/dist/router/metrics.js.map +0 -1
- package/dist/router/middleware.d.ts +0 -249
- package/dist/router/middleware.d.ts.map +0 -1
- package/dist/router/middleware.js +0 -434
- package/dist/router/middleware.js.map +0 -1
- package/dist/router/middleware.test.d.ts +0 -2
- package/dist/router/middleware.test.d.ts.map +0 -1
- package/dist/router/middleware.test.js +0 -816
- package/dist/router/middleware.test.js.map +0 -1
- package/dist/router/pattern-matching.d.ts +0 -149
- package/dist/router/pattern-matching.d.ts.map +0 -1
- package/dist/router/pattern-matching.js +0 -349
- package/dist/router/pattern-matching.js.map +0 -1
- package/dist/router/revalidation.d.ts +0 -44
- package/dist/router/revalidation.d.ts.map +0 -1
- package/dist/router/revalidation.js +0 -147
- package/dist/router/revalidation.js.map +0 -1
- package/dist/router/router-context.d.ts +0 -135
- package/dist/router/router-context.d.ts.map +0 -1
- package/dist/router/router-context.js +0 -36
- package/dist/router/router-context.js.map +0 -1
- package/dist/router/segment-resolution.d.ts +0 -127
- package/dist/router/segment-resolution.d.ts.map +0 -1
- package/dist/router/segment-resolution.js +0 -919
- package/dist/router/segment-resolution.js.map +0 -1
- package/dist/router/trie-matching.d.ts +0 -40
- package/dist/router/trie-matching.d.ts.map +0 -1
- package/dist/router/trie-matching.js +0 -127
- package/dist/router/trie-matching.js.map +0 -1
- package/dist/router/types.d.ts +0 -136
- package/dist/router/types.d.ts.map +0 -1
- package/dist/router/types.js +0 -7
- package/dist/router/types.js.map +0 -1
- package/dist/router.d.ts +0 -753
- package/dist/router.d.ts.map +0 -1
- package/dist/router.gen.d.ts +0 -6
- package/dist/router.gen.d.ts.map +0 -1
- package/dist/router.gen.js +0 -6
- package/dist/router.gen.js.map +0 -1
- package/dist/router.js +0 -1304
- package/dist/router.js.map +0 -1
- package/dist/rsc/__tests__/helpers.test.d.ts +0 -2
- package/dist/rsc/__tests__/helpers.test.d.ts.map +0 -1
- package/dist/rsc/__tests__/helpers.test.js +0 -140
- package/dist/rsc/__tests__/helpers.test.js.map +0 -1
- package/dist/rsc/handler.d.ts +0 -45
- package/dist/rsc/handler.d.ts.map +0 -1
- package/dist/rsc/handler.js +0 -1172
- package/dist/rsc/handler.js.map +0 -1
- package/dist/rsc/helpers.d.ts +0 -16
- package/dist/rsc/helpers.d.ts.map +0 -1
- package/dist/rsc/helpers.js +0 -55
- package/dist/rsc/helpers.js.map +0 -1
- package/dist/rsc/index.d.ts +0 -22
- package/dist/rsc/index.d.ts.map +0 -1
- package/dist/rsc/index.js +0 -23
- package/dist/rsc/index.js.map +0 -1
- package/dist/rsc/nonce.d.ts +0 -9
- package/dist/rsc/nonce.d.ts.map +0 -1
- package/dist/rsc/nonce.js +0 -18
- package/dist/rsc/nonce.js.map +0 -1
- package/dist/rsc/types.d.ts +0 -206
- package/dist/rsc/types.d.ts.map +0 -1
- package/dist/rsc/types.js +0 -8
- package/dist/rsc/types.js.map +0 -1
- package/dist/search-params.d.ts +0 -103
- package/dist/search-params.d.ts.map +0 -1
- package/dist/search-params.js +0 -74
- package/dist/search-params.js.map +0 -1
- package/dist/segment-system.d.ts +0 -75
- package/dist/segment-system.d.ts.map +0 -1
- package/dist/segment-system.js +0 -336
- package/dist/segment-system.js.map +0 -1
- package/dist/server/context.d.ts +0 -245
- package/dist/server/context.d.ts.map +0 -1
- package/dist/server/context.js +0 -197
- package/dist/server/context.js.map +0 -1
- package/dist/server/fetchable-loader-store.d.ts +0 -18
- package/dist/server/fetchable-loader-store.d.ts.map +0 -1
- package/dist/server/fetchable-loader-store.js +0 -18
- package/dist/server/fetchable-loader-store.js.map +0 -1
- package/dist/server/handle-store.d.ts +0 -85
- package/dist/server/handle-store.d.ts.map +0 -1
- package/dist/server/handle-store.js +0 -142
- package/dist/server/handle-store.js.map +0 -1
- package/dist/server/loader-registry.d.ts +0 -55
- package/dist/server/loader-registry.d.ts.map +0 -1
- package/dist/server/loader-registry.js +0 -132
- package/dist/server/loader-registry.js.map +0 -1
- package/dist/server/request-context.d.ts +0 -226
- package/dist/server/request-context.d.ts.map +0 -1
- package/dist/server/request-context.js +0 -290
- package/dist/server/request-context.js.map +0 -1
- package/dist/server/root-layout.d.ts +0 -4
- package/dist/server/root-layout.d.ts.map +0 -1
- package/dist/server/root-layout.js +0 -5
- package/dist/server/root-layout.js.map +0 -1
- package/dist/server.d.ts +0 -15
- package/dist/server.d.ts.map +0 -1
- package/dist/server.js +0 -20
- package/dist/server.js.map +0 -1
- package/dist/ssr/__tests__/ssr-handler.test.d.ts +0 -2
- package/dist/ssr/__tests__/ssr-handler.test.d.ts.map +0 -1
- package/dist/ssr/__tests__/ssr-handler.test.js +0 -132
- package/dist/ssr/__tests__/ssr-handler.test.js.map +0 -1
- package/dist/ssr/index.d.ts +0 -98
- package/dist/ssr/index.d.ts.map +0 -1
- package/dist/ssr/index.js +0 -158
- package/dist/ssr/index.js.map +0 -1
- package/dist/static-handler.d.ts +0 -50
- package/dist/static-handler.d.ts.map +0 -1
- package/dist/static-handler.gen.d.ts +0 -5
- package/dist/static-handler.gen.d.ts.map +0 -1
- package/dist/static-handler.gen.js +0 -5
- package/dist/static-handler.gen.js.map +0 -1
- package/dist/static-handler.js +0 -29
- package/dist/static-handler.js.map +0 -1
- package/dist/theme/ThemeProvider.d.ts +0 -20
- package/dist/theme/ThemeProvider.d.ts.map +0 -1
- package/dist/theme/ThemeProvider.js +0 -240
- package/dist/theme/ThemeProvider.js.map +0 -1
- package/dist/theme/ThemeScript.d.ts +0 -48
- package/dist/theme/ThemeScript.d.ts.map +0 -1
- package/dist/theme/ThemeScript.js +0 -13
- package/dist/theme/ThemeScript.js.map +0 -1
- package/dist/theme/__tests__/theme.test.d.ts +0 -2
- package/dist/theme/__tests__/theme.test.d.ts.map +0 -1
- package/dist/theme/__tests__/theme.test.js +0 -103
- package/dist/theme/__tests__/theme.test.js.map +0 -1
- package/dist/theme/constants.d.ts +0 -29
- package/dist/theme/constants.d.ts.map +0 -1
- package/dist/theme/constants.js +0 -48
- package/dist/theme/constants.js.map +0 -1
- package/dist/theme/index.d.ts +0 -31
- package/dist/theme/index.d.ts.map +0 -1
- package/dist/theme/index.js +0 -36
- package/dist/theme/index.js.map +0 -1
- package/dist/theme/theme-context.d.ts +0 -40
- package/dist/theme/theme-context.d.ts.map +0 -1
- package/dist/theme/theme-context.js +0 -60
- package/dist/theme/theme-context.js.map +0 -1
- package/dist/theme/theme-script.d.ts +0 -27
- package/dist/theme/theme-script.d.ts.map +0 -1
- package/dist/theme/theme-script.js +0 -147
- package/dist/theme/theme-script.js.map +0 -1
- package/dist/theme/types.d.ts +0 -163
- package/dist/theme/types.d.ts.map +0 -1
- package/dist/theme/types.js +0 -11
- package/dist/theme/types.js.map +0 -1
- package/dist/theme/use-theme.d.ts +0 -12
- package/dist/theme/use-theme.d.ts.map +0 -1
- package/dist/theme/use-theme.js +0 -40
- package/dist/theme/use-theme.js.map +0 -1
- package/dist/types.d.ts +0 -1479
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -10
- package/dist/types.js.map +0 -1
- package/dist/urls.d.ts +0 -441
- package/dist/urls.d.ts.map +0 -1
- package/dist/urls.gen.d.ts +0 -8
- package/dist/urls.gen.d.ts.map +0 -1
- package/dist/urls.gen.js +0 -8
- package/dist/urls.gen.js.map +0 -1
- package/dist/urls.js +0 -443
- package/dist/urls.js.map +0 -1
- package/dist/use-loader.d.ts +0 -127
- package/dist/use-loader.d.ts.map +0 -1
- package/dist/use-loader.js +0 -237
- package/dist/use-loader.js.map +0 -1
- package/dist/vite/__tests__/ast-handler-extract.test.d.ts +0 -2
- package/dist/vite/__tests__/ast-handler-extract.test.d.ts.map +0 -1
- package/dist/vite/__tests__/ast-handler-extract.test.js +0 -294
- package/dist/vite/__tests__/ast-handler-extract.test.js.map +0 -1
- package/dist/vite/__tests__/expose-id-utils.test.d.ts +0 -2
- package/dist/vite/__tests__/expose-id-utils.test.d.ts.map +0 -1
- package/dist/vite/__tests__/expose-id-utils.test.js +0 -224
- package/dist/vite/__tests__/expose-id-utils.test.js.map +0 -1
- package/dist/vite/__tests__/expose-internal-ids.test.d.ts +0 -2
- package/dist/vite/__tests__/expose-internal-ids.test.d.ts.map +0 -1
- package/dist/vite/__tests__/expose-internal-ids.test.js +0 -647
- package/dist/vite/__tests__/expose-internal-ids.test.js.map +0 -1
- package/dist/vite/__tests__/expose-router-id.test.d.ts +0 -2
- package/dist/vite/__tests__/expose-router-id.test.d.ts.map +0 -1
- package/dist/vite/__tests__/expose-router-id.test.js +0 -39
- package/dist/vite/__tests__/expose-router-id.test.js.map +0 -1
- package/dist/vite/ast-handler-extract.d.ts +0 -49
- package/dist/vite/ast-handler-extract.d.ts.map +0 -1
- package/dist/vite/ast-handler-extract.js +0 -249
- package/dist/vite/ast-handler-extract.js.map +0 -1
- package/dist/vite/expose-action-id.d.ts +0 -19
- package/dist/vite/expose-action-id.d.ts.map +0 -1
- package/dist/vite/expose-action-id.js +0 -250
- package/dist/vite/expose-action-id.js.map +0 -1
- package/dist/vite/expose-id-utils.d.ts +0 -69
- package/dist/vite/expose-id-utils.d.ts.map +0 -1
- package/dist/vite/expose-id-utils.js +0 -289
- package/dist/vite/expose-id-utils.js.map +0 -1
- package/dist/vite/expose-internal-ids.d.ts +0 -22
- package/dist/vite/expose-internal-ids.d.ts.map +0 -1
- package/dist/vite/expose-internal-ids.js +0 -886
- package/dist/vite/expose-internal-ids.js.map +0 -1
- package/dist/vite/index.d.ts +0 -149
- package/dist/vite/index.d.ts.map +0 -1
- package/dist/vite/index.js.bak +0 -5448
- package/dist/vite/index.js.map +0 -1
- package/dist/vite/index.named-routes.gen.ts +0 -103
- package/dist/vite/package-resolution.d.ts +0 -43
- package/dist/vite/package-resolution.d.ts.map +0 -1
- package/dist/vite/package-resolution.js +0 -112
- package/dist/vite/package-resolution.js.map +0 -1
- package/dist/vite/virtual-entries.d.ts +0 -25
- package/dist/vite/virtual-entries.d.ts.map +0 -1
- package/dist/vite/virtual-entries.js +0 -110
- package/dist/vite/virtual-entries.js.map +0 -1
|
@@ -91,7 +91,7 @@ export default clientUrls(({ path, layout, loader, revalidate }) => [
|
|
|
91
91
|
nextParams,
|
|
92
92
|
defaultShouldRevalidate,
|
|
93
93
|
}) => {
|
|
94
|
-
if (isAction) return false;
|
|
94
|
+
if (isAction()) return false;
|
|
95
95
|
return currentParams.slug !== nextParams.slug
|
|
96
96
|
? defaultShouldRevalidate
|
|
97
97
|
: false;
|
|
@@ -184,14 +184,36 @@ only its _decision_ crosses the wire with the navigation request. Requests that
|
|
|
184
184
|
carry no decisions (no-JS, progressive enhancement, prefetch, document loads)
|
|
185
185
|
follow the locked server defaults.
|
|
186
186
|
|
|
187
|
+
`isAction` is the same callable matcher as the server predicate, not a
|
|
188
|
+
boolean. Action identity is `actionId`, whose FORM differs per environment:
|
|
189
|
+
file-path `$id` (`path#export`) in the RSC env, hashed `$$id` in the
|
|
190
|
+
browser — which is why the matcher (resolving an imported reference's
|
|
191
|
+
`$id ?? $$id`) is the supported surface and a file-path substring on
|
|
192
|
+
`actionId` is not:
|
|
193
|
+
|
|
194
|
+
```ts
|
|
195
|
+
import { addToCart, removeFromCart } from "./actions/cart";
|
|
196
|
+
import * as CartActions from "./actions/cart";
|
|
197
|
+
|
|
198
|
+
revalidate(({ isAction }) => isAction()); // any action
|
|
199
|
+
revalidate(({ isAction }) => isAction(addToCart)); // one action
|
|
200
|
+
revalidate(({ isAction }) => isAction(addToCart, removeFromCart)); // several
|
|
201
|
+
revalidate(({ isAction }) => isAction(CartActions)); // import * as
|
|
202
|
+
revalidate(({ isAction }) => isAction({ addToCart, removeFromCart })); // object
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
Bare `isAction()` is "is this an action at all?". `actionId` stays as the
|
|
206
|
+
string escape hatch. Return `isAction(refs) || undefined` to defer to the
|
|
207
|
+
locked default on a non-match (same idiom as the server).
|
|
208
|
+
|
|
187
209
|
Two scars worth copying:
|
|
188
210
|
|
|
189
211
|
- A blunt `() => false` keeps serving the OLD product on product→product
|
|
190
212
|
navigations (same route, new param). Make predicates param-sensitive:
|
|
191
213
|
return `defaultShouldRevalidate` when the identifying param changed.
|
|
192
|
-
- One action, per-loader outcomes: a cart badge loader revalidates on
|
|
193
|
-
(`isAction
|
|
194
|
-
|
|
214
|
+
- One action, per-loader outcomes: a cart badge loader revalidates on cart
|
|
215
|
+
actions (`isAction(CartActions)`) while product/related loaders hold —
|
|
216
|
+
three freshness outcomes in a single commit, decided per loader.
|
|
195
217
|
|
|
196
218
|
## Loaders are full citizens: signals and handles
|
|
197
219
|
|
package/skills/loader/SKILL.md
CHANGED
|
@@ -359,6 +359,7 @@ loader(CartLoader, () => [
|
|
|
359
359
|
]);
|
|
360
360
|
revalidate((ctx) => ctx.isAction(addToCart, removeFromCart) || undefined); // several
|
|
361
361
|
revalidate((ctx) => ctx.isAction(CartActions) || undefined); // any action in the module
|
|
362
|
+
revalidate((ctx) => ctx.isAction({ addToCart, removeFromCart }) || undefined); // object form
|
|
362
363
|
```
|
|
363
364
|
|
|
364
365
|
`isAction()` is a method on the revalidate predicate's **context argument** —
|
package/skills/testing/SKILL.md
CHANGED
|
@@ -32,7 +32,7 @@ index.rsc.ts` alias are all in [`./setup.md`](./setup.md). Read it before writin
|
|
|
32
32
|
> [`./bindings.md`](./bindings.md).
|
|
33
33
|
|
|
34
34
|
For the long-form prose guide (setup walkthrough + migration), see
|
|
35
|
-
[`docs/testing.md`](https://github.com/
|
|
35
|
+
[`docs/testing.md`](https://github.com/rangojs/rango/blob/main/packages/rangojs-router/docs/testing.md)
|
|
36
36
|
(the `docs/` directory is not shipped in the published package, so this is an
|
|
37
37
|
absolute link).
|
|
38
38
|
|
|
@@ -89,6 +89,7 @@ Each primitive links to its sub-file (API + recipe + caveats).
|
|
|
89
89
|
| one middleware's ordering / short-circuit / cookie+header merge | unit (node) | [`runMiddleware`](./middleware.md) | `@rangojs/router/testing` |
|
|
90
90
|
| a `"use server"` action's cookie / header / flash output (even on `throw redirect()`) | unit (node) | [`runInRequestContext`](./server-actions.md) | `@rangojs/router/testing` |
|
|
91
91
|
| a `transition({ when })` gate (keep/drop) against nav source / target / action metadata | unit (node) | `runTransitionWhen` (`{ kept, whenContext }`; pass `{ ppr: true }` for pre-handler timing) | `@rangojs/router/testing` |
|
|
92
|
+
| a `clientUrls()` `revalidate()` / `isAction(ref)` predicate | unit (node) | `runClientRevalidate` (production `makeIsAction` + locked defaults) | `@rangojs/router/testing` |
|
|
92
93
|
| a handle's `collect`/accumulator, a seeded handle read, or a loader handle write | unit | [`collectHandle` / seeded `handles` / `handlePushes`](./handles.md) | `@rangojs/router/testing` |
|
|
93
94
|
| a CLIENT component reading router context (`useParams`/`useReverse`/`Outlet`/`useNavigation`/`useLoader`) | unit (DOM) | [`renderRoute`](./client-components.md) | `@rangojs/router/testing/dom` |
|
|
94
95
|
| a redirect / status / headers / cookies / **response route** (json/text/html/xml/md), no Flight | integration | [`dispatch`](./response-routes.md) | `@rangojs/router/testing` |
|
|
@@ -100,4 +100,4 @@ describe("bindings seam", () => {
|
|
|
100
100
|
|
|
101
101
|
- (cross-cutting)
|
|
102
102
|
- Siblings: `./loader.md`, `./middleware.md`, `./server-actions.md`
|
|
103
|
-
- Long-form prose: [docs/testing.md](https://github.com/
|
|
103
|
+
- Long-form prose: [docs/testing.md](https://github.com/rangojs/rango/blob/main/packages/rangojs-router/docs/testing.md) — section "What these primitives deliberately don't cover (the platform-bindings paragraph)"
|
|
@@ -169,4 +169,4 @@ expect(await store.getShell(key)).not.toBeNull();
|
|
|
169
169
|
|
|
170
170
|
- `/caching`, `/prerender`, `/use-cache`, `/ppr` — the DSL this tests
|
|
171
171
|
- Siblings: [`./e2e-parity.md`](./e2e-parity.md), [`./response-routes.md`](./response-routes.md)
|
|
172
|
-
- Long-form prose: [docs/testing.md](https://github.com/
|
|
172
|
+
- Long-form prose: [docs/testing.md](https://github.com/rangojs/rango/blob/main/packages/rangojs-router/docs/testing.md) — section "Cache, SWR, and prerender"
|
|
@@ -128,4 +128,4 @@ it("resolves params + reverse + Outlet through the layout chain", async () => {
|
|
|
128
128
|
|
|
129
129
|
- `/hooks` — the DSL this tests
|
|
130
130
|
- Siblings: `./handles.md`, `./reverse-and-types.md`, `./render-handler.md`, `./e2e-parity.md`
|
|
131
|
-
- Long-form prose: [docs/testing.md](https://github.com/
|
|
131
|
+
- Long-form prose: [docs/testing.md](https://github.com/rangojs/rango/blob/main/packages/rangojs-router/docs/testing.md) — section "Reverse and components" (and the "Catch: streaming `use(promise)` Suspense content" subsection)
|
|
@@ -122,4 +122,4 @@ A `submit` intent does NOT replay against a snapshot of the server — it submit
|
|
|
122
122
|
|
|
123
123
|
- `/hooks`, `/view-transitions` — the DSL this tests
|
|
124
124
|
- Siblings: [`./cache-prerender.md`](./cache-prerender.md), [`./client-components.md`](./client-components.md)
|
|
125
|
-
- Long-form prose: [docs/testing.md](https://github.com/
|
|
125
|
+
- Long-form prose: [docs/testing.md](https://github.com/rangojs/rango/blob/main/packages/rangojs-router/docs/testing.md) — section "E2E with dev/prod and PE parity" (and "Running a subset locally")
|
package/skills/testing/flight.md
CHANGED
|
@@ -88,4 +88,4 @@ it("snapshots the normalized payload", async () => {
|
|
|
88
88
|
|
|
89
89
|
- `/route` — the DSL this tests
|
|
90
90
|
- Siblings: `./setup.md`, `./server-tree.md`, `./render-handler.md`
|
|
91
|
-
- Long-form prose: [docs/testing.md](https://github.com/
|
|
91
|
+
- Long-form prose: [docs/testing.md](https://github.com/rangojs/rango/blob/main/packages/rangojs-router/docs/testing.md) — section "renderToFlightString — real async Server Components"
|
|
@@ -150,4 +150,4 @@ it("renders the seeded trail (seed the INPUT pushes, the collect runs)", async (
|
|
|
150
150
|
|
|
151
151
|
- `/handler-use`, `/breadcrumbs` — the DSL this tests
|
|
152
152
|
- Siblings: `./loader.md`, `./client-components.md`, `./render-handler.md`
|
|
153
|
-
- Long-form prose: [docs/testing.md](https://github.com/
|
|
153
|
+
- Long-form prose: [docs/testing.md](https://github.com/rangojs/rango/blob/main/packages/rangojs-router/docs/testing.md) — section "Testing a handle's collect/accumulator"
|
package/skills/testing/loader.md
CHANGED
|
@@ -127,4 +127,4 @@ it("asserts a loader's set-cookie + redirect (runLoaderResult)", async () => {
|
|
|
127
127
|
|
|
128
128
|
- `/loader` — the DSL this tests
|
|
129
129
|
- Siblings: `./handles.md`, `./reverse-and-types.md`, `./bindings.md`, `./server-actions.md`
|
|
130
|
-
- Long-form prose: [docs/testing.md](https://github.com/
|
|
130
|
+
- Long-form prose: [docs/testing.md](https://github.com/rangojs/rango/blob/main/packages/rangojs-router/docs/testing.md) — section "Loaders — the raw body or a registered createLoader"
|
|
@@ -96,4 +96,4 @@ Pass an array to run several in order. Cookies set inside middleware via the sta
|
|
|
96
96
|
|
|
97
97
|
- `/middleware` — the DSL this tests
|
|
98
98
|
- Siblings: `./response-routes.md`, `./server-actions.md`, `./loader.md`, `./bindings.md`
|
|
99
|
-
- Long-form prose: [docs/testing.md](https://github.com/
|
|
99
|
+
- Long-form prose: [docs/testing.md](https://github.com/rangojs/rango/blob/main/packages/rangojs-router/docs/testing.md) — section "Middleware"
|
|
@@ -119,4 +119,4 @@ it("asserts the client-cache directives", async () => {
|
|
|
119
119
|
|
|
120
120
|
- `/route` — the DSL this tests
|
|
121
121
|
- Siblings: [`./server-tree.md`](./server-tree.md), [`./server-actions.md`](./server-actions.md), [`./setup.md`](./setup.md), [`./loader.md`](./loader.md)
|
|
122
|
-
- Long-form prose: [docs/testing.md](https://github.com/
|
|
122
|
+
- Long-form prose: [docs/testing.md](https://github.com/rangojs/rango/blob/main/packages/rangojs-router/docs/testing.md) — section "renderHandler — run a real route handler and assert its RSC"
|
|
@@ -92,4 +92,4 @@ describe("api routes via dispatch", () => {
|
|
|
92
92
|
|
|
93
93
|
- `/response-routes`, `/mime-routes` — the DSL this tests
|
|
94
94
|
- Siblings: `./middleware.md`, `./setup.md`, `./cache-prerender.md`
|
|
95
|
-
- Long-form prose: [docs/testing.md](https://github.com/
|
|
95
|
+
- Long-form prose: [docs/testing.md](https://github.com/rangojs/rango/blob/main/packages/rangojs-router/docs/testing.md) — section "dispatch — request to Response" (the `rangoTestConfig` preset stubs `@vitejs/plugin-rsc/rsc`, so no per-file `vi.mock` is needed)
|
|
@@ -82,4 +82,4 @@ For a large type-only suite, collect recipe-1/2 assertions in `*.test-d.ts` file
|
|
|
82
82
|
|
|
83
83
|
- `/typesafety`, `/links` — the DSL this tests
|
|
84
84
|
- Siblings: `./client-components.md`, `./loader.md`
|
|
85
|
-
- Long-form prose: [docs/testing.md](https://github.com/
|
|
85
|
+
- Long-form prose: [docs/testing.md](https://github.com/rangojs/rango/blob/main/packages/rangojs-router/docs/testing.md) — section "Type-level tests — make misuse fail to compile"
|
|
@@ -104,4 +104,4 @@ it("asserts the client-cache directives an action issued", async () => {
|
|
|
104
104
|
|
|
105
105
|
- `/server-actions` — the DSL this tests
|
|
106
106
|
- Siblings: `./render-handler.md`, `./middleware.md`, `./loader.md`, `./bindings.md`
|
|
107
|
-
- Long-form prose: [docs/testing.md](https://github.com/
|
|
107
|
+
- Long-form prose: [docs/testing.md](https://github.com/rangojs/rango/blob/main/packages/rangojs-router/docs/testing.md) — section "runInRequestContext — the handler / server-action test primitive"
|
|
@@ -125,4 +125,4 @@ it("asserts the server-rendered host content", async () => {
|
|
|
125
125
|
|
|
126
126
|
- `/route` — the DSL this tests
|
|
127
127
|
- Siblings: `./flight.md`, `./render-handler.md`, `./setup.md`
|
|
128
|
-
- Long-form prose: [docs/testing.md](https://github.com/
|
|
128
|
+
- Long-form prose: [docs/testing.md](https://github.com/rangojs/rango/blob/main/packages/rangojs-router/docs/testing.md) — section "renderServerTree — serialize then deserialize to an inspectable tree" (and the "findElements / textContent" subsection)
|
package/skills/testing/setup.md
CHANGED
|
@@ -120,4 +120,4 @@ Scripts:
|
|
|
120
120
|
|
|
121
121
|
- (cross-cutting)
|
|
122
122
|
- Siblings: `./flight.md`, `./server-tree.md`, `./render-handler.md`, `./response-routes.md`
|
|
123
|
-
- Long-form prose: [docs/testing.md](https://github.com/
|
|
123
|
+
- Long-form prose: [docs/testing.md](https://github.com/rangojs/rango/blob/main/packages/rangojs-router/docs/testing.md) — section "Setup" (and the subsections "Resolving @rangojs/router in a unit test — use the preset" and "Two vitest projects")
|
|
@@ -204,6 +204,7 @@ import * as CartActions from "./actions/cart";
|
|
|
204
204
|
revalidate((ctx) => ctx.isAction(addToCart) || undefined); // one action
|
|
205
205
|
revalidate((ctx) => ctx.isAction(addToCart, removeFromCart) || undefined); // several
|
|
206
206
|
revalidate((ctx) => ctx.isAction(CartActions) || undefined); // any action in the module
|
|
207
|
+
revalidate((ctx) => ctx.isAction({ addToCart, removeFromCart }) || undefined); // object form
|
|
207
208
|
```
|
|
208
209
|
|
|
209
210
|
`ctx.isAction()` (only available on the revalidate predicate's context) returns a
|
|
@@ -101,7 +101,7 @@ export type UpdateMode =
|
|
|
101
101
|
}
|
|
102
102
|
| { type: "leave-intercept"; interceptSourceUrl?: string }
|
|
103
103
|
| { type: "stale-revalidation"; interceptSourceUrl?: string }
|
|
104
|
-
| { type: "action"; interceptSourceUrl?: string };
|
|
104
|
+
| { type: "action"; interceptSourceUrl?: string; actionId?: string };
|
|
105
105
|
|
|
106
106
|
/**
|
|
107
107
|
* Type for the fetchPartialUpdate function
|
|
@@ -200,7 +200,16 @@ export function createPartialUpdater(
|
|
|
200
200
|
clientRevalidation = collectClientRevalidationDecisions({
|
|
201
201
|
currentUrl: new URL(previousUrl, window.location.origin),
|
|
202
202
|
nextUrl: new URL(url, window.location.origin),
|
|
203
|
-
|
|
203
|
+
// This partial fetch is a GET the server evaluates WITHOUT
|
|
204
|
+
// actionContext (navigation defaults) even when it is an
|
|
205
|
+
// action-triggered refetch — so the decision baseline is never the
|
|
206
|
+
// action default here. Predicates still see isAction()/actionId
|
|
207
|
+
// truthfully for matching.
|
|
208
|
+
actionRequest: false,
|
|
209
|
+
isAction: mode.type === "action",
|
|
210
|
+
...(mode.type === "action" && mode.actionId !== undefined
|
|
211
|
+
? { actionId: mode.actionId }
|
|
212
|
+
: {}),
|
|
204
213
|
stale: mode.type === "stale-revalidation",
|
|
205
214
|
});
|
|
206
215
|
} catch {
|
|
@@ -145,6 +145,7 @@ export function createServerActionBridge(
|
|
|
145
145
|
async function refetchRoute(opts?: {
|
|
146
146
|
segments?: string[];
|
|
147
147
|
interceptSourceUrl?: string | null;
|
|
148
|
+
actionId?: string;
|
|
148
149
|
}): Promise<void> {
|
|
149
150
|
const src = opts?.interceptSourceUrl ?? null;
|
|
150
151
|
const navTx = createNavigationTransaction(
|
|
@@ -167,6 +168,7 @@ export function createServerActionBridge(
|
|
|
167
168
|
{
|
|
168
169
|
type: "action" as const,
|
|
169
170
|
...(src ? { interceptSourceUrl: src } : {}),
|
|
171
|
+
...(opts?.actionId !== undefined ? { actionId: opts.actionId } : {}),
|
|
170
172
|
},
|
|
171
173
|
);
|
|
172
174
|
} finally {
|
|
@@ -309,6 +311,9 @@ export function createServerActionBridge(
|
|
|
309
311
|
clientRevalidation = collectClientRevalidationDecisions({
|
|
310
312
|
currentUrl: actionPageUrl,
|
|
311
313
|
nextUrl: actionPageUrl,
|
|
314
|
+
// Decisions ride the action POST itself — the server evaluates it
|
|
315
|
+
// with actionContext, so the locked default is the action default.
|
|
316
|
+
actionRequest: true,
|
|
312
317
|
isAction: true,
|
|
313
318
|
actionId: id,
|
|
314
319
|
stale: false,
|
|
@@ -707,7 +712,7 @@ export function createServerActionBridge(
|
|
|
707
712
|
// Invalidation is deferred to finalizeAction(); here we only trigger
|
|
708
713
|
// the revalidation refetch of the new route (suppressed on keep).
|
|
709
714
|
if (!scenario.onInterceptRoute && !keepCache) {
|
|
710
|
-
refetchRoute().catch((error) => {
|
|
715
|
+
refetchRoute({ actionId: id }).catch((error) => {
|
|
711
716
|
if (isBackgroundSuppressible(error)) return;
|
|
712
717
|
console.error(
|
|
713
718
|
"[Browser] Background revalidation failed:",
|
|
@@ -724,6 +729,7 @@ export function createServerActionBridge(
|
|
|
724
729
|
if (!keepCache) {
|
|
725
730
|
await refetchRoute({
|
|
726
731
|
interceptSourceUrl: store.getInterceptSourceUrl(),
|
|
732
|
+
actionId: id,
|
|
727
733
|
});
|
|
728
734
|
}
|
|
729
735
|
break;
|
|
@@ -737,7 +743,7 @@ export function createServerActionBridge(
|
|
|
737
743
|
// resolving last must discharge a directive-free sibling's repair.
|
|
738
744
|
// See the keep row in docs/design/rango-state-cookie.md (the all-keep
|
|
739
745
|
// edge, and the benign re-mark-stale-after-refetch end-state delta).
|
|
740
|
-
await refetchRoute({ interceptSourceUrl });
|
|
746
|
+
await refetchRoute({ interceptSourceUrl, actionId: id });
|
|
741
747
|
break;
|
|
742
748
|
}
|
|
743
749
|
|
|
@@ -759,6 +765,7 @@ export function createServerActionBridge(
|
|
|
759
765
|
await refetchRoute({
|
|
760
766
|
segments: segmentsToSend,
|
|
761
767
|
interceptSourceUrl,
|
|
768
|
+
actionId: id,
|
|
762
769
|
});
|
|
763
770
|
break;
|
|
764
771
|
}
|
|
@@ -207,8 +207,8 @@ interface CacheEnvelope {
|
|
|
207
207
|
* leader (function threw, or the result was not serializable) propagates to
|
|
208
208
|
* current waiters, which then retry fresh.
|
|
209
209
|
*
|
|
210
|
-
* A leader that NEVER settles must not hang followers (scar tissue,
|
|
211
|
-
* pilot
|
|
210
|
+
* A leader that NEVER settles must not hang followers (scar tissue, production
|
|
211
|
+
* pilot incident): a background shell capture's render became leader, awaited a
|
|
212
212
|
* tarpitting upstream fetch, and workerd killed the capture's waitUntil context
|
|
213
213
|
* — orphaning the leader promise as permanently pending, its map entry never
|
|
214
214
|
* cleared. Every later document render calling the same cached function (an
|
|
@@ -86,7 +86,7 @@ export const MAX_REVALIDATION_INTERVAL = 30;
|
|
|
86
86
|
* This is the default; override per store via
|
|
87
87
|
* `CFCacheStoreOptions.edgeLookupTimeoutMs` (<= 0 disables the budget).
|
|
88
88
|
*
|
|
89
|
-
* 25ms, raised from 10:
|
|
89
|
+
* 25ms, raised from 10: Workers logs (production pilot) showed the
|
|
90
90
|
* 10ms budget firing frequently on cold colos where the first Cache API touch
|
|
91
91
|
* is slow but healthy — each false positive downgrades a warm L1 HIT to an
|
|
92
92
|
* L2/render round trip that costs far more than the 15ms of extra patience.
|
|
@@ -2383,7 +2383,7 @@ export class CFCacheStore<TEnv = unknown> implements SegmentCacheStore<TEnv> {
|
|
|
2383
2383
|
* this, kv.put/get reject with `414 ... exceeds key length limit of 512`
|
|
2384
2384
|
* and the entry silently never reaches L2 (observed in production for
|
|
2385
2385
|
* "use cache" items whose serialized args — e.g. a CMS query object — blow
|
|
2386
|
-
* the cap;
|
|
2386
|
+
* the cap; production pilot). Keys are opaque storage identifiers, so
|
|
2387
2387
|
* normalization is semantics-preserving as long as distinct logical keys
|
|
2388
2388
|
* stay distinct: colliding requires an identical 400-byte prefix AND a
|
|
2389
2389
|
* 128-bit SHA-256 collision. Deterministic, so every family's read, write,
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { startTransition } from "react";
|
|
4
|
+
import { makeIsAction } from "../router/is-action.js";
|
|
5
|
+
import {
|
|
6
|
+
lockedClientDefault,
|
|
7
|
+
runClientRevalidateChain,
|
|
8
|
+
} from "./revalidate-chain.js";
|
|
4
9
|
import { encodeClientRevalidationDecisions } from "./revalidation-protocol.js";
|
|
5
|
-
import type {
|
|
10
|
+
import type { ClientUrlPatterns } from "./types.js";
|
|
6
11
|
|
|
7
12
|
export interface ClientUrlNavigationIntent {
|
|
8
13
|
readonly routeId: string;
|
|
@@ -156,6 +161,17 @@ export function beginClientUrlNavigation(
|
|
|
156
161
|
export function collectClientRevalidationDecisions(options: {
|
|
157
162
|
currentUrl: URL;
|
|
158
163
|
nextUrl: URL;
|
|
164
|
+
/**
|
|
165
|
+
* True only when the decisions ride the action POST itself — the one
|
|
166
|
+
* request the server evaluates with actionContext (locked default true).
|
|
167
|
+
* Action-triggered refetch GETs (partial-update terminals) pass false:
|
|
168
|
+
* the server gives those navigation defaults, and the delta gate below
|
|
169
|
+
* must diff against the default the SERVER will use, or a force decision
|
|
170
|
+
* on the refetch would be silently swallowed as "equals default".
|
|
171
|
+
*/
|
|
172
|
+
actionRequest: boolean;
|
|
173
|
+
/** Action TRUTH for the predicates' isAction() matcher; may be true on
|
|
174
|
+
* refetch GETs where actionRequest is false. */
|
|
159
175
|
isAction: boolean;
|
|
160
176
|
actionId?: string;
|
|
161
177
|
stale: boolean;
|
|
@@ -163,7 +179,8 @@ export function collectClientRevalidationDecisions(options: {
|
|
|
163
179
|
const group = activeGroup;
|
|
164
180
|
if (!group) return null;
|
|
165
181
|
|
|
166
|
-
const { currentUrl, nextUrl, isAction, actionId, stale } =
|
|
182
|
+
const { currentUrl, nextUrl, actionRequest, isAction, actionId, stale } =
|
|
183
|
+
options;
|
|
167
184
|
const currentLocal = stripMountPrefix(currentUrl.pathname, group.mount);
|
|
168
185
|
if (currentLocal === null) return null;
|
|
169
186
|
const currentMatch = group.definition.match(currentLocal);
|
|
@@ -178,52 +195,33 @@ export function collectClientRevalidationDecisions(options: {
|
|
|
178
195
|
nextLocal === null ? null : group.definition.match(nextLocal);
|
|
179
196
|
const nextParams = nextMatch?.params ?? {};
|
|
180
197
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
198
|
+
const defaultShouldRevalidate = lockedClientDefault({
|
|
199
|
+
actionRequest,
|
|
200
|
+
currentParams: currentMatch.params,
|
|
201
|
+
nextParams,
|
|
202
|
+
currentUrl,
|
|
203
|
+
nextUrl,
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
const baseArgs = {
|
|
207
|
+
currentUrl,
|
|
208
|
+
nextUrl,
|
|
209
|
+
currentParams: currentMatch.params,
|
|
210
|
+
nextParams,
|
|
211
|
+
stale,
|
|
212
|
+
isAction: makeIsAction(actionId, isAction),
|
|
213
|
+
...(actionId !== undefined ? { actionId } : {}),
|
|
192
214
|
};
|
|
193
|
-
const defaultShouldRevalidate = isAction
|
|
194
|
-
? true
|
|
195
|
-
: !paramsEqual(currentMatch.params, nextParams) ||
|
|
196
|
-
currentUrl.search !== nextUrl.search;
|
|
197
|
-
|
|
198
215
|
const skip: string[] = [];
|
|
199
216
|
const force: string[] = [];
|
|
200
217
|
for (const { loader, revalidate } of record.loaders) {
|
|
201
218
|
if (revalidate.length === 0) continue;
|
|
202
|
-
const
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
currentParams: currentMatch.params,
|
|
206
|
-
nextParams,
|
|
219
|
+
const decision = runClientRevalidateChain(
|
|
220
|
+
revalidate,
|
|
221
|
+
baseArgs,
|
|
207
222
|
defaultShouldRevalidate,
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
...(actionId !== undefined ? { actionId } : {}),
|
|
211
|
-
};
|
|
212
|
-
// Same iteration contract as the server: every predicate runs, the last
|
|
213
|
-
// boolean verdict wins. A throwing predicate fails open to the default
|
|
214
|
-
// (mirrors evaluateRevalidation's fail-open).
|
|
215
|
-
let decision = defaultShouldRevalidate;
|
|
216
|
-
for (const fn of revalidate) {
|
|
217
|
-
try {
|
|
218
|
-
const verdict = fn(args);
|
|
219
|
-
if (typeof verdict === "boolean") decision = verdict;
|
|
220
|
-
} catch (error) {
|
|
221
|
-
console.error(
|
|
222
|
-
`[@rangojs/router] clientUrls revalidate() threw for loader "${loader.$$id}"; using default decision:`,
|
|
223
|
-
error,
|
|
224
|
-
);
|
|
225
|
-
}
|
|
226
|
-
}
|
|
223
|
+
`loader "${loader.$$id}"`,
|
|
224
|
+
);
|
|
227
225
|
if (decision === defaultShouldRevalidate) continue;
|
|
228
226
|
(decision ? force : skip).push(loader.$$id);
|
|
229
227
|
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The clientUrls revalidate() chain evaluator, shared by the browser
|
|
3
|
+
* collector (navigation.ts) and the public testing primitive
|
|
4
|
+
* (testing/run-client-revalidate.ts) so the two can never drift.
|
|
5
|
+
*
|
|
6
|
+
* Semantics mirror the server's evaluateRevalidation
|
|
7
|
+
* (src/router/revalidation.ts): a boolean verdict is a hard decision and
|
|
8
|
+
* short-circuits the rest of the chain; a `{ defaultShouldRevalidate }`
|
|
9
|
+
* object updates the running suggestion, which later predicates receive as
|
|
10
|
+
* their `defaultShouldRevalidate`; null/undefined defers; a throwing
|
|
11
|
+
* predicate fails open to the current suggestion (logged). One deliberate
|
|
12
|
+
* divergence: the object form is accepted only with a boolean value — the
|
|
13
|
+
* server is laxer, but never re-compares the value, while this decision
|
|
14
|
+
* feeds a strict-equality delta gate and the wire encoding
|
|
15
|
+
* (navigation.ts), where a truthy non-boolean would invert intent.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import { paramsEqual } from "../router/params-util.js";
|
|
19
|
+
import type { ClientRevalidateArgs, ClientRevalidateFn } from "./types.js";
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* The locked default the server will apply to the request these decisions
|
|
23
|
+
* ride on. `actionRequest` is about the REQUEST, not the user gesture: only
|
|
24
|
+
* the action POST itself is evaluated server-side with actionContext
|
|
25
|
+
* (default `true`); the follow-up refetch GETs an action can trigger carry
|
|
26
|
+
* no actionContext and get navigation defaults — even though their
|
|
27
|
+
* predicates still see `isAction()` as true.
|
|
28
|
+
*/
|
|
29
|
+
export function lockedClientDefault(options: {
|
|
30
|
+
actionRequest: boolean;
|
|
31
|
+
currentParams: Record<string, string>;
|
|
32
|
+
nextParams: Record<string, string>;
|
|
33
|
+
currentUrl: URL;
|
|
34
|
+
nextUrl: URL;
|
|
35
|
+
}): boolean {
|
|
36
|
+
if (options.actionRequest) return true;
|
|
37
|
+
return (
|
|
38
|
+
!paramsEqual(options.currentParams, options.nextParams) ||
|
|
39
|
+
options.currentUrl.search !== options.nextUrl.search
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function runClientRevalidateChain(
|
|
44
|
+
fns: readonly ClientRevalidateFn[],
|
|
45
|
+
baseArgs: Omit<ClientRevalidateArgs, "defaultShouldRevalidate">,
|
|
46
|
+
lockedDefault: boolean,
|
|
47
|
+
label: string,
|
|
48
|
+
): boolean {
|
|
49
|
+
let suggestion = lockedDefault;
|
|
50
|
+
for (const fn of fns) {
|
|
51
|
+
let verdict: ReturnType<ClientRevalidateFn>;
|
|
52
|
+
try {
|
|
53
|
+
verdict = fn({ ...baseArgs, defaultShouldRevalidate: suggestion });
|
|
54
|
+
} catch (error) {
|
|
55
|
+
console.error(
|
|
56
|
+
`[@rangojs/router] clientUrls revalidate() threw for ${label}; using default decision:`,
|
|
57
|
+
error,
|
|
58
|
+
);
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
if (
|
|
62
|
+
process.env.NODE_ENV !== "production" &&
|
|
63
|
+
verdict != null &&
|
|
64
|
+
typeof (verdict as { then?: unknown }).then === "function"
|
|
65
|
+
) {
|
|
66
|
+
console.warn(
|
|
67
|
+
`[rango] clientUrls revalidate() for ${label} returned a Promise; ` +
|
|
68
|
+
`predicates must be synchronous (return a boolean, ` +
|
|
69
|
+
`{ defaultShouldRevalidate }, or null/undefined). The async result ` +
|
|
70
|
+
`was IGNORED and the default (${suggestion}) was kept.`,
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
if (typeof verdict === "boolean") return verdict;
|
|
74
|
+
if (
|
|
75
|
+
verdict &&
|
|
76
|
+
typeof verdict === "object" &&
|
|
77
|
+
typeof verdict.defaultShouldRevalidate === "boolean"
|
|
78
|
+
) {
|
|
79
|
+
suggestion = verdict.defaultShouldRevalidate;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return suggestion;
|
|
83
|
+
}
|
package/src/client-urls/types.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ComponentType, ReactNode } from "react";
|
|
2
2
|
import type {
|
|
3
|
+
IsActionFn,
|
|
3
4
|
LoaderDefinition,
|
|
4
5
|
LoaderOptions,
|
|
5
6
|
TransitionConfig,
|
|
@@ -54,7 +55,8 @@ export type ClientLayoutFn = <const TItems extends ClientUrlItems>(
|
|
|
54
55
|
* subset of the server ShouldRevalidateFn args — the predicate RUNS IN THE
|
|
55
56
|
* BROWSER (it is declared in a "use client" module and never crosses the
|
|
56
57
|
* projection boundary); only its decision is sent to the server. There is no
|
|
57
|
-
* `context` — no server handler context exists where this executes.
|
|
58
|
+
* `context` — no server handler context exists where this executes. `isAction`
|
|
59
|
+
* is the same callable matcher as on the server, not a boolean.
|
|
58
60
|
*/
|
|
59
61
|
export interface ClientRevalidateArgs {
|
|
60
62
|
/** Full URL of the page being navigated away from (current location). */
|
|
@@ -66,21 +68,46 @@ export interface ClientRevalidateArgs {
|
|
|
66
68
|
/** Route params for the navigation target (definition-local match). */
|
|
67
69
|
readonly nextParams: Record<string, string>;
|
|
68
70
|
/**
|
|
69
|
-
* The
|
|
70
|
-
* the same rules the server
|
|
71
|
-
*
|
|
72
|
-
*
|
|
71
|
+
* The current default decision for this loader, computed client-side with
|
|
72
|
+
* the same rules the server applies to the request the decisions ride on:
|
|
73
|
+
* `true` when they ride the action POST itself, otherwise `true` when
|
|
74
|
+
* params/search changed. (An action-triggered refetch GET gets navigation
|
|
75
|
+
* defaults — matching the server — even though `isAction()` is true.)
|
|
76
|
+
* Earlier predicates' `{ defaultShouldRevalidate }` verdicts thread into
|
|
77
|
+
* this value, exactly like the server chain. Return it for default
|
|
78
|
+
* behavior plus your own conditions.
|
|
73
79
|
*/
|
|
74
80
|
readonly defaultShouldRevalidate: boolean;
|
|
75
81
|
/** True when this is a stale history-entry background revalidation. */
|
|
76
82
|
readonly stale: boolean;
|
|
77
|
-
/**
|
|
78
|
-
|
|
79
|
-
|
|
83
|
+
/**
|
|
84
|
+
* Same {@link IsActionFn} the server `revalidate()` predicate receives.
|
|
85
|
+
* In the browser the match is against the action stub's hashed `$$id`
|
|
86
|
+
* (the id the action request carries) — not the RSC file-path `$id`.
|
|
87
|
+
*/
|
|
88
|
+
readonly isAction: IsActionFn;
|
|
89
|
+
/**
|
|
90
|
+
* The triggering server action's id, when this is an action. In the
|
|
91
|
+
* browser this is the hashed `hash#export` form (`$$id`), not the RSC
|
|
92
|
+
* file-path `src/...#export`. Prefer `isAction(ref)` — a substring of
|
|
93
|
+
* `path#export` will not match here in production.
|
|
94
|
+
*/
|
|
80
95
|
readonly actionId?: string;
|
|
81
96
|
}
|
|
82
97
|
|
|
83
|
-
|
|
98
|
+
/**
|
|
99
|
+
* Client-run per-loader predicate, with the same chain semantics as the
|
|
100
|
+
* server's `revalidate()` (src/router/revalidation.ts): a boolean is a HARD
|
|
101
|
+
* decision that short-circuits the rest of the chain; a
|
|
102
|
+
* `{ defaultShouldRevalidate }` object updates the running suggestion, which
|
|
103
|
+
* later predicates receive as their `defaultShouldRevalidate`; `void` /
|
|
104
|
+
* `null` / `undefined` defers to the current suggestion — so
|
|
105
|
+
* `isAction(CartActions) || undefined` defers to the locked default.
|
|
106
|
+
* Predicates must be synchronous; the object form requires a boolean value.
|
|
107
|
+
*/
|
|
108
|
+
export type ClientRevalidateFn = (
|
|
109
|
+
args: ClientRevalidateArgs,
|
|
110
|
+
) => boolean | { defaultShouldRevalidate: boolean } | null | void;
|
|
84
111
|
|
|
85
112
|
export interface ClientUrlLoaderRecord {
|
|
86
113
|
readonly loader: LoaderDefinition<any, any>;
|
|
@@ -158,10 +185,11 @@ export interface ClientUrlHelpers {
|
|
|
158
185
|
readonly loading: (component: ReactNode) => ClientUrlItem;
|
|
159
186
|
/**
|
|
160
187
|
* Per-loader revalidation predicate, valid inside a loader() use callback
|
|
161
|
-
* only. Runs IN THE BROWSER with client-computable args
|
|
162
|
-
* re-run the loader,
|
|
163
|
-
*
|
|
164
|
-
* follow the locked server
|
|
188
|
+
* only. Runs IN THE BROWSER with client-computable args (including the
|
|
189
|
+
* callable `isAction(...refs)` matcher); return true to re-run the loader,
|
|
190
|
+
* false to keep held data. Absent predicates (and requests that carry no
|
|
191
|
+
* decisions: no-JS, PE, prefetch, document loads) follow the locked server
|
|
192
|
+
* defaults.
|
|
165
193
|
*/
|
|
166
194
|
readonly revalidate: (fn: ClientRevalidateFn) => ClientUrlItem;
|
|
167
195
|
/**
|
package/src/client.tsx
CHANGED
|
@@ -470,3 +470,8 @@ export { useReverse } from "./browser/react/use-reverse.js";
|
|
|
470
470
|
export type { ScopedReverseFunction, LocalReverseFunction } from "./reverse.js";
|
|
471
471
|
|
|
472
472
|
export type { LoaderDefinition } from "./types.js";
|
|
473
|
+
export type { ActionRef, IsActionFn } from "./types.js";
|
|
474
|
+
export type {
|
|
475
|
+
ClientRevalidateArgs,
|
|
476
|
+
ClientRevalidateFn,
|
|
477
|
+
} from "./client-urls/types.js";
|
package/src/index.rsc.ts
CHANGED