@rangojs/router 0.0.0-experimental.124 → 0.0.0-experimental.125
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/rango.js +3 -4
- package/dist/vite/index.js +9 -43
- package/package.json +1 -1
- package/skills/hooks/SKILL.md +2 -2
- package/skills/route/SKILL.md +6 -0
- package/src/__internal.ts +0 -65
- package/src/browser/action-coordinator.ts +1 -1
- package/src/browser/action-fence.ts +10 -0
- package/src/browser/event-controller.ts +1 -83
- package/src/browser/navigation-store-handle.ts +3 -4
- package/src/browser/navigation-store.ts +0 -39
- package/src/browser/navigation-transaction.ts +0 -32
- package/src/browser/partial-update.ts +1 -83
- package/src/browser/prefetch/cache.ts +6 -45
- package/src/browser/prefetch/queue.ts +6 -3
- package/src/browser/rango-state.ts +2 -23
- package/src/browser/react/Link.tsx +0 -2
- package/src/browser/react/NavigationProvider.tsx +2 -1
- package/src/browser/react/ScrollRestoration.tsx +10 -6
- package/src/browser/react/filter-segment-order.ts +0 -2
- package/src/browser/react/index.ts +0 -45
- package/src/browser/react/location-state-shared.ts +0 -13
- package/src/browser/react/location-state.ts +0 -1
- package/src/browser/react/use-action.ts +6 -15
- package/src/browser/react/use-handle.ts +0 -5
- package/src/browser/react/use-link-status.ts +0 -4
- package/src/browser/react/use-navigation.ts +0 -3
- package/src/browser/react/use-params.ts +0 -2
- package/src/browser/react/use-search-params.ts +0 -5
- package/src/browser/react/use-segments.ts +0 -13
- package/src/browser/rsc-router.tsx +2 -2
- package/src/browser/types.ts +0 -1
- package/src/browser/validate-redirect-origin.ts +4 -5
- package/src/build/route-trie.ts +3 -0
- package/src/build/route-types/param-extraction.ts +6 -3
- package/src/build/route-types/router-processing.ts +0 -8
- package/src/cache/cache-policy.ts +0 -54
- package/src/cache/cache-runtime.ts +27 -24
- package/src/cache/cache-scope.ts +0 -27
- package/src/cache/cache-tag.ts +0 -37
- package/src/cache/cf/cf-cache-store.ts +72 -45
- package/src/cache/cf/index.ts +0 -24
- package/src/cache/document-cache.ts +0 -36
- package/src/cache/handle-snapshot.ts +0 -40
- package/src/cache/index.ts +0 -27
- package/src/cache/memory-segment-store.ts +0 -52
- package/src/cache/profile-registry.ts +7 -3
- package/src/cache/read-through-swr.ts +41 -11
- package/src/cache/segment-codec.ts +0 -16
- package/src/cache/types.ts +0 -98
- package/src/client.rsc.tsx +1 -22
- package/src/client.tsx +14 -32
- package/src/deps/ssr.ts +0 -1
- package/src/handle.ts +2 -12
- package/src/handles/MetaTags.tsx +0 -14
- package/src/handles/meta.ts +0 -39
- package/src/host/cookie-handler.ts +0 -36
- package/src/host/errors.ts +0 -24
- package/src/host/index.ts +6 -0
- package/src/host/pattern-matcher.ts +7 -50
- package/src/host/router.ts +1 -65
- package/src/host/testing.ts +0 -16
- package/src/host/types.ts +6 -2
- package/src/href-client.ts +0 -4
- package/src/index.rsc.ts +20 -2
- package/src/internal-debug.ts +2 -4
- package/src/loader.rsc.ts +4 -15
- package/src/loader.ts +3 -9
- package/src/network-error-thrower.tsx +1 -6
- package/src/outlet-provider.tsx +1 -5
- package/src/prerender/param-hash.ts +10 -11
- package/src/prerender/store.ts +23 -30
- package/src/prerender.ts +34 -0
- package/src/root-error-boundary.tsx +1 -19
- package/src/route-content-wrapper.tsx +1 -44
- package/src/route-definition/dsl-helpers.ts +7 -19
- package/src/route-definition/helpers-types.ts +3 -3
- package/src/route-definition/redirect.ts +11 -1
- package/src/route-map-builder.ts +0 -16
- package/src/router/content-negotiation.ts +0 -13
- package/src/router/error-handling.ts +12 -16
- package/src/router/find-match.ts +4 -30
- package/src/router/intercept-resolution.ts +10 -1
- package/src/router/lazy-includes.ts +1 -57
- package/src/router/loader-resolution.ts +3 -2
- package/src/router/logging.ts +0 -6
- package/src/router/manifest.ts +1 -25
- package/src/router/match-api.ts +0 -20
- package/src/router/match-context.ts +0 -22
- package/src/router/match-handlers.ts +0 -43
- package/src/router/match-middleware/background-revalidation.ts +0 -7
- package/src/router/match-middleware/cache-lookup.ts +1 -54
- package/src/router/match-middleware/cache-store.ts +0 -31
- package/src/router/match-middleware/intercept-resolution.ts +0 -22
- package/src/router/match-middleware/segment-resolution.ts +0 -21
- package/src/router/match-pipelines.ts +1 -42
- package/src/router/match-result.ts +1 -52
- package/src/router/metrics.ts +0 -34
- package/src/router/middleware-cookies.ts +0 -13
- package/src/router/middleware-types.ts +0 -115
- package/src/router/middleware.ts +7 -30
- package/src/router/navigation-snapshot.ts +0 -51
- package/src/router/params-util.ts +23 -0
- package/src/router/pattern-matching.ts +1 -33
- package/src/router/prerender-match.ts +29 -45
- package/src/router/request-classification.ts +1 -38
- package/src/router/revalidation.ts +5 -58
- package/src/router/router-context.ts +0 -26
- package/src/router/segment-resolution/fresh.ts +25 -57
- package/src/router/segment-resolution/helpers.ts +34 -0
- package/src/router/segment-resolution/loader-cache.ts +10 -13
- package/src/router/segment-resolution/revalidation.ts +5 -42
- package/src/router/segment-resolution/streamed-handler-telemetry.ts +52 -0
- package/src/router/segment-resolution.ts +4 -1
- package/src/router/telemetry-otel.ts +0 -20
- package/src/router/telemetry.ts +0 -22
- package/src/router/timeout.ts +0 -20
- package/src/router/trie-matching.ts +63 -40
- package/src/router/types.ts +1 -63
- package/src/router/url-params.ts +0 -5
- package/src/router.ts +4 -2
- package/src/rsc/handler.ts +11 -2
- package/src/rsc/helpers.ts +15 -0
- package/src/rsc/origin-guard.ts +0 -12
- package/src/rsc/progressive-enhancement.ts +2 -1
- package/src/rsc/rsc-rendering.ts +2 -7
- package/src/rsc/runtime-warnings.ts +14 -0
- package/src/rsc/server-action.ts +30 -28
- package/src/rsc/types.ts +0 -1
- package/src/search-params.ts +0 -16
- package/src/segment-loader-promise.ts +14 -2
- package/src/segment-system.tsx +79 -88
- package/src/server/handle-store.ts +7 -24
- package/src/server/loader-registry.ts +5 -24
- package/src/server/request-context.ts +6 -78
- package/src/ssr/index.tsx +14 -14
- package/src/static-handler.ts +2 -27
- package/src/testing/cache-status.ts +0 -47
- package/src/testing/collect-handle.ts +1 -24
- package/src/testing/e2e/index.ts +0 -22
- package/src/testing/e2e/matchers.ts +0 -16
- package/src/testing/flight-matchers.ts +0 -13
- package/src/testing/flight-normalize.ts +3 -30
- package/src/testing/flight.ts +0 -48
- package/src/testing/generated-routes.ts +1 -41
- package/src/testing/index.ts +0 -21
- package/src/testing/internal/context.ts +3 -45
- package/src/testing/internal/seed-vars.ts +0 -26
- package/src/testing/render-handler.ts +0 -49
- package/src/testing/render-route.tsx +0 -90
- package/src/testing/run-loader.ts +0 -96
- package/src/testing/run-middleware.ts +0 -26
- package/src/theme/ThemeProvider.tsx +0 -52
- package/src/theme/ThemeScript.tsx +0 -6
- package/src/theme/constants.ts +0 -12
- package/src/theme/index.ts +0 -7
- package/src/theme/theme-context.ts +1 -5
- package/src/theme/theme-script.ts +0 -14
- package/src/theme/use-theme.ts +0 -3
- package/src/types/boundaries.ts +0 -35
- package/src/types/error-types.ts +25 -89
- package/src/types/global-namespace.ts +4 -14
- package/src/types/handler-context.ts +0 -8
- package/src/types/index.ts +0 -10
- package/src/types/request-scope.ts +0 -19
- package/src/types/route-config.ts +6 -50
- package/src/types/route-entry.ts +0 -6
- package/src/types/segments.ts +0 -13
- package/src/urls/include-helper.ts +0 -4
- package/src/urls/index.ts +0 -6
- package/src/urls/path-helper-types.ts +2 -2
- package/src/urls/path-helper.ts +0 -54
- package/src/urls/urls-function.ts +0 -13
- package/src/use-loader.tsx +0 -186
- package/src/vite/discovery/bundle-postprocess.ts +2 -1
- package/src/vite/discovery/discover-routers.ts +6 -7
- package/src/vite/discovery/virtual-module-codegen.ts +1 -11
- package/src/vite/plugin-types.ts +3 -1
- package/src/vite/plugins/cjs-to-esm.ts +0 -11
- package/src/vite/plugins/client-ref-dedup.ts +0 -11
- package/src/vite/plugins/client-ref-hashing.ts +0 -10
- package/src/vite/plugins/cloudflare-protocol-stub.ts +0 -20
- package/src/vite/plugins/expose-action-id.ts +2 -73
- package/src/vite/plugins/expose-id-utils.ts +0 -55
- package/src/vite/plugins/expose-ids/export-analysis.ts +0 -38
- package/src/vite/plugins/expose-ids/handler-transform.ts +0 -15
- package/src/vite/plugins/expose-ids/loader-transform.ts +0 -15
- package/src/vite/plugins/expose-ids/router-transform.ts +0 -13
- package/src/vite/plugins/expose-internal-ids.ts +10 -0
- package/src/vite/plugins/performance-tracks.ts +0 -3
- package/src/vite/plugins/use-cache-transform.ts +0 -36
- package/src/vite/plugins/version-injector.ts +0 -20
- package/src/vite/plugins/version-plugin.ts +1 -49
- package/src/vite/plugins/virtual-entries.ts +0 -15
- package/src/vite/rango.ts +1 -108
- package/src/vite/router-discovery.ts +2 -1
- package/src/vite/utils/ast-handler-extract.ts +0 -16
- package/src/vite/utils/bundle-analysis.ts +6 -13
- package/src/vite/utils/client-chunks.ts +0 -6
- package/src/vite/utils/forward-user-plugins.ts +0 -22
- package/src/vite/utils/manifest-utils.ts +0 -4
- package/src/vite/utils/package-resolution.ts +1 -73
- package/src/vite/utils/prerender-utils.ts +0 -35
- package/src/vite/utils/shared-utils.ts +3 -35
- 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/src/browser/shallow.ts +0 -40
|
@@ -30,11 +30,6 @@ const CACHE_RUNTIME_IMPORT = "@rangojs/router/cache-runtime";
|
|
|
30
30
|
// and should not be wrapped (children can't be cache-keyed).
|
|
31
31
|
const LAYOUT_TEMPLATE_PATTERN = /\/(layout|template)\.(tsx?|jsx?)$/;
|
|
32
32
|
|
|
33
|
-
/**
|
|
34
|
-
* Grammar for a valid function-level directive: `use cache` optionally followed
|
|
35
|
-
* by `: <profile-name>`. The single source of truth for both the transform and
|
|
36
|
-
* the near-miss validator below.
|
|
37
|
-
*/
|
|
38
33
|
export const USE_CACHE_DIRECTIVE_RE: RegExp = /^use cache(:\s*[\w-]+)?$/;
|
|
39
34
|
|
|
40
35
|
export function useCacheTransform(): Plugin {
|
|
@@ -72,7 +67,6 @@ export function useCacheTransform(): Plugin {
|
|
|
72
67
|
|
|
73
68
|
const start = counter ? performance.now() : 0;
|
|
74
69
|
try {
|
|
75
|
-
// Lazy-load transform helpers
|
|
76
70
|
if (!rscTransforms) {
|
|
77
71
|
try {
|
|
78
72
|
rscTransforms = await import("@vitejs/plugin-rsc/transforms");
|
|
@@ -87,7 +81,6 @@ export function useCacheTransform(): Plugin {
|
|
|
87
81
|
transformHoistInlineDirective,
|
|
88
82
|
} = rscTransforms;
|
|
89
83
|
|
|
90
|
-
// Parse AST
|
|
91
84
|
let ast: any;
|
|
92
85
|
try {
|
|
93
86
|
const { parseAst } = await import("vite");
|
|
@@ -99,7 +92,6 @@ export function useCacheTransform(): Plugin {
|
|
|
99
92
|
const filePath = normalizePath(path.relative(projectRoot, id));
|
|
100
93
|
const isLayoutOrTemplate = LAYOUT_TEMPLATE_PATTERN.test(id);
|
|
101
94
|
|
|
102
|
-
// Check for file-level "use cache"
|
|
103
95
|
if (hasDirective(ast.body, "use cache")) {
|
|
104
96
|
return transformFileLevelUseCache(
|
|
105
97
|
code,
|
|
@@ -112,8 +104,6 @@ export function useCacheTransform(): Plugin {
|
|
|
112
104
|
);
|
|
113
105
|
}
|
|
114
106
|
|
|
115
|
-
// Check for function-level "use cache" / "use cache: profileName"
|
|
116
|
-
// (only if there's no file-level directive but code still contains the string)
|
|
117
107
|
const functionResult = transformFunctionLevelUseCache(
|
|
118
108
|
code,
|
|
119
109
|
ast,
|
|
@@ -123,9 +113,6 @@ export function useCacheTransform(): Plugin {
|
|
|
123
113
|
transformHoistInlineDirective,
|
|
124
114
|
);
|
|
125
115
|
|
|
126
|
-
// Check for near-miss directives on the function-level path. The
|
|
127
|
-
// file-level branch above returns earlier (it wraps every export
|
|
128
|
-
// regardless), so this runs only when there is no file-level directive.
|
|
129
116
|
warnOnNearMissDirectives(ast, id, this.warn.bind(this));
|
|
130
117
|
|
|
131
118
|
if (functionResult) return functionResult;
|
|
@@ -145,7 +132,6 @@ function transformFileLevelUseCache(
|
|
|
145
132
|
isLayoutOrTemplate: boolean,
|
|
146
133
|
transformWrapExport: (typeof import("@vitejs/plugin-rsc/transforms"))["transformWrapExport"],
|
|
147
134
|
) {
|
|
148
|
-
// Collect non-function exports to report after wrapping
|
|
149
135
|
const nonFunctionExports: string[] = [];
|
|
150
136
|
|
|
151
137
|
const { exportNames, output } = transformWrapExport(code, ast, {
|
|
@@ -155,9 +141,7 @@ function transformFileLevelUseCache(
|
|
|
155
141
|
},
|
|
156
142
|
rejectNonAsyncFunction: false,
|
|
157
143
|
filter: (name: string, meta: { isFunction?: boolean }) => {
|
|
158
|
-
// Skip default export of layout/template files (they receive children)
|
|
159
144
|
if (name === "default" && isLayoutOrTemplate) return false;
|
|
160
|
-
// Non-function exports cannot be wrapped with registerCachedFunction
|
|
161
145
|
if (meta.isFunction === false) {
|
|
162
146
|
nonFunctionExports.push(name);
|
|
163
147
|
return false;
|
|
@@ -178,7 +162,6 @@ function transformFileLevelUseCache(
|
|
|
178
162
|
}
|
|
179
163
|
|
|
180
164
|
if (exportNames.length === 0) {
|
|
181
|
-
// Even if no exports were wrapped, strip the directive
|
|
182
165
|
const s = new MagicString(code);
|
|
183
166
|
const directive = findFileLevelDirective(ast);
|
|
184
167
|
if (directive) {
|
|
@@ -195,12 +178,10 @@ function transformFileLevelUseCache(
|
|
|
195
178
|
return;
|
|
196
179
|
}
|
|
197
180
|
|
|
198
|
-
// Prepend the import
|
|
199
181
|
output.prepend(
|
|
200
182
|
`import { registerCachedFunction as __rango_registerCachedFunction } from ${JSON.stringify(CACHE_RUNTIME_IMPORT)};\n`,
|
|
201
183
|
);
|
|
202
184
|
|
|
203
|
-
// Replace the directive with a comment
|
|
204
185
|
const directive = findFileLevelDirective(ast);
|
|
205
186
|
if (directive) {
|
|
206
187
|
output.overwrite(
|
|
@@ -244,9 +225,6 @@ function transformFunctionLevelUseCache(
|
|
|
244
225
|
|
|
245
226
|
if (names.length === 0) return;
|
|
246
227
|
|
|
247
|
-
// Use a top-level import instead of await import() — the hoisted wrapper
|
|
248
|
-
// may be placed in a non-async context (e.g., inside a synchronous
|
|
249
|
-
// urls() callback) where await is not allowed.
|
|
250
228
|
output.prepend(
|
|
251
229
|
`import { registerCachedFunction as __rango_registerCachedFunction } from ${JSON.stringify(CACHE_RUNTIME_IMPORT)};\n`,
|
|
252
230
|
);
|
|
@@ -261,9 +239,6 @@ function transformFunctionLevelUseCache(
|
|
|
261
239
|
}
|
|
262
240
|
}
|
|
263
241
|
|
|
264
|
-
/**
|
|
265
|
-
* Find the file-level "use cache" directive AST node for removal.
|
|
266
|
-
*/
|
|
267
242
|
function findFileLevelDirective(
|
|
268
243
|
ast: any,
|
|
269
244
|
): { start: number; end: number } | null {
|
|
@@ -280,18 +255,8 @@ function findFileLevelDirective(
|
|
|
280
255
|
return null;
|
|
281
256
|
}
|
|
282
257
|
|
|
283
|
-
/**
|
|
284
|
-
* Regex for near-miss: starts with "use cache:" but has invalid tokens.
|
|
285
|
-
*/
|
|
286
258
|
const NEAR_MISS_RE = /^use cache:\s*.+$/;
|
|
287
259
|
|
|
288
|
-
/**
|
|
289
|
-
* Walk the AST looking for string literals that look like malformed
|
|
290
|
-
* "use cache" directives and emit a Vite warning for each.
|
|
291
|
-
*
|
|
292
|
-
* This catches cases like `"use cache: bad.name"` or `"use cache: "`
|
|
293
|
-
* that the transform regex silently ignores.
|
|
294
|
-
*/
|
|
295
260
|
function warnOnNearMissDirectives(
|
|
296
261
|
ast: any,
|
|
297
262
|
fileId: string,
|
|
@@ -319,7 +284,6 @@ function warnOnNearMissDirectives(
|
|
|
319
284
|
}
|
|
320
285
|
}
|
|
321
286
|
|
|
322
|
-
// Walk into function bodies where directives appear
|
|
323
287
|
for (const key of Object.keys(node)) {
|
|
324
288
|
const child = node[key];
|
|
325
289
|
if (Array.isArray(child)) {
|
|
@@ -29,7 +29,6 @@ export function createVersionInjectorPlugin(
|
|
|
29
29
|
|
|
30
30
|
transform(code, id) {
|
|
31
31
|
if (!resolvedEntryPath) return null;
|
|
32
|
-
// Only transform the RSC entry file
|
|
33
32
|
const normalizedId = Vite.normalizePath(id);
|
|
34
33
|
const normalizedEntry = Vite.normalizePath(resolvedEntryPath);
|
|
35
34
|
|
|
@@ -37,25 +36,10 @@ export function createVersionInjectorPlugin(
|
|
|
37
36
|
return null;
|
|
38
37
|
}
|
|
39
38
|
|
|
40
|
-
// Always prepend `import "virtual:rsc-router/routes-manifest"` as the
|
|
41
|
-
// first side-effect import. The manifest virtual module's `load()` hook
|
|
42
|
-
// awaits `s.discoveryDone` so that, by the time the rest of the entry
|
|
43
|
-
// including any module-level `router.reverse()` calls under `./router.js`
|
|
44
|
-
// evaluates, runtime discovery has rewritten `router.named-routes.gen.ts`
|
|
45
|
-
// with the full route table.
|
|
46
|
-
//
|
|
47
|
-
// ES module evaluation order matters here: while imports are *parsed*
|
|
48
|
-
// hoisted, side-effect imports are evaluated in source order in the
|
|
49
|
-
// dependency graph. A user-authored `import "virtual:rsc-router/..."`
|
|
50
|
-
// placed after `import "./router.js"` runs too late: the manifest
|
|
51
|
-
// gate fires after router.tsx has already crashed on a stale gen file.
|
|
52
|
-
// We always prepend; ESM dedups any user-written duplicate, so module
|
|
53
|
-
// initialization still runs once.
|
|
54
39
|
const prepend: string[] = [
|
|
55
40
|
`import "virtual:rsc-router/routes-manifest";`,
|
|
56
41
|
];
|
|
57
42
|
|
|
58
|
-
// Auto-inject VERSION if file uses createRSCHandler without version
|
|
59
43
|
let newCode = code;
|
|
60
44
|
const needsVersion =
|
|
61
45
|
code.includes("createRSCHandler") &&
|
|
@@ -70,10 +54,6 @@ export function createVersionInjectorPlugin(
|
|
|
70
54
|
);
|
|
71
55
|
}
|
|
72
56
|
|
|
73
|
-
// Insert after any leading `/// <reference ... />` triple-slash
|
|
74
|
-
// directives (and surrounding blank lines). TypeScript requires those
|
|
75
|
-
// directives to precede all other code; putting our imports above
|
|
76
|
-
// them silently demotes the directives to plain comments.
|
|
77
57
|
const lines = newCode.split("\n");
|
|
78
58
|
let insertAt = 0;
|
|
79
59
|
while (insertAt < lines.length) {
|
|
@@ -138,8 +138,6 @@ export function createVersionPlugin(): Plugin {
|
|
|
138
138
|
|
|
139
139
|
let versionCounter = 0;
|
|
140
140
|
const bumpVersion = (reason: string) => {
|
|
141
|
-
// Use timestamp + counter to guarantee uniqueness even when multiple
|
|
142
|
-
// bumps happen within the same millisecond (e.g. cascading HMR events).
|
|
143
141
|
currentVersion = Date.now().toString(16) + String(++versionCounter);
|
|
144
142
|
console.log(`[rango] ${reason}, version updated: ${currentVersion}`);
|
|
145
143
|
|
|
@@ -158,9 +156,6 @@ export function createVersionPlugin(): Plugin {
|
|
|
158
156
|
|
|
159
157
|
configResolved(config) {
|
|
160
158
|
isDev = config.command === "serve";
|
|
161
|
-
// Capture the resolved cacheDir so we can ignore optimizer-output
|
|
162
|
-
// writes inside it. Vite resolves cacheDir against the project root,
|
|
163
|
-
// so this is a stable absolute path for the lifetime of the server.
|
|
164
159
|
resolvedCacheDir = config.cacheDir
|
|
165
160
|
? String(config.cacheDir).replace(/\\/g, "/")
|
|
166
161
|
: undefined;
|
|
@@ -210,27 +205,15 @@ export function createVersionPlugin(): Plugin {
|
|
|
210
205
|
return null;
|
|
211
206
|
},
|
|
212
207
|
|
|
213
|
-
// Track RSC module changes and update version
|
|
214
208
|
async hotUpdate(ctx) {
|
|
215
209
|
if (!isDev) return;
|
|
216
210
|
|
|
217
|
-
// Check if this is an RSC environment update (not client/ssr)
|
|
218
|
-
// RSC modules affect server-rendered content and cached payloads
|
|
219
|
-
// In Vite 6, environment is accessed via `this.environment`
|
|
220
211
|
const isRscModule = this.environment?.name === "rsc";
|
|
221
212
|
|
|
222
213
|
if (!isRscModule) return;
|
|
223
214
|
|
|
224
|
-
// Skip Vite's own pre-bundled dep cache writes. The optimizer rewrites
|
|
225
|
-
// files inside the configured `cacheDir` on every discovery cycle
|
|
226
|
-
// (and when other dev servers under the same cwd populate their own
|
|
227
|
-
// isolated cache dirs). These are not user-source changes, so bumping
|
|
228
|
-
// the app version on them produces spurious version mismatches that
|
|
229
|
-
// surface as forced reloads on in-flight actions.
|
|
230
215
|
if (isViteDepCachePath(ctx.file, resolvedCacheDir)) return;
|
|
231
216
|
|
|
232
|
-
// Skip re-bumping when the version virtual module itself is invalidated
|
|
233
|
-
// (our own bumpVersion() invalidates it, which re-triggers hotUpdate).
|
|
234
217
|
if (
|
|
235
218
|
ctx.modules.length === 1 &&
|
|
236
219
|
ctx.modules[0].id === "\0" + VIRTUAL_IDS.version
|
|
@@ -245,9 +228,6 @@ export function createVersionPlugin(): Plugin {
|
|
|
245
228
|
const source = await ctx.read();
|
|
246
229
|
const nextSignature = getClientModuleSignature(source);
|
|
247
230
|
if (nextSignature) {
|
|
248
|
-
// "use client" file — compare export signatures.
|
|
249
|
-
// client-component-hmr may have cleared ctx.modules, so we
|
|
250
|
-
// cannot rely on ctx.modules.length for these files.
|
|
251
231
|
clientModuleSignatures.set(filePath, nextSignature);
|
|
252
232
|
if (
|
|
253
233
|
previousSignature &&
|
|
@@ -258,20 +238,11 @@ export function createVersionPlugin(): Plugin {
|
|
|
258
238
|
} else {
|
|
259
239
|
clientModuleSignatures.delete(filePath);
|
|
260
240
|
if (!previousSignature) {
|
|
261
|
-
// Not and never was "use client" — use module graph check.
|
|
262
|
-
// ctx.modules is reliable for pure server files (only
|
|
263
|
-
// client-component-hmr clears it for "use client" modules).
|
|
264
241
|
if (ctx.modules.length === 0) return;
|
|
265
242
|
}
|
|
266
|
-
// Was "use client" but directive removed — boundary changed,
|
|
267
|
-
// bump below.
|
|
268
243
|
}
|
|
269
|
-
} catch {
|
|
270
|
-
// Fail open: if we can't read or parse the update, invalidate.
|
|
271
|
-
}
|
|
244
|
+
} catch {}
|
|
272
245
|
} else {
|
|
273
|
-
// Non-code file (json, css, etc.) — only bump if it's actually
|
|
274
|
-
// referenced by the RSC module graph.
|
|
275
246
|
if (ctx.modules.length === 0) return;
|
|
276
247
|
}
|
|
277
248
|
|
|
@@ -280,20 +251,6 @@ export function createVersionPlugin(): Plugin {
|
|
|
280
251
|
};
|
|
281
252
|
}
|
|
282
253
|
|
|
283
|
-
/**
|
|
284
|
-
* Match Vite's pre-bundled dep cache directories. These paths are rewritten
|
|
285
|
-
* by the dep optimizer (and by isolated test fixtures sharing the same cwd),
|
|
286
|
-
* not by user source changes, so they should not bump the app version (which
|
|
287
|
-
* would force a client reload mid-request).
|
|
288
|
-
*
|
|
289
|
-
* Two checks:
|
|
290
|
-
* 1. Anything inside the resolved `cacheDir` (precise — covers custom paths
|
|
291
|
-
* like the `RANGO_E2E_VITE_CACHE_DIR` overrides in the test fixtures).
|
|
292
|
-
* 2. Heuristic match for any `node_modules/.vite*` directory or a
|
|
293
|
-
* `.vite-isolated/` segment anywhere in the path. This catches the
|
|
294
|
-
* *other* dev servers in the same cwd whose cacheDir we cannot read
|
|
295
|
-
* (we only see config of the server we're attached to).
|
|
296
|
-
*/
|
|
297
254
|
export function isViteDepCachePath(
|
|
298
255
|
filePath: string | undefined,
|
|
299
256
|
cacheDir?: string,
|
|
@@ -311,11 +268,6 @@ export function isViteDepCachePath(
|
|
|
311
268
|
}
|
|
312
269
|
}
|
|
313
270
|
|
|
314
|
-
// Vite/optimizer convention: cache dirs always sit directly under
|
|
315
|
-
// `node_modules/` and start with `.vite` (e.g. `.vite`, `.vite-temp`,
|
|
316
|
-
// `.vite_rango_generate`, `.vite-e2e-test-app`). The `/.vite-isolated/`
|
|
317
|
-
// segment covers the test-fixture pattern that places the cache outside
|
|
318
|
-
// node_modules.
|
|
319
271
|
return (
|
|
320
272
|
/\/node_modules\/\.vite[^/]*\//.test(normalized) ||
|
|
321
273
|
normalized.includes("/.vite-isolated/")
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Default virtual entry file contents for rsc-router.
|
|
3
|
-
* These are used when users don't provide their own entry files.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
1
|
export const VIRTUAL_ENTRY_BROWSER: string = `
|
|
7
2
|
import {
|
|
8
3
|
createFromReadableStream,
|
|
@@ -51,9 +46,6 @@ export const renderHTML = createSSRHandler({
|
|
|
51
46
|
});
|
|
52
47
|
`.trim();
|
|
53
48
|
|
|
54
|
-
/**
|
|
55
|
-
* Generate the RSC entry content with the specified router path
|
|
56
|
-
*/
|
|
57
49
|
export function getVirtualEntryRSC(routerPath: string): string {
|
|
58
50
|
return `
|
|
59
51
|
import {
|
|
@@ -104,9 +96,6 @@ export default function handler(request, env) {
|
|
|
104
96
|
`.trim();
|
|
105
97
|
}
|
|
106
98
|
|
|
107
|
-
/**
|
|
108
|
-
* Virtual module IDs
|
|
109
|
-
*/
|
|
110
99
|
export const VIRTUAL_IDS = {
|
|
111
100
|
browser: "virtual:rsc-router/entry.browser.js",
|
|
112
101
|
ssr: "virtual:rsc-router/entry.ssr.js",
|
|
@@ -114,10 +103,6 @@ export const VIRTUAL_IDS = {
|
|
|
114
103
|
version: "@rangojs/router:version",
|
|
115
104
|
} as const;
|
|
116
105
|
|
|
117
|
-
/**
|
|
118
|
-
* Virtual module content for version.
|
|
119
|
-
* Exports VERSION - a timestamp that changes on server restart (dev) or at build time (production).
|
|
120
|
-
*/
|
|
121
106
|
export function getVirtualVersionContent(version: string): string {
|
|
122
107
|
return `export const VERSION = ${JSON.stringify(version)};`;
|
|
123
108
|
}
|
package/src/vite/rango.ts
CHANGED
|
@@ -66,18 +66,7 @@ export async function rango(options?: RangoOptions): Promise<PluginOption[]> {
|
|
|
66
66
|
const resolvedOptions: RangoOptions = options ?? { preset: "node" };
|
|
67
67
|
const preset = resolvedOptions.preset ?? "node";
|
|
68
68
|
const showBanner = resolvedOptions.banner ?? true;
|
|
69
|
-
// Client-chunking strategy (per-route/per-feature splitting of the browser
|
|
70
|
-
// bundle). Defaults to the built-in directory strategy (`true`) pre-1.0; pass
|
|
71
|
-
// `clientChunks: false` to opt out. Resolved once and forwarded to
|
|
72
|
-
// @vitejs/plugin-rsc in both presets. The built-in strategy only splits where it
|
|
73
|
-
// recognizes a route structure, so this default is a no-op for flat / host-split
|
|
74
|
-
// apps and never duplicates the shared runtime.
|
|
75
69
|
const clientChunksOption = resolvedOptions.clientChunks ?? true;
|
|
76
|
-
// Shared context the built-in strategy reads at build time: the production
|
|
77
|
-
// hashes of registered error/notFound fallback modules (-> app-fallback).
|
|
78
|
-
// Populated by the discovery plugin in buildStart, before the client build
|
|
79
|
-
// invokes the strategy. Only wired when the built-in strategy is active; a
|
|
80
|
-
// custom function owns its own grouping.
|
|
81
70
|
const useBuiltInClientChunks = clientChunksOption === true;
|
|
82
71
|
const clientChunkCtx: ClientChunkContext | undefined = useBuiltInClientChunks
|
|
83
72
|
? { fallbackRefs: new Set<string>() }
|
|
@@ -124,14 +113,8 @@ export async function rango(options?: RangoOptions): Promise<PluginOption[]> {
|
|
|
124
113
|
const prerenderEnabled = true;
|
|
125
114
|
|
|
126
115
|
if (preset === "cloudflare") {
|
|
127
|
-
// Cloudflare preset: configure entries for cloudflare worker setup
|
|
128
|
-
// Router is not needed here - worker.rsc.tsx imports it directly
|
|
129
|
-
|
|
130
|
-
// Dynamically import @vitejs/plugin-rsc
|
|
131
116
|
const { default: rsc } = await import("@vitejs/plugin-rsc");
|
|
132
117
|
|
|
133
|
-
// Only client and ssr entries - rsc entry is handled by cloudflare plugin
|
|
134
|
-
// Always use virtual modules for cloudflare preset
|
|
135
118
|
const finalEntries: { client: string; ssr: string } = {
|
|
136
119
|
client: VIRTUAL_IDS.browser,
|
|
137
120
|
ssr: VIRTUAL_IDS.ssr,
|
|
@@ -142,10 +125,7 @@ export async function rango(options?: RangoOptions): Promise<PluginOption[]> {
|
|
|
142
125
|
enforce: "pre",
|
|
143
126
|
|
|
144
127
|
config() {
|
|
145
|
-
// Configure environments for cloudflare deployment
|
|
146
128
|
return {
|
|
147
|
-
// Exclude rsc-router modules from optimization to prevent module duplication
|
|
148
|
-
// This ensures the same Context instance is used by both browser entry and RSC proxy modules
|
|
149
129
|
optimizeDeps: {
|
|
150
130
|
exclude: excludeDeps,
|
|
151
131
|
rolldownOptions: sharedRolldownOptions,
|
|
@@ -168,21 +148,12 @@ export async function rango(options?: RangoOptions): Promise<PluginOption[]> {
|
|
|
168
148
|
client: {
|
|
169
149
|
build: {
|
|
170
150
|
rollupOptions: {
|
|
171
|
-
// FILE_NAME_CONFLICT (and any other client-build warning) is
|
|
172
|
-
// emitted by the CLIENT environment build, which consults THIS
|
|
173
|
-
// env's onwarn -- Vite 8's environment builds do NOT propagate
|
|
174
|
-
// the top-level build.rollupOptions.onwarn into the client env.
|
|
175
|
-
// Wire it here so the suppression runs where the conflicts
|
|
176
|
-
// originate (the top-level handler is invoked 0x for these; the
|
|
177
|
-
// client-env handler is invoked for all of them).
|
|
178
151
|
onwarn,
|
|
179
152
|
output: {
|
|
180
153
|
manualChunks: getManualChunks,
|
|
181
154
|
},
|
|
182
155
|
},
|
|
183
156
|
},
|
|
184
|
-
// Pre-bundle rsc-html-stream to prevent discovery during first request
|
|
185
|
-
// Exclude rsc-router modules to ensure same Context instance
|
|
186
157
|
optimizeDeps: {
|
|
187
158
|
include: [nested("rsc-html-stream/client")],
|
|
188
159
|
exclude: excludeDeps,
|
|
@@ -190,12 +161,9 @@ export async function rango(options?: RangoOptions): Promise<PluginOption[]> {
|
|
|
190
161
|
},
|
|
191
162
|
},
|
|
192
163
|
ssr: {
|
|
193
|
-
// Build SSR inside RSC directory so wrangler can deploy self-contained dist/rsc
|
|
194
164
|
build: {
|
|
195
165
|
outDir: "./dist/rsc/ssr",
|
|
196
166
|
},
|
|
197
|
-
// Pre-bundle SSR entry and React for proper module linking with childEnvironments
|
|
198
|
-
// All deps must be listed to avoid late discovery triggering ERR_OUTDATED_OPTIMIZED_DEP
|
|
199
167
|
optimizeDeps: {
|
|
200
168
|
entries: [finalEntries.ssr],
|
|
201
169
|
include: [
|
|
@@ -215,10 +183,7 @@ export async function rango(options?: RangoOptions): Promise<PluginOption[]> {
|
|
|
215
183
|
},
|
|
216
184
|
},
|
|
217
185
|
rsc: {
|
|
218
|
-
// RSC environment needs exclude list and esbuild options
|
|
219
|
-
// Exclude rsc-router modules to prevent createContext in RSC environment
|
|
220
186
|
optimizeDeps: {
|
|
221
|
-
// Pre-bundle all RSC deps to prevent late discovery triggering ERR_OUTDATED_OPTIMIZED_DEP
|
|
222
187
|
include: [
|
|
223
188
|
"react",
|
|
224
189
|
"react/jsx-runtime",
|
|
@@ -249,13 +214,7 @@ export async function rango(options?: RangoOptions): Promise<PluginOption[]> {
|
|
|
249
214
|
});
|
|
250
215
|
|
|
251
216
|
plugins.push(createVirtualEntriesPlugin(finalEntries));
|
|
252
|
-
|
|
253
|
-
// Dev-only: RSDW client patch for React Performance Tracks
|
|
254
217
|
plugins.push(performanceTracksPlugin());
|
|
255
|
-
|
|
256
|
-
// Add RSC plugin with cloudflare-specific options
|
|
257
|
-
// Note: loadModuleDevProxy should NOT be used with childEnvironments
|
|
258
|
-
// since SSR runs in workerd alongside RSC
|
|
259
218
|
plugins.push(
|
|
260
219
|
rsc({
|
|
261
220
|
entries: finalEntries,
|
|
@@ -263,13 +222,8 @@ export async function rango(options?: RangoOptions): Promise<PluginOption[]> {
|
|
|
263
222
|
clientChunks,
|
|
264
223
|
}) as PluginOption,
|
|
265
224
|
);
|
|
266
|
-
|
|
267
|
-
// Deduplicate client references from third-party packages in dev mode.
|
|
268
|
-
// Prevents module duplication when server components import "use client"
|
|
269
|
-
// packages that are also imported directly by client components.
|
|
270
225
|
plugins.push(clientRefDedup());
|
|
271
226
|
} else {
|
|
272
|
-
// Auto-discover router using Vite's resolved root (not process.cwd())
|
|
273
227
|
plugins.push({
|
|
274
228
|
name: "@rangojs/router:auto-discover",
|
|
275
229
|
config(userConfig) {
|
|
@@ -292,18 +246,15 @@ export async function rango(options?: RangoOptions): Promise<PluginOption[]> {
|
|
|
292
246
|
.join("\n");
|
|
293
247
|
throw new Error(`[rango] Multiple routers found:\n${list}`);
|
|
294
248
|
}
|
|
295
|
-
// 0 found: routerRef.path stays undefined, warn at startup via discovery plugin
|
|
296
249
|
},
|
|
297
250
|
});
|
|
298
251
|
|
|
299
|
-
// Always use virtual entries for client, ssr, and rsc
|
|
300
252
|
const finalEntries = {
|
|
301
253
|
client: VIRTUAL_IDS.browser,
|
|
302
254
|
ssr: VIRTUAL_IDS.ssr,
|
|
303
255
|
rsc: VIRTUAL_IDS.rsc,
|
|
304
256
|
};
|
|
305
257
|
|
|
306
|
-
// Dynamically import @vitejs/plugin-rsc
|
|
307
258
|
const { default: rsc } = await import("@vitejs/plugin-rsc");
|
|
308
259
|
|
|
309
260
|
let hasWarnedDuplicate = false;
|
|
@@ -336,13 +287,6 @@ export async function rango(options?: RangoOptions): Promise<PluginOption[]> {
|
|
|
336
287
|
client: {
|
|
337
288
|
build: {
|
|
338
289
|
rollupOptions: {
|
|
339
|
-
// FILE_NAME_CONFLICT (and any other client-build warning) is
|
|
340
|
-
// emitted by the CLIENT environment build, which consults THIS
|
|
341
|
-
// env's onwarn -- Vite 8's environment builds do NOT propagate
|
|
342
|
-
// the top-level build.rollupOptions.onwarn into the client env.
|
|
343
|
-
// Wire it here so the suppression runs where the conflicts
|
|
344
|
-
// originate (the top-level handler is invoked 0x for these; the
|
|
345
|
-
// client-env handler is invoked for all of them).
|
|
346
290
|
onwarn,
|
|
347
291
|
output: {
|
|
348
292
|
manualChunks: getManualChunks,
|
|
@@ -423,36 +367,17 @@ export async function rango(options?: RangoOptions): Promise<PluginOption[]> {
|
|
|
423
367
|
},
|
|
424
368
|
});
|
|
425
369
|
|
|
426
|
-
// Add virtual entries plugin (RSC entry generated lazily from routerRef)
|
|
427
370
|
plugins.push(createVirtualEntriesPlugin(finalEntries, routerRef));
|
|
428
|
-
|
|
429
|
-
// Dev-only: RSDW client patch for React Performance Tracks
|
|
430
371
|
plugins.push(performanceTracksPlugin());
|
|
431
|
-
|
|
432
372
|
plugins.push(
|
|
433
373
|
rsc({
|
|
434
374
|
entries: finalEntries,
|
|
435
375
|
clientChunks,
|
|
436
376
|
}) as PluginOption,
|
|
437
377
|
);
|
|
438
|
-
|
|
439
|
-
// Deduplicate client references from third-party packages in dev mode.
|
|
440
|
-
// Prevents module duplication when server components import "use client"
|
|
441
|
-
// packages that are also imported directly by client components.
|
|
442
378
|
plugins.push(clientRefDedup());
|
|
443
379
|
}
|
|
444
380
|
|
|
445
|
-
// Fix HMR for "use client" components.
|
|
446
|
-
//
|
|
447
|
-
// @vitejs/plugin-rsc's hotUpdate returns undefined for "use client" files
|
|
448
|
-
// in the RSC environment. Vite then tries to propagate through the RSC
|
|
449
|
-
// module graph, but the proxy module has no import.meta.hot.accept()
|
|
450
|
-
// boundary, causing a full page reload. The client env would handle it
|
|
451
|
-
// fine via React Refresh, but the RSC env's full-reload arrives first.
|
|
452
|
-
//
|
|
453
|
-
// Fix: in the RSC env, return [] for "use client" files to signal
|
|
454
|
-
// "handled, nothing to propagate". The client env is left alone so
|
|
455
|
-
// React Refresh processes the update normally.
|
|
456
381
|
plugins.push({
|
|
457
382
|
name: "@rangojs/router:client-component-hmr",
|
|
458
383
|
hotUpdate(ctx) {
|
|
@@ -476,59 +401,27 @@ export async function rango(options?: RangoOptions): Promise<PluginOption[]> {
|
|
|
476
401
|
trimmed.startsWith('"use client"') ||
|
|
477
402
|
trimmed.startsWith("'use client'")
|
|
478
403
|
) {
|
|
479
|
-
// Consume the update in RSC/SSR envs. The proxy module was already
|
|
480
|
-
// re-transformed by the RSC plugin's hotUpdate. Without this, Vite
|
|
481
|
-
// tries to propagate through the RSC/SSR module graph where the proxy
|
|
482
|
-
// has no import.meta.hot.accept() boundary, triggering a full reload.
|
|
483
|
-
// The actual component update is handled by React Refresh in the
|
|
484
|
-
// client environment.
|
|
485
404
|
return [];
|
|
486
405
|
}
|
|
487
|
-
} catch {
|
|
488
|
-
// File deleted/moved during HMR, let default handling proceed
|
|
489
|
-
}
|
|
406
|
+
} catch {}
|
|
490
407
|
},
|
|
491
408
|
});
|
|
492
409
|
|
|
493
410
|
plugins.push(exposeActionId());
|
|
494
|
-
|
|
495
|
-
// "use cache" directive transform (enforce: "post"):
|
|
496
|
-
// Wraps exports with registerCachedFunction() for function-level caching.
|
|
497
411
|
plugins.push(useCacheTransform());
|
|
498
|
-
|
|
499
|
-
// Consolidated plugin for create* ID injection (enforce: "post"):
|
|
500
|
-
// loaders, handles, location state, and prerender handlers.
|
|
501
412
|
plugins.push(exposeInternalIds());
|
|
502
|
-
|
|
503
|
-
// Router ID injection runs at normal priority (no enforce) to avoid
|
|
504
|
-
// changing Vite's dep optimization timing.
|
|
505
413
|
plugins.push(exposeRouterId());
|
|
506
|
-
|
|
507
|
-
// Add version virtual module plugin for cache invalidation
|
|
508
414
|
plugins.push(createVersionPlugin());
|
|
509
415
|
|
|
510
|
-
// Entry path for discovery: user-specified value (if any) or undefined.
|
|
511
|
-
// Auto-discovered path is passed separately via routerRef.
|
|
512
|
-
// Cloudflare preset: deferred to configResolved (read from resolved Vite env config).
|
|
513
416
|
const discoveryEntryPath =
|
|
514
417
|
preset !== "cloudflare" ? routerRef.path : undefined;
|
|
515
|
-
// Ref for deferred auto-discovery (node preset only, undefined for cloudflare)
|
|
516
418
|
const discoveryRouterRef = preset !== "cloudflare" ? routerRef : undefined;
|
|
517
419
|
|
|
518
|
-
// Version injector: auto-injects VERSION and routes-manifest into the RSC entry.
|
|
519
|
-
// For cloudflare preset, the entry is resolved lazily in configResolved.
|
|
520
|
-
// For node preset, the virtual entry already includes these imports.
|
|
521
420
|
if (preset === "cloudflare") {
|
|
522
421
|
plugins.push(createVersionInjectorPlugin(undefined));
|
|
523
422
|
}
|
|
524
423
|
|
|
525
|
-
// Transform CJS vendor files to ESM for browser compatibility
|
|
526
|
-
// optimizeDeps.include doesn't work because the file is loaded after initial optimization
|
|
527
424
|
plugins.push(createCjsToEsmPlugin());
|
|
528
|
-
|
|
529
|
-
// Router discovery plugin for build-time manifest generation.
|
|
530
|
-
// For cloudflare, the entry is resolved lazily in configResolved from the RSC environment.
|
|
531
|
-
// For node, discoveryRouterRef provides the auto-discovered path when not user-specified.
|
|
532
425
|
plugins.push(
|
|
533
426
|
createRouterDiscoveryPlugin(discoveryEntryPath, {
|
|
534
427
|
routerPathRef: discoveryRouterRef,
|
|
@@ -424,7 +424,8 @@ export function createRouterDiscoveryPlugin(
|
|
|
424
424
|
releaseBuildEnv(s).catch(() => {});
|
|
425
425
|
});
|
|
426
426
|
|
|
427
|
-
// Mirror the build-path contract (
|
|
427
|
+
// Mirror the build-path contract (the buildStart hook below, which sets
|
|
428
|
+
// __rscRouterDiscoveryActive before running user modules):
|
|
428
429
|
// set __rscRouterDiscoveryActive before running user modules so any
|
|
429
430
|
// module-level router.reverse() calls return a placeholder instead
|
|
430
431
|
// of throwing. The temp Vite server's module runner has its own
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import type MagicString from "magic-string";
|
|
2
2
|
import { hashInlineId, buildExportMap } from "../plugins/expose-id-utils.js";
|
|
3
3
|
|
|
4
|
-
// ---------------------------------------------------------------------------
|
|
5
|
-
// Types
|
|
6
|
-
// ---------------------------------------------------------------------------
|
|
7
|
-
|
|
8
4
|
/** Minimal ESTree Program node — avoids importing from `rollup` (not a direct dep). */
|
|
9
5
|
interface ProgramNode {
|
|
10
6
|
type: "Program";
|
|
@@ -70,10 +66,6 @@ function findImportInsertionPos(
|
|
|
70
66
|
return insertionPos;
|
|
71
67
|
}
|
|
72
68
|
|
|
73
|
-
// ---------------------------------------------------------------------------
|
|
74
|
-
// AST walking helper
|
|
75
|
-
// ---------------------------------------------------------------------------
|
|
76
|
-
|
|
77
69
|
/**
|
|
78
70
|
* Recursively walk an ESTree AST node, calling `enter` on each node.
|
|
79
71
|
* Parent is passed for context.
|
|
@@ -111,10 +103,6 @@ function walkNode(
|
|
|
111
103
|
ancestors.pop();
|
|
112
104
|
}
|
|
113
105
|
|
|
114
|
-
// ---------------------------------------------------------------------------
|
|
115
|
-
// AST analysis
|
|
116
|
-
// ---------------------------------------------------------------------------
|
|
117
|
-
|
|
118
106
|
/**
|
|
119
107
|
* Parse the file with Vite's parseAst and find all calls to `fnName`.
|
|
120
108
|
* Distinguishes between `export const X = fnName(...)` (exportInfo set)
|
|
@@ -426,10 +414,6 @@ export function extractModuleLevelDeclarations(
|
|
|
426
414
|
return declarations;
|
|
427
415
|
}
|
|
428
416
|
|
|
429
|
-
// ---------------------------------------------------------------------------
|
|
430
|
-
// Transform
|
|
431
|
-
// ---------------------------------------------------------------------------
|
|
432
|
-
|
|
433
417
|
/**
|
|
434
418
|
* Transform inline handler calls by extracting them into virtual modules.
|
|
435
419
|
* Only processes inline calls (exportInfo === null); export const calls are
|