@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
package/AGENTS.md
CHANGED
|
@@ -10,4 +10,4 @@ Start with the mental model at `node_modules/@rangojs/router/skills/rango/SKILL.
|
|
|
10
10
|
|
|
11
11
|
## Contributing
|
|
12
12
|
|
|
13
|
-
This package is developed in the monorepo at https://github.com/
|
|
13
|
+
This package is developed in the monorepo at https://github.com/rangojs/rango. If you are contributing there rather than consuming the published package, read the root `AGENTS.md` in that repo for the pre-push gate and e2e rules — they apply to the monorepo, not to consumer apps.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025-2026 Ivo Todorov
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -4,13 +4,14 @@ A code-first, type-safe React Server Components router. Django-inspired:
|
|
|
4
4
|
routes are expressed in one visible tree, URLs are built from names, and
|
|
5
5
|
everything past the core is opt-in.
|
|
6
6
|
|
|
7
|
-
> **
|
|
8
|
-
>
|
|
7
|
+
> **Pre-1.0:** Rango follows semver 0.x — breaking changes land in minor
|
|
8
|
+
> releases and are noted in the changelog. npm `latest` is the current 0.x
|
|
9
|
+
> release; the `experimental` tag tracks `main` between tagged releases.
|
|
9
10
|
|
|
10
11
|
This page is a tour: it builds one small shop and meets the entire core API
|
|
11
12
|
along the way — about six primitives. Everything else is opt-in and linked at
|
|
12
13
|
the end. For the design rationale behind these APIs, read
|
|
13
|
-
[Why Rango](https://github.com/
|
|
14
|
+
[Why Rango](https://github.com/rangojs/rango/blob/main/packages/rangojs-router/docs/why-rango.md); this page shows how it feels, that page
|
|
14
15
|
argues why it's right.
|
|
15
16
|
|
|
16
17
|
## Start a new app
|
|
@@ -24,7 +25,8 @@ pnpm create rango my-app
|
|
|
24
25
|
|
|
25
26
|
Select a deployment target with `--template basic`, `--template cloudflare`, or
|
|
26
27
|
`--template vercel`. The templates include streaming RSC, typed routes, Server
|
|
27
|
-
Actions, Tailwind CSS, and production deployment configuration
|
|
28
|
+
Actions, Tailwind CSS, and production deployment configuration; the scaffolder
|
|
29
|
+
installs the latest `@rangojs/router` release. For a plain
|
|
28
30
|
JavaScript Node app, add `--template basic --js`. With npm, run
|
|
29
31
|
`npm create rango@latest my-app`. The scaffolder currently requires Node.js 24
|
|
30
32
|
or newer.
|
|
@@ -34,7 +36,7 @@ or newer.
|
|
|
34
36
|
If you are adding Rango to an existing Vite RSC project:
|
|
35
37
|
|
|
36
38
|
```bash
|
|
37
|
-
npm install @rangojs/router@
|
|
39
|
+
npm install @rangojs/router@latest react @vitejs/plugin-rsc
|
|
38
40
|
```
|
|
39
41
|
|
|
40
42
|
```ts
|
|
@@ -170,7 +172,7 @@ per group — while matching stays an `O(path length)` prefix trie, identical
|
|
|
170
172
|
in dev and production. None of this is assumed: the trie is benchmarked
|
|
171
173
|
in-repo against multi-thousand-route manifests, and the lazy guarantees are
|
|
172
174
|
pinned by run-count tests (see
|
|
173
|
-
[matching & lazy discovery](https://github.com/
|
|
175
|
+
[matching & lazy discovery](https://github.com/rangojs/rango/blob/main/packages/rangojs-router/docs/internal/matching-and-lazy-discovery.md)).
|
|
174
176
|
Grow the tree without watching the boot time.
|
|
175
177
|
|
|
176
178
|
That's a working site. Everything below adds to this app.
|
|
@@ -466,19 +468,19 @@ npx rango generate src/ # recursive scan
|
|
|
466
468
|
|
|
467
469
|
### Examples
|
|
468
470
|
|
|
469
|
-
- [`e2e/mini`](https://github.com/
|
|
470
|
-
- [`cloudflare-basic`](https://github.com/
|
|
471
|
-
- [`cloudflare-multi-router`](https://github.com/
|
|
472
|
-
- [`vercel-basic`](https://github.com/
|
|
473
|
-
- [`vercel-multi-router`](https://github.com/
|
|
471
|
+
- [`e2e/mini`](https://github.com/rangojs/rango/tree/main/packages/rangojs-router/e2e/mini) — single-file demo app
|
|
472
|
+
- [`cloudflare-basic`](https://github.com/rangojs/rango/tree/main/tests/cloudflare-basic) — Cloudflare Workers with caching, loaders, theme, and pre-rendering
|
|
473
|
+
- [`cloudflare-multi-router`](https://github.com/rangojs/rango/tree/main/examples/cloudflare-multi-router) — multi-app host routing
|
|
474
|
+
- [`vercel-basic`](https://github.com/rangojs/rango/tree/main/examples/vercel-basic) — Vercel deployment with `preset: "vercel"`, `VercelCacheStore`, and OTel tracing
|
|
475
|
+
- [`vercel-multi-router`](https://github.com/rangojs/rango/tree/main/examples/vercel-multi-router) — multi-app host routing on Vercel (single function, routed by Host header)
|
|
474
476
|
|
|
475
477
|
### Going deeper
|
|
476
478
|
|
|
477
|
-
- [Why Rango](https://github.com/
|
|
479
|
+
- [Why Rango](https://github.com/rangojs/rango/blob/main/packages/rangojs-router/docs/why-rango.md) — the design rationale, claim by claim
|
|
478
480
|
- [Framework comparison](./skills/comparison/references/framework-comparison.md) — Rango vs Next.js App Router, TanStack Start, and Waku, capability by capability
|
|
479
|
-
- [Docs index](https://github.com/
|
|
480
|
-
- [Execution model](https://github.com/
|
|
481
|
+
- [Docs index](https://github.com/rangojs/rango/blob/main/packages/rangojs-router/docs/README.md) — architecture, caching, prerender, testing
|
|
482
|
+
- [Execution model](https://github.com/rangojs/rango/blob/main/packages/rangojs-router/docs/internal/execution-model.md) — the runtime contract
|
|
481
483
|
|
|
482
484
|
## License
|
|
483
485
|
|
|
484
|
-
MIT
|
|
486
|
+
[MIT](./LICENSE)
|
|
@@ -66,7 +66,7 @@ export declare const MAX_REVALIDATION_INTERVAL = 30;
|
|
|
66
66
|
* This is the default; override per store via
|
|
67
67
|
* `CFCacheStoreOptions.edgeLookupTimeoutMs` (<= 0 disables the budget).
|
|
68
68
|
*
|
|
69
|
-
* 25ms, raised from 10:
|
|
69
|
+
* 25ms, raised from 10: Workers logs (production pilot) showed the
|
|
70
70
|
* 10ms budget firing frequently on cold colos where the first Cache API touch
|
|
71
71
|
* is slow but healthy — each false positive downgrades a warm L1 HIT to an
|
|
72
72
|
* L2/render round trip that costs far more than the 15ms of extra patience.
|
|
@@ -322,7 +322,7 @@ export declare class CFCacheStore<TEnv = unknown> implements SegmentCacheStore<T
|
|
|
322
322
|
* this, kv.put/get reject with `414 ... exceeds key length limit of 512`
|
|
323
323
|
* and the entry silently never reaches L2 (observed in production for
|
|
324
324
|
* "use cache" items whose serialized args — e.g. a CMS query object — blow
|
|
325
|
-
* the cap;
|
|
325
|
+
* the cap; production pilot). Keys are opaque storage identifiers, so
|
|
326
326
|
* normalization is semantics-preserving as long as distinct logical keys
|
|
327
327
|
* stay distinct: colliding requires an identical 400-byte prefix AND a
|
|
328
328
|
* 128-bit SHA-256 collision. Deterministic, so every family's read, write,
|
|
@@ -31,6 +31,17 @@ export declare function beginClientUrlNavigation(targetUrl: URL, signal: AbortSi
|
|
|
31
31
|
export declare function collectClientRevalidationDecisions(options: {
|
|
32
32
|
currentUrl: URL;
|
|
33
33
|
nextUrl: URL;
|
|
34
|
+
/**
|
|
35
|
+
* True only when the decisions ride the action POST itself — the one
|
|
36
|
+
* request the server evaluates with actionContext (locked default true).
|
|
37
|
+
* Action-triggered refetch GETs (partial-update terminals) pass false:
|
|
38
|
+
* the server gives those navigation defaults, and the delta gate below
|
|
39
|
+
* must diff against the default the SERVER will use, or a force decision
|
|
40
|
+
* on the refetch would be silently swallowed as "equals default".
|
|
41
|
+
*/
|
|
42
|
+
actionRequest: boolean;
|
|
43
|
+
/** Action TRUTH for the predicates' isAction() matcher; may be true on
|
|
44
|
+
* refetch GETs where actionRequest is false. */
|
|
34
45
|
isAction: boolean;
|
|
35
46
|
actionId?: string;
|
|
36
47
|
stale: boolean;
|
|
@@ -0,0 +1,33 @@
|
|
|
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
|
+
import type { ClientRevalidateArgs, ClientRevalidateFn } from "./types.js";
|
|
18
|
+
/**
|
|
19
|
+
* The locked default the server will apply to the request these decisions
|
|
20
|
+
* ride on. `actionRequest` is about the REQUEST, not the user gesture: only
|
|
21
|
+
* the action POST itself is evaluated server-side with actionContext
|
|
22
|
+
* (default `true`); the follow-up refetch GETs an action can trigger carry
|
|
23
|
+
* no actionContext and get navigation defaults — even though their
|
|
24
|
+
* predicates still see `isAction()` as true.
|
|
25
|
+
*/
|
|
26
|
+
export declare function lockedClientDefault(options: {
|
|
27
|
+
actionRequest: boolean;
|
|
28
|
+
currentParams: Record<string, string>;
|
|
29
|
+
nextParams: Record<string, string>;
|
|
30
|
+
currentUrl: URL;
|
|
31
|
+
nextUrl: URL;
|
|
32
|
+
}): boolean;
|
|
33
|
+
export declare function runClientRevalidateChain(fns: readonly ClientRevalidateFn[], baseArgs: Omit<ClientRevalidateArgs, "defaultShouldRevalidate">, lockedDefault: boolean, label: string): boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ComponentType, ReactNode } from "react";
|
|
2
|
-
import type { LoaderDefinition, LoaderOptions, TransitionConfig } from "../types.js";
|
|
2
|
+
import type { IsActionFn, LoaderDefinition, LoaderOptions, TransitionConfig } from "../types.js";
|
|
3
3
|
import type { TrieMatchResult } from "../router/trie-matching.js";
|
|
4
4
|
import type { PathOptions } from "../urls/pattern-types.js";
|
|
5
5
|
import type { SearchSchema } from "../search-params.js";
|
|
@@ -23,7 +23,8 @@ export type ClientLayoutFn = <const TItems extends ClientUrlItems>(component: Co
|
|
|
23
23
|
* subset of the server ShouldRevalidateFn args — the predicate RUNS IN THE
|
|
24
24
|
* BROWSER (it is declared in a "use client" module and never crosses the
|
|
25
25
|
* projection boundary); only its decision is sent to the server. There is no
|
|
26
|
-
* `context` — no server handler context exists where this executes.
|
|
26
|
+
* `context` — no server handler context exists where this executes. `isAction`
|
|
27
|
+
* is the same callable matcher as on the server, not a boolean.
|
|
27
28
|
*/
|
|
28
29
|
export interface ClientRevalidateArgs {
|
|
29
30
|
/** Full URL of the page being navigated away from (current location). */
|
|
@@ -35,20 +36,45 @@ export interface ClientRevalidateArgs {
|
|
|
35
36
|
/** Route params for the navigation target (definition-local match). */
|
|
36
37
|
readonly nextParams: Record<string, string>;
|
|
37
38
|
/**
|
|
38
|
-
* The
|
|
39
|
-
* the same rules the server
|
|
40
|
-
*
|
|
41
|
-
*
|
|
39
|
+
* The current default decision for this loader, computed client-side with
|
|
40
|
+
* the same rules the server applies to the request the decisions ride on:
|
|
41
|
+
* `true` when they ride the action POST itself, otherwise `true` when
|
|
42
|
+
* params/search changed. (An action-triggered refetch GET gets navigation
|
|
43
|
+
* defaults — matching the server — even though `isAction()` is true.)
|
|
44
|
+
* Earlier predicates' `{ defaultShouldRevalidate }` verdicts thread into
|
|
45
|
+
* this value, exactly like the server chain. Return it for default
|
|
46
|
+
* behavior plus your own conditions.
|
|
42
47
|
*/
|
|
43
48
|
readonly defaultShouldRevalidate: boolean;
|
|
44
49
|
/** True when this is a stale history-entry background revalidation. */
|
|
45
50
|
readonly stale: boolean;
|
|
46
|
-
/**
|
|
47
|
-
|
|
48
|
-
|
|
51
|
+
/**
|
|
52
|
+
* Same {@link IsActionFn} the server `revalidate()` predicate receives.
|
|
53
|
+
* In the browser the match is against the action stub's hashed `$$id`
|
|
54
|
+
* (the id the action request carries) — not the RSC file-path `$id`.
|
|
55
|
+
*/
|
|
56
|
+
readonly isAction: IsActionFn;
|
|
57
|
+
/**
|
|
58
|
+
* The triggering server action's id, when this is an action. In the
|
|
59
|
+
* browser this is the hashed `hash#export` form (`$$id`), not the RSC
|
|
60
|
+
* file-path `src/...#export`. Prefer `isAction(ref)` — a substring of
|
|
61
|
+
* `path#export` will not match here in production.
|
|
62
|
+
*/
|
|
49
63
|
readonly actionId?: string;
|
|
50
64
|
}
|
|
51
|
-
|
|
65
|
+
/**
|
|
66
|
+
* Client-run per-loader predicate, with the same chain semantics as the
|
|
67
|
+
* server's `revalidate()` (src/router/revalidation.ts): a boolean is a HARD
|
|
68
|
+
* decision that short-circuits the rest of the chain; a
|
|
69
|
+
* `{ defaultShouldRevalidate }` object updates the running suggestion, which
|
|
70
|
+
* later predicates receive as their `defaultShouldRevalidate`; `void` /
|
|
71
|
+
* `null` / `undefined` defers to the current suggestion — so
|
|
72
|
+
* `isAction(CartActions) || undefined` defers to the locked default.
|
|
73
|
+
* Predicates must be synchronous; the object form requires a boolean value.
|
|
74
|
+
*/
|
|
75
|
+
export type ClientRevalidateFn = (args: ClientRevalidateArgs) => boolean | {
|
|
76
|
+
defaultShouldRevalidate: boolean;
|
|
77
|
+
} | null | void;
|
|
52
78
|
export interface ClientUrlLoaderRecord {
|
|
53
79
|
readonly loader: LoaderDefinition<any, any>;
|
|
54
80
|
/** Client-run per-loader revalidation predicates; empty = locked defaults. */
|
|
@@ -114,10 +140,11 @@ export interface ClientUrlHelpers {
|
|
|
114
140
|
readonly loading: (component: ReactNode) => ClientUrlItem;
|
|
115
141
|
/**
|
|
116
142
|
* Per-loader revalidation predicate, valid inside a loader() use callback
|
|
117
|
-
* only. Runs IN THE BROWSER with client-computable args
|
|
118
|
-
* re-run the loader,
|
|
119
|
-
*
|
|
120
|
-
* follow the locked server
|
|
143
|
+
* only. Runs IN THE BROWSER with client-computable args (including the
|
|
144
|
+
* callable `isAction(...refs)` matcher); return true to re-run the loader,
|
|
145
|
+
* false to keep held data. Absent predicates (and requests that carry no
|
|
146
|
+
* decisions: no-JS, PE, prefetch, document loads) follow the locked server
|
|
147
|
+
* defaults.
|
|
121
148
|
*/
|
|
122
149
|
readonly revalidate: (fn: ClientRevalidateFn) => ClientUrlItem;
|
|
123
150
|
/**
|
package/dist/types/client.d.ts
CHANGED
|
@@ -190,3 +190,5 @@ export { useHref } from "./browser/react/use-href.js";
|
|
|
190
190
|
export { useReverse } from "./browser/react/use-reverse.js";
|
|
191
191
|
export type { ScopedReverseFunction, LocalReverseFunction } from "./reverse.js";
|
|
192
192
|
export type { LoaderDefinition } from "./types.js";
|
|
193
|
+
export type { ActionRef, IsActionFn } from "./types.js";
|
|
194
|
+
export type { ClientRevalidateArgs, ClientRevalidateFn, } from "./client-urls/types.js";
|
package/dist/types/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
export { RouteNotFoundError, DataNotFoundError, notFound, MiddlewareError, HandlerError, BuildError, DslContextError, InvalidHandlerError, RouterError, Skip, isSkip, } from "./errors.js";
|
|
13
13
|
export type { DocumentProps, DefaultEnv, RouteDefinition, RouteConfig, RouteDefinitionOptions, TrailingSlashMode, Handler, // Supports params object, path pattern, or route name
|
|
14
|
-
HandlerContext, ExtractParams, GenericParams, Middleware, RevalidateParams, Revalidate, ActionRef, RouteKeys, LoaderDefinition, LoaderFn, LoaderContext, LoaderOptions, FetchableLoaderOptions, LoadOptions, ErrorInfo, ErrorBoundaryFallbackProps, ErrorBoundaryHandler, ClientErrorBoundaryFallbackProps, NotFoundInfo, NotFoundBoundaryFallbackProps, NotFoundBoundaryHandler, ErrorPhase, OnErrorContext, OnErrorCallback, } from "./types.js";
|
|
14
|
+
HandlerContext, ExtractParams, GenericParams, Middleware, RevalidateParams, Revalidate, ActionRef, IsActionFn, RouteKeys, LoaderDefinition, LoaderFn, LoaderContext, LoaderOptions, FetchableLoaderOptions, LoadOptions, ErrorInfo, ErrorBoundaryFallbackProps, ErrorBoundaryHandler, ClientErrorBoundaryFallbackProps, NotFoundInfo, NotFoundBoundaryFallbackProps, NotFoundBoundaryHandler, ErrorPhase, OnErrorContext, OnErrorCallback, } from "./types.js";
|
|
15
15
|
export type { SearchSchema, SearchSchemaValue, ResolveSearchSchema, RouteSearchParams, RouteParams, } from "./search-params.js";
|
|
16
16
|
export { TRACKING_SEARCH_PARAMS, type CacheSearchParams, } from "./cache/search-params-filter.js";
|
|
17
17
|
export { createLoader } from "./loader.js";
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* in RSC context, while the regular index.ts is used in client components.
|
|
10
10
|
*/
|
|
11
11
|
export { RouteNotFoundError, DataNotFoundError, notFound, MiddlewareError, HandlerError, BuildError, DslContextError, InvalidHandlerError, RouterError, Skip, isSkip, } from "./index.js";
|
|
12
|
-
export type { DocumentProps, DefaultEnv, RouteDefinition, RouteConfig, RouteDefinitionOptions, TrailingSlashMode, Handler, HandlerContext, ExtractParams, GenericParams, Middleware, RevalidateParams, Revalidate, ActionRef, RouteKeys, LoaderDefinition, LoaderFn, LoaderContext, FetchableLoaderOptions, LoadOptions, ErrorInfo, ErrorBoundaryFallbackProps, ErrorBoundaryHandler, ClientErrorBoundaryFallbackProps, NotFoundInfo, NotFoundBoundaryFallbackProps, NotFoundBoundaryHandler, ErrorPhase, OnErrorContext, OnErrorCallback, TransitionConfig, TransitionWhenFn, TransitionWhenContext, ViewTransitionClass, } from "./types.js";
|
|
12
|
+
export type { DocumentProps, DefaultEnv, RouteDefinition, RouteConfig, RouteDefinitionOptions, TrailingSlashMode, Handler, HandlerContext, ExtractParams, GenericParams, Middleware, RevalidateParams, Revalidate, ActionRef, IsActionFn, RouteKeys, LoaderDefinition, LoaderFn, LoaderContext, FetchableLoaderOptions, LoadOptions, ErrorInfo, ErrorBoundaryFallbackProps, ErrorBoundaryHandler, ClientErrorBoundaryFallbackProps, NotFoundInfo, NotFoundBoundaryFallbackProps, NotFoundBoundaryHandler, ErrorPhase, OnErrorContext, OnErrorCallback, TransitionConfig, TransitionWhenFn, TransitionWhenContext, ViewTransitionClass, } from "./types.js";
|
|
13
13
|
export type { RangoOptions, SSRStreamMode, SSROptions, ResolveStreamingContext, } from "./router.js";
|
|
14
14
|
export type { OriginCheckConfig, OriginCheckContext, OriginCheckPhase, } from "./rsc/origin-guard.js";
|
|
15
15
|
export type { ShellCaptureDebug, ShellCaptureDebugEvent, } from "./rsc/shell-capture.js";
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared `isAction()` matcher for revalidate predicates (server + clientUrls).
|
|
3
|
+
*
|
|
4
|
+
* Action identity is `actionId`. The helper resolves an imported reference the
|
|
5
|
+
* same way the action boundary derives that id (`$id ?? $$id`), so a
|
|
6
|
+
* rename-safe `isAction(fn)` / `isAction(namespace)` match works in both the
|
|
7
|
+
* RSC environment (file-path `$id`) and the browser (hashed `$$id`).
|
|
8
|
+
*/
|
|
9
|
+
import type { IsActionFn } from "../types.js";
|
|
10
|
+
/**
|
|
11
|
+
* Resolve a server-action reference's stable id, mirroring how the action
|
|
12
|
+
* boundary derives `actionContext.actionId` in `rsc/server-action.ts`
|
|
13
|
+
* (`$id ?? $$id`): the file-path `$id` set by the expose-action-id plugin in a
|
|
14
|
+
* production RSC build when present, otherwise React's `$$id`. Resolving both
|
|
15
|
+
* the incoming `actionId` and the reference with the same precedence makes
|
|
16
|
+
* `isAction()` form-agnostic across dev and production.
|
|
17
|
+
*/
|
|
18
|
+
export declare function resolveActionRefId(ref: unknown): string | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* Build the `isAction()` helper bound to the current action. Called with no
|
|
21
|
+
* arguments it answers "is this request an action at all?" — `true` during
|
|
22
|
+
* action handling (including action-triggered refetches that carry no id
|
|
23
|
+
* yet), `false` on plain navigation. Called with one or more action
|
|
24
|
+
* references it narrows to those: a single imported action, several
|
|
25
|
+
* (variadic), a namespace import (`import * as Mod`), an object literal of
|
|
26
|
+
* actions (`{ addToCart, removeFromCart }`), or a grouped namespace object.
|
|
27
|
+
* Returns `false` when there is no action or nothing matches.
|
|
28
|
+
*
|
|
29
|
+
* `inAction` is the request kind. It defaults to "an id is present" so
|
|
30
|
+
* existing server call sites stay a single argument. The client passes the
|
|
31
|
+
* explicit flag so a refetch terminal with `isAction: true` still answers
|
|
32
|
+
* bare `isAction()` even if `actionId` was not threaded.
|
|
33
|
+
*/
|
|
34
|
+
export declare function makeIsAction(currentActionId: string | undefined, inAction?: boolean): IsActionFn;
|
|
@@ -29,7 +29,7 @@ export declare const SHELL_CAPTURE_MAX_WAIT_MS = 15000;
|
|
|
29
29
|
* Hard cap on one capture TASK — runShellCapture end to end (both attempts +
|
|
30
30
|
* the in-place retry delay). SHELL_CAPTURE_MAX_WAIT_MS arms only inside
|
|
31
31
|
* captureShellHTML, AFTER the capture's router.match(); a handler wedged on a
|
|
32
|
-
* never-settling upstream await (
|
|
32
|
+
* never-settling upstream await (production pilot: a 30s+ tarpitting fetch)
|
|
33
33
|
* wedges the task with no deadline in force. The task's settle path releases
|
|
34
34
|
* the per-key stampede guard and the serialized capture-queue slot, so an
|
|
35
35
|
* unbounded task strands BOTH for the isolate's lifetime.
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
* condition and would throw if pulled into this barrel.
|
|
27
27
|
*
|
|
28
28
|
* Layers:
|
|
29
|
-
* - Unit: runMiddleware, runLoader
|
|
29
|
+
* - Unit: runMiddleware, runLoader, runClientRevalidate
|
|
30
30
|
* - Integration: dispatch (request -> Response)
|
|
31
31
|
* - Cross-cut: assertCacheStatus, assertShellStatus, assertGeneratedRoutesMatch
|
|
32
32
|
* - Component: see @rangojs/router/testing/dom (renderRoute)
|
|
@@ -39,6 +39,8 @@ export { runLoader, runLoaderResult } from "./run-loader.js";
|
|
|
39
39
|
export type { RunLoaderOptions, RunLoaderResult, UseResolver, TestLoaderContext, } from "./run-loader.js";
|
|
40
40
|
export { runTransitionWhen } from "./run-transition-when.js";
|
|
41
41
|
export type { RunTransitionWhenOptions, RunTransitionWhenResult, } from "./run-transition-when.js";
|
|
42
|
+
export { runClientRevalidate } from "./run-client-revalidate.js";
|
|
43
|
+
export type { RunClientRevalidateOptions } from "./run-client-revalidate.js";
|
|
42
44
|
export { dispatch } from "./dispatch.js";
|
|
43
45
|
export type { DispatchOptions } from "./dispatch.js";
|
|
44
46
|
export { assertCacheStatus, assertCacheDecision, parseCacheHeader, createCacheSink, filterCacheDecisions, } from "./cache-status.js";
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* runClientRevalidate — unit-test clientUrls() revalidate() predicates.
|
|
3
|
+
*
|
|
4
|
+
* Builds the same {@link ClientRevalidateArgs} the browser collector passes
|
|
5
|
+
* and evaluates the predicate(s) through the SAME chain evaluator production
|
|
6
|
+
* uses (client-urls/revalidate-chain.ts) — locked default, boolean
|
|
7
|
+
* short-circuit, soft-verdict threading, and fail-open are the production
|
|
8
|
+
* code paths, not a re-implementation. Pass an array to test a chain.
|
|
9
|
+
*
|
|
10
|
+
* Synchronous: client revalidate functions must be sync.
|
|
11
|
+
*/
|
|
12
|
+
import type { ClientRevalidateFn } from "../client-urls/types.js";
|
|
13
|
+
/**
|
|
14
|
+
* Options for {@link runClientRevalidate}. Defaults model a same-URL
|
|
15
|
+
* navigation with no action (locked default `false`).
|
|
16
|
+
*/
|
|
17
|
+
export interface RunClientRevalidateOptions {
|
|
18
|
+
currentUrl?: string | URL;
|
|
19
|
+
nextUrl?: string | URL;
|
|
20
|
+
currentParams?: Record<string, string>;
|
|
21
|
+
nextParams?: Record<string, string>;
|
|
22
|
+
stale?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* The triggering action: a single imported reference (id resolved via
|
|
25
|
+
* `$id ?? $$id`; throws if the function carries neither) or a raw actionId
|
|
26
|
+
* string. A namespace/object is rejected — it cannot identify the ONE
|
|
27
|
+
* action that triggered the request. Omit for a plain navigation.
|
|
28
|
+
*/
|
|
29
|
+
action?: ((...args: never[]) => unknown) | string;
|
|
30
|
+
/**
|
|
31
|
+
* Model an action-triggered refetch GET: predicates see `isAction()` as
|
|
32
|
+
* true, but the locked default stays the navigation default, matching how
|
|
33
|
+
* the server evaluates that request (no actionContext). Defaults to
|
|
34
|
+
* treating a provided `action` as the action POST itself.
|
|
35
|
+
*/
|
|
36
|
+
actionRequest?: boolean;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Run one clientUrls `revalidate()` predicate — or a chain, in declaration
|
|
40
|
+
* order — against production-built args. Returns the final boolean decision
|
|
41
|
+
* (locked default if every predicate defers or throws).
|
|
42
|
+
*/
|
|
43
|
+
export declare function runClientRevalidate(fn: ClientRevalidateFn | readonly ClientRevalidateFn[], opts?: RunClientRevalidateOptions): boolean;
|
|
@@ -418,13 +418,17 @@ export type RevalidateParams<TParams = GenericParams, TEnv = any> = Parameters<S
|
|
|
418
418
|
/**
|
|
419
419
|
* A reference to a server action, used by `isAction()` in a revalidate predicate.
|
|
420
420
|
*
|
|
421
|
-
* Either a directly imported action (`import { addToCart }`)
|
|
422
|
-
* import of an action module (`import * as CartActions`)
|
|
421
|
+
* Either a directly imported action (`import { addToCart }`), a namespace
|
|
422
|
+
* import of an action module (`import * as CartActions`), an object
|
|
423
|
+
* literal of actions (`{ addToCart, removeFromCart }`), or a grouped
|
|
424
|
+
* namespace (`{ Cart: CartActions, Order: OrderActions }`). Matching resolves the
|
|
423
425
|
* action's build-injected id (`path#export`) — the same identity the router uses
|
|
424
426
|
* for `actionId` — so a renamed or moved action breaks at compile time instead
|
|
425
427
|
* of silently failing to match.
|
|
426
428
|
*/
|
|
427
429
|
export type ActionRef = ((...args: never[]) => unknown) | Record<string, unknown>;
|
|
430
|
+
/** The `isAction()` matcher passed to server and client `revalidate()` predicates. */
|
|
431
|
+
export type IsActionFn = (...actions: ActionRef[]) => boolean;
|
|
428
432
|
/**
|
|
429
433
|
* Revalidation function called during client-side navigation to decide whether
|
|
430
434
|
* a segment (layout, route, parallel slot, or loader) should be re-rendered.
|
|
@@ -511,8 +515,10 @@ export type ShouldRevalidateFn<TParams = GenericParams, TEnv = any> = (args: {
|
|
|
511
515
|
/**
|
|
512
516
|
* Typed, rename-safe action matching. Returns `true` when the action that
|
|
513
517
|
* triggered this revalidation is one of the given references — or, for a
|
|
514
|
-
* namespace import (`import * as CartActions`),
|
|
515
|
-
*
|
|
518
|
+
* namespace import (`import * as CartActions`), object literal
|
|
519
|
+
* (`{ addToCart, removeFromCart }`), or grouped namespaces
|
|
520
|
+
* (`{ Cart: CartActions }`), any of those exports — and `false`
|
|
521
|
+
* otherwise (including plain navigation with no action).
|
|
516
522
|
*
|
|
517
523
|
* Called with NO arguments it answers "is this request an action at all?":
|
|
518
524
|
* `true` for any action, `false` on plain navigation. Use the bare form when
|
|
@@ -536,9 +542,10 @@ export type ShouldRevalidateFn<TParams = GenericParams, TEnv = any> = (args: {
|
|
|
536
542
|
* revalidate((ctx) => ctx.isAction(addToCart) || undefined); // one action
|
|
537
543
|
* revalidate((ctx) => ctx.isAction(addToCart, removeFromCart) || undefined); // several
|
|
538
544
|
* revalidate((ctx) => ctx.isAction(CartActions) || undefined); // any in the module
|
|
545
|
+
* revalidate((ctx) => ctx.isAction({ addToCart, removeFromCart }) || undefined); // object form
|
|
539
546
|
* ```
|
|
540
547
|
*/
|
|
541
|
-
isAction:
|
|
548
|
+
isAction: IsActionFn;
|
|
542
549
|
/** URL where the action was executed (the page the user was on when they triggered the action). */
|
|
543
550
|
actionUrl?: URL;
|
|
544
551
|
/** Return value from the action execution. Can be used to conditionally revalidate based on the action's outcome. */
|
|
@@ -3,7 +3,7 @@ import "./global-namespace.js";
|
|
|
3
3
|
export type { DocumentProps, ExtractParams, TrailingSlashMode, RouteConfig, RouteDefinitionOptions, RouteDefinition, ResolvedRouteMap, } from "./route-config.js";
|
|
4
4
|
export type { ErrorInfo, ErrorBoundaryFallbackProps, ErrorBoundaryHandler, ClientErrorBoundaryFallbackProps, LoaderDataResult, NotFoundInfo, NotFoundBoundaryFallbackProps, NotFoundBoundaryHandler, } from "./boundaries.js";
|
|
5
5
|
export { isLoaderDataResult } from "./boundaries.js";
|
|
6
|
-
export type { MiddlewareFn, ScopedRouteMap, Handler, HandlerContext, InternalHandlerContext, GenericParams, RevalidateParams, ShouldRevalidateFn, ActionRef, RouteKeys, ExtractRouteParams, HandlersForRouteMap, Revalidate, Middleware, } from "./handler-context.js";
|
|
6
|
+
export type { MiddlewareFn, ScopedRouteMap, Handler, HandlerContext, InternalHandlerContext, GenericParams, RevalidateParams, ShouldRevalidateFn, ActionRef, IsActionFn, RouteKeys, ExtractRouteParams, HandlersForRouteMap, Revalidate, Middleware, } from "./handler-context.js";
|
|
7
7
|
export type { ViewTransitionClass, TransitionConfig, TransitionWhenFn, TransitionWhenContext, ResolvedSegment, SegmentMetadata, SlotState, RootLayoutProps, MatchResult, } from "./segments.js";
|
|
8
8
|
export type { LazyIncludeContext, RouteEntry } from "./route-entry.js";
|
|
9
9
|
export type { LoaderContext, LoaderFn, FetchableLoaderOptions, LoaderOptions, LoadOptions, LoaderDefinition, } from "./loader-types.js";
|
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
import type { Plugin } from "vite";
|
|
2
|
+
/**
|
|
3
|
+
* Per-reference own `bind` injected next to `$$id`. React's client.browser
|
|
4
|
+
* build carries no server-reference metadata across `.bind()` (the
|
|
5
|
+
* edge/node/server builds install an own `bind` on each reference that
|
|
6
|
+
* does), so `isAction(boundStub)` would silently miss in the browser only.
|
|
7
|
+
* Installing the same per-reference own `bind` here — scoped to the stubs
|
|
8
|
+
* this plugin already wraps, guarded to never override an existing own
|
|
9
|
+
* `bind` — closes that without mutating the global Function.prototype
|
|
10
|
+
* (which would re-wrap once per Vite environment/HMR pass and break
|
|
11
|
+
* native-function detection for co-loaded code). The helper re-installs
|
|
12
|
+
* itself on the bound result so chained binds keep the metadata too.
|
|
13
|
+
*/
|
|
14
|
+
export declare const ACTION_BIND_HELPER_NAME: string;
|
|
15
|
+
export declare const ACTION_BIND_HELPER_SOURCE: string;
|
|
2
16
|
/**
|
|
3
17
|
* Vite plugin that exposes action IDs on server reference functions.
|
|
4
18
|
*
|
package/dist/vite/index.js
CHANGED
|
@@ -1401,6 +1401,14 @@ function isUseServerModule(filePath) {
|
|
|
1401
1401
|
return false;
|
|
1402
1402
|
}
|
|
1403
1403
|
}
|
|
1404
|
+
var ACTION_BIND_HELPER_NAME = "__rangoActionBind";
|
|
1405
|
+
var ACTION_BIND_HELPER_SOURCE = `var ${ACTION_BIND_HELPER_NAME} = function () {
|
|
1406
|
+
var bound = Function.prototype.bind.apply(this, arguments);
|
|
1407
|
+
if (typeof this.$id === "string") bound.$id = this.$id;
|
|
1408
|
+
if (typeof this.$$id === "string") bound.$$id = this.$$id;
|
|
1409
|
+
bound.bind = ${ACTION_BIND_HELPER_NAME};
|
|
1410
|
+
return bound;
|
|
1411
|
+
};`;
|
|
1404
1412
|
function applyServerReferenceWrapping(code, s, hashToFileMap) {
|
|
1405
1413
|
if (!code.includes("createServerReference(")) {
|
|
1406
1414
|
return false;
|
|
@@ -1425,9 +1433,13 @@ function applyServerReferenceWrapping(code, s, hashToFileMap) {
|
|
|
1425
1433
|
}
|
|
1426
1434
|
}
|
|
1427
1435
|
}
|
|
1428
|
-
const replacement = `(function(fn) { fn.$$id = ${finalIdArg}; return fn; })(${fnCall}(${idArg}${rest}))`;
|
|
1436
|
+
const replacement = `(function(fn) { fn.$$id = ${finalIdArg}; if (!Object.prototype.hasOwnProperty.call(fn, "bind")) fn.bind = ${ACTION_BIND_HELPER_NAME}; return fn; })(${fnCall}(${idArg}${rest}))`;
|
|
1429
1437
|
s.overwrite(start, end, replacement);
|
|
1430
1438
|
}
|
|
1439
|
+
if (hasChanges) {
|
|
1440
|
+
s.prepend(`${ACTION_BIND_HELPER_SOURCE}
|
|
1441
|
+
`);
|
|
1442
|
+
}
|
|
1431
1443
|
return hasChanges;
|
|
1432
1444
|
}
|
|
1433
1445
|
function transformServerReferences(code, sourceId, hashToFileMap) {
|
|
@@ -3698,7 +3710,7 @@ import { resolve } from "node:path";
|
|
|
3698
3710
|
// package.json
|
|
3699
3711
|
var package_default = {
|
|
3700
3712
|
name: "@rangojs/router",
|
|
3701
|
-
version: "0.
|
|
3713
|
+
version: "0.11.0",
|
|
3702
3714
|
description: "Django-inspired RSC router with composable URL patterns",
|
|
3703
3715
|
keywords: [
|
|
3704
3716
|
"react",
|
|
@@ -3707,15 +3719,15 @@ var package_default = {
|
|
|
3707
3719
|
"rsc",
|
|
3708
3720
|
"vite"
|
|
3709
3721
|
],
|
|
3710
|
-
homepage: "https://github.com/
|
|
3722
|
+
homepage: "https://github.com/rangojs/rango#readme",
|
|
3711
3723
|
bugs: {
|
|
3712
|
-
url: "https://github.com/
|
|
3724
|
+
url: "https://github.com/rangojs/rango/issues"
|
|
3713
3725
|
},
|
|
3714
3726
|
license: "MIT",
|
|
3715
3727
|
author: "Ivo Todorov",
|
|
3716
3728
|
repository: {
|
|
3717
3729
|
type: "git",
|
|
3718
|
-
url: "git+https://github.com/
|
|
3730
|
+
url: "git+https://github.com/rangojs/rango.git",
|
|
3719
3731
|
directory: "packages/rangojs-router"
|
|
3720
3732
|
},
|
|
3721
3733
|
bin: {
|
|
@@ -3730,7 +3742,8 @@ var package_default = {
|
|
|
3730
3742
|
"dist",
|
|
3731
3743
|
"skills",
|
|
3732
3744
|
"AGENTS.md",
|
|
3733
|
-
"README.md"
|
|
3745
|
+
"README.md",
|
|
3746
|
+
"LICENSE"
|
|
3734
3747
|
],
|
|
3735
3748
|
type: "module",
|
|
3736
3749
|
exports: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rangojs/router",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "Django-inspired RSC router with composable URL patterns",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -9,15 +9,15 @@
|
|
|
9
9
|
"rsc",
|
|
10
10
|
"vite"
|
|
11
11
|
],
|
|
12
|
-
"homepage": "https://github.com/
|
|
12
|
+
"homepage": "https://github.com/rangojs/rango#readme",
|
|
13
13
|
"bugs": {
|
|
14
|
-
"url": "https://github.com/
|
|
14
|
+
"url": "https://github.com/rangojs/rango/issues"
|
|
15
15
|
},
|
|
16
16
|
"license": "MIT",
|
|
17
17
|
"author": "Ivo Todorov",
|
|
18
18
|
"repository": {
|
|
19
19
|
"type": "git",
|
|
20
|
-
"url": "git+https://github.com/
|
|
20
|
+
"url": "git+https://github.com/rangojs/rango.git",
|
|
21
21
|
"directory": "packages/rangojs-router"
|
|
22
22
|
},
|
|
23
23
|
"bin": {
|
|
@@ -32,7 +32,8 @@
|
|
|
32
32
|
"dist",
|
|
33
33
|
"skills",
|
|
34
34
|
"AGENTS.md",
|
|
35
|
-
"README.md"
|
|
35
|
+
"README.md",
|
|
36
|
+
"LICENSE"
|
|
36
37
|
],
|
|
37
38
|
"type": "module",
|
|
38
39
|
"exports": {
|
|
@@ -150,7 +150,7 @@ The treemap shows nested boxes; box area = uncompressed size. Hover for gzip/bro
|
|
|
150
150
|
|
|
151
151
|
## Reporting Rango regressions
|
|
152
152
|
|
|
153
|
-
If a finding looks like a `@rangojs/router` regression (the framework is shipping more than it should, not your app), open an issue at the [@rangojs/router GitHub](https://github.com/
|
|
153
|
+
If a finding looks like a `@rangojs/router` regression (the framework is shipping more than it should, not your app), open an issue at the [@rangojs/router GitHub](https://github.com/rangojs/rango/issues) and include:
|
|
154
154
|
|
|
155
155
|
- The output of `client.html` / `rsc.html` (screenshots or the JSON `data = {...}` block from the HTML).
|
|
156
156
|
- The `@rangojs/router` version (`pnpm why @rangojs/router`).
|