react-router 7.16.0 → 8.0.0-pre.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +0 -1
- package/dist/development/dom-export.d.ts +6 -172
- package/dist/development/dom-export.js +12 -1007
- package/dist/development/index-react-server-client.d.ts +7 -4
- package/dist/development/index-react-server-client.js +8 -52
- package/dist/development/index-react-server.d.ts +1645 -1635
- package/dist/development/index-react-server.js +2880 -3642
- package/dist/development/index.d.ts +43 -1475
- package/dist/development/index.js +37 -2621
- package/dist/development/lib/actions.js +62 -0
- package/dist/development/lib/components.d.ts +1022 -0
- package/dist/development/lib/components.js +835 -0
- package/dist/development/lib/context.d.ts +83 -0
- package/dist/development/lib/context.js +41 -0
- package/dist/development/lib/dom/dom.d.ts +119 -0
- package/dist/development/lib/dom/dom.js +143 -0
- package/dist/development/lib/dom/lib.d.ts +2042 -0
- package/dist/development/lib/dom/lib.js +1259 -0
- package/dist/development/lib/dom/server.d.ts +138 -0
- package/dist/development/lib/dom/server.js +301 -0
- package/dist/development/lib/dom/ssr/components.d.ts +196 -0
- package/dist/development/lib/dom/ssr/components.js +579 -0
- package/dist/development/lib/dom/ssr/data.js +29 -0
- package/dist/development/lib/dom/ssr/entry.d.ts +59 -0
- package/dist/development/lib/dom/ssr/errorBoundaries.d.ts +27 -0
- package/dist/development/lib/dom/ssr/errorBoundaries.js +83 -0
- package/dist/development/lib/dom/ssr/errors.d.ts +7 -0
- package/dist/development/lib/dom/ssr/errors.js +36 -0
- package/dist/development/lib/dom/ssr/fallback.js +28 -0
- package/dist/development/lib/dom/ssr/fog-of-war.d.ts +12 -0
- package/dist/development/lib/dom/ssr/fog-of-war.js +170 -0
- package/dist/development/lib/dom/ssr/hydration.d.ts +32 -0
- package/dist/development/lib/dom/ssr/hydration.js +29 -0
- package/dist/development/lib/dom/ssr/invariant.js +16 -0
- package/dist/development/lib/dom/ssr/links.js +170 -0
- package/dist/development/lib/dom/ssr/markup.js +24 -0
- package/dist/development/lib/dom/ssr/routeModules.d.ts +206 -0
- package/dist/development/lib/dom/ssr/routeModules.js +31 -0
- package/dist/development/lib/dom/ssr/routes-test-stub.d.ts +62 -0
- package/dist/development/lib/dom/ssr/routes-test-stub.js +108 -0
- package/dist/development/lib/dom/ssr/routes.d.ts +33 -0
- package/dist/development/lib/dom/ssr/routes.js +303 -0
- package/dist/development/lib/dom/ssr/server.d.ts +45 -0
- package/dist/development/lib/dom/ssr/server.js +68 -0
- package/dist/development/lib/dom/ssr/single-fetch.d.ts +14 -0
- package/dist/development/lib/dom/ssr/single-fetch.js +346 -0
- package/dist/development/lib/dom-export/dom-router-provider.d.ts +9 -0
- package/dist/development/lib/dom-export/dom-router-provider.js +22 -0
- package/dist/development/lib/dom-export/hydrated-router.d.ts +125 -0
- package/dist/development/lib/dom-export/hydrated-router.js +153 -0
- package/dist/development/lib/errors.js +29 -0
- package/dist/development/lib/hooks.d.ts +947 -0
- package/dist/development/lib/hooks.js +1386 -0
- package/dist/development/lib/href.d.ts +20 -0
- package/dist/development/lib/href.js +50 -0
- package/dist/development/lib/router/history.d.ts +258 -0
- package/dist/development/lib/router/history.js +371 -0
- package/dist/development/lib/router/instrumentation.d.ts +86 -0
- package/dist/development/lib/router/instrumentation.js +213 -0
- package/dist/development/lib/router/links.d.ts +113 -0
- package/dist/development/lib/router/router.d.ts +663 -0
- package/dist/development/lib/router/router.js +2981 -0
- package/dist/development/lib/router/utils.d.ts +942 -0
- package/dist/development/lib/router/utils.js +791 -0
- package/dist/development/lib/rsc/browser.d.ts +137 -0
- package/dist/development/lib/rsc/browser.js +599 -0
- package/dist/development/lib/rsc/errorBoundaries.d.ts +11 -0
- package/dist/development/lib/rsc/errorBoundaries.js +90 -0
- package/dist/development/lib/rsc/html-stream/browser.d.ts +48 -0
- package/dist/development/lib/rsc/html-stream/browser.js +74 -0
- package/dist/development/lib/rsc/html-stream/server.js +78 -0
- package/dist/development/lib/rsc/route-modules.js +27 -0
- package/dist/development/lib/rsc/server.rsc.d.ts +219 -0
- package/dist/development/lib/rsc/server.ssr.d.ts +129 -0
- package/dist/development/lib/rsc/server.ssr.js +388 -0
- package/dist/development/lib/server-runtime/build.d.ts +66 -0
- package/dist/development/lib/server-runtime/cookies.d.ts +66 -0
- package/dist/development/lib/server-runtime/cookies.js +139 -0
- package/dist/development/lib/server-runtime/crypto.js +43 -0
- package/dist/development/lib/server-runtime/data.d.ts +13 -0
- package/dist/development/lib/server-runtime/data.js +25 -0
- package/dist/development/lib/server-runtime/dev.d.ts +9 -0
- package/dist/development/lib/server-runtime/dev.js +26 -0
- package/dist/development/lib/server-runtime/entry.js +20 -0
- package/dist/development/lib/server-runtime/errors.js +95 -0
- package/dist/development/lib/server-runtime/headers.js +73 -0
- package/dist/development/lib/server-runtime/invariant.js +19 -0
- package/dist/development/lib/server-runtime/mode.d.ts +12 -0
- package/dist/development/lib/server-runtime/mode.js +25 -0
- package/dist/development/lib/server-runtime/routeMatching.js +28 -0
- package/dist/development/lib/server-runtime/routes.d.ts +13 -0
- package/dist/development/lib/server-runtime/routes.js +74 -0
- package/dist/development/lib/server-runtime/server.d.ts +10 -0
- package/dist/development/lib/server-runtime/server.js +351 -0
- package/dist/development/lib/server-runtime/serverHandoff.js +17 -0
- package/dist/development/lib/server-runtime/sessions/cookieStorage.d.ts +25 -0
- package/dist/development/lib/server-runtime/sessions/cookieStorage.js +45 -0
- package/dist/development/lib/server-runtime/sessions/memoryStorage.d.ts +23 -0
- package/dist/development/lib/server-runtime/sessions/memoryStorage.js +52 -0
- package/dist/development/lib/server-runtime/sessions.d.ts +145 -0
- package/dist/development/lib/server-runtime/sessions.js +98 -0
- package/dist/development/lib/server-runtime/single-fetch.d.ts +7 -0
- package/dist/development/lib/server-runtime/single-fetch.js +215 -0
- package/dist/development/lib/server-runtime/urls.js +31 -0
- package/dist/development/lib/server-runtime/warnings.js +20 -0
- package/dist/development/lib/types/future.d.ts +9 -0
- package/dist/development/lib/types/internal.d.ts +26 -177
- package/dist/development/lib/types/internal.js +3 -2
- package/dist/{production/register-CNAx3TXj.d.ts → development/lib/types/register.d.ts} +9 -15
- package/dist/development/lib/types/route-data.d.ts +113 -0
- package/dist/development/lib/types/route-module-annotations.d.ts +149 -0
- package/dist/development/lib/types/route-module.d.ts +19 -0
- package/dist/development/lib/types/serializes-to.d.ts +13 -0
- package/dist/development/lib/types/utils.d.ts +11 -0
- package/dist/development/vendor/turbo-stream-v2/flatten.js +159 -0
- package/dist/development/vendor/turbo-stream-v2/turbo-stream.js +178 -0
- package/dist/development/vendor/turbo-stream-v2/unflatten.js +198 -0
- package/dist/development/vendor/turbo-stream-v2/utils.js +47 -0
- package/dist/production/dom-export.d.ts +6 -172
- package/dist/production/dom-export.js +12 -1007
- package/dist/production/index-react-server-client.d.ts +7 -4
- package/dist/production/index-react-server-client.js +8 -52
- package/dist/production/index-react-server.d.ts +1645 -1635
- package/dist/production/index-react-server.js +2871 -3642
- package/dist/production/index.d.ts +43 -1475
- package/dist/production/index.js +37 -2621
- package/dist/production/lib/actions.js +62 -0
- package/dist/production/lib/components.d.ts +1022 -0
- package/dist/production/lib/components.js +835 -0
- package/dist/production/lib/context.d.ts +83 -0
- package/dist/production/lib/context.js +41 -0
- package/dist/production/lib/dom/dom.d.ts +119 -0
- package/dist/production/lib/dom/dom.js +143 -0
- package/dist/production/lib/dom/lib.d.ts +2042 -0
- package/dist/production/lib/dom/lib.js +1259 -0
- package/dist/production/lib/dom/server.d.ts +138 -0
- package/dist/production/lib/dom/server.js +301 -0
- package/dist/production/lib/dom/ssr/components.d.ts +196 -0
- package/dist/production/lib/dom/ssr/components.js +579 -0
- package/dist/production/lib/dom/ssr/data.js +29 -0
- package/dist/production/lib/dom/ssr/entry.d.ts +59 -0
- package/dist/production/lib/dom/ssr/errorBoundaries.d.ts +27 -0
- package/dist/production/lib/dom/ssr/errorBoundaries.js +83 -0
- package/dist/production/lib/dom/ssr/errors.d.ts +7 -0
- package/dist/production/lib/dom/ssr/errors.js +36 -0
- package/dist/production/lib/dom/ssr/fallback.js +21 -0
- package/dist/production/lib/dom/ssr/fog-of-war.d.ts +12 -0
- package/dist/production/lib/dom/ssr/fog-of-war.js +170 -0
- package/dist/production/lib/dom/ssr/hydration.d.ts +32 -0
- package/dist/production/lib/dom/ssr/hydration.js +29 -0
- package/dist/production/lib/dom/ssr/invariant.js +16 -0
- package/dist/production/lib/dom/ssr/links.js +170 -0
- package/dist/production/lib/dom/ssr/markup.js +24 -0
- package/dist/production/lib/dom/ssr/routeModules.d.ts +206 -0
- package/dist/production/lib/dom/ssr/routeModules.js +31 -0
- package/dist/production/lib/dom/ssr/routes-test-stub.d.ts +62 -0
- package/dist/production/lib/dom/ssr/routes-test-stub.js +108 -0
- package/dist/production/lib/dom/ssr/routes.d.ts +33 -0
- package/dist/production/lib/dom/ssr/routes.js +303 -0
- package/dist/production/lib/dom/ssr/server.d.ts +45 -0
- package/dist/production/lib/dom/ssr/server.js +68 -0
- package/dist/production/lib/dom/ssr/single-fetch.d.ts +14 -0
- package/dist/production/lib/dom/ssr/single-fetch.js +346 -0
- package/dist/production/lib/dom-export/dom-router-provider.d.ts +9 -0
- package/dist/production/lib/dom-export/dom-router-provider.js +22 -0
- package/dist/production/lib/dom-export/hydrated-router.d.ts +125 -0
- package/dist/production/lib/dom-export/hydrated-router.js +153 -0
- package/dist/production/lib/errors.js +29 -0
- package/dist/production/lib/hooks.d.ts +947 -0
- package/dist/production/lib/hooks.js +1371 -0
- package/dist/production/lib/href.d.ts +20 -0
- package/dist/production/lib/href.js +50 -0
- package/dist/production/lib/router/history.d.ts +258 -0
- package/dist/production/lib/router/history.js +371 -0
- package/dist/production/lib/router/instrumentation.d.ts +86 -0
- package/dist/production/lib/router/instrumentation.js +213 -0
- package/dist/production/lib/router/links.d.ts +113 -0
- package/dist/production/lib/router/router.d.ts +663 -0
- package/dist/production/lib/router/router.js +2981 -0
- package/dist/production/lib/router/utils.d.ts +942 -0
- package/dist/production/lib/router/utils.js +782 -0
- package/dist/production/lib/rsc/browser.d.ts +137 -0
- package/dist/production/lib/rsc/browser.js +599 -0
- package/dist/production/lib/rsc/errorBoundaries.d.ts +11 -0
- package/dist/production/lib/rsc/errorBoundaries.js +90 -0
- package/dist/production/lib/rsc/html-stream/browser.d.ts +48 -0
- package/dist/production/lib/rsc/html-stream/browser.js +74 -0
- package/dist/production/lib/rsc/html-stream/server.js +78 -0
- package/dist/production/lib/rsc/route-modules.js +27 -0
- package/dist/production/lib/rsc/server.rsc.d.ts +219 -0
- package/dist/production/lib/rsc/server.ssr.d.ts +129 -0
- package/dist/production/lib/rsc/server.ssr.js +388 -0
- package/dist/production/lib/server-runtime/build.d.ts +66 -0
- package/dist/production/lib/server-runtime/cookies.d.ts +66 -0
- package/dist/production/lib/server-runtime/cookies.js +139 -0
- package/dist/production/lib/server-runtime/crypto.js +43 -0
- package/dist/production/lib/server-runtime/data.d.ts +13 -0
- package/dist/production/lib/server-runtime/data.js +25 -0
- package/dist/production/lib/server-runtime/dev.d.ts +9 -0
- package/dist/production/lib/server-runtime/dev.js +26 -0
- package/dist/production/lib/server-runtime/entry.js +20 -0
- package/dist/production/lib/server-runtime/errors.js +95 -0
- package/dist/production/lib/server-runtime/headers.js +73 -0
- package/dist/production/lib/server-runtime/invariant.js +19 -0
- package/dist/production/lib/server-runtime/mode.d.ts +12 -0
- package/dist/production/lib/server-runtime/mode.js +25 -0
- package/dist/production/lib/server-runtime/routeMatching.js +28 -0
- package/dist/production/lib/server-runtime/routes.d.ts +13 -0
- package/dist/production/lib/server-runtime/routes.js +74 -0
- package/dist/production/lib/server-runtime/server.d.ts +10 -0
- package/dist/production/lib/server-runtime/server.js +351 -0
- package/dist/production/lib/server-runtime/serverHandoff.js +17 -0
- package/dist/production/lib/server-runtime/sessions/cookieStorage.d.ts +25 -0
- package/dist/production/lib/server-runtime/sessions/cookieStorage.js +45 -0
- package/dist/production/lib/server-runtime/sessions/memoryStorage.d.ts +23 -0
- package/dist/production/lib/server-runtime/sessions/memoryStorage.js +52 -0
- package/dist/production/lib/server-runtime/sessions.d.ts +145 -0
- package/dist/production/lib/server-runtime/sessions.js +98 -0
- package/dist/production/lib/server-runtime/single-fetch.d.ts +7 -0
- package/dist/production/lib/server-runtime/single-fetch.js +215 -0
- package/dist/production/lib/server-runtime/urls.js +31 -0
- package/dist/production/lib/server-runtime/warnings.js +20 -0
- package/dist/production/lib/types/future.d.ts +9 -0
- package/dist/production/lib/types/internal.d.ts +26 -177
- package/dist/production/lib/types/internal.js +3 -2
- package/dist/{development/register-CNAx3TXj.d.ts → production/lib/types/register.d.ts} +9 -15
- package/dist/production/lib/types/route-data.d.ts +113 -0
- package/dist/production/lib/types/route-module-annotations.d.ts +149 -0
- package/dist/production/lib/types/route-module.d.ts +19 -0
- package/dist/production/lib/types/serializes-to.d.ts +13 -0
- package/dist/production/lib/types/utils.d.ts +11 -0
- package/dist/production/vendor/turbo-stream-v2/flatten.js +159 -0
- package/dist/production/vendor/turbo-stream-v2/turbo-stream.js +178 -0
- package/dist/production/vendor/turbo-stream-v2/unflatten.js +198 -0
- package/dist/production/vendor/turbo-stream-v2/utils.js +47 -0
- package/docs/explanation/backend-for-frontend.md +50 -0
- package/docs/explanation/code-splitting.md +77 -0
- package/docs/explanation/concurrency.md +135 -0
- package/docs/explanation/form-vs-fetcher.md +292 -0
- package/docs/explanation/hot-module-replacement.md +137 -0
- package/docs/explanation/hydration.md +14 -0
- package/docs/explanation/index-query-param.md +86 -0
- package/docs/explanation/index.md +4 -0
- package/docs/explanation/lazy-route-discovery.md +78 -0
- package/docs/explanation/location.md +6 -0
- package/docs/explanation/progressive-enhancement.md +150 -0
- package/docs/explanation/race-conditions.md +88 -0
- package/docs/explanation/react-transitions.md +160 -0
- package/docs/explanation/route-matching.md +7 -0
- package/docs/explanation/server-client-execution.md +4 -0
- package/docs/explanation/sessions-and-cookies.md +465 -0
- package/docs/explanation/special-files.md +16 -0
- package/docs/explanation/state-management.md +524 -0
- package/docs/explanation/styling.md +87 -0
- package/docs/explanation/type-safety.md +82 -0
- package/docs/how-to/accessibility.md +44 -0
- package/docs/how-to/client-data.md +199 -0
- package/docs/how-to/data-strategy.md +317 -0
- package/docs/how-to/error-boundary.md +231 -0
- package/docs/how-to/error-reporting.md +134 -0
- package/docs/how-to/fetchers.md +307 -0
- package/docs/how-to/file-route-conventions.md +410 -0
- package/docs/how-to/file-uploads.md +217 -0
- package/docs/how-to/form-validation.md +120 -0
- package/docs/how-to/headers.md +164 -0
- package/docs/how-to/index.md +4 -0
- package/docs/how-to/instrumentation.md +556 -0
- package/docs/how-to/meta.md +40 -0
- package/docs/how-to/middleware.md +728 -0
- package/docs/how-to/navigation-blocking.md +233 -0
- package/docs/how-to/optimize-revalidation.md +12 -0
- package/docs/how-to/pre-rendering.md +225 -0
- package/docs/how-to/presets.md +103 -0
- package/docs/how-to/react-server-components.md +899 -0
- package/docs/how-to/resource-routes.md +126 -0
- package/docs/how-to/route-module-type-safety.md +100 -0
- package/docs/how-to/search-params.md +4 -0
- package/docs/how-to/security.md +30 -0
- package/docs/how-to/server-bundles.md +66 -0
- package/docs/how-to/spa.md +120 -0
- package/docs/how-to/status.md +63 -0
- package/docs/how-to/suspense.md +132 -0
- package/docs/how-to/using-handle.md +117 -0
- package/docs/how-to/view-transitions.md +237 -0
- package/docs/how-to/webhook.md +50 -0
- package/docs/index.md +39 -0
- package/docs/start/data/actions.md +138 -0
- package/docs/start/data/custom.md +198 -0
- package/docs/start/data/data-loading.md +44 -0
- package/docs/start/data/index.md +4 -0
- package/docs/start/data/installation.md +52 -0
- package/docs/start/data/navigating.md +12 -0
- package/docs/start/data/pending-ui.md +12 -0
- package/docs/start/data/route-object.md +248 -0
- package/docs/start/data/routing.md +281 -0
- package/docs/start/data/testing.md +8 -0
- package/docs/start/declarative/index.md +4 -0
- package/docs/start/declarative/installation.md +43 -0
- package/docs/start/declarative/navigating.md +133 -0
- package/docs/start/declarative/routing.md +237 -0
- package/docs/start/declarative/url-values.md +65 -0
- package/docs/start/framework/actions.md +175 -0
- package/docs/start/framework/data-loading.md +201 -0
- package/docs/start/framework/deploying.md +96 -0
- package/docs/start/framework/index.md +4 -0
- package/docs/start/framework/installation.md +42 -0
- package/docs/start/framework/navigating.md +182 -0
- package/docs/start/framework/pending-ui.md +142 -0
- package/docs/start/framework/rendering.md +59 -0
- package/docs/start/framework/route-module.md +527 -0
- package/docs/start/framework/routing.md +362 -0
- package/docs/start/framework/testing.md +133 -0
- package/docs/start/index.md +4 -0
- package/docs/start/modes.md +201 -0
- package/docs/upgrading/component-routes.md +363 -0
- package/docs/upgrading/future.md +31 -0
- package/docs/upgrading/index.md +4 -0
- package/docs/upgrading/remix.md +403 -0
- package/docs/upgrading/router-provider.md +442 -0
- package/docs/upgrading/v6.md +379 -0
- package/package.json +44 -87
- package/dist/development/browser-D3uq9sI1.d.ts +0 -318
- package/dist/development/browser-nIQ4Nsyi.d.mts +0 -318
- package/dist/development/chunk-IBI7OMNB.js +0 -1363
- package/dist/development/chunk-QUQL4437.mjs +0 -11529
- package/dist/development/chunk-S54KXAEJ.mjs +0 -2585
- package/dist/development/chunk-SRID2YZ2.js +0 -10229
- package/dist/development/chunk-XEJDWL2B.js +0 -188
- package/dist/development/context-m8rizgnE.d.mts +0 -1771
- package/dist/development/data-D4xhSy90.d.ts +0 -1732
- package/dist/development/data-U8FS-wNn.d.mts +0 -1732
- package/dist/development/dom-export.d.mts +0 -172
- package/dist/development/dom-export.mjs +0 -1008
- package/dist/development/index-react-server-client-BLiUx67a.d.ts +0 -3655
- package/dist/development/index-react-server-client-CdKROblb.d.mts +0 -2600
- package/dist/development/index-react-server-client.d.mts +0 -4
- package/dist/development/index-react-server-client.mjs +0 -59
- package/dist/development/index-react-server.d.mts +0 -2703
- package/dist/development/index-react-server.mjs +0 -3780
- package/dist/development/index.d.mts +0 -1478
- package/dist/development/index.mjs +0 -277
- package/dist/development/instrumentation-1q4YhLGP.d.ts +0 -715
- package/dist/development/lib/types/internal.d.mts +0 -184
- package/dist/development/lib/types/internal.mjs +0 -10
- package/dist/development/register-CqK96Zfk.d.mts +0 -30
- package/dist/production/browser-D3uq9sI1.d.ts +0 -318
- package/dist/production/browser-nIQ4Nsyi.d.mts +0 -318
- package/dist/production/chunk-EAQNHM3N.js +0 -188
- package/dist/production/chunk-NALGHHKE.mjs +0 -2585
- package/dist/production/chunk-Q65P7S7Y.mjs +0 -11529
- package/dist/production/chunk-SKEDDLRM.js +0 -1363
- package/dist/production/chunk-Y7DNFQZP.js +0 -10229
- package/dist/production/context-m8rizgnE.d.mts +0 -1771
- package/dist/production/data-D4xhSy90.d.ts +0 -1732
- package/dist/production/data-U8FS-wNn.d.mts +0 -1732
- package/dist/production/dom-export.d.mts +0 -172
- package/dist/production/dom-export.mjs +0 -1008
- package/dist/production/index-react-server-client-BLiUx67a.d.ts +0 -3655
- package/dist/production/index-react-server-client-CdKROblb.d.mts +0 -2600
- package/dist/production/index-react-server-client.d.mts +0 -4
- package/dist/production/index-react-server-client.mjs +0 -59
- package/dist/production/index-react-server.d.mts +0 -2703
- package/dist/production/index-react-server.mjs +0 -3780
- package/dist/production/index.d.mts +0 -1478
- package/dist/production/index.mjs +0 -277
- package/dist/production/instrumentation-1q4YhLGP.d.ts +0 -715
- package/dist/production/lib/types/internal.d.mts +0 -184
- package/dist/production/lib/types/internal.mjs +0 -10
- package/dist/production/register-CqK96Zfk.d.mts +0 -30
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
|
|
2
|
+
import { Location } from "../../router/history.js";
|
|
3
|
+
import { ActionFunction, ActionFunctionArgs, DataRouteMatch, DataStrategyResult, LoaderFunction, LoaderFunctionArgs, MiddlewareFunction, Params, ShouldRevalidateFunction } from "../../router/utils.js";
|
|
4
|
+
import { LinkDescriptor } from "../../router/links.js";
|
|
5
|
+
import { SerializeFrom } from "../../types/route-data.js";
|
|
6
|
+
import { ComponentType, ReactElement } from "react";
|
|
7
|
+
|
|
8
|
+
//#region lib/dom/ssr/routeModules.d.ts
|
|
9
|
+
interface RouteModules {
|
|
10
|
+
[routeId: string]: RouteModule | undefined;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The shape of a route module shipped to the client
|
|
14
|
+
*/
|
|
15
|
+
interface RouteModule {
|
|
16
|
+
clientAction?: ClientActionFunction;
|
|
17
|
+
clientLoader?: ClientLoaderFunction;
|
|
18
|
+
clientMiddleware?: MiddlewareFunction<Record<string, DataStrategyResult>>[];
|
|
19
|
+
ErrorBoundary?: ErrorBoundaryComponent;
|
|
20
|
+
HydrateFallback?: HydrateFallbackComponent;
|
|
21
|
+
Layout?: LayoutComponent;
|
|
22
|
+
default: RouteComponent;
|
|
23
|
+
handle?: RouteHandle;
|
|
24
|
+
links?: LinksFunction;
|
|
25
|
+
meta?: MetaFunction;
|
|
26
|
+
shouldRevalidate?: ShouldRevalidateFunction;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* The shape of a route module on the server
|
|
30
|
+
*/
|
|
31
|
+
interface ServerRouteModule extends RouteModule {
|
|
32
|
+
action?: ActionFunction;
|
|
33
|
+
headers?: HeadersFunction | {
|
|
34
|
+
[name: string]: string;
|
|
35
|
+
};
|
|
36
|
+
loader?: LoaderFunction;
|
|
37
|
+
middleware?: MiddlewareFunction<Response>[];
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* A function that handles data mutations for a route on the client
|
|
41
|
+
*/
|
|
42
|
+
type ClientActionFunction = (args: ClientActionFunctionArgs) => ReturnType<ActionFunction>;
|
|
43
|
+
/**
|
|
44
|
+
* Arguments passed to a route `clientAction` function
|
|
45
|
+
*/
|
|
46
|
+
type ClientActionFunctionArgs = ActionFunctionArgs & {
|
|
47
|
+
serverAction: <T = unknown>() => Promise<SerializeFrom<T>>;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* A function that loads data for a route on the client
|
|
51
|
+
*/
|
|
52
|
+
type ClientLoaderFunction = ((args: ClientLoaderFunctionArgs) => ReturnType<LoaderFunction>) & {
|
|
53
|
+
hydrate?: boolean;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Arguments passed to a route `clientLoader` function
|
|
57
|
+
*/
|
|
58
|
+
type ClientLoaderFunctionArgs = LoaderFunctionArgs & {
|
|
59
|
+
serverLoader: <T = unknown>() => Promise<SerializeFrom<T>>;
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* ErrorBoundary to display for this route
|
|
63
|
+
*/
|
|
64
|
+
type ErrorBoundaryComponent = ComponentType;
|
|
65
|
+
type HeadersArgs = {
|
|
66
|
+
loaderHeaders: Headers;
|
|
67
|
+
parentHeaders: Headers;
|
|
68
|
+
actionHeaders: Headers;
|
|
69
|
+
errorHeaders: Headers | undefined;
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* A function that returns HTTP headers to be used for a route. These headers
|
|
73
|
+
* will be merged with (and take precedence over) headers from parent routes.
|
|
74
|
+
*/
|
|
75
|
+
interface HeadersFunction {
|
|
76
|
+
(args: HeadersArgs): Headers | HeadersInit;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* `<Route HydrateFallback>` component to render on initial loads
|
|
80
|
+
* when client loaders are present
|
|
81
|
+
*/
|
|
82
|
+
type HydrateFallbackComponent = ComponentType;
|
|
83
|
+
/**
|
|
84
|
+
* Optional, root-only `<Route Layout>` component to wrap the root content in.
|
|
85
|
+
* Useful for defining the <html>/<head>/<body> document shell shared by the
|
|
86
|
+
* Component, HydrateFallback, and ErrorBoundary
|
|
87
|
+
*/
|
|
88
|
+
type LayoutComponent = ComponentType<{
|
|
89
|
+
children: ReactElement<unknown, ErrorBoundaryComponent | HydrateFallbackComponent | RouteComponent>;
|
|
90
|
+
}>;
|
|
91
|
+
/**
|
|
92
|
+
* A function that defines `<link>` tags to be inserted into the `<head>` of
|
|
93
|
+
* the document on route transitions.
|
|
94
|
+
*
|
|
95
|
+
* @see https://reactrouter.com/start/framework/route-module#meta
|
|
96
|
+
*/
|
|
97
|
+
interface LinksFunction {
|
|
98
|
+
(): LinkDescriptor[];
|
|
99
|
+
}
|
|
100
|
+
interface MetaMatch<RouteId extends string = string, Loader extends LoaderFunction | ClientLoaderFunction | unknown = unknown> {
|
|
101
|
+
id: RouteId;
|
|
102
|
+
pathname: DataRouteMatch["pathname"];
|
|
103
|
+
loaderData: Loader extends LoaderFunction | ClientLoaderFunction ? SerializeFrom<Loader> : unknown;
|
|
104
|
+
handle?: RouteHandle;
|
|
105
|
+
params: DataRouteMatch["params"];
|
|
106
|
+
meta: MetaDescriptor[];
|
|
107
|
+
error?: unknown;
|
|
108
|
+
}
|
|
109
|
+
type MetaMatches<MatchLoaders extends Record<string, LoaderFunction | ClientLoaderFunction | unknown> = Record<string, unknown>> = Array<{ [K in keyof MatchLoaders]: MetaMatch<Exclude<K, number | symbol>, MatchLoaders[K]> }[keyof MatchLoaders]>;
|
|
110
|
+
interface MetaArgs<Loader extends LoaderFunction | ClientLoaderFunction | unknown = unknown, MatchLoaders extends Record<string, LoaderFunction | ClientLoaderFunction | unknown> = Record<string, unknown>> {
|
|
111
|
+
loaderData: (Loader extends LoaderFunction | ClientLoaderFunction ? SerializeFrom<Loader> : unknown) | undefined;
|
|
112
|
+
params: Params;
|
|
113
|
+
location: Location;
|
|
114
|
+
matches: MetaMatches<MatchLoaders>;
|
|
115
|
+
error?: unknown;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* A function that returns an array of data objects to use for rendering
|
|
119
|
+
* metadata HTML tags in a route. These tags are not rendered on descendant
|
|
120
|
+
* routes in the route hierarchy. In other words, they will only be rendered on
|
|
121
|
+
* the route in which they are exported.
|
|
122
|
+
*
|
|
123
|
+
* @param Loader - The type of the current route's loader function
|
|
124
|
+
* @param MatchLoaders - Mapping from a parent route's filepath to its loader
|
|
125
|
+
* function type
|
|
126
|
+
*
|
|
127
|
+
* Note that parent route filepaths are relative to the `app/` directory.
|
|
128
|
+
*
|
|
129
|
+
* For example, if this meta function is for `/sales/customers/$customerId`:
|
|
130
|
+
*
|
|
131
|
+
* ```ts
|
|
132
|
+
* // app/root.tsx
|
|
133
|
+
* const loader = () => ({ hello: "world" })
|
|
134
|
+
* export type Loader = typeof loader
|
|
135
|
+
*
|
|
136
|
+
* // app/routes/sales.tsx
|
|
137
|
+
* const loader = () => ({ salesCount: 1074 })
|
|
138
|
+
* export type Loader = typeof loader
|
|
139
|
+
*
|
|
140
|
+
* // app/routes/sales/customers.tsx
|
|
141
|
+
* const loader = () => ({ customerCount: 74 })
|
|
142
|
+
* export type Loader = typeof loader
|
|
143
|
+
*
|
|
144
|
+
* // app/routes/sales/customers/$customersId.tsx
|
|
145
|
+
* import type { Loader as RootLoader } from "../../../root"
|
|
146
|
+
* import type { Loader as SalesLoader } from "../../sales"
|
|
147
|
+
* import type { Loader as CustomersLoader } from "../../sales/customers"
|
|
148
|
+
*
|
|
149
|
+
* const loader = () => ({ name: "Customer name" })
|
|
150
|
+
*
|
|
151
|
+
* const meta: MetaFunction<typeof loader, {
|
|
152
|
+
* "root": RootLoader,
|
|
153
|
+
* "routes/sales": SalesLoader,
|
|
154
|
+
* "routes/sales/customers": CustomersLoader,
|
|
155
|
+
* }> = ({ loaderData, matches }) => {
|
|
156
|
+
* const { name } = loaderData
|
|
157
|
+
* // ^? string
|
|
158
|
+
* const { customerCount } = matches.find((match) => match.id === "routes/sales/customers").loaderData
|
|
159
|
+
* // ^? number
|
|
160
|
+
* const { salesCount } = matches.find((match) => match.id === "routes/sales").loaderData
|
|
161
|
+
* // ^? number
|
|
162
|
+
* const { hello } = matches.find((match) => match.id === "root").loaderData
|
|
163
|
+
* // ^? "world"
|
|
164
|
+
* }
|
|
165
|
+
* ```
|
|
166
|
+
*/
|
|
167
|
+
interface MetaFunction<Loader extends LoaderFunction | ClientLoaderFunction | unknown = unknown, MatchLoaders extends Record<string, LoaderFunction | ClientLoaderFunction | unknown> = Record<string, unknown>> {
|
|
168
|
+
(args: MetaArgs<Loader, MatchLoaders>): MetaDescriptor[] | undefined;
|
|
169
|
+
}
|
|
170
|
+
type MetaDescriptor = {
|
|
171
|
+
charSet: "utf-8";
|
|
172
|
+
} | {
|
|
173
|
+
title: string;
|
|
174
|
+
} | {
|
|
175
|
+
name: string;
|
|
176
|
+
content: string;
|
|
177
|
+
} | {
|
|
178
|
+
property: string;
|
|
179
|
+
content: string;
|
|
180
|
+
} | {
|
|
181
|
+
httpEquiv: string;
|
|
182
|
+
content: string;
|
|
183
|
+
} | {
|
|
184
|
+
"script:ld+json": LdJsonObject | LdJsonObject[];
|
|
185
|
+
} | {
|
|
186
|
+
tagName: "meta" | "link";
|
|
187
|
+
[name: string]: string;
|
|
188
|
+
} | {
|
|
189
|
+
[name: string]: unknown;
|
|
190
|
+
};
|
|
191
|
+
type LdJsonObject = { [Key in string]: LdJsonValue } & { [Key in string]?: LdJsonValue | undefined };
|
|
192
|
+
type LdJsonArray = LdJsonValue[] | readonly LdJsonValue[];
|
|
193
|
+
type LdJsonPrimitive = string | number | boolean | null;
|
|
194
|
+
type LdJsonValue = LdJsonPrimitive | LdJsonObject | LdJsonArray;
|
|
195
|
+
/**
|
|
196
|
+
* A React component that is rendered for a route.
|
|
197
|
+
*/
|
|
198
|
+
type RouteComponent = ComponentType<{}>;
|
|
199
|
+
/**
|
|
200
|
+
* An arbitrary object that is associated with a route.
|
|
201
|
+
*
|
|
202
|
+
* @see https://reactrouter.com/how-to/using-handle
|
|
203
|
+
*/
|
|
204
|
+
type RouteHandle = unknown;
|
|
205
|
+
//#endregion
|
|
206
|
+
export { ClientActionFunction, ClientActionFunctionArgs, ClientLoaderFunction, ClientLoaderFunctionArgs, HeadersArgs, HeadersFunction, LinksFunction, MetaArgs, MetaDescriptor, MetaFunction, RouteModules, ServerRouteModule };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* react-router v8.0.0-pre.0
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) Remix Software Inc.
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the MIT license found in the
|
|
7
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
8
|
+
*
|
|
9
|
+
* @license MIT
|
|
10
|
+
*/
|
|
11
|
+
//#region lib/dom/ssr/routeModules.ts
|
|
12
|
+
async function loadRouteModule(route, routeModulesCache) {
|
|
13
|
+
if (route.id in routeModulesCache) return routeModulesCache[route.id];
|
|
14
|
+
try {
|
|
15
|
+
let routeModule = await import(
|
|
16
|
+
/* @vite-ignore */
|
|
17
|
+
/* webpackIgnore: true */
|
|
18
|
+
route.module
|
|
19
|
+
);
|
|
20
|
+
routeModulesCache[route.id] = routeModule;
|
|
21
|
+
return routeModule;
|
|
22
|
+
} catch (error) {
|
|
23
|
+
console.error(`Error loading route module \`${route.module}\`, reloading page...`);
|
|
24
|
+
console.error(error);
|
|
25
|
+
if (window.__reactRouterContext && window.__reactRouterContext.isSpaMode && import.meta.hot) throw error;
|
|
26
|
+
window.location.reload();
|
|
27
|
+
return new Promise(() => {});
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
//#endregion
|
|
31
|
+
export { loadRouteModule };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
|
|
2
|
+
import { InitialEntry } from "../../router/history.js";
|
|
3
|
+
import { ActionFunction, IndexRouteObject, LoaderFunction, NonIndexRouteObject, RouterContextProvider } from "../../router/utils.js";
|
|
4
|
+
import { HydrationState } from "../../router/router.js";
|
|
5
|
+
import { LinksFunction, MetaFunction } from "./routeModules.js";
|
|
6
|
+
import { FutureConfig } from "./entry.js";
|
|
7
|
+
import * as React$1 from "react";
|
|
8
|
+
|
|
9
|
+
//#region lib/dom/ssr/routes-test-stub.d.ts
|
|
10
|
+
interface StubRouteExtensions {
|
|
11
|
+
Component?: React$1.ComponentType<any>;
|
|
12
|
+
HydrateFallback?: React$1.ComponentType<any>;
|
|
13
|
+
ErrorBoundary?: React$1.ComponentType<any>;
|
|
14
|
+
loader?: LoaderFunction;
|
|
15
|
+
action?: ActionFunction;
|
|
16
|
+
children?: StubRouteObject[];
|
|
17
|
+
meta?: MetaFunction;
|
|
18
|
+
links?: LinksFunction;
|
|
19
|
+
}
|
|
20
|
+
interface StubIndexRouteObject extends Omit<IndexRouteObject, "Component" | "HydrateFallback" | "ErrorBoundary" | "loader" | "action" | "element" | "errorElement" | "children">, StubRouteExtensions {}
|
|
21
|
+
interface StubNonIndexRouteObject extends Omit<NonIndexRouteObject, "Component" | "HydrateFallback" | "ErrorBoundary" | "loader" | "action" | "element" | "errorElement" | "children">, StubRouteExtensions {}
|
|
22
|
+
type StubRouteObject = StubIndexRouteObject | StubNonIndexRouteObject;
|
|
23
|
+
interface RoutesTestStubProps {
|
|
24
|
+
/**
|
|
25
|
+
* The initial entries in the history stack. This allows you to start a test with
|
|
26
|
+
* multiple locations already in the history stack (for testing a back navigation, etc.)
|
|
27
|
+
* The test will default to the last entry in initialEntries if no initialIndex is provided.
|
|
28
|
+
* e.g. initialEntries={["/home", "/about", "/contact"]}
|
|
29
|
+
*/
|
|
30
|
+
initialEntries?: InitialEntry[];
|
|
31
|
+
/**
|
|
32
|
+
* The initial index in the history stack to render. This allows you to start a test at a specific entry.
|
|
33
|
+
* It defaults to the last entry in initialEntries.
|
|
34
|
+
* e.g.
|
|
35
|
+
* initialEntries: ["/", "/events/123"]
|
|
36
|
+
* initialIndex: 1 // start at "/events/123"
|
|
37
|
+
*/
|
|
38
|
+
initialIndex?: number;
|
|
39
|
+
/**
|
|
40
|
+
* Used to set the route's initial loader and action data.
|
|
41
|
+
* e.g. hydrationData={{
|
|
42
|
+
* loaderData: { "/contact": { locale: "en-US" } },
|
|
43
|
+
* actionData: { "/login": { errors: { email: "invalid email" } }}
|
|
44
|
+
* }}
|
|
45
|
+
*/
|
|
46
|
+
hydrationData?: HydrationState;
|
|
47
|
+
/**
|
|
48
|
+
* Future flags mimicking the settings in react-router.config.ts
|
|
49
|
+
*/
|
|
50
|
+
future?: Partial<FutureConfig>;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* @category Utils
|
|
54
|
+
*/
|
|
55
|
+
declare function createRoutesStub(routes: StubRouteObject[], _context?: RouterContextProvider): ({
|
|
56
|
+
initialEntries,
|
|
57
|
+
initialIndex,
|
|
58
|
+
hydrationData,
|
|
59
|
+
future
|
|
60
|
+
}: RoutesTestStubProps) => React$1.JSX.Element;
|
|
61
|
+
//#endregion
|
|
62
|
+
export { RoutesTestStubProps, createRoutesStub };
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* react-router v8.0.0-pre.0
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) Remix Software Inc.
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the MIT license found in the
|
|
7
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
8
|
+
*
|
|
9
|
+
* @license MIT
|
|
10
|
+
*/
|
|
11
|
+
import { RouterContextProvider, convertRoutesToDataRoutes } from "../../router/utils.js";
|
|
12
|
+
import { Outlet, RouterProvider, createMemoryRouter, withComponentProps, withErrorBoundaryProps, withHydrateFallbackProps } from "../../components.js";
|
|
13
|
+
import { FrameworkContext } from "./components.js";
|
|
14
|
+
import * as React$1 from "react";
|
|
15
|
+
//#region lib/dom/ssr/routes-test-stub.tsx
|
|
16
|
+
/**
|
|
17
|
+
* @category Utils
|
|
18
|
+
*/
|
|
19
|
+
function createRoutesStub(routes, _context) {
|
|
20
|
+
return function RoutesTestStub({ initialEntries, initialIndex, hydrationData, future }) {
|
|
21
|
+
let routerRef = React$1.useRef(null);
|
|
22
|
+
let frameworkContextRef = React$1.useRef(null);
|
|
23
|
+
if (routerRef.current == null || frameworkContextRef.current == null) {
|
|
24
|
+
frameworkContextRef.current = {
|
|
25
|
+
future: {},
|
|
26
|
+
manifest: {
|
|
27
|
+
routes: {},
|
|
28
|
+
entry: {
|
|
29
|
+
imports: [],
|
|
30
|
+
module: ""
|
|
31
|
+
},
|
|
32
|
+
url: "",
|
|
33
|
+
version: ""
|
|
34
|
+
},
|
|
35
|
+
routeModules: {},
|
|
36
|
+
ssr: false,
|
|
37
|
+
isSpaMode: false,
|
|
38
|
+
routeDiscovery: {
|
|
39
|
+
mode: "lazy",
|
|
40
|
+
manifestPath: "/__manifest"
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
routerRef.current = createMemoryRouter(processRoutes(convertRoutesToDataRoutes(routes, (r) => r), _context ?? new RouterContextProvider(), frameworkContextRef.current.manifest, frameworkContextRef.current.routeModules), {
|
|
44
|
+
initialEntries,
|
|
45
|
+
initialIndex,
|
|
46
|
+
hydrationData
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
return /* @__PURE__ */ React$1.createElement(FrameworkContext.Provider, { value: frameworkContextRef.current }, /* @__PURE__ */ React$1.createElement(RouterProvider, { router: routerRef.current }));
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
function processRoutes(routes, context, manifest, routeModules, parentId) {
|
|
53
|
+
return routes.map((route) => {
|
|
54
|
+
if (!route.id) throw new Error("Expected a route.id in react-router processRoutes() function");
|
|
55
|
+
let newRoute = {
|
|
56
|
+
id: route.id,
|
|
57
|
+
path: route.path,
|
|
58
|
+
index: route.index,
|
|
59
|
+
Component: route.Component ? withComponentProps(route.Component) : void 0,
|
|
60
|
+
HydrateFallback: route.HydrateFallback ? withHydrateFallbackProps(route.HydrateFallback) : void 0,
|
|
61
|
+
ErrorBoundary: route.ErrorBoundary ? withErrorBoundaryProps(route.ErrorBoundary) : void 0,
|
|
62
|
+
action: route.action ? (args) => route.action({
|
|
63
|
+
...args,
|
|
64
|
+
context
|
|
65
|
+
}) : void 0,
|
|
66
|
+
loader: route.loader ? (args) => route.loader({
|
|
67
|
+
...args,
|
|
68
|
+
context
|
|
69
|
+
}) : void 0,
|
|
70
|
+
middleware: route.middleware ? route.middleware.map((mw) => (...args) => mw({
|
|
71
|
+
...args[0],
|
|
72
|
+
context
|
|
73
|
+
}, args[1])) : void 0,
|
|
74
|
+
handle: route.handle,
|
|
75
|
+
shouldRevalidate: route.shouldRevalidate
|
|
76
|
+
};
|
|
77
|
+
let entryRoute = {
|
|
78
|
+
id: route.id,
|
|
79
|
+
path: route.path,
|
|
80
|
+
index: route.index,
|
|
81
|
+
parentId,
|
|
82
|
+
hasAction: route.action != null,
|
|
83
|
+
hasLoader: route.loader != null,
|
|
84
|
+
hasClientAction: false,
|
|
85
|
+
hasClientLoader: false,
|
|
86
|
+
hasClientMiddleware: false,
|
|
87
|
+
hasErrorBoundary: route.ErrorBoundary != null,
|
|
88
|
+
module: "build/stub-path-to-module.js",
|
|
89
|
+
clientActionModule: void 0,
|
|
90
|
+
clientLoaderModule: void 0,
|
|
91
|
+
clientMiddlewareModule: void 0,
|
|
92
|
+
hydrateFallbackModule: void 0
|
|
93
|
+
};
|
|
94
|
+
manifest.routes[newRoute.id] = entryRoute;
|
|
95
|
+
routeModules[route.id] = {
|
|
96
|
+
default: newRoute.Component || Outlet,
|
|
97
|
+
ErrorBoundary: newRoute.ErrorBoundary || void 0,
|
|
98
|
+
handle: route.handle,
|
|
99
|
+
links: route.links,
|
|
100
|
+
meta: route.meta,
|
|
101
|
+
shouldRevalidate: route.shouldRevalidate
|
|
102
|
+
};
|
|
103
|
+
if (route.children) newRoute.children = processRoutes(route.children, context, manifest, routeModules, newRoute.id);
|
|
104
|
+
return newRoute;
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
//#endregion
|
|
108
|
+
export { createRoutesStub };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
|
|
2
|
+
import { DataRouteObject, RouteManifest } from "../../router/utils.js";
|
|
3
|
+
import { HydrationState } from "../../router/router.js";
|
|
4
|
+
import { ClientLoaderFunction, RouteModules } from "./routeModules.js";
|
|
5
|
+
//#region lib/dom/ssr/routes.d.ts
|
|
6
|
+
interface Route {
|
|
7
|
+
index?: boolean;
|
|
8
|
+
caseSensitive?: boolean;
|
|
9
|
+
id: string;
|
|
10
|
+
parentId?: string;
|
|
11
|
+
path?: string;
|
|
12
|
+
}
|
|
13
|
+
interface EntryRoute extends Route {
|
|
14
|
+
hasAction: boolean;
|
|
15
|
+
hasLoader: boolean;
|
|
16
|
+
hasClientAction: boolean;
|
|
17
|
+
hasClientLoader: boolean;
|
|
18
|
+
hasClientMiddleware: boolean;
|
|
19
|
+
hasErrorBoundary: boolean;
|
|
20
|
+
imports?: string[];
|
|
21
|
+
css?: string[];
|
|
22
|
+
module: string;
|
|
23
|
+
clientActionModule: string | undefined;
|
|
24
|
+
clientLoaderModule: string | undefined;
|
|
25
|
+
clientMiddlewareModule: string | undefined;
|
|
26
|
+
hydrateFallbackModule: string | undefined;
|
|
27
|
+
parentId?: string;
|
|
28
|
+
}
|
|
29
|
+
declare function createClientRoutesWithHMRRevalidationOptOut(needsRevalidation: Set<string>, manifest: RouteManifest<EntryRoute>, routeModulesCache: RouteModules, initialState: HydrationState, ssr: boolean, isSpaMode: boolean): DataRouteObject[];
|
|
30
|
+
declare function createClientRoutes(manifest: RouteManifest<EntryRoute>, routeModulesCache: RouteModules, initialState: HydrationState | null, ssr: boolean, isSpaMode: boolean, parentId?: string, routesByParentId?: Record<string, Omit<EntryRoute, "children">[]>, needsRevalidation?: Set<string>): DataRouteObject[];
|
|
31
|
+
declare function shouldHydrateRouteLoader(routeId: string, clientLoader: ClientLoaderFunction | undefined, hasLoader: boolean, isSpaMode: boolean): boolean;
|
|
32
|
+
//#endregion
|
|
33
|
+
export { EntryRoute, Route, createClientRoutes, createClientRoutesWithHMRRevalidationOptOut, shouldHydrateRouteLoader };
|