@rangojs/router 0.0.0-experimental.7dc955ec → 0.0.0-experimental.8123bb7e
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/__internal.d.ts +83 -0
- package/dist/__internal.d.ts.map +1 -0
- package/dist/__internal.js +19 -0
- package/dist/__internal.js.map +1 -0
- package/dist/__mocks__/version.d.ts +7 -0
- package/dist/__mocks__/version.d.ts.map +1 -0
- package/dist/__mocks__/version.js +7 -0
- package/dist/__mocks__/version.js.map +1 -0
- package/dist/__tests__/client-href.test.d.ts +2 -0
- package/dist/__tests__/client-href.test.d.ts.map +1 -0
- package/dist/__tests__/client-href.test.js +74 -0
- package/dist/__tests__/client-href.test.js.map +1 -0
- package/dist/__tests__/component-utils.test.d.ts +2 -0
- package/dist/__tests__/component-utils.test.d.ts.map +1 -0
- package/dist/__tests__/component-utils.test.js +51 -0
- package/dist/__tests__/component-utils.test.js.map +1 -0
- package/dist/__tests__/event-controller.test.d.ts +2 -0
- package/dist/__tests__/event-controller.test.d.ts.map +1 -0
- package/dist/__tests__/event-controller.test.js +538 -0
- package/dist/__tests__/event-controller.test.js.map +1 -0
- package/dist/__tests__/helpers/route-tree.d.ts +118 -0
- package/dist/__tests__/helpers/route-tree.d.ts.map +1 -0
- package/dist/__tests__/helpers/route-tree.js +374 -0
- package/dist/__tests__/helpers/route-tree.js.map +1 -0
- package/dist/__tests__/match-result.test.d.ts +2 -0
- package/dist/__tests__/match-result.test.d.ts.map +1 -0
- package/dist/__tests__/match-result.test.js +154 -0
- package/dist/__tests__/match-result.test.js.map +1 -0
- package/dist/__tests__/navigation-store.test.d.ts +2 -0
- package/dist/__tests__/navigation-store.test.d.ts.map +1 -0
- package/dist/__tests__/navigation-store.test.js +440 -0
- package/dist/__tests__/navigation-store.test.js.map +1 -0
- package/dist/__tests__/partial-update.test.d.ts +2 -0
- package/dist/__tests__/partial-update.test.d.ts.map +1 -0
- package/dist/__tests__/partial-update.test.js +1009 -0
- package/dist/__tests__/partial-update.test.js.map +1 -0
- package/dist/__tests__/reverse-types.test.d.ts +8 -0
- package/dist/__tests__/reverse-types.test.d.ts.map +1 -0
- package/dist/__tests__/reverse-types.test.js +656 -0
- package/dist/__tests__/reverse-types.test.js.map +1 -0
- package/dist/__tests__/route-definition.test.d.ts +2 -0
- package/dist/__tests__/route-definition.test.d.ts.map +1 -0
- package/dist/__tests__/route-definition.test.js +55 -0
- package/dist/__tests__/route-definition.test.js.map +1 -0
- package/dist/__tests__/router-helpers.test.d.ts +2 -0
- package/dist/__tests__/router-helpers.test.d.ts.map +1 -0
- package/dist/__tests__/router-helpers.test.js +377 -0
- package/dist/__tests__/router-helpers.test.js.map +1 -0
- package/dist/__tests__/router-integration-2.test.d.ts +2 -0
- package/dist/__tests__/router-integration-2.test.d.ts.map +1 -0
- package/dist/__tests__/router-integration-2.test.js +426 -0
- package/dist/__tests__/router-integration-2.test.js.map +1 -0
- package/dist/__tests__/router-integration.test.d.ts +2 -0
- package/dist/__tests__/router-integration.test.d.ts.map +1 -0
- package/dist/__tests__/router-integration.test.js +1051 -0
- package/dist/__tests__/router-integration.test.js.map +1 -0
- package/dist/__tests__/search-params.test.d.ts +5 -0
- package/dist/__tests__/search-params.test.d.ts.map +1 -0
- package/dist/__tests__/search-params.test.js +306 -0
- package/dist/__tests__/search-params.test.js.map +1 -0
- package/dist/__tests__/segment-system.test.d.ts +2 -0
- package/dist/__tests__/segment-system.test.d.ts.map +1 -0
- package/dist/__tests__/segment-system.test.js +627 -0
- package/dist/__tests__/segment-system.test.js.map +1 -0
- package/dist/__tests__/static-handler-types.test.d.ts +8 -0
- package/dist/__tests__/static-handler-types.test.d.ts.map +1 -0
- package/dist/__tests__/static-handler-types.test.js +63 -0
- package/dist/__tests__/static-handler-types.test.js.map +1 -0
- package/dist/__tests__/urls.test.d.ts +2 -0
- package/dist/__tests__/urls.test.d.ts.map +1 -0
- package/dist/__tests__/urls.test.js +421 -0
- package/dist/__tests__/urls.test.js.map +1 -0
- package/dist/__tests__/use-mount.test.d.ts +2 -0
- package/dist/__tests__/use-mount.test.d.ts.map +1 -0
- package/dist/__tests__/use-mount.test.js +35 -0
- package/dist/__tests__/use-mount.test.js.map +1 -0
- package/dist/bin/rango.d.ts +2 -0
- package/dist/bin/rango.d.ts.map +1 -0
- package/dist/bin/rango.js.map +1 -0
- package/dist/browser/event-controller.d.ts +191 -0
- package/dist/browser/event-controller.d.ts.map +1 -0
- package/dist/browser/event-controller.js +559 -0
- package/dist/browser/event-controller.js.map +1 -0
- package/dist/browser/index.d.ts +2 -0
- package/dist/browser/index.d.ts.map +1 -0
- package/dist/browser/index.js +14 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/browser/link-interceptor.d.ts +38 -0
- package/dist/browser/link-interceptor.d.ts.map +1 -0
- package/dist/browser/link-interceptor.js +99 -0
- package/dist/browser/link-interceptor.js.map +1 -0
- package/dist/browser/logging.d.ts +10 -0
- package/dist/browser/logging.d.ts.map +1 -0
- package/dist/browser/logging.js +29 -0
- package/dist/browser/logging.js.map +1 -0
- package/dist/browser/lru-cache.d.ts +17 -0
- package/dist/browser/lru-cache.d.ts.map +1 -0
- package/dist/browser/lru-cache.js +50 -0
- package/dist/browser/lru-cache.js.map +1 -0
- package/dist/browser/merge-segment-loaders.d.ts +39 -0
- package/dist/browser/merge-segment-loaders.d.ts.map +1 -0
- package/dist/browser/merge-segment-loaders.js +102 -0
- package/dist/browser/merge-segment-loaders.js.map +1 -0
- package/dist/browser/navigation-bridge.d.ts +102 -0
- package/dist/browser/navigation-bridge.d.ts.map +1 -0
- package/dist/browser/navigation-bridge.js +708 -0
- package/dist/browser/navigation-bridge.js.map +1 -0
- package/dist/browser/navigation-client.d.ts +25 -0
- package/dist/browser/navigation-client.d.ts.map +1 -0
- package/dist/browser/navigation-client.js +157 -0
- package/dist/browser/navigation-client.js.map +1 -0
- package/dist/browser/navigation-store.d.ts +101 -0
- package/dist/browser/navigation-store.d.ts.map +1 -0
- package/dist/browser/navigation-store.js +625 -0
- package/dist/browser/navigation-store.js.map +1 -0
- package/dist/browser/partial-update.d.ts +75 -0
- package/dist/browser/partial-update.d.ts.map +1 -0
- package/dist/browser/partial-update.js +426 -0
- package/dist/browser/partial-update.js.map +1 -0
- package/dist/browser/react/Link.d.ts +86 -0
- package/dist/browser/react/Link.d.ts.map +1 -0
- package/dist/browser/react/Link.js +128 -0
- package/dist/browser/react/Link.js.map +1 -0
- package/dist/browser/react/NavigationProvider.d.ts +63 -0
- package/dist/browser/react/NavigationProvider.d.ts.map +1 -0
- package/dist/browser/react/NavigationProvider.js +216 -0
- package/dist/browser/react/NavigationProvider.js.map +1 -0
- package/dist/browser/react/ScrollRestoration.d.ts +75 -0
- package/dist/browser/react/ScrollRestoration.d.ts.map +1 -0
- package/dist/browser/react/ScrollRestoration.js +57 -0
- package/dist/browser/react/ScrollRestoration.js.map +1 -0
- package/dist/browser/react/context.d.ts +46 -0
- package/dist/browser/react/context.d.ts.map +1 -0
- package/dist/browser/react/context.js +10 -0
- package/dist/browser/react/context.js.map +1 -0
- package/dist/browser/react/index.d.ts +11 -0
- package/dist/browser/react/index.d.ts.map +1 -0
- package/dist/browser/react/index.js +22 -0
- package/dist/browser/react/index.js.map +1 -0
- package/dist/browser/react/location-state-shared.d.ts +63 -0
- package/dist/browser/react/location-state-shared.d.ts.map +1 -0
- package/dist/browser/react/location-state-shared.js +81 -0
- package/dist/browser/react/location-state-shared.js.map +1 -0
- package/dist/browser/react/location-state.d.ts +23 -0
- package/dist/browser/react/location-state.d.ts.map +1 -0
- package/dist/browser/react/location-state.js +29 -0
- package/dist/browser/react/location-state.js.map +1 -0
- package/dist/browser/react/mount-context.d.ts +24 -0
- package/dist/browser/react/mount-context.d.ts.map +1 -0
- package/dist/browser/react/mount-context.js +24 -0
- package/dist/browser/react/mount-context.js.map +1 -0
- package/dist/browser/react/use-action.d.ts +64 -0
- package/dist/browser/react/use-action.d.ts.map +1 -0
- package/dist/browser/react/use-action.js +134 -0
- package/dist/browser/react/use-action.js.map +1 -0
- package/dist/browser/react/use-client-cache.d.ts +41 -0
- package/dist/browser/react/use-client-cache.d.ts.map +1 -0
- package/dist/browser/react/use-client-cache.js +39 -0
- package/dist/browser/react/use-client-cache.js.map +1 -0
- package/dist/browser/react/use-handle.d.ts +31 -0
- package/dist/browser/react/use-handle.d.ts.map +1 -0
- package/dist/browser/react/use-handle.js +144 -0
- package/dist/browser/react/use-handle.js.map +1 -0
- package/dist/browser/react/use-href.d.ts +33 -0
- package/dist/browser/react/use-href.d.ts.map +1 -0
- package/dist/browser/react/use-href.js +39 -0
- package/dist/browser/react/use-href.js.map +1 -0
- package/dist/browser/react/use-link-status.d.ts +37 -0
- package/dist/browser/react/use-link-status.d.ts.map +1 -0
- package/dist/browser/react/use-link-status.js +99 -0
- package/dist/browser/react/use-link-status.js.map +1 -0
- package/dist/browser/react/use-mount.d.ts +25 -0
- package/dist/browser/react/use-mount.d.ts.map +1 -0
- package/dist/browser/react/use-mount.js +30 -0
- package/dist/browser/react/use-mount.js.map +1 -0
- package/dist/browser/react/use-navigation.d.ts +27 -0
- package/dist/browser/react/use-navigation.d.ts.map +1 -0
- package/dist/browser/react/use-navigation.js +87 -0
- package/dist/browser/react/use-navigation.js.map +1 -0
- package/dist/browser/react/use-segments.d.ts +38 -0
- package/dist/browser/react/use-segments.d.ts.map +1 -0
- package/dist/browser/react/use-segments.js +130 -0
- package/dist/browser/react/use-segments.js.map +1 -0
- package/dist/browser/request-controller.d.ts +26 -0
- package/dist/browser/request-controller.d.ts.map +1 -0
- package/dist/browser/request-controller.js +147 -0
- package/dist/browser/request-controller.js.map +1 -0
- package/dist/browser/rsc-router.d.ts +129 -0
- package/dist/browser/rsc-router.d.ts.map +1 -0
- package/dist/browser/rsc-router.js +195 -0
- package/dist/browser/rsc-router.js.map +1 -0
- package/dist/browser/scroll-restoration.d.ts +93 -0
- package/dist/browser/scroll-restoration.d.ts.map +1 -0
- package/dist/browser/scroll-restoration.js +321 -0
- package/dist/browser/scroll-restoration.js.map +1 -0
- package/dist/browser/segment-structure-assert.d.ts +17 -0
- package/dist/browser/segment-structure-assert.d.ts.map +1 -0
- package/dist/browser/segment-structure-assert.js +59 -0
- package/dist/browser/segment-structure-assert.js.map +1 -0
- package/dist/browser/server-action-bridge.d.ts +26 -0
- package/dist/browser/server-action-bridge.d.ts.map +1 -0
- package/dist/browser/server-action-bridge.js +668 -0
- package/dist/browser/server-action-bridge.js.map +1 -0
- package/dist/browser/shallow.d.ts +12 -0
- package/dist/browser/shallow.d.ts.map +1 -0
- package/dist/browser/shallow.js +34 -0
- package/dist/browser/shallow.js.map +1 -0
- package/dist/browser/types.d.ts +369 -0
- package/dist/browser/types.d.ts.map +1 -0
- package/dist/browser/types.js +2 -0
- package/dist/browser/types.js.map +1 -0
- package/dist/build/__tests__/generate-cli.test.d.ts +2 -0
- package/dist/build/__tests__/generate-cli.test.d.ts.map +1 -0
- package/dist/build/__tests__/generate-cli.test.js +237 -0
- package/dist/build/__tests__/generate-cli.test.js.map +1 -0
- package/dist/build/__tests__/generate-manifest.test.d.ts +2 -0
- package/dist/build/__tests__/generate-manifest.test.d.ts.map +1 -0
- package/dist/build/__tests__/generate-manifest.test.js +119 -0
- package/dist/build/__tests__/generate-manifest.test.js.map +1 -0
- package/dist/build/__tests__/generate-route-types.test.d.ts +2 -0
- package/dist/build/__tests__/generate-route-types.test.d.ts.map +1 -0
- package/dist/build/__tests__/generate-route-types.test.js +620 -0
- package/dist/build/__tests__/generate-route-types.test.js.map +1 -0
- package/dist/build/__tests__/per-router-manifest.test.d.ts +2 -0
- package/dist/build/__tests__/per-router-manifest.test.d.ts.map +1 -0
- package/dist/build/__tests__/per-router-manifest.test.js +308 -0
- package/dist/build/__tests__/per-router-manifest.test.js.map +1 -0
- package/dist/build/generate-manifest.d.ts +81 -0
- package/dist/build/generate-manifest.d.ts.map +1 -0
- package/dist/build/generate-manifest.js +276 -0
- package/dist/build/generate-manifest.js.map +1 -0
- package/dist/build/generate-route-types.d.ts +115 -0
- package/dist/build/generate-route-types.d.ts.map +1 -0
- package/dist/build/generate-route-types.js +740 -0
- package/dist/build/generate-route-types.js.map +1 -0
- package/dist/build/index.d.ts +21 -0
- package/dist/build/index.d.ts.map +1 -0
- package/dist/build/index.js +21 -0
- package/dist/build/index.js.map +1 -0
- package/dist/build/route-trie.d.ts +71 -0
- package/dist/build/route-trie.d.ts.map +1 -0
- package/dist/build/route-trie.js +175 -0
- package/dist/build/route-trie.js.map +1 -0
- package/dist/cache/__tests__/cache-scope.test.d.ts +2 -0
- package/dist/cache/__tests__/cache-scope.test.d.ts.map +1 -0
- package/dist/cache/__tests__/cache-scope.test.js +208 -0
- package/dist/cache/__tests__/cache-scope.test.js.map +1 -0
- package/dist/cache/__tests__/document-cache.test.d.ts +2 -0
- package/dist/cache/__tests__/document-cache.test.d.ts.map +1 -0
- package/dist/cache/__tests__/document-cache.test.js +345 -0
- package/dist/cache/__tests__/document-cache.test.js.map +1 -0
- package/dist/cache/__tests__/memory-segment-store.test.d.ts +2 -0
- package/dist/cache/__tests__/memory-segment-store.test.d.ts.map +1 -0
- package/dist/cache/__tests__/memory-segment-store.test.js +425 -0
- package/dist/cache/__tests__/memory-segment-store.test.js.map +1 -0
- package/dist/cache/__tests__/memory-store.test.d.ts +2 -0
- package/dist/cache/__tests__/memory-store.test.d.ts.map +1 -0
- package/dist/cache/__tests__/memory-store.test.js +367 -0
- package/dist/cache/__tests__/memory-store.test.js.map +1 -0
- package/dist/cache/cache-scope.d.ts +102 -0
- package/dist/cache/cache-scope.d.ts.map +1 -0
- package/dist/cache/cache-scope.js +440 -0
- package/dist/cache/cache-scope.js.map +1 -0
- package/dist/cache/cf/__tests__/cf-cache-store.test.d.ts +2 -0
- package/dist/cache/cf/__tests__/cf-cache-store.test.d.ts.map +1 -0
- package/dist/cache/cf/__tests__/cf-cache-store.test.js +330 -0
- package/dist/cache/cf/__tests__/cf-cache-store.test.js.map +1 -0
- package/dist/cache/cf/cf-cache-store.d.ts +165 -0
- package/dist/cache/cf/cf-cache-store.d.ts.map +1 -0
- package/dist/cache/cf/cf-cache-store.js +242 -0
- package/dist/cache/cf/cf-cache-store.js.map +1 -0
- package/dist/cache/cf/index.d.ts +14 -0
- package/dist/cache/cf/index.d.ts.map +1 -0
- package/dist/cache/cf/index.js +17 -0
- package/dist/cache/cf/index.js.map +1 -0
- package/dist/cache/document-cache.d.ts +64 -0
- package/dist/cache/document-cache.d.ts.map +1 -0
- package/dist/cache/document-cache.js +228 -0
- package/dist/cache/document-cache.js.map +1 -0
- package/dist/cache/index.d.ts +19 -0
- package/dist/cache/index.d.ts.map +1 -0
- package/dist/cache/index.js +21 -0
- package/dist/cache/index.js.map +1 -0
- package/dist/cache/memory-segment-store.d.ts +110 -0
- package/dist/cache/memory-segment-store.d.ts.map +1 -0
- package/dist/cache/memory-segment-store.js +117 -0
- package/dist/cache/memory-segment-store.js.map +1 -0
- package/dist/cache/memory-store.d.ts +41 -0
- package/dist/cache/memory-store.d.ts.map +1 -0
- package/dist/cache/memory-store.js +191 -0
- package/dist/cache/memory-store.js.map +1 -0
- package/dist/cache/types.d.ts +317 -0
- package/dist/cache/types.d.ts.map +1 -0
- package/dist/cache/types.js +12 -0
- package/dist/cache/types.js.map +1 -0
- package/dist/client.d.ts +248 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +367 -0
- package/dist/client.js.map +1 -0
- package/dist/client.rsc.d.ts +26 -0
- package/dist/client.rsc.d.ts.map +1 -0
- package/dist/client.rsc.js +46 -0
- package/dist/client.rsc.js.map +1 -0
- package/dist/component-utils.d.ts +36 -0
- package/dist/component-utils.d.ts.map +1 -0
- package/dist/component-utils.js +61 -0
- package/dist/component-utils.js.map +1 -0
- package/dist/components/DefaultDocument.d.ts +13 -0
- package/dist/components/DefaultDocument.d.ts.map +1 -0
- package/dist/components/DefaultDocument.js +15 -0
- package/dist/components/DefaultDocument.js.map +1 -0
- package/dist/debug.d.ts +58 -0
- package/dist/debug.d.ts.map +1 -0
- package/dist/debug.js +157 -0
- package/dist/debug.js.map +1 -0
- package/dist/default-error-boundary.d.ts +11 -0
- package/dist/default-error-boundary.d.ts.map +1 -0
- package/dist/default-error-boundary.js +45 -0
- package/dist/default-error-boundary.js.map +1 -0
- package/dist/deps/browser.d.ts +2 -0
- package/dist/deps/browser.d.ts.map +1 -0
- package/dist/deps/browser.js +3 -0
- package/dist/deps/browser.js.map +1 -0
- package/dist/deps/html-stream-client.d.ts +2 -0
- package/dist/deps/html-stream-client.d.ts.map +1 -0
- package/dist/deps/html-stream-client.js +3 -0
- package/dist/deps/html-stream-client.js.map +1 -0
- package/dist/deps/html-stream-server.d.ts +2 -0
- package/dist/deps/html-stream-server.d.ts.map +1 -0
- package/dist/deps/html-stream-server.js +3 -0
- package/dist/deps/html-stream-server.js.map +1 -0
- package/dist/deps/rsc.d.ts +2 -0
- package/dist/deps/rsc.d.ts.map +1 -0
- package/dist/deps/rsc.js +4 -0
- package/dist/deps/rsc.js.map +1 -0
- package/dist/deps/ssr.d.ts +2 -0
- package/dist/deps/ssr.d.ts.map +1 -0
- package/dist/deps/ssr.js +3 -0
- package/dist/deps/ssr.js.map +1 -0
- package/dist/errors.d.ts +174 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +241 -0
- package/dist/errors.js.map +1 -0
- package/dist/handle.d.ts +78 -0
- package/dist/handle.d.ts.map +1 -0
- package/dist/handle.js +82 -0
- package/dist/handle.js.map +1 -0
- package/dist/handles/MetaTags.d.ts +14 -0
- package/dist/handles/MetaTags.d.ts.map +1 -0
- package/dist/handles/MetaTags.js +136 -0
- package/dist/handles/MetaTags.js.map +1 -0
- package/dist/handles/index.d.ts +6 -0
- package/dist/handles/index.d.ts.map +1 -0
- package/dist/handles/index.js +6 -0
- package/dist/handles/index.js.map +1 -0
- package/dist/handles/meta.d.ts +39 -0
- package/dist/handles/meta.d.ts.map +1 -0
- package/dist/handles/meta.js +202 -0
- package/dist/handles/meta.js.map +1 -0
- package/dist/host/__tests__/errors.test.d.ts +2 -0
- package/dist/host/__tests__/errors.test.d.ts.map +1 -0
- package/dist/host/__tests__/errors.test.js +76 -0
- package/dist/host/__tests__/errors.test.js.map +1 -0
- package/dist/host/__tests__/pattern-comprehensive.test.d.ts +2 -0
- package/dist/host/__tests__/pattern-comprehensive.test.d.ts.map +1 -0
- package/dist/host/__tests__/pattern-comprehensive.test.js +732 -0
- package/dist/host/__tests__/pattern-comprehensive.test.js.map +1 -0
- package/dist/host/__tests__/pattern-matcher.test.d.ts +2 -0
- package/dist/host/__tests__/pattern-matcher.test.d.ts.map +1 -0
- package/dist/host/__tests__/pattern-matcher.test.js +251 -0
- package/dist/host/__tests__/pattern-matcher.test.js.map +1 -0
- package/dist/host/__tests__/router.test.d.ts +2 -0
- package/dist/host/__tests__/router.test.d.ts.map +1 -0
- package/dist/host/__tests__/router.test.js +241 -0
- package/dist/host/__tests__/router.test.js.map +1 -0
- package/dist/host/__tests__/testing.test.d.ts +2 -0
- package/dist/host/__tests__/testing.test.d.ts.map +1 -0
- package/dist/host/__tests__/testing.test.js +64 -0
- package/dist/host/__tests__/testing.test.js.map +1 -0
- package/dist/host/__tests__/utils.test.d.ts +2 -0
- package/dist/host/__tests__/utils.test.d.ts.map +1 -0
- package/dist/host/__tests__/utils.test.js +29 -0
- package/dist/host/__tests__/utils.test.js.map +1 -0
- package/dist/host/cookie-handler.d.ts +34 -0
- package/dist/host/cookie-handler.d.ts.map +1 -0
- package/dist/host/cookie-handler.js +124 -0
- package/dist/host/cookie-handler.js.map +1 -0
- package/dist/host/errors.d.ts +56 -0
- package/dist/host/errors.d.ts.map +1 -0
- package/dist/host/errors.js +79 -0
- package/dist/host/errors.js.map +1 -0
- package/dist/host/index.d.ts +29 -0
- package/dist/host/index.d.ts.map +1 -0
- package/dist/host/index.js +32 -0
- package/dist/host/index.js.map +1 -0
- package/dist/host/pattern-matcher.d.ts +36 -0
- package/dist/host/pattern-matcher.d.ts.map +1 -0
- package/dist/host/pattern-matcher.js +172 -0
- package/dist/host/pattern-matcher.js.map +1 -0
- package/dist/host/router.d.ts +26 -0
- package/dist/host/router.d.ts.map +1 -0
- package/dist/host/router.js +218 -0
- package/dist/host/router.js.map +1 -0
- package/dist/host/testing.d.ts +36 -0
- package/dist/host/testing.d.ts.map +1 -0
- package/dist/host/testing.js +55 -0
- package/dist/host/testing.js.map +1 -0
- package/dist/host/types.d.ts +115 -0
- package/dist/host/types.d.ts.map +1 -0
- package/dist/host/types.js +7 -0
- package/dist/host/types.js.map +1 -0
- package/dist/host/utils.d.ts +21 -0
- package/dist/host/utils.d.ts.map +1 -0
- package/dist/host/utils.js +23 -0
- package/dist/host/utils.js.map +1 -0
- package/dist/href-client.d.ts +131 -0
- package/dist/href-client.d.ts.map +1 -0
- package/dist/href-client.js +64 -0
- package/dist/href-client.js.map +1 -0
- package/dist/href-context.d.ts +29 -0
- package/dist/href-context.d.ts.map +1 -0
- package/dist/href-context.js +21 -0
- package/dist/href-context.js.map +1 -0
- package/dist/index.d.ts +73 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +91 -0
- package/dist/index.js.map +1 -0
- package/dist/index.rsc.d.ts +32 -0
- package/dist/index.rsc.d.ts.map +1 -0
- package/dist/index.rsc.js +40 -0
- package/dist/index.rsc.js.map +1 -0
- package/dist/internal-debug.d.ts +2 -0
- package/dist/internal-debug.d.ts.map +1 -0
- package/dist/internal-debug.js +5 -0
- package/dist/internal-debug.js.map +1 -0
- package/dist/loader.d.ts +14 -0
- package/dist/loader.d.ts.map +1 -0
- package/dist/loader.js +20 -0
- package/dist/loader.js.map +1 -0
- package/dist/loader.rsc.d.ts +19 -0
- package/dist/loader.rsc.d.ts.map +1 -0
- package/dist/loader.rsc.js +99 -0
- package/dist/loader.rsc.js.map +1 -0
- package/dist/network-error-thrower.d.ts +17 -0
- package/dist/network-error-thrower.d.ts.map +1 -0
- package/dist/network-error-thrower.js +14 -0
- package/dist/network-error-thrower.js.map +1 -0
- package/dist/outlet-context.d.ts +13 -0
- package/dist/outlet-context.d.ts.map +1 -0
- package/dist/outlet-context.js +3 -0
- package/dist/outlet-context.js.map +1 -0
- package/dist/prerender/__tests__/param-hash.test.d.ts +2 -0
- package/dist/prerender/__tests__/param-hash.test.d.ts.map +1 -0
- package/dist/prerender/__tests__/param-hash.test.js +148 -0
- package/dist/prerender/__tests__/param-hash.test.js.map +1 -0
- package/dist/prerender/param-hash.d.ts +16 -0
- package/dist/prerender/param-hash.d.ts.map +1 -0
- package/dist/prerender/param-hash.js +36 -0
- package/dist/prerender/param-hash.js.map +1 -0
- package/dist/prerender/store.d.ts +38 -0
- package/dist/prerender/store.d.ts.map +1 -0
- package/dist/prerender/store.js +61 -0
- package/dist/prerender/store.js.map +1 -0
- package/dist/prerender.d.ts +66 -0
- package/dist/prerender.d.ts.map +1 -0
- package/dist/prerender.js +57 -0
- package/dist/prerender.js.map +1 -0
- package/dist/reverse.d.ts +196 -0
- package/dist/reverse.d.ts.map +1 -0
- package/dist/reverse.js +78 -0
- package/dist/reverse.js.map +1 -0
- package/dist/root-error-boundary.d.ts +33 -0
- package/dist/root-error-boundary.d.ts.map +1 -0
- package/dist/root-error-boundary.js +165 -0
- package/dist/root-error-boundary.js.map +1 -0
- package/dist/route-content-wrapper.d.ts +46 -0
- package/dist/route-content-wrapper.d.ts.map +1 -0
- package/dist/route-content-wrapper.js +77 -0
- package/dist/route-content-wrapper.js.map +1 -0
- package/dist/route-definition.d.ts +421 -0
- package/dist/route-definition.d.ts.map +1 -0
- package/dist/route-definition.js +868 -0
- package/dist/route-definition.js.map +1 -0
- package/dist/route-map-builder.d.ts +155 -0
- package/dist/route-map-builder.d.ts.map +1 -0
- package/dist/route-map-builder.js +237 -0
- package/dist/route-map-builder.js.map +1 -0
- package/dist/route-types.d.ts +165 -0
- package/dist/route-types.d.ts.map +1 -0
- package/dist/route-types.js +7 -0
- package/dist/route-types.js.map +1 -0
- package/dist/router/__tests__/handler-context.test.d.ts +2 -0
- package/dist/router/__tests__/handler-context.test.d.ts.map +1 -0
- package/dist/router/__tests__/handler-context.test.js +65 -0
- package/dist/router/__tests__/handler-context.test.js.map +1 -0
- package/dist/router/__tests__/loader-cycle-detection.test.d.ts +2 -0
- package/dist/router/__tests__/loader-cycle-detection.test.d.ts.map +1 -0
- package/dist/router/__tests__/loader-cycle-detection.test.js +221 -0
- package/dist/router/__tests__/loader-cycle-detection.test.js.map +1 -0
- package/dist/router/__tests__/match-context.test.d.ts +2 -0
- package/dist/router/__tests__/match-context.test.d.ts.map +1 -0
- package/dist/router/__tests__/match-context.test.js +92 -0
- package/dist/router/__tests__/match-context.test.js.map +1 -0
- package/dist/router/__tests__/match-pipelines.test.d.ts +2 -0
- package/dist/router/__tests__/match-pipelines.test.d.ts.map +1 -0
- package/dist/router/__tests__/match-pipelines.test.js +417 -0
- package/dist/router/__tests__/match-pipelines.test.js.map +1 -0
- package/dist/router/__tests__/match-result.test.d.ts +2 -0
- package/dist/router/__tests__/match-result.test.d.ts.map +1 -0
- package/dist/router/__tests__/match-result.test.js +457 -0
- package/dist/router/__tests__/match-result.test.js.map +1 -0
- package/dist/router/__tests__/on-error.test.d.ts +2 -0
- package/dist/router/__tests__/on-error.test.d.ts.map +1 -0
- package/dist/router/__tests__/on-error.test.js +678 -0
- package/dist/router/__tests__/on-error.test.js.map +1 -0
- package/dist/router/__tests__/pattern-matching.test.d.ts +2 -0
- package/dist/router/__tests__/pattern-matching.test.d.ts.map +1 -0
- package/dist/router/__tests__/pattern-matching.test.js +629 -0
- package/dist/router/__tests__/pattern-matching.test.js.map +1 -0
- package/dist/router/__tests__/segment-resolution-parallel-loading.test.d.ts +2 -0
- package/dist/router/__tests__/segment-resolution-parallel-loading.test.d.ts.map +1 -0
- package/dist/router/__tests__/segment-resolution-parallel-loading.test.js +155 -0
- package/dist/router/__tests__/segment-resolution-parallel-loading.test.js.map +1 -0
- package/dist/router/error-handling.d.ts +77 -0
- package/dist/router/error-handling.d.ts.map +1 -0
- package/dist/router/error-handling.js +202 -0
- package/dist/router/error-handling.js.map +1 -0
- package/dist/router/handler-context.d.ts +20 -0
- package/dist/router/handler-context.d.ts.map +1 -0
- package/dist/router/handler-context.js +198 -0
- package/dist/router/handler-context.js.map +1 -0
- package/dist/router/intercept-resolution.d.ts +66 -0
- package/dist/router/intercept-resolution.d.ts.map +1 -0
- package/dist/router/intercept-resolution.js +246 -0
- package/dist/router/intercept-resolution.js.map +1 -0
- package/dist/router/loader-resolution.d.ts +64 -0
- package/dist/router/loader-resolution.d.ts.map +1 -0
- package/dist/router/loader-resolution.js +284 -0
- package/dist/router/loader-resolution.js.map +1 -0
- package/dist/router/logging.d.ts +15 -0
- package/dist/router/logging.d.ts.map +1 -0
- package/dist/router/logging.js +99 -0
- package/dist/router/logging.js.map +1 -0
- package/dist/router/manifest.d.ts +22 -0
- package/dist/router/manifest.d.ts.map +1 -0
- package/dist/router/manifest.js +181 -0
- package/dist/router/manifest.js.map +1 -0
- package/dist/router/match-api.d.ts +35 -0
- package/dist/router/match-api.d.ts.map +1 -0
- package/dist/router/match-api.js +406 -0
- package/dist/router/match-api.js.map +1 -0
- package/dist/router/match-context.d.ts +206 -0
- package/dist/router/match-context.d.ts.map +1 -0
- package/dist/router/match-context.js +17 -0
- package/dist/router/match-context.js.map +1 -0
- package/dist/router/match-middleware/background-revalidation.d.ts +127 -0
- package/dist/router/match-middleware/background-revalidation.d.ts.map +1 -0
- package/dist/router/match-middleware/background-revalidation.js +75 -0
- package/dist/router/match-middleware/background-revalidation.js.map +1 -0
- package/dist/router/match-middleware/cache-lookup.d.ts +112 -0
- package/dist/router/match-middleware/cache-lookup.d.ts.map +1 -0
- package/dist/router/match-middleware/cache-lookup.js +257 -0
- package/dist/router/match-middleware/cache-lookup.js.map +1 -0
- package/dist/router/match-middleware/cache-store.d.ts +113 -0
- package/dist/router/match-middleware/cache-store.d.ts.map +1 -0
- package/dist/router/match-middleware/cache-store.js +108 -0
- package/dist/router/match-middleware/cache-store.js.map +1 -0
- package/dist/router/match-middleware/index.d.ts +81 -0
- package/dist/router/match-middleware/index.d.ts.map +1 -0
- package/dist/router/match-middleware/index.js +80 -0
- package/dist/router/match-middleware/index.js.map +1 -0
- package/dist/router/match-middleware/intercept-resolution.d.ts +117 -0
- package/dist/router/match-middleware/intercept-resolution.d.ts.map +1 -0
- package/dist/router/match-middleware/intercept-resolution.js +134 -0
- package/dist/router/match-middleware/intercept-resolution.js.map +1 -0
- package/dist/router/match-middleware/segment-resolution.d.ts +99 -0
- package/dist/router/match-middleware/segment-resolution.d.ts.map +1 -0
- package/dist/router/match-middleware/segment-resolution.js +53 -0
- package/dist/router/match-middleware/segment-resolution.js.map +1 -0
- package/dist/router/match-pipelines.d.ts +147 -0
- package/dist/router/match-pipelines.d.ts.map +1 -0
- package/dist/router/match-pipelines.js +82 -0
- package/dist/router/match-pipelines.js.map +1 -0
- package/dist/router/match-result.d.ts +126 -0
- package/dist/router/match-result.d.ts.map +1 -0
- package/dist/router/match-result.js +93 -0
- package/dist/router/match-result.js.map +1 -0
- package/dist/router/metrics.d.ts +20 -0
- package/dist/router/metrics.d.ts.map +1 -0
- package/dist/router/metrics.js +47 -0
- package/dist/router/metrics.js.map +1 -0
- package/dist/router/middleware.d.ts +249 -0
- package/dist/router/middleware.d.ts.map +1 -0
- package/dist/router/middleware.js +434 -0
- package/dist/router/middleware.js.map +1 -0
- package/dist/router/middleware.test.d.ts +2 -0
- package/dist/router/middleware.test.d.ts.map +1 -0
- package/dist/router/middleware.test.js +816 -0
- package/dist/router/middleware.test.js.map +1 -0
- package/dist/router/pattern-matching.d.ts +149 -0
- package/dist/router/pattern-matching.d.ts.map +1 -0
- package/dist/router/pattern-matching.js +349 -0
- package/dist/router/pattern-matching.js.map +1 -0
- package/dist/router/revalidation.d.ts +44 -0
- package/dist/router/revalidation.d.ts.map +1 -0
- package/dist/router/revalidation.js +147 -0
- package/dist/router/revalidation.js.map +1 -0
- package/dist/router/router-context.d.ts +135 -0
- package/dist/router/router-context.d.ts.map +1 -0
- package/dist/router/router-context.js +36 -0
- package/dist/router/router-context.js.map +1 -0
- package/dist/router/segment-resolution.d.ts +127 -0
- package/dist/router/segment-resolution.d.ts.map +1 -0
- package/dist/router/segment-resolution.js +919 -0
- package/dist/router/segment-resolution.js.map +1 -0
- package/dist/router/trie-matching.d.ts +40 -0
- package/dist/router/trie-matching.d.ts.map +1 -0
- package/dist/router/trie-matching.js +127 -0
- package/dist/router/trie-matching.js.map +1 -0
- package/dist/router/types.d.ts +136 -0
- package/dist/router/types.d.ts.map +1 -0
- package/dist/router/types.js +7 -0
- package/dist/router/types.js.map +1 -0
- package/dist/router.d.ts +753 -0
- package/dist/router.d.ts.map +1 -0
- package/dist/router.gen.d.ts +6 -0
- package/dist/router.gen.d.ts.map +1 -0
- package/dist/router.gen.js +6 -0
- package/dist/router.gen.js.map +1 -0
- package/dist/router.js +1304 -0
- package/dist/router.js.map +1 -0
- package/dist/rsc/__tests__/helpers.test.d.ts +2 -0
- package/dist/rsc/__tests__/helpers.test.d.ts.map +1 -0
- package/dist/rsc/__tests__/helpers.test.js +140 -0
- package/dist/rsc/__tests__/helpers.test.js.map +1 -0
- package/dist/rsc/handler.d.ts +45 -0
- package/dist/rsc/handler.d.ts.map +1 -0
- package/dist/rsc/handler.js +1172 -0
- package/dist/rsc/handler.js.map +1 -0
- package/dist/rsc/helpers.d.ts +16 -0
- package/dist/rsc/helpers.d.ts.map +1 -0
- package/dist/rsc/helpers.js +55 -0
- package/dist/rsc/helpers.js.map +1 -0
- package/dist/rsc/index.d.ts +22 -0
- package/dist/rsc/index.d.ts.map +1 -0
- package/dist/rsc/index.js +23 -0
- package/dist/rsc/index.js.map +1 -0
- package/dist/rsc/nonce.d.ts +9 -0
- package/dist/rsc/nonce.d.ts.map +1 -0
- package/dist/rsc/nonce.js +18 -0
- package/dist/rsc/nonce.js.map +1 -0
- package/dist/rsc/types.d.ts +206 -0
- package/dist/rsc/types.d.ts.map +1 -0
- package/dist/rsc/types.js +8 -0
- package/dist/rsc/types.js.map +1 -0
- package/dist/search-params.d.ts +103 -0
- package/dist/search-params.d.ts.map +1 -0
- package/dist/search-params.js +74 -0
- package/dist/search-params.js.map +1 -0
- package/dist/segment-system.d.ts +75 -0
- package/dist/segment-system.d.ts.map +1 -0
- package/dist/segment-system.js +336 -0
- package/dist/segment-system.js.map +1 -0
- package/dist/server/context.d.ts +245 -0
- package/dist/server/context.d.ts.map +1 -0
- package/dist/server/context.js +197 -0
- package/dist/server/context.js.map +1 -0
- package/dist/server/fetchable-loader-store.d.ts +18 -0
- package/dist/server/fetchable-loader-store.d.ts.map +1 -0
- package/dist/server/fetchable-loader-store.js +18 -0
- package/dist/server/fetchable-loader-store.js.map +1 -0
- package/dist/server/handle-store.d.ts +85 -0
- package/dist/server/handle-store.d.ts.map +1 -0
- package/dist/server/handle-store.js +142 -0
- package/dist/server/handle-store.js.map +1 -0
- package/dist/server/loader-registry.d.ts +55 -0
- package/dist/server/loader-registry.d.ts.map +1 -0
- package/dist/server/loader-registry.js +132 -0
- package/dist/server/loader-registry.js.map +1 -0
- package/dist/server/request-context.d.ts +226 -0
- package/dist/server/request-context.d.ts.map +1 -0
- package/dist/server/request-context.js +290 -0
- package/dist/server/request-context.js.map +1 -0
- package/dist/server/root-layout.d.ts +4 -0
- package/dist/server/root-layout.d.ts.map +1 -0
- package/dist/server/root-layout.js +5 -0
- package/dist/server/root-layout.js.map +1 -0
- package/dist/server.d.ts +15 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +20 -0
- package/dist/server.js.map +1 -0
- package/dist/ssr/__tests__/ssr-handler.test.d.ts +2 -0
- package/dist/ssr/__tests__/ssr-handler.test.d.ts.map +1 -0
- package/dist/ssr/__tests__/ssr-handler.test.js +132 -0
- package/dist/ssr/__tests__/ssr-handler.test.js.map +1 -0
- package/dist/ssr/index.d.ts +98 -0
- package/dist/ssr/index.d.ts.map +1 -0
- package/dist/ssr/index.js +158 -0
- package/dist/ssr/index.js.map +1 -0
- package/dist/static-handler.d.ts +50 -0
- package/dist/static-handler.d.ts.map +1 -0
- package/dist/static-handler.gen.d.ts +5 -0
- package/dist/static-handler.gen.d.ts.map +1 -0
- package/dist/static-handler.gen.js +5 -0
- package/dist/static-handler.gen.js.map +1 -0
- package/dist/static-handler.js +29 -0
- package/dist/static-handler.js.map +1 -0
- package/dist/theme/ThemeProvider.d.ts +20 -0
- package/dist/theme/ThemeProvider.d.ts.map +1 -0
- package/dist/theme/ThemeProvider.js +240 -0
- package/dist/theme/ThemeProvider.js.map +1 -0
- package/dist/theme/ThemeScript.d.ts +48 -0
- package/dist/theme/ThemeScript.d.ts.map +1 -0
- package/dist/theme/ThemeScript.js +13 -0
- package/dist/theme/ThemeScript.js.map +1 -0
- package/dist/theme/__tests__/theme.test.d.ts +2 -0
- package/dist/theme/__tests__/theme.test.d.ts.map +1 -0
- package/dist/theme/__tests__/theme.test.js +103 -0
- package/dist/theme/__tests__/theme.test.js.map +1 -0
- package/dist/theme/constants.d.ts +29 -0
- package/dist/theme/constants.d.ts.map +1 -0
- package/dist/theme/constants.js +48 -0
- package/dist/theme/constants.js.map +1 -0
- package/dist/theme/index.d.ts +31 -0
- package/dist/theme/index.d.ts.map +1 -0
- package/dist/theme/index.js +36 -0
- package/dist/theme/index.js.map +1 -0
- package/dist/theme/theme-context.d.ts +40 -0
- package/dist/theme/theme-context.d.ts.map +1 -0
- package/dist/theme/theme-context.js +60 -0
- package/dist/theme/theme-context.js.map +1 -0
- package/dist/theme/theme-script.d.ts +27 -0
- package/dist/theme/theme-script.d.ts.map +1 -0
- package/dist/theme/theme-script.js +147 -0
- package/dist/theme/theme-script.js.map +1 -0
- package/dist/theme/types.d.ts +163 -0
- package/dist/theme/types.d.ts.map +1 -0
- package/dist/theme/types.js +11 -0
- package/dist/theme/types.js.map +1 -0
- package/dist/theme/use-theme.d.ts +12 -0
- package/dist/theme/use-theme.d.ts.map +1 -0
- package/dist/theme/use-theme.js +40 -0
- package/dist/theme/use-theme.js.map +1 -0
- package/dist/types.d.ts +1479 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +10 -0
- package/dist/types.js.map +1 -0
- package/dist/urls.d.ts +441 -0
- package/dist/urls.d.ts.map +1 -0
- package/dist/urls.gen.d.ts +8 -0
- package/dist/urls.gen.d.ts.map +1 -0
- package/dist/urls.gen.js +8 -0
- package/dist/urls.gen.js.map +1 -0
- package/dist/urls.js +443 -0
- package/dist/urls.js.map +1 -0
- package/dist/use-loader.d.ts +127 -0
- package/dist/use-loader.d.ts.map +1 -0
- package/dist/use-loader.js +237 -0
- package/dist/use-loader.js.map +1 -0
- package/dist/vite/__tests__/ast-handler-extract.test.d.ts +2 -0
- package/dist/vite/__tests__/ast-handler-extract.test.d.ts.map +1 -0
- package/dist/vite/__tests__/ast-handler-extract.test.js +294 -0
- package/dist/vite/__tests__/ast-handler-extract.test.js.map +1 -0
- package/dist/vite/__tests__/expose-id-utils.test.d.ts +2 -0
- package/dist/vite/__tests__/expose-id-utils.test.d.ts.map +1 -0
- package/dist/vite/__tests__/expose-id-utils.test.js +224 -0
- package/dist/vite/__tests__/expose-id-utils.test.js.map +1 -0
- package/dist/vite/__tests__/expose-internal-ids.test.d.ts +2 -0
- package/dist/vite/__tests__/expose-internal-ids.test.d.ts.map +1 -0
- package/dist/vite/__tests__/expose-internal-ids.test.js +647 -0
- package/dist/vite/__tests__/expose-internal-ids.test.js.map +1 -0
- package/dist/vite/__tests__/expose-router-id.test.d.ts +2 -0
- package/dist/vite/__tests__/expose-router-id.test.d.ts.map +1 -0
- package/dist/vite/__tests__/expose-router-id.test.js +39 -0
- package/dist/vite/__tests__/expose-router-id.test.js.map +1 -0
- package/dist/vite/ast-handler-extract.d.ts +49 -0
- package/dist/vite/ast-handler-extract.d.ts.map +1 -0
- package/dist/vite/ast-handler-extract.js +249 -0
- package/dist/vite/ast-handler-extract.js.map +1 -0
- package/dist/vite/expose-action-id.d.ts +19 -0
- package/dist/vite/expose-action-id.d.ts.map +1 -0
- package/dist/vite/expose-action-id.js +250 -0
- package/dist/vite/expose-action-id.js.map +1 -0
- package/dist/vite/expose-id-utils.d.ts +69 -0
- package/dist/vite/expose-id-utils.d.ts.map +1 -0
- package/dist/vite/expose-id-utils.js +289 -0
- package/dist/vite/expose-id-utils.js.map +1 -0
- package/dist/vite/expose-internal-ids.d.ts +22 -0
- package/dist/vite/expose-internal-ids.d.ts.map +1 -0
- package/dist/vite/expose-internal-ids.js +886 -0
- package/dist/vite/expose-internal-ids.js.map +1 -0
- package/dist/vite/index.d.ts +149 -0
- package/dist/vite/index.d.ts.map +1 -0
- package/dist/vite/index.js +144 -4
- package/dist/vite/index.js.map +1 -0
- package/dist/vite/index.named-routes.gen.ts +103 -0
- package/dist/vite/package-resolution.d.ts +43 -0
- package/dist/vite/package-resolution.d.ts.map +1 -0
- package/dist/vite/package-resolution.js +112 -0
- package/dist/vite/package-resolution.js.map +1 -0
- package/dist/vite/virtual-entries.d.ts +25 -0
- package/dist/vite/virtual-entries.d.ts.map +1 -0
- package/dist/vite/virtual-entries.js +110 -0
- package/dist/vite/virtual-entries.js.map +1 -0
- package/package.json +1 -1
- package/skills/loader/SKILL.md +53 -43
- package/skills/router-setup/SKILL.md +52 -2
- package/src/browser/debug-channel.ts +93 -0
- package/src/browser/navigation-client.ts +25 -1
- package/src/browser/prefetch/queue.ts +61 -29
- package/src/browser/prefetch/resource-ready.ts +77 -0
- package/src/browser/react/NavigationProvider.tsx +5 -3
- package/src/browser/server-action-bridge.ts +12 -0
- package/src/browser/types.ts +8 -1
- package/src/deps/browser.ts +1 -0
- package/src/route-definition/helpers-types.ts +6 -5
- package/src/router/loader-resolution.ts +7 -1
- package/src/router/segment-resolution/fresh.ts +1 -12
- package/src/router/segment-resolution/helpers.ts +29 -24
- package/src/router/segment-resolution/revalidation.ts +0 -9
- package/src/router/types.ts +1 -0
- package/src/router.ts +1 -0
- package/src/rsc/handler.ts +27 -2
- package/src/rsc/loader-fetch.ts +7 -2
- package/src/rsc/progressive-enhancement.ts +4 -1
- package/src/rsc/rsc-rendering.ts +4 -1
- package/src/rsc/server-action.ts +2 -0
- package/src/rsc/types.ts +7 -1
- package/src/server/request-context.ts +8 -2
- package/src/types/handler-context.ts +13 -9
- package/src/types/loader-types.ts +4 -4
- package/src/vite/plugins/performance-tracks.ts +235 -0
- package/src/vite/rango.ts +11 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Package Resolution Utilities
|
|
3
|
+
*
|
|
4
|
+
* Handles detection of workspace vs npm install context and generates
|
|
5
|
+
* appropriate aliases and exclude lists for Vite configuration.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Get the published package name (e.g., "@rangojs/router")
|
|
9
|
+
*/
|
|
10
|
+
export declare function getPublishedPackageName(): string;
|
|
11
|
+
/**
|
|
12
|
+
* Check if the package is installed from npm (scoped) vs workspace (unscoped)
|
|
13
|
+
*
|
|
14
|
+
* In workspace development:
|
|
15
|
+
* - Package is installed as "@rangojs/router" via pnpm workspace alias
|
|
16
|
+
* - The scoped name (@rangojs/router) doesn't exist in node_modules
|
|
17
|
+
*
|
|
18
|
+
* When installed from npm:
|
|
19
|
+
* - Package is installed as "@rangojs/router"
|
|
20
|
+
* - We need aliases to map "@rangojs/router/*" to "@rangojs/router/*"
|
|
21
|
+
*/
|
|
22
|
+
export declare function isInstalledFromNpm(): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Check if we're in a monorepo/workspace development context
|
|
25
|
+
*/
|
|
26
|
+
export declare function isWorkspaceDevelopment(): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Generate the list of modules to exclude from Vite's dependency optimization.
|
|
29
|
+
*
|
|
30
|
+
* We include both the published name and the virtual name because
|
|
31
|
+
* Vite's optimizer runs before alias resolution.
|
|
32
|
+
*/
|
|
33
|
+
export declare function getExcludeDeps(): string[];
|
|
34
|
+
/**
|
|
35
|
+
* Generate aliases to map virtual package paths to the actual published package.
|
|
36
|
+
*
|
|
37
|
+
* Only needed when installed from npm, where the package is under @rangojs/router
|
|
38
|
+
* but virtual entries import from rsc-router/*.
|
|
39
|
+
*
|
|
40
|
+
* Returns empty object in workspace development where rsc-router resolves directly.
|
|
41
|
+
*/
|
|
42
|
+
export declare function getPackageAliases(): Record<string, string>;
|
|
43
|
+
//# sourceMappingURL=package-resolution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-resolution.d.ts","sourceRoot":"","sources":["../../src/vite/package-resolution.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAWH;;GAEG;AACH,wBAAgB,uBAAuB,IAAI,MAAM,CAEhD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,IAAI,OAAO,CAI5C;AAED;;GAEG;AACH,wBAAgB,sBAAsB,IAAI,OAAO,CAEhD;AAmBD;;;;;GAKG;AACH,wBAAgB,cAAc,IAAI,MAAM,EAAE,CAczC;AAkBD;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAc1D"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Package Resolution Utilities
|
|
3
|
+
*
|
|
4
|
+
* Handles detection of workspace vs npm install context and generates
|
|
5
|
+
* appropriate aliases and exclude lists for Vite configuration.
|
|
6
|
+
*/
|
|
7
|
+
import { existsSync } from "node:fs";
|
|
8
|
+
import { resolve } from "node:path";
|
|
9
|
+
import packageJson from "../../package.json" with { type: "json" };
|
|
10
|
+
/**
|
|
11
|
+
* The canonical name used in virtual entries (without scope)
|
|
12
|
+
*/
|
|
13
|
+
const VIRTUAL_PACKAGE_NAME = "@rangojs/router";
|
|
14
|
+
/**
|
|
15
|
+
* Get the published package name (e.g., "@rangojs/router")
|
|
16
|
+
*/
|
|
17
|
+
export function getPublishedPackageName() {
|
|
18
|
+
return packageJson.name;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Check if the package is installed from npm (scoped) vs workspace (unscoped)
|
|
22
|
+
*
|
|
23
|
+
* In workspace development:
|
|
24
|
+
* - Package is installed as "@rangojs/router" via pnpm workspace alias
|
|
25
|
+
* - The scoped name (@rangojs/router) doesn't exist in node_modules
|
|
26
|
+
*
|
|
27
|
+
* When installed from npm:
|
|
28
|
+
* - Package is installed as "@rangojs/router"
|
|
29
|
+
* - We need aliases to map "@rangojs/router/*" to "@rangojs/router/*"
|
|
30
|
+
*/
|
|
31
|
+
export function isInstalledFromNpm() {
|
|
32
|
+
const packageName = getPublishedPackageName();
|
|
33
|
+
// Check if the scoped package exists in node_modules
|
|
34
|
+
return existsSync(resolve(process.cwd(), "node_modules", packageName));
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Check if we're in a monorepo/workspace development context
|
|
38
|
+
*/
|
|
39
|
+
export function isWorkspaceDevelopment() {
|
|
40
|
+
return !isInstalledFromNpm();
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Subpaths that need to be excluded from Vite's dependency optimization
|
|
44
|
+
* and potentially aliased
|
|
45
|
+
*/
|
|
46
|
+
const PACKAGE_SUBPATHS = [
|
|
47
|
+
"",
|
|
48
|
+
"/browser",
|
|
49
|
+
"/client",
|
|
50
|
+
"/server",
|
|
51
|
+
"/rsc",
|
|
52
|
+
"/ssr",
|
|
53
|
+
"/internal/deps/browser",
|
|
54
|
+
"/internal/deps/html-stream-client",
|
|
55
|
+
"/internal/deps/ssr",
|
|
56
|
+
"/internal/deps/rsc",
|
|
57
|
+
];
|
|
58
|
+
/**
|
|
59
|
+
* Generate the list of modules to exclude from Vite's dependency optimization.
|
|
60
|
+
*
|
|
61
|
+
* We include both the published name and the virtual name because
|
|
62
|
+
* Vite's optimizer runs before alias resolution.
|
|
63
|
+
*/
|
|
64
|
+
export function getExcludeDeps() {
|
|
65
|
+
const packageName = getPublishedPackageName();
|
|
66
|
+
const excludes = [];
|
|
67
|
+
for (const subpath of PACKAGE_SUBPATHS) {
|
|
68
|
+
// Add scoped package paths
|
|
69
|
+
excludes.push(`${packageName}${subpath}`);
|
|
70
|
+
// Add virtual/aliased paths (before alias resolution)
|
|
71
|
+
if (packageName !== VIRTUAL_PACKAGE_NAME) {
|
|
72
|
+
excludes.push(`${VIRTUAL_PACKAGE_NAME}${subpath}`);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return excludes;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Subpaths that need aliasing (subset of PACKAGE_SUBPATHS)
|
|
79
|
+
*/
|
|
80
|
+
const ALIAS_SUBPATHS = [
|
|
81
|
+
"/internal/deps/browser",
|
|
82
|
+
"/internal/deps/ssr",
|
|
83
|
+
"/internal/deps/rsc",
|
|
84
|
+
"/internal/deps/html-stream-client",
|
|
85
|
+
"/internal/deps/html-stream-server",
|
|
86
|
+
"/browser",
|
|
87
|
+
"/client",
|
|
88
|
+
"/server",
|
|
89
|
+
"/rsc",
|
|
90
|
+
"/ssr",
|
|
91
|
+
];
|
|
92
|
+
/**
|
|
93
|
+
* Generate aliases to map virtual package paths to the actual published package.
|
|
94
|
+
*
|
|
95
|
+
* Only needed when installed from npm, where the package is under @rangojs/router
|
|
96
|
+
* but virtual entries import from rsc-router/*.
|
|
97
|
+
*
|
|
98
|
+
* Returns empty object in workspace development where rsc-router resolves directly.
|
|
99
|
+
*/
|
|
100
|
+
export function getPackageAliases() {
|
|
101
|
+
if (isWorkspaceDevelopment()) {
|
|
102
|
+
// No aliases needed - rsc-router resolves directly
|
|
103
|
+
return {};
|
|
104
|
+
}
|
|
105
|
+
const packageName = getPublishedPackageName();
|
|
106
|
+
const aliases = {};
|
|
107
|
+
for (const subpath of ALIAS_SUBPATHS) {
|
|
108
|
+
aliases[`${VIRTUAL_PACKAGE_NAME}${subpath}`] = `${packageName}${subpath}`;
|
|
109
|
+
}
|
|
110
|
+
return aliases;
|
|
111
|
+
}
|
|
112
|
+
//# sourceMappingURL=package-resolution.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-resolution.js","sourceRoot":"","sources":["../../src/vite/package-resolution.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,WAAW,MAAM,oBAAoB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAEnE;;GAEG;AACH,MAAM,oBAAoB,GAAG,iBAAiB,CAAC;AAE/C;;GAEG;AACH,MAAM,UAAU,uBAAuB;IACrC,OAAO,WAAW,CAAC,IAAI,CAAC;AAC1B,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,kBAAkB;IAChC,MAAM,WAAW,GAAG,uBAAuB,EAAE,CAAC;IAC9C,qDAAqD;IACrD,OAAO,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,cAAc,EAAE,WAAW,CAAC,CAAC,CAAC;AACzE,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,sBAAsB;IACpC,OAAO,CAAC,kBAAkB,EAAE,CAAC;AAC/B,CAAC;AAED;;;GAGG;AACH,MAAM,gBAAgB,GAAG;IACvB,EAAE;IACF,UAAU;IACV,SAAS;IACT,SAAS;IACT,MAAM;IACN,MAAM;IACN,wBAAwB;IACxB,mCAAmC;IACnC,oBAAoB;IACpB,oBAAoB;CACZ,CAAC;AAEX;;;;;GAKG;AACH,MAAM,UAAU,cAAc;IAC5B,MAAM,WAAW,GAAG,uBAAuB,EAAE,CAAC;IAC9C,MAAM,QAAQ,GAAa,EAAE,CAAC;IAE9B,KAAK,MAAM,OAAO,IAAI,gBAAgB,EAAE,CAAC;QACvC,2BAA2B;QAC3B,QAAQ,CAAC,IAAI,CAAC,GAAG,WAAW,GAAG,OAAO,EAAE,CAAC,CAAC;QAC1C,sDAAsD;QACtD,IAAI,WAAW,KAAK,oBAAoB,EAAE,CAAC;YACzC,QAAQ,CAAC,IAAI,CAAC,GAAG,oBAAoB,GAAG,OAAO,EAAE,CAAC,CAAC;QACrD,CAAC;IACH,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;GAEG;AACH,MAAM,cAAc,GAAG;IACrB,wBAAwB;IACxB,oBAAoB;IACpB,oBAAoB;IACpB,mCAAmC;IACnC,mCAAmC;IACnC,UAAU;IACV,SAAS;IACT,SAAS;IACT,MAAM;IACN,MAAM;CACE,CAAC;AAEX;;;;;;;GAOG;AACH,MAAM,UAAU,iBAAiB;IAC/B,IAAI,sBAAsB,EAAE,EAAE,CAAC;QAC7B,mDAAmD;QACnD,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,WAAW,GAAG,uBAAuB,EAAE,CAAC;IAC9C,MAAM,OAAO,GAA2B,EAAE,CAAC;IAE3C,KAAK,MAAM,OAAO,IAAI,cAAc,EAAE,CAAC;QACrC,OAAO,CAAC,GAAG,oBAAoB,GAAG,OAAO,EAAE,CAAC,GAAG,GAAG,WAAW,GAAG,OAAO,EAAE,CAAC;IAC5E,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
export declare const VIRTUAL_ENTRY_BROWSER: string;
|
|
6
|
+
export declare const VIRTUAL_ENTRY_SSR: string;
|
|
7
|
+
/**
|
|
8
|
+
* Generate the RSC entry content with the specified router path
|
|
9
|
+
*/
|
|
10
|
+
export declare function getVirtualEntryRSC(routerPath: string): string;
|
|
11
|
+
/**
|
|
12
|
+
* Virtual module IDs
|
|
13
|
+
*/
|
|
14
|
+
export declare const VIRTUAL_IDS: {
|
|
15
|
+
readonly browser: "virtual:rsc-router/entry.browser.js";
|
|
16
|
+
readonly ssr: "virtual:rsc-router/entry.ssr.js";
|
|
17
|
+
readonly rsc: "virtual:rsc-router/entry.rsc.js";
|
|
18
|
+
readonly version: "@rangojs/router:version";
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Virtual module content for version.
|
|
22
|
+
* Exports VERSION - a timestamp that changes on server restart (dev) or at build time (production).
|
|
23
|
+
*/
|
|
24
|
+
export declare function getVirtualVersionContent(version: string): string;
|
|
25
|
+
//# sourceMappingURL=virtual-entries.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"virtual-entries.d.ts","sourceRoot":"","sources":["../../src/vite/virtual-entries.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,MAAM,qBAAqB,EAAE,MA+B5B,CAAC;AAET,eAAO,MAAM,iBAAiB,EAAE,MAaxB,CAAC;AAET;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAuC7D;AAED;;GAEG;AACH,eAAO,MAAM,WAAW;;;;;CAKd,CAAC;AAEX;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEhE"}
|
|
@@ -0,0 +1,110 @@
|
|
|
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
|
+
export const VIRTUAL_ENTRY_BROWSER = `
|
|
6
|
+
import {
|
|
7
|
+
createFromReadableStream,
|
|
8
|
+
createFromFetch,
|
|
9
|
+
setServerCallback,
|
|
10
|
+
encodeReply,
|
|
11
|
+
createTemporaryReferenceSet,
|
|
12
|
+
} from "@rangojs/router/internal/deps/browser";
|
|
13
|
+
import { createElement, StrictMode } from "react";
|
|
14
|
+
import { hydrateRoot } from "react-dom/client";
|
|
15
|
+
import { rscStream } from "@rangojs/router/internal/deps/html-stream-client";
|
|
16
|
+
import { initBrowserApp, RSCRouter } from "@rangojs/router/browser";
|
|
17
|
+
|
|
18
|
+
async function initializeApp() {
|
|
19
|
+
const deps = {
|
|
20
|
+
createFromFetch,
|
|
21
|
+
createFromReadableStream,
|
|
22
|
+
encodeReply,
|
|
23
|
+
setServerCallback,
|
|
24
|
+
createTemporaryReferenceSet,
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
await initBrowserApp({ rscStream, deps });
|
|
28
|
+
|
|
29
|
+
hydrateRoot(
|
|
30
|
+
document,
|
|
31
|
+
createElement(StrictMode, null, createElement(RSCRouter))
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
initializeApp().catch(console.error);
|
|
36
|
+
`.trim();
|
|
37
|
+
export const VIRTUAL_ENTRY_SSR = `
|
|
38
|
+
import { createFromReadableStream } from "@rangojs/router/internal/deps/ssr";
|
|
39
|
+
import { renderToReadableStream } from "react-dom/server.edge";
|
|
40
|
+
import { injectRSCPayload } from "@rangojs/router/internal/deps/html-stream-server";
|
|
41
|
+
import { createSSRHandler } from "@rangojs/router/ssr";
|
|
42
|
+
|
|
43
|
+
export const renderHTML = createSSRHandler({
|
|
44
|
+
createFromReadableStream,
|
|
45
|
+
renderToReadableStream,
|
|
46
|
+
injectRSCPayload,
|
|
47
|
+
loadBootstrapScriptContent: () =>
|
|
48
|
+
import.meta.viteRsc.loadBootstrapScriptContent("index"),
|
|
49
|
+
});
|
|
50
|
+
`.trim();
|
|
51
|
+
/**
|
|
52
|
+
* Generate the RSC entry content with the specified router path
|
|
53
|
+
*/
|
|
54
|
+
export function getVirtualEntryRSC(routerPath) {
|
|
55
|
+
return `
|
|
56
|
+
import {
|
|
57
|
+
renderToReadableStream,
|
|
58
|
+
decodeReply,
|
|
59
|
+
createTemporaryReferenceSet,
|
|
60
|
+
loadServerAction,
|
|
61
|
+
decodeAction,
|
|
62
|
+
decodeFormState,
|
|
63
|
+
} from "@rangojs/router/internal/deps/rsc";
|
|
64
|
+
import { router } from "${routerPath}";
|
|
65
|
+
import { createRSCHandler } from "@rangojs/router/internal/rsc-handler";
|
|
66
|
+
import { VERSION } from "@rangojs/router:version";
|
|
67
|
+
|
|
68
|
+
// Import loader manifest to ensure all fetchable loaders are registered at startup
|
|
69
|
+
// This is critical for serverless/multi-process deployments where the loader module
|
|
70
|
+
// might not be imported before a GET request arrives
|
|
71
|
+
import "virtual:rsc-router/loader-manifest";
|
|
72
|
+
|
|
73
|
+
// Import pre-generated route manifest so href() works immediately on cold start.
|
|
74
|
+
// In build mode, this contains the full route map generated at build time.
|
|
75
|
+
// In dev mode, this is a no-op (manifest is populated in-memory by the discovery plugin).
|
|
76
|
+
import "virtual:rsc-router/routes-manifest";
|
|
77
|
+
|
|
78
|
+
export default createRSCHandler({
|
|
79
|
+
router,
|
|
80
|
+
version: VERSION,
|
|
81
|
+
deps: {
|
|
82
|
+
renderToReadableStream,
|
|
83
|
+
decodeReply,
|
|
84
|
+
createTemporaryReferenceSet,
|
|
85
|
+
loadServerAction,
|
|
86
|
+
decodeAction,
|
|
87
|
+
decodeFormState,
|
|
88
|
+
},
|
|
89
|
+
loadSSRModule: () =>
|
|
90
|
+
import.meta.viteRsc.loadModule("ssr", "index"),
|
|
91
|
+
});
|
|
92
|
+
`.trim();
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Virtual module IDs
|
|
96
|
+
*/
|
|
97
|
+
export const VIRTUAL_IDS = {
|
|
98
|
+
browser: "virtual:rsc-router/entry.browser.js",
|
|
99
|
+
ssr: "virtual:rsc-router/entry.ssr.js",
|
|
100
|
+
rsc: "virtual:rsc-router/entry.rsc.js",
|
|
101
|
+
version: "@rangojs/router:version",
|
|
102
|
+
};
|
|
103
|
+
/**
|
|
104
|
+
* Virtual module content for version.
|
|
105
|
+
* Exports VERSION - a timestamp that changes on server restart (dev) or at build time (production).
|
|
106
|
+
*/
|
|
107
|
+
export function getVirtualVersionContent(version) {
|
|
108
|
+
return `export const VERSION = ${JSON.stringify(version)};`;
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=virtual-entries.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"virtual-entries.js","sourceRoot":"","sources":["../../src/vite/virtual-entries.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,CAAC,MAAM,qBAAqB,GAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+B5C,CAAC,IAAI,EAAE,CAAC;AAET,MAAM,CAAC,MAAM,iBAAiB,GAAW;;;;;;;;;;;;;CAaxC,CAAC,IAAI,EAAE,CAAC;AAET;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,UAAkB;IACnD,OAAO;;;;;;;;;0BASiB,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4BnC,CAAC,IAAI,EAAE,CAAC;AACT,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,OAAO,EAAE,qCAAqC;IAC9C,GAAG,EAAE,iCAAiC;IACtC,GAAG,EAAE,iCAAiC;IACtC,OAAO,EAAE,yBAAyB;CAC1B,CAAC;AAEX;;;GAGG;AACH,MAAM,UAAU,wBAAwB,CAAC,OAAe;IACtD,OAAO,0BAA0B,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC;AAC9D,CAAC"}
|
package/package.json
CHANGED
package/skills/loader/SKILL.md
CHANGED
|
@@ -65,24 +65,10 @@ export const urlpatterns = urls(({ path, loader }) => [
|
|
|
65
65
|
|
|
66
66
|
## Consuming Loader Data
|
|
67
67
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
> **IMPORTANT: Prefer consuming loaders in client components.** Keeping data
|
|
73
|
-
> fetching in loaders and consumption in client components creates a clean
|
|
74
|
-
> separation: the server-side handler renders static markup that can be
|
|
75
|
-
> freely cached with `cache()`, while loader data stays fresh on every
|
|
76
|
-
> request. When you consume loaders in server handlers via `ctx.use()`, the
|
|
77
|
-
> handler output depends on the loader data, which means caching the handler
|
|
78
|
-
> also caches the data — defeating the purpose of the live data layer.
|
|
79
|
-
|
|
80
|
-
### In Client Components (Preferred)
|
|
81
|
-
|
|
82
|
-
Client components use `useLoader()` from `@rangojs/router/client`.
|
|
83
|
-
The loader **must** be registered with `loader()` in the route's DSL
|
|
84
|
-
segments so the framework knows to resolve it during SSR and stream
|
|
85
|
-
the data to the client:
|
|
68
|
+
Register loaders with `loader()` in the DSL and consume them in client
|
|
69
|
+
components with `useLoader()`. This is the recommended pattern — it keeps
|
|
70
|
+
data fetching on the server and consumption on the client, with a clean
|
|
71
|
+
separation that works correctly with `cache()`.
|
|
86
72
|
|
|
87
73
|
```typescript
|
|
88
74
|
"use client";
|
|
@@ -96,40 +82,60 @@ function ProductDetails() {
|
|
|
96
82
|
```
|
|
97
83
|
|
|
98
84
|
```typescript
|
|
99
|
-
// Route definition — loader() registration required
|
|
85
|
+
// Route definition — loader() registration required
|
|
100
86
|
path("/product/:slug", ProductPage, { name: "product" }, () => [
|
|
101
|
-
loader(ProductLoader),
|
|
87
|
+
loader(ProductLoader),
|
|
102
88
|
]);
|
|
103
89
|
```
|
|
104
90
|
|
|
105
|
-
|
|
91
|
+
DSL loaders are the **live data layer** — they resolve fresh on every
|
|
92
|
+
request, even when the route is inside a `cache()` boundary. The router
|
|
93
|
+
excludes them from the segment cache at storage time and re-resolves them
|
|
94
|
+
on retrieval. This means `cache()` gives you cached UI + fresh data by
|
|
95
|
+
default.
|
|
106
96
|
|
|
107
|
-
|
|
108
|
-
This doesn't require `loader()` registration in the DSL — it works
|
|
109
|
-
standalone. **However**, prefer client-side consumption when possible (see
|
|
110
|
-
note above).
|
|
97
|
+
### Cache safety
|
|
111
98
|
|
|
112
|
-
|
|
113
|
-
|
|
99
|
+
DSL loaders can safely read `createVar({ cache: false })` variables
|
|
100
|
+
because they are always resolved fresh. The read guard is bypassed for
|
|
101
|
+
loader functions — they never produce stale data.
|
|
102
|
+
|
|
103
|
+
### ctx.use(Loader) — escape hatch
|
|
104
|
+
|
|
105
|
+
For cases where you need loader data in the server handler itself (e.g.,
|
|
106
|
+
to set ctx variables or make routing decisions), use `ctx.use(Loader)`:
|
|
114
107
|
|
|
115
|
-
|
|
108
|
+
```typescript
|
|
116
109
|
path("/product/:slug", async (ctx) => {
|
|
117
110
|
const { product } = await ctx.use(ProductLoader);
|
|
118
|
-
|
|
119
|
-
|
|
111
|
+
ctx.set(Product, product); // make available to children
|
|
112
|
+
return <ProductPage />;
|
|
113
|
+
}, { name: "product" }, () => [
|
|
114
|
+
loader(ProductLoader), // still register for client consumption
|
|
115
|
+
])
|
|
120
116
|
```
|
|
121
117
|
|
|
122
|
-
When you
|
|
118
|
+
When you register with `loader()` in the DSL, `ctx.use()` returns the
|
|
123
119
|
same memoized result — loaders never run twice per request.
|
|
124
120
|
|
|
121
|
+
**Limitations of ctx.use(Loader):**
|
|
122
|
+
|
|
123
|
+
- The handler output depends on the loader data. If the route is inside
|
|
124
|
+
`cache()`, the handler is cached with the loader result baked in —
|
|
125
|
+
defeating the live data guarantee.
|
|
126
|
+
- Non-cacheable variable reads (`createVar({ cache: false })`) inside the
|
|
127
|
+
handler still throw, even if the data came from a loader.
|
|
128
|
+
- Prefer DSL `loader()` + client `useLoader()` for data that depends on
|
|
129
|
+
non-cacheable context variables.
|
|
130
|
+
|
|
125
131
|
**Never use `useLoader()` in server components** — it is a client-only API.
|
|
126
132
|
|
|
127
133
|
### Summary
|
|
128
134
|
|
|
129
|
-
|
|
|
130
|
-
|
|
|
131
|
-
|
|
|
132
|
-
|
|
|
135
|
+
| Pattern | API | Cache-safe | Recommended |
|
|
136
|
+
| ---------------------- | ------------------- | ---------- | ----------- |
|
|
137
|
+
| DSL + client component | `useLoader(Loader)` | Yes | Yes |
|
|
138
|
+
| Handler escape hatch | `ctx.use(Loader)` | No | When needed |
|
|
133
139
|
|
|
134
140
|
## Loader Context
|
|
135
141
|
|
|
@@ -548,7 +554,7 @@ export const ProductLoader = createLoader(async (ctx) => {
|
|
|
548
554
|
.first();
|
|
549
555
|
|
|
550
556
|
if (!product) {
|
|
551
|
-
|
|
557
|
+
notFound("Product not found");
|
|
552
558
|
}
|
|
553
559
|
|
|
554
560
|
return { product };
|
|
@@ -564,10 +570,9 @@ export const CartLoader = createLoader(async (ctx) => {
|
|
|
564
570
|
return { cart };
|
|
565
571
|
});
|
|
566
572
|
|
|
567
|
-
// urls.tsx
|
|
573
|
+
// urls.tsx — register loaders in the DSL
|
|
568
574
|
export const urlpatterns = urls(({ path, layout, loader, loading, cache, revalidate }) => [
|
|
569
575
|
layout(<ShopLayout />, () => [
|
|
570
|
-
// Shared cart loader for all shop routes
|
|
571
576
|
loader(CartLoader, () => [
|
|
572
577
|
revalidate(({ actionId }) => actionId?.includes("Cart") ?? false),
|
|
573
578
|
]),
|
|
@@ -579,17 +584,22 @@ export const urlpatterns = urls(({ path, layout, loader, loading, cache, revalid
|
|
|
579
584
|
]),
|
|
580
585
|
]);
|
|
581
586
|
|
|
582
|
-
//
|
|
587
|
+
// components/ProductDetails.tsx — consume in client component
|
|
588
|
+
"use client";
|
|
589
|
+
import { useLoader } from "@rangojs/router/client";
|
|
583
590
|
import { ProductLoader, CartLoader } from "./loaders/shop";
|
|
584
591
|
|
|
585
|
-
|
|
586
|
-
const { product } =
|
|
587
|
-
const { cart } =
|
|
592
|
+
function ProductDetails() {
|
|
593
|
+
const { data: { product } } = useLoader(ProductLoader);
|
|
594
|
+
const { data: { cart } } = useLoader(CartLoader);
|
|
588
595
|
|
|
589
596
|
return (
|
|
590
597
|
<div>
|
|
591
598
|
<h1>{product.name}</h1>
|
|
592
|
-
<AddToCartButton
|
|
599
|
+
<AddToCartButton
|
|
600
|
+
productId={product.id}
|
|
601
|
+
inCart={cart?.items.includes(product.id)}
|
|
602
|
+
/>
|
|
593
603
|
</div>
|
|
594
604
|
);
|
|
595
605
|
}
|
|
@@ -84,10 +84,10 @@ interface RSCRouterOptions<TEnv> {
|
|
|
84
84
|
// Default error boundary
|
|
85
85
|
defaultErrorBoundary?: ReactNode | ErrorBoundaryHandler;
|
|
86
86
|
|
|
87
|
-
// Default not-found boundary
|
|
87
|
+
// Default not-found boundary for notFound() thrown in handlers/loaders
|
|
88
88
|
defaultNotFoundBoundary?: ReactNode | NotFoundBoundaryHandler;
|
|
89
89
|
|
|
90
|
-
// Component for 404
|
|
90
|
+
// Component for 404 (no route match, or notFound() without a boundary)
|
|
91
91
|
notFound?: ReactNode | ((props: { pathname: string }) => ReactNode);
|
|
92
92
|
|
|
93
93
|
// Error logging callback
|
|
@@ -290,6 +290,56 @@ const router = createRouter({
|
|
|
290
290
|
export default router;
|
|
291
291
|
```
|
|
292
292
|
|
|
293
|
+
## Not Found Handling
|
|
294
|
+
|
|
295
|
+
Two distinct 404 scenarios:
|
|
296
|
+
|
|
297
|
+
**1. No route matches the URL** — the router renders the `notFound` component from `createRouter()` config. This is automatic.
|
|
298
|
+
|
|
299
|
+
**2. A handler/loader calls `notFound()`** — signals that the route matched but the data doesn't exist (e.g., invalid product ID).
|
|
300
|
+
|
|
301
|
+
```typescript
|
|
302
|
+
import { notFound } from "@rangojs/router";
|
|
303
|
+
|
|
304
|
+
// In a handler or loader
|
|
305
|
+
path("/product/:slug", async (ctx) => {
|
|
306
|
+
const product = await db.getProduct(ctx.params.slug);
|
|
307
|
+
if (!product) notFound("Product not found");
|
|
308
|
+
return <ProductPage product={product} />;
|
|
309
|
+
});
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
### Fallback chain for `notFound()`
|
|
313
|
+
|
|
314
|
+
When `notFound()` is thrown, the router looks for a fallback in this order:
|
|
315
|
+
|
|
316
|
+
1. **`notFoundBoundary()`** — nearest boundary in the route tree (route-level)
|
|
317
|
+
2. **`defaultNotFoundBoundary`** — from `createRouter()` config (app-level)
|
|
318
|
+
3. **`notFound`** — from `createRouter()` config (same component used for no-route-match)
|
|
319
|
+
4. **Default `<h1>Not Found</h1>`** — built-in fallback
|
|
320
|
+
|
|
321
|
+
All cases set HTTP 404 status.
|
|
322
|
+
|
|
323
|
+
### notFoundBoundary
|
|
324
|
+
|
|
325
|
+
Wrap routes with `notFoundBoundary()` for route-specific not-found UI:
|
|
326
|
+
|
|
327
|
+
```typescript
|
|
328
|
+
urls(({ path, layout }) => [
|
|
329
|
+
layout(ShopLayout, () => [
|
|
330
|
+
notFoundBoundary(({ notFound: info }) => (
|
|
331
|
+
<div>
|
|
332
|
+
<h1>Not Found</h1>
|
|
333
|
+
<p>{info.message}</p>
|
|
334
|
+
</div>
|
|
335
|
+
)),
|
|
336
|
+
path("/product/:slug", ProductPage),
|
|
337
|
+
]),
|
|
338
|
+
]);
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
`notFoundBoundary` receives `{ notFound: NotFoundInfo }` where `NotFoundInfo` contains `message`, `segmentId`, `segmentType`, and `pathname`.
|
|
342
|
+
|
|
293
343
|
## Including Sub-patterns
|
|
294
344
|
|
|
295
345
|
```typescript
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Client-side debug channel for React Performance Tracks.
|
|
3
|
+
*
|
|
4
|
+
* Creates a bidirectional channel that communicates with the server-side
|
|
5
|
+
* debug channel via Vite's HMR WebSocket. Used with createFromFetch()
|
|
6
|
+
* so Chrome DevTools can display Server Components in the Performance tab.
|
|
7
|
+
*
|
|
8
|
+
* Dev-only — gated behind import.meta.hot.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
export const DEBUG_ID_HEADER = "X-RSC-Debug-Id";
|
|
12
|
+
const DEBUG_S2C_EVENT = "rango:perf-s2c";
|
|
13
|
+
const DEBUG_C2S_EVENT = "rango:perf-c2s";
|
|
14
|
+
|
|
15
|
+
type DebugPayload =
|
|
16
|
+
| { i: string; b: string } // chunk (base64)
|
|
17
|
+
| { i: string; d: true }; // done
|
|
18
|
+
|
|
19
|
+
const bytesToBase64 = (bytes: Uint8Array) => {
|
|
20
|
+
let binary = "";
|
|
21
|
+
for (let i = 0; i < bytes.length; i++) {
|
|
22
|
+
binary += String.fromCharCode(bytes[i]!);
|
|
23
|
+
}
|
|
24
|
+
return btoa(binary);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const base64ToBytes = (base64: string) =>
|
|
28
|
+
Uint8Array.from(atob(base64), (char) => char.charCodeAt(0));
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Create a client-side debug channel for the given debugId.
|
|
32
|
+
* The channel communicates with the server via Vite's HMR WebSocket.
|
|
33
|
+
*/
|
|
34
|
+
export function createClientDebugChannel(debugId: string): {
|
|
35
|
+
readable: ReadableStream<Uint8Array>;
|
|
36
|
+
writable: WritableStream<Uint8Array>;
|
|
37
|
+
} | null {
|
|
38
|
+
const hot = (import.meta as any).hot;
|
|
39
|
+
if (!hot) return null;
|
|
40
|
+
|
|
41
|
+
let closed = false;
|
|
42
|
+
let onServerData: ((payload: DebugPayload) => void) | undefined;
|
|
43
|
+
|
|
44
|
+
const cleanup = (notify?: boolean) => {
|
|
45
|
+
if (closed) return;
|
|
46
|
+
closed = true;
|
|
47
|
+
if (onServerData) {
|
|
48
|
+
hot.off(DEBUG_S2C_EVENT, onServerData);
|
|
49
|
+
}
|
|
50
|
+
if (notify) {
|
|
51
|
+
hot.send(DEBUG_C2S_EVENT, { i: debugId, d: true } satisfies DebugPayload);
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
// Readable: receives server-to-client debug data via HMR WS
|
|
56
|
+
const readable = new ReadableStream<Uint8Array>({
|
|
57
|
+
start(controller) {
|
|
58
|
+
onServerData = (payload: DebugPayload) => {
|
|
59
|
+
if (closed || payload.i !== debugId) return;
|
|
60
|
+
if ("b" in payload) {
|
|
61
|
+
controller.enqueue(base64ToBytes(payload.b));
|
|
62
|
+
}
|
|
63
|
+
if ("d" in payload) {
|
|
64
|
+
cleanup();
|
|
65
|
+
controller.close();
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
hot.on(DEBUG_S2C_EVENT, onServerData);
|
|
69
|
+
},
|
|
70
|
+
cancel() {
|
|
71
|
+
cleanup(true);
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
// Writable: sends client-to-server commands via HMR WS
|
|
76
|
+
const writable = new WritableStream<Uint8Array>({
|
|
77
|
+
write(chunk) {
|
|
78
|
+
if (closed) throw new TypeError("Channel is closed");
|
|
79
|
+
hot.send(DEBUG_C2S_EVENT, {
|
|
80
|
+
i: debugId,
|
|
81
|
+
b: bytesToBase64(chunk),
|
|
82
|
+
} satisfies DebugPayload);
|
|
83
|
+
},
|
|
84
|
+
close() {
|
|
85
|
+
cleanup(true);
|
|
86
|
+
},
|
|
87
|
+
abort() {
|
|
88
|
+
cleanup(true);
|
|
89
|
+
},
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
return { readable, writable };
|
|
93
|
+
}
|