@depup/tanstack__react-router 1.166.4-depup.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/LICENSE +21 -0
- package/README.md +32 -0
- package/dist/cjs/Asset.cjs +177 -0
- package/dist/cjs/Asset.cjs.map +1 -0
- package/dist/cjs/Asset.d.cts +5 -0
- package/dist/cjs/CatchBoundary.cjs +114 -0
- package/dist/cjs/CatchBoundary.cjs.map +1 -0
- package/dist/cjs/CatchBoundary.d.cts +12 -0
- package/dist/cjs/ClientOnly.cjs +21 -0
- package/dist/cjs/ClientOnly.cjs.map +1 -0
- package/dist/cjs/ClientOnly.d.cts +49 -0
- package/dist/cjs/HeadContent.cjs +15 -0
- package/dist/cjs/HeadContent.cjs.map +1 -0
- package/dist/cjs/HeadContent.d.cts +6 -0
- package/dist/cjs/HeadContent.dev.cjs +41 -0
- package/dist/cjs/HeadContent.dev.cjs.map +1 -0
- package/dist/cjs/HeadContent.dev.d.cts +10 -0
- package/dist/cjs/Match.cjs +255 -0
- package/dist/cjs/Match.cjs.map +1 -0
- package/dist/cjs/Match.d.cts +14 -0
- package/dist/cjs/Matches.cjs +138 -0
- package/dist/cjs/Matches.cjs.map +1 -0
- package/dist/cjs/Matches.d.cts +68 -0
- package/dist/cjs/RouterProvider.cjs +32 -0
- package/dist/cjs/RouterProvider.cjs.map +1 -0
- package/dist/cjs/RouterProvider.d.cts +23 -0
- package/dist/cjs/SafeFragment.cjs +8 -0
- package/dist/cjs/SafeFragment.cjs.map +1 -0
- package/dist/cjs/SafeFragment.d.cts +1 -0
- package/dist/cjs/ScriptOnce.cjs +22 -0
- package/dist/cjs/ScriptOnce.cjs.map +1 -0
- package/dist/cjs/ScriptOnce.d.cts +6 -0
- package/dist/cjs/Scripts.cjs +56 -0
- package/dist/cjs/Scripts.cjs.map +1 -0
- package/dist/cjs/Scripts.d.cts +5 -0
- package/dist/cjs/ScrollRestoration.cjs +38 -0
- package/dist/cjs/ScrollRestoration.cjs.map +1 -0
- package/dist/cjs/ScrollRestoration.d.cts +14 -0
- package/dist/cjs/Transitioner.cjs +119 -0
- package/dist/cjs/Transitioner.cjs.map +1 -0
- package/dist/cjs/Transitioner.d.cts +1 -0
- package/dist/cjs/awaited.cjs +51 -0
- package/dist/cjs/awaited.cjs.map +1 -0
- package/dist/cjs/awaited.d.cts +14 -0
- package/dist/cjs/fileRoute.cjs +109 -0
- package/dist/cjs/fileRoute.cjs.map +1 -0
- package/dist/cjs/fileRoute.d.cts +87 -0
- package/dist/cjs/headContentUtils.cjs +185 -0
- package/dist/cjs/headContentUtils.cjs.map +1 -0
- package/dist/cjs/headContentUtils.d.cts +7 -0
- package/dist/cjs/history.d.cts +8 -0
- package/dist/cjs/index.cjs +241 -0
- package/dist/cjs/index.cjs.map +1 -0
- package/dist/cjs/index.d.cts +51 -0
- package/dist/cjs/index.dev.cjs +241 -0
- package/dist/cjs/index.dev.cjs.map +1 -0
- package/dist/cjs/index.dev.d.cts +2 -0
- package/dist/cjs/lazyRouteComponent.cjs +70 -0
- package/dist/cjs/lazyRouteComponent.cjs.map +1 -0
- package/dist/cjs/lazyRouteComponent.d.cts +11 -0
- package/dist/cjs/link.cjs +573 -0
- package/dist/cjs/link.cjs.map +1 -0
- package/dist/cjs/link.d.cts +98 -0
- package/dist/cjs/matchContext.cjs +27 -0
- package/dist/cjs/matchContext.cjs.map +1 -0
- package/dist/cjs/matchContext.d.cts +3 -0
- package/dist/cjs/not-found.cjs +38 -0
- package/dist/cjs/not-found.cjs.map +1 -0
- package/dist/cjs/not-found.d.cts +9 -0
- package/dist/cjs/renderRouteNotFound.cjs +22 -0
- package/dist/cjs/renderRouteNotFound.cjs.map +1 -0
- package/dist/cjs/renderRouteNotFound.d.cts +10 -0
- package/dist/cjs/route.cjs +198 -0
- package/dist/cjs/route.cjs.map +1 -0
- package/dist/cjs/route.d.cts +142 -0
- package/dist/cjs/router.cjs +22 -0
- package/dist/cjs/router.cjs.map +1 -0
- package/dist/cjs/router.d.cts +83 -0
- package/dist/cjs/routerContext.cjs +23 -0
- package/dist/cjs/routerContext.cjs.map +1 -0
- package/dist/cjs/routerContext.d.cts +3 -0
- package/dist/cjs/scroll-restoration.cjs +39 -0
- package/dist/cjs/scroll-restoration.cjs.map +1 -0
- package/dist/cjs/scroll-restoration.d.cts +1 -0
- package/dist/cjs/ssr/RouterClient.cjs +25 -0
- package/dist/cjs/ssr/RouterClient.cjs.map +1 -0
- package/dist/cjs/ssr/RouterClient.d.cts +4 -0
- package/dist/cjs/ssr/RouterServer.cjs +9 -0
- package/dist/cjs/ssr/RouterServer.cjs.map +1 -0
- package/dist/cjs/ssr/RouterServer.d.cts +4 -0
- package/dist/cjs/ssr/client.cjs +12 -0
- package/dist/cjs/ssr/client.cjs.map +1 -0
- package/dist/cjs/ssr/client.d.cts +2 -0
- package/dist/cjs/ssr/defaultRenderHandler.cjs +15 -0
- package/dist/cjs/ssr/defaultRenderHandler.cjs.map +1 -0
- package/dist/cjs/ssr/defaultRenderHandler.d.cts +1 -0
- package/dist/cjs/ssr/defaultStreamHandler.cjs +16 -0
- package/dist/cjs/ssr/defaultStreamHandler.cjs.map +1 -0
- package/dist/cjs/ssr/defaultStreamHandler.d.cts +1 -0
- package/dist/cjs/ssr/renderRouterToStream.cjs +73 -0
- package/dist/cjs/ssr/renderRouterToStream.cjs.map +1 -0
- package/dist/cjs/ssr/renderRouterToStream.d.cts +8 -0
- package/dist/cjs/ssr/renderRouterToString.cjs +31 -0
- package/dist/cjs/ssr/renderRouterToString.cjs.map +1 -0
- package/dist/cjs/ssr/renderRouterToString.d.cts +7 -0
- package/dist/cjs/ssr/serializer.d.cts +6 -0
- package/dist/cjs/ssr/server.cjs +20 -0
- package/dist/cjs/ssr/server.cjs.map +1 -0
- package/dist/cjs/ssr/server.d.cts +6 -0
- package/dist/cjs/structuralSharing.d.cts +8 -0
- package/dist/cjs/typePrimitives.d.cts +16 -0
- package/dist/cjs/useBlocker.cjs +171 -0
- package/dist/cjs/useBlocker.cjs.map +1 -0
- package/dist/cjs/useBlocker.d.cts +66 -0
- package/dist/cjs/useCanGoBack.cjs +8 -0
- package/dist/cjs/useCanGoBack.cjs.map +1 -0
- package/dist/cjs/useCanGoBack.d.cts +1 -0
- package/dist/cjs/useLoaderData.cjs +15 -0
- package/dist/cjs/useLoaderData.cjs.map +1 -0
- package/dist/cjs/useLoaderData.d.cts +19 -0
- package/dist/cjs/useLoaderDeps.cjs +14 -0
- package/dist/cjs/useLoaderDeps.cjs.map +1 -0
- package/dist/cjs/useLoaderDeps.d.cts +19 -0
- package/dist/cjs/useLocation.cjs +10 -0
- package/dist/cjs/useLocation.cjs.map +1 -0
- package/dist/cjs/useLocation.d.cts +18 -0
- package/dist/cjs/useMatch.cjs +47 -0
- package/dist/cjs/useMatch.cjs.map +1 -0
- package/dist/cjs/useMatch.d.cts +14 -0
- package/dist/cjs/useNavigate.cjs +49 -0
- package/dist/cjs/useNavigate.cjs.map +1 -0
- package/dist/cjs/useNavigate.d.cts +28 -0
- package/dist/cjs/useParams.cjs +17 -0
- package/dist/cjs/useParams.cjs.map +1 -0
- package/dist/cjs/useParams.d.cts +21 -0
- package/dist/cjs/useRouteContext.cjs +11 -0
- package/dist/cjs/useRouteContext.cjs.map +1 -0
- package/dist/cjs/useRouteContext.d.cts +3 -0
- package/dist/cjs/useRouter.cjs +32 -0
- package/dist/cjs/useRouter.cjs.map +1 -0
- package/dist/cjs/useRouter.d.cts +14 -0
- package/dist/cjs/useRouterState.cjs +38 -0
- package/dist/cjs/useRouterState.cjs.map +1 -0
- package/dist/cjs/useRouterState.d.cts +20 -0
- package/dist/cjs/useSearch.cjs +16 -0
- package/dist/cjs/useSearch.cjs.map +1 -0
- package/dist/cjs/useSearch.d.cts +21 -0
- package/dist/cjs/utils.cjs +62 -0
- package/dist/cjs/utils.cjs.map +1 -0
- package/dist/cjs/utils.d.cts +54 -0
- package/dist/esm/Asset.d.ts +5 -0
- package/dist/esm/Asset.js +160 -0
- package/dist/esm/Asset.js.map +1 -0
- package/dist/esm/CatchBoundary.d.ts +12 -0
- package/dist/esm/CatchBoundary.js +97 -0
- package/dist/esm/CatchBoundary.js.map +1 -0
- package/dist/esm/ClientOnly.d.ts +49 -0
- package/dist/esm/ClientOnly.js +21 -0
- package/dist/esm/ClientOnly.js.map +1 -0
- package/dist/esm/HeadContent.d.ts +6 -0
- package/dist/esm/HeadContent.dev.d.ts +10 -0
- package/dist/esm/HeadContent.dev.js +25 -0
- package/dist/esm/HeadContent.dev.js.map +1 -0
- package/dist/esm/HeadContent.js +15 -0
- package/dist/esm/HeadContent.js.map +1 -0
- package/dist/esm/Match.d.ts +14 -0
- package/dist/esm/Match.js +238 -0
- package/dist/esm/Match.js.map +1 -0
- package/dist/esm/Matches.d.ts +68 -0
- package/dist/esm/Matches.js +121 -0
- package/dist/esm/Matches.js.map +1 -0
- package/dist/esm/RouterProvider.d.ts +23 -0
- package/dist/esm/RouterProvider.js +32 -0
- package/dist/esm/RouterProvider.js.map +1 -0
- package/dist/esm/SafeFragment.d.ts +1 -0
- package/dist/esm/SafeFragment.js +8 -0
- package/dist/esm/SafeFragment.js.map +1 -0
- package/dist/esm/ScriptOnce.d.ts +6 -0
- package/dist/esm/ScriptOnce.js +22 -0
- package/dist/esm/ScriptOnce.js.map +1 -0
- package/dist/esm/Scripts.d.ts +5 -0
- package/dist/esm/Scripts.js +56 -0
- package/dist/esm/Scripts.js.map +1 -0
- package/dist/esm/ScrollRestoration.d.ts +14 -0
- package/dist/esm/ScrollRestoration.js +38 -0
- package/dist/esm/ScrollRestoration.js.map +1 -0
- package/dist/esm/Transitioner.d.ts +1 -0
- package/dist/esm/Transitioner.js +102 -0
- package/dist/esm/Transitioner.js.map +1 -0
- package/dist/esm/awaited.d.ts +14 -0
- package/dist/esm/awaited.js +34 -0
- package/dist/esm/awaited.js.map +1 -0
- package/dist/esm/fileRoute.d.ts +87 -0
- package/dist/esm/fileRoute.js +109 -0
- package/dist/esm/fileRoute.js.map +1 -0
- package/dist/esm/headContentUtils.d.ts +7 -0
- package/dist/esm/headContentUtils.js +168 -0
- package/dist/esm/headContentUtils.js.map +1 -0
- package/dist/esm/history.d.ts +8 -0
- package/dist/esm/index.d.ts +51 -0
- package/dist/esm/index.dev.d.ts +2 -0
- package/dist/esm/index.dev.js +133 -0
- package/dist/esm/index.dev.js.map +1 -0
- package/dist/esm/index.js +133 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/lazyRouteComponent.d.ts +11 -0
- package/dist/esm/lazyRouteComponent.js +53 -0
- package/dist/esm/lazyRouteComponent.js.map +1 -0
- package/dist/esm/link.d.ts +98 -0
- package/dist/esm/link.js +556 -0
- package/dist/esm/link.js.map +1 -0
- package/dist/esm/matchContext.d.ts +3 -0
- package/dist/esm/matchContext.js +10 -0
- package/dist/esm/matchContext.js.map +1 -0
- package/dist/esm/not-found.d.ts +9 -0
- package/dist/esm/not-found.js +38 -0
- package/dist/esm/not-found.js.map +1 -0
- package/dist/esm/renderRouteNotFound.d.ts +10 -0
- package/dist/esm/renderRouteNotFound.js +22 -0
- package/dist/esm/renderRouteNotFound.js.map +1 -0
- package/dist/esm/route.d.ts +142 -0
- package/dist/esm/route.js +198 -0
- package/dist/esm/route.js.map +1 -0
- package/dist/esm/router.d.ts +83 -0
- package/dist/esm/router.js +22 -0
- package/dist/esm/router.js.map +1 -0
- package/dist/esm/routerContext.d.ts +3 -0
- package/dist/esm/routerContext.js +6 -0
- package/dist/esm/routerContext.js.map +1 -0
- package/dist/esm/scroll-restoration.d.ts +1 -0
- package/dist/esm/scroll-restoration.js +39 -0
- package/dist/esm/scroll-restoration.js.map +1 -0
- package/dist/esm/ssr/RouterClient.d.ts +4 -0
- package/dist/esm/ssr/RouterClient.js +25 -0
- package/dist/esm/ssr/RouterClient.js.map +1 -0
- package/dist/esm/ssr/RouterServer.d.ts +4 -0
- package/dist/esm/ssr/RouterServer.js +9 -0
- package/dist/esm/ssr/RouterServer.js.map +1 -0
- package/dist/esm/ssr/client.d.ts +2 -0
- package/dist/esm/ssr/client.js +6 -0
- package/dist/esm/ssr/client.js.map +1 -0
- package/dist/esm/ssr/defaultRenderHandler.d.ts +1 -0
- package/dist/esm/ssr/defaultRenderHandler.js +15 -0
- package/dist/esm/ssr/defaultRenderHandler.js.map +1 -0
- package/dist/esm/ssr/defaultStreamHandler.d.ts +1 -0
- package/dist/esm/ssr/defaultStreamHandler.js +16 -0
- package/dist/esm/ssr/defaultStreamHandler.js.map +1 -0
- package/dist/esm/ssr/renderRouterToStream.d.ts +8 -0
- package/dist/esm/ssr/renderRouterToStream.js +73 -0
- package/dist/esm/ssr/renderRouterToStream.js.map +1 -0
- package/dist/esm/ssr/renderRouterToString.d.ts +7 -0
- package/dist/esm/ssr/renderRouterToString.js +31 -0
- package/dist/esm/ssr/renderRouterToString.js.map +1 -0
- package/dist/esm/ssr/serializer.d.ts +6 -0
- package/dist/esm/ssr/server.d.ts +6 -0
- package/dist/esm/ssr/server.js +14 -0
- package/dist/esm/ssr/server.js.map +1 -0
- package/dist/esm/structuralSharing.d.ts +8 -0
- package/dist/esm/typePrimitives.d.ts +16 -0
- package/dist/esm/useBlocker.d.ts +66 -0
- package/dist/esm/useBlocker.js +154 -0
- package/dist/esm/useBlocker.js.map +1 -0
- package/dist/esm/useCanGoBack.d.ts +1 -0
- package/dist/esm/useCanGoBack.js +8 -0
- package/dist/esm/useCanGoBack.js.map +1 -0
- package/dist/esm/useLoaderData.d.ts +19 -0
- package/dist/esm/useLoaderData.js +15 -0
- package/dist/esm/useLoaderData.js.map +1 -0
- package/dist/esm/useLoaderDeps.d.ts +19 -0
- package/dist/esm/useLoaderDeps.js +14 -0
- package/dist/esm/useLoaderDeps.js.map +1 -0
- package/dist/esm/useLocation.d.ts +18 -0
- package/dist/esm/useLocation.js +10 -0
- package/dist/esm/useLocation.js.map +1 -0
- package/dist/esm/useMatch.d.ts +14 -0
- package/dist/esm/useMatch.js +30 -0
- package/dist/esm/useMatch.js.map +1 -0
- package/dist/esm/useNavigate.d.ts +28 -0
- package/dist/esm/useNavigate.js +32 -0
- package/dist/esm/useNavigate.js.map +1 -0
- package/dist/esm/useParams.d.ts +21 -0
- package/dist/esm/useParams.js +17 -0
- package/dist/esm/useParams.js.map +1 -0
- package/dist/esm/useRouteContext.d.ts +3 -0
- package/dist/esm/useRouteContext.js +11 -0
- package/dist/esm/useRouteContext.js.map +1 -0
- package/dist/esm/useRouter.d.ts +14 -0
- package/dist/esm/useRouter.js +15 -0
- package/dist/esm/useRouter.js.map +1 -0
- package/dist/esm/useRouterState.d.ts +20 -0
- package/dist/esm/useRouterState.js +38 -0
- package/dist/esm/useRouterState.js.map +1 -0
- package/dist/esm/useSearch.d.ts +21 -0
- package/dist/esm/useSearch.js +16 -0
- package/dist/esm/useSearch.js.map +1 -0
- package/dist/esm/utils.d.ts +54 -0
- package/dist/esm/utils.js +45 -0
- package/dist/esm/utils.js.map +1 -0
- package/dist/llms/index.d.ts +3 -0
- package/dist/llms/index.js +43 -0
- package/dist/llms/rules/api.d.ts +2 -0
- package/dist/llms/rules/api.js +4612 -0
- package/dist/llms/rules/guide.d.ts +2 -0
- package/dist/llms/rules/guide.js +10690 -0
- package/dist/llms/rules/installation.d.ts +2 -0
- package/dist/llms/rules/installation.js +1285 -0
- package/dist/llms/rules/routing.d.ts +2 -0
- package/dist/llms/rules/routing.js +1984 -0
- package/dist/llms/rules/setup-and-architecture.d.ts +2 -0
- package/dist/llms/rules/setup-and-architecture.js +920 -0
- package/package.json +142 -0
- package/src/Asset.tsx +219 -0
- package/src/CatchBoundary.tsx +120 -0
- package/src/ClientOnly.tsx +68 -0
- package/src/HeadContent.dev.tsx +46 -0
- package/src/HeadContent.tsx +22 -0
- package/src/Match.tsx +360 -0
- package/src/Matches.tsx +313 -0
- package/src/RouterProvider.tsx +92 -0
- package/src/SafeFragment.tsx +5 -0
- package/src/ScriptOnce.tsx +21 -0
- package/src/Scripts.tsx +80 -0
- package/src/ScrollRestoration.tsx +69 -0
- package/src/Transitioner.tsx +134 -0
- package/src/awaited.tsx +55 -0
- package/src/fileRoute.ts +313 -0
- package/src/headContentUtils.tsx +217 -0
- package/src/history.ts +9 -0
- package/src/index.dev.tsx +6 -0
- package/src/index.tsx +341 -0
- package/src/lazyRouteComponent.tsx +96 -0
- package/src/link.tsx +984 -0
- package/src/matchContext.tsx +8 -0
- package/src/not-found.tsx +43 -0
- package/src/renderRouteNotFound.tsx +35 -0
- package/src/route.tsx +740 -0
- package/src/router.ts +127 -0
- package/src/routerContext.tsx +4 -0
- package/src/scroll-restoration.tsx +45 -0
- package/src/ssr/RouterClient.tsx +22 -0
- package/src/ssr/RouterServer.tsx +9 -0
- package/src/ssr/client.ts +2 -0
- package/src/ssr/defaultRenderHandler.tsx +12 -0
- package/src/ssr/defaultStreamHandler.tsx +13 -0
- package/src/ssr/renderRouterToStream.tsx +90 -0
- package/src/ssr/renderRouterToString.tsx +36 -0
- package/src/ssr/serializer.ts +7 -0
- package/src/ssr/server.ts +6 -0
- package/src/structuralSharing.ts +47 -0
- package/src/typePrimitives.ts +84 -0
- package/src/useBlocker.tsx +320 -0
- package/src/useCanGoBack.ts +5 -0
- package/src/useLoaderData.tsx +91 -0
- package/src/useLoaderDeps.tsx +69 -0
- package/src/useLocation.tsx +52 -0
- package/src/useMatch.tsx +123 -0
- package/src/useNavigate.tsx +78 -0
- package/src/useParams.tsx +107 -0
- package/src/useRouteContext.ts +30 -0
- package/src/useRouter.tsx +25 -0
- package/src/useRouterState.tsx +86 -0
- package/src/useSearch.tsx +105 -0
- package/src/utils.ts +125 -0
package/src/index.tsx
ADDED
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
export {
|
|
2
|
+
defer,
|
|
3
|
+
isMatch,
|
|
4
|
+
joinPaths,
|
|
5
|
+
cleanPath,
|
|
6
|
+
trimPathLeft,
|
|
7
|
+
trimPathRight,
|
|
8
|
+
trimPath,
|
|
9
|
+
resolvePath,
|
|
10
|
+
interpolatePath,
|
|
11
|
+
rootRouteId,
|
|
12
|
+
defaultParseSearch,
|
|
13
|
+
defaultStringifySearch,
|
|
14
|
+
parseSearchWith,
|
|
15
|
+
stringifySearchWith,
|
|
16
|
+
functionalUpdate,
|
|
17
|
+
replaceEqualDeep,
|
|
18
|
+
isPlainObject,
|
|
19
|
+
isPlainArray,
|
|
20
|
+
deepEqual,
|
|
21
|
+
createControlledPromise,
|
|
22
|
+
retainSearchParams,
|
|
23
|
+
stripSearchParams,
|
|
24
|
+
createSerializationAdapter,
|
|
25
|
+
} from '@tanstack/router-core'
|
|
26
|
+
|
|
27
|
+
export type {
|
|
28
|
+
AnyRoute,
|
|
29
|
+
DeferredPromiseState,
|
|
30
|
+
DeferredPromise,
|
|
31
|
+
ParsedLocation,
|
|
32
|
+
RemoveTrailingSlashes,
|
|
33
|
+
RemoveLeadingSlashes,
|
|
34
|
+
ActiveOptions,
|
|
35
|
+
ResolveRelativePath,
|
|
36
|
+
RootRouteId,
|
|
37
|
+
AnyPathParams,
|
|
38
|
+
ResolveParams,
|
|
39
|
+
ResolveOptionalParams,
|
|
40
|
+
ResolveRequiredParams,
|
|
41
|
+
SearchSchemaInput,
|
|
42
|
+
AnyContext,
|
|
43
|
+
RouteContext,
|
|
44
|
+
PreloadableObj,
|
|
45
|
+
RoutePathOptions,
|
|
46
|
+
StaticDataRouteOption,
|
|
47
|
+
RoutePathOptionsIntersection,
|
|
48
|
+
UpdatableStaticRouteOption,
|
|
49
|
+
MetaDescriptor,
|
|
50
|
+
RouteLinkEntry,
|
|
51
|
+
ParseParamsFn,
|
|
52
|
+
SearchFilter,
|
|
53
|
+
ResolveId,
|
|
54
|
+
InferFullSearchSchema,
|
|
55
|
+
InferFullSearchSchemaInput,
|
|
56
|
+
ErrorRouteProps,
|
|
57
|
+
ErrorComponentProps,
|
|
58
|
+
NotFoundRouteProps,
|
|
59
|
+
TrimPath,
|
|
60
|
+
TrimPathLeft,
|
|
61
|
+
TrimPathRight,
|
|
62
|
+
StringifyParamsFn,
|
|
63
|
+
ParamsOptions,
|
|
64
|
+
InferAllParams,
|
|
65
|
+
InferAllContext,
|
|
66
|
+
LooseReturnType,
|
|
67
|
+
LooseAsyncReturnType,
|
|
68
|
+
ContextReturnType,
|
|
69
|
+
ContextAsyncReturnType,
|
|
70
|
+
ResolveLoaderData,
|
|
71
|
+
ResolveRouteContext,
|
|
72
|
+
SearchSerializer,
|
|
73
|
+
SearchParser,
|
|
74
|
+
TrailingSlashOption,
|
|
75
|
+
Manifest,
|
|
76
|
+
RouterManagedTag,
|
|
77
|
+
ControlledPromise,
|
|
78
|
+
Constrain,
|
|
79
|
+
Expand,
|
|
80
|
+
MergeAll,
|
|
81
|
+
Assign,
|
|
82
|
+
IntersectAssign,
|
|
83
|
+
ResolveValidatorInput,
|
|
84
|
+
ResolveValidatorOutput,
|
|
85
|
+
Register,
|
|
86
|
+
AnyValidator,
|
|
87
|
+
DefaultValidator,
|
|
88
|
+
ValidatorFn,
|
|
89
|
+
AnySchema,
|
|
90
|
+
AnyValidatorAdapter,
|
|
91
|
+
AnyValidatorFn,
|
|
92
|
+
AnyValidatorObj,
|
|
93
|
+
ResolveValidatorInputFn,
|
|
94
|
+
ResolveValidatorOutputFn,
|
|
95
|
+
ResolveSearchValidatorInput,
|
|
96
|
+
ResolveSearchValidatorInputFn,
|
|
97
|
+
Validator,
|
|
98
|
+
ValidatorAdapter,
|
|
99
|
+
ValidatorObj,
|
|
100
|
+
FileRoutesByPath,
|
|
101
|
+
RouteById,
|
|
102
|
+
RootRouteOptions,
|
|
103
|
+
CreateFileRoute,
|
|
104
|
+
SerializationAdapter,
|
|
105
|
+
AnySerializationAdapter,
|
|
106
|
+
SerializableExtensions,
|
|
107
|
+
} from '@tanstack/router-core'
|
|
108
|
+
|
|
109
|
+
export {
|
|
110
|
+
createHistory,
|
|
111
|
+
createBrowserHistory,
|
|
112
|
+
createHashHistory,
|
|
113
|
+
createMemoryHistory,
|
|
114
|
+
} from '@tanstack/history'
|
|
115
|
+
|
|
116
|
+
export type {
|
|
117
|
+
BlockerFn,
|
|
118
|
+
HistoryLocation,
|
|
119
|
+
RouterHistory,
|
|
120
|
+
ParsedPath,
|
|
121
|
+
HistoryState,
|
|
122
|
+
} from '@tanstack/history'
|
|
123
|
+
|
|
124
|
+
export { useAwaited, Await } from './awaited'
|
|
125
|
+
export type { AwaitOptions } from './awaited'
|
|
126
|
+
|
|
127
|
+
export { CatchBoundary, ErrorComponent } from './CatchBoundary'
|
|
128
|
+
export { ClientOnly, useHydrated } from './ClientOnly'
|
|
129
|
+
|
|
130
|
+
export {
|
|
131
|
+
FileRoute,
|
|
132
|
+
createFileRoute,
|
|
133
|
+
FileRouteLoader,
|
|
134
|
+
LazyRoute,
|
|
135
|
+
createLazyRoute,
|
|
136
|
+
createLazyFileRoute,
|
|
137
|
+
} from './fileRoute'
|
|
138
|
+
|
|
139
|
+
export * from './history'
|
|
140
|
+
|
|
141
|
+
export { lazyRouteComponent } from './lazyRouteComponent'
|
|
142
|
+
|
|
143
|
+
export { useLinkProps, createLink, Link, linkOptions } from './link'
|
|
144
|
+
export type {
|
|
145
|
+
InferDescendantToPaths,
|
|
146
|
+
RelativeToPath,
|
|
147
|
+
RelativeToParentPath,
|
|
148
|
+
RelativeToCurrentPath,
|
|
149
|
+
AbsoluteToPath,
|
|
150
|
+
RelativeToPathAutoComplete,
|
|
151
|
+
NavigateOptions,
|
|
152
|
+
ToOptions,
|
|
153
|
+
ToMaskOptions,
|
|
154
|
+
ToSubOptions,
|
|
155
|
+
ResolveRoute,
|
|
156
|
+
SearchParamOptions,
|
|
157
|
+
PathParamOptions,
|
|
158
|
+
ToPathOption,
|
|
159
|
+
LinkOptions,
|
|
160
|
+
MakeOptionalPathParams,
|
|
161
|
+
FileRouteTypes,
|
|
162
|
+
RouteContextParameter,
|
|
163
|
+
BeforeLoadContextParameter,
|
|
164
|
+
ResolveAllContext,
|
|
165
|
+
ResolveAllParamsFromParent,
|
|
166
|
+
ResolveFullSearchSchema,
|
|
167
|
+
ResolveFullSearchSchemaInput,
|
|
168
|
+
RouteIds,
|
|
169
|
+
NavigateFn,
|
|
170
|
+
BuildLocationFn,
|
|
171
|
+
FullSearchSchemaOption,
|
|
172
|
+
MakeRemountDepsOptionsUnion,
|
|
173
|
+
RemountDepsOptions,
|
|
174
|
+
ResolveFullPath,
|
|
175
|
+
AnyRouteWithContext,
|
|
176
|
+
AnyRouterWithContext,
|
|
177
|
+
CommitLocationOptions,
|
|
178
|
+
MatchLocation,
|
|
179
|
+
UseNavigateResult,
|
|
180
|
+
AnyRedirect,
|
|
181
|
+
Redirect,
|
|
182
|
+
RedirectOptions,
|
|
183
|
+
ResolvedRedirect,
|
|
184
|
+
MakeRouteMatch,
|
|
185
|
+
MakeRouteMatchUnion,
|
|
186
|
+
RouteMatch,
|
|
187
|
+
AnyRouteMatch,
|
|
188
|
+
RouteContextFn,
|
|
189
|
+
RouteContextOptions,
|
|
190
|
+
BeforeLoadContextOptions,
|
|
191
|
+
ContextOptions,
|
|
192
|
+
RouteOptions,
|
|
193
|
+
FileBaseRouteOptions,
|
|
194
|
+
BaseRouteOptions,
|
|
195
|
+
UpdatableRouteOptions,
|
|
196
|
+
RouteLoaderFn,
|
|
197
|
+
LoaderFnContext,
|
|
198
|
+
LazyRouteOptions,
|
|
199
|
+
AnyRouter,
|
|
200
|
+
RegisteredRouter,
|
|
201
|
+
RouterContextOptions,
|
|
202
|
+
ControllablePromise,
|
|
203
|
+
InjectedHtmlEntry,
|
|
204
|
+
RouterOptions,
|
|
205
|
+
RouterState,
|
|
206
|
+
ListenerFn,
|
|
207
|
+
BuildNextOptions,
|
|
208
|
+
RouterConstructorOptions,
|
|
209
|
+
RouterEvents,
|
|
210
|
+
RouterEvent,
|
|
211
|
+
RouterListener,
|
|
212
|
+
RouteConstraints,
|
|
213
|
+
RouteMask,
|
|
214
|
+
MatchRouteOptions,
|
|
215
|
+
CreateLazyFileRoute,
|
|
216
|
+
} from '@tanstack/router-core'
|
|
217
|
+
export type {
|
|
218
|
+
UseLinkPropsOptions,
|
|
219
|
+
ActiveLinkOptions,
|
|
220
|
+
LinkProps,
|
|
221
|
+
LinkComponent,
|
|
222
|
+
LinkComponentProps,
|
|
223
|
+
CreateLinkProps,
|
|
224
|
+
} from './link'
|
|
225
|
+
|
|
226
|
+
export {
|
|
227
|
+
Matches,
|
|
228
|
+
useMatchRoute,
|
|
229
|
+
MatchRoute,
|
|
230
|
+
useMatches,
|
|
231
|
+
useParentMatches,
|
|
232
|
+
useChildMatches,
|
|
233
|
+
} from './Matches'
|
|
234
|
+
|
|
235
|
+
export type { UseMatchRouteOptions, MakeMatchRouteOptions } from './Matches'
|
|
236
|
+
|
|
237
|
+
export { Match, Outlet } from './Match'
|
|
238
|
+
|
|
239
|
+
export { useMatch } from './useMatch'
|
|
240
|
+
export { useLoaderDeps } from './useLoaderDeps'
|
|
241
|
+
export { useLoaderData } from './useLoaderData'
|
|
242
|
+
|
|
243
|
+
export {
|
|
244
|
+
redirect,
|
|
245
|
+
isRedirect,
|
|
246
|
+
createRouterConfig,
|
|
247
|
+
DEFAULT_PROTOCOL_ALLOWLIST,
|
|
248
|
+
} from '@tanstack/router-core'
|
|
249
|
+
|
|
250
|
+
export {
|
|
251
|
+
RouteApi,
|
|
252
|
+
getRouteApi,
|
|
253
|
+
Route,
|
|
254
|
+
createRoute,
|
|
255
|
+
RootRoute,
|
|
256
|
+
rootRouteWithContext,
|
|
257
|
+
createRootRoute,
|
|
258
|
+
createRootRouteWithContext,
|
|
259
|
+
createRouteMask,
|
|
260
|
+
NotFoundRoute,
|
|
261
|
+
} from './route'
|
|
262
|
+
export type {
|
|
263
|
+
AnyRootRoute,
|
|
264
|
+
AsyncRouteComponent,
|
|
265
|
+
RouteComponent,
|
|
266
|
+
ErrorRouteComponent,
|
|
267
|
+
NotFoundRouteComponent,
|
|
268
|
+
DefaultRouteTypes,
|
|
269
|
+
RouteTypes,
|
|
270
|
+
} from './route'
|
|
271
|
+
|
|
272
|
+
export { createRouter, Router } from './router'
|
|
273
|
+
|
|
274
|
+
export { lazyFn, SearchParamError } from '@tanstack/router-core'
|
|
275
|
+
|
|
276
|
+
export { RouterProvider, RouterContextProvider } from './RouterProvider'
|
|
277
|
+
export type { RouterProps } from './RouterProvider'
|
|
278
|
+
|
|
279
|
+
export {
|
|
280
|
+
useElementScrollRestoration,
|
|
281
|
+
ScrollRestoration,
|
|
282
|
+
} from './ScrollRestoration'
|
|
283
|
+
|
|
284
|
+
export type { UseBlockerOpts, ShouldBlockFn } from './useBlocker'
|
|
285
|
+
export { useBlocker, Block } from './useBlocker'
|
|
286
|
+
|
|
287
|
+
export { useNavigate, Navigate } from './useNavigate'
|
|
288
|
+
|
|
289
|
+
export { useParams } from './useParams'
|
|
290
|
+
export { useSearch } from './useSearch'
|
|
291
|
+
|
|
292
|
+
export { useRouteContext } from './useRouteContext'
|
|
293
|
+
export { useRouter } from './useRouter'
|
|
294
|
+
export { useRouterState } from './useRouterState'
|
|
295
|
+
export { useLocation } from './useLocation'
|
|
296
|
+
export { useCanGoBack } from './useCanGoBack'
|
|
297
|
+
|
|
298
|
+
export { CatchNotFound, DefaultGlobalNotFound } from './not-found'
|
|
299
|
+
export { notFound, isNotFound } from '@tanstack/router-core'
|
|
300
|
+
export type { NotFoundError } from '@tanstack/router-core'
|
|
301
|
+
|
|
302
|
+
export type {
|
|
303
|
+
ValidateLinkOptions,
|
|
304
|
+
InferStructuralSharing,
|
|
305
|
+
ValidateUseSearchOptions,
|
|
306
|
+
ValidateUseParamsOptions,
|
|
307
|
+
ValidateLinkOptionsArray,
|
|
308
|
+
} from './typePrimitives'
|
|
309
|
+
|
|
310
|
+
export type {
|
|
311
|
+
ValidateFromPath,
|
|
312
|
+
ValidateToPath,
|
|
313
|
+
ValidateSearch,
|
|
314
|
+
ValidateParams,
|
|
315
|
+
InferFrom,
|
|
316
|
+
InferTo,
|
|
317
|
+
InferMaskTo,
|
|
318
|
+
InferMaskFrom,
|
|
319
|
+
ValidateNavigateOptions,
|
|
320
|
+
ValidateNavigateOptionsArray,
|
|
321
|
+
ValidateRedirectOptions,
|
|
322
|
+
ValidateRedirectOptionsArray,
|
|
323
|
+
ValidateId,
|
|
324
|
+
InferStrict,
|
|
325
|
+
InferShouldThrow,
|
|
326
|
+
InferSelected,
|
|
327
|
+
ValidateUseSearchResult,
|
|
328
|
+
ValidateUseParamsResult,
|
|
329
|
+
} from '@tanstack/router-core'
|
|
330
|
+
|
|
331
|
+
export { ScriptOnce } from './ScriptOnce'
|
|
332
|
+
export { Asset } from './Asset'
|
|
333
|
+
export { HeadContent } from './HeadContent'
|
|
334
|
+
export { useTags } from './headContentUtils'
|
|
335
|
+
export { Scripts } from './Scripts'
|
|
336
|
+
export type * from './ssr/serializer'
|
|
337
|
+
export { composeRewrites } from '@tanstack/router-core'
|
|
338
|
+
export type {
|
|
339
|
+
LocationRewrite,
|
|
340
|
+
LocationRewriteFunction,
|
|
341
|
+
} from '@tanstack/router-core'
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
import { isModuleNotFoundError } from '@tanstack/router-core'
|
|
3
|
+
import { reactUse } from './utils'
|
|
4
|
+
import type { AsyncRouteComponent } from './route'
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Wrap a dynamic import to create a route component that supports
|
|
8
|
+
* `.preload()` and friendly reload-on-module-missing behavior.
|
|
9
|
+
*
|
|
10
|
+
* @param importer Function returning a module promise
|
|
11
|
+
* @param exportName Named export to use (default: `default`)
|
|
12
|
+
* @returns A lazy route component compatible with TanStack Router
|
|
13
|
+
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/lazyRouteComponentFunction
|
|
14
|
+
*/
|
|
15
|
+
export function lazyRouteComponent<
|
|
16
|
+
T extends Record<string, any>,
|
|
17
|
+
TKey extends keyof T = 'default',
|
|
18
|
+
>(
|
|
19
|
+
importer: () => Promise<T>,
|
|
20
|
+
exportName?: TKey,
|
|
21
|
+
): T[TKey] extends (props: infer TProps) => any
|
|
22
|
+
? AsyncRouteComponent<TProps>
|
|
23
|
+
: never {
|
|
24
|
+
let loadPromise: Promise<any> | undefined
|
|
25
|
+
let comp: T[TKey] | T['default']
|
|
26
|
+
let error: any
|
|
27
|
+
let reload: boolean
|
|
28
|
+
|
|
29
|
+
const load = () => {
|
|
30
|
+
if (!loadPromise) {
|
|
31
|
+
loadPromise = importer()
|
|
32
|
+
.then((res) => {
|
|
33
|
+
loadPromise = undefined
|
|
34
|
+
comp = res[exportName ?? 'default']
|
|
35
|
+
})
|
|
36
|
+
.catch((err) => {
|
|
37
|
+
// We don't want an error thrown from preload in this case, because
|
|
38
|
+
// there's nothing we want to do about module not found during preload.
|
|
39
|
+
// Record the error, the rest is handled during the render path.
|
|
40
|
+
error = err
|
|
41
|
+
// If the load fails due to module not found, it may mean a new version of
|
|
42
|
+
// the build was deployed and the user's browser is still using an old version.
|
|
43
|
+
// If this happens, the old version in the user's browser would have an outdated
|
|
44
|
+
// URL to the lazy module.
|
|
45
|
+
// In that case, we want to attempt one window refresh to get the latest.
|
|
46
|
+
if (isModuleNotFoundError(error)) {
|
|
47
|
+
if (
|
|
48
|
+
error instanceof Error &&
|
|
49
|
+
typeof window !== 'undefined' &&
|
|
50
|
+
typeof sessionStorage !== 'undefined'
|
|
51
|
+
) {
|
|
52
|
+
// Again, we want to reload one time on module not found error and not enter
|
|
53
|
+
// a reload loop if there is some other issue besides an old deploy.
|
|
54
|
+
// That's why we store our reload attempt in sessionStorage.
|
|
55
|
+
// Use error.message as key because it contains the module path that failed.
|
|
56
|
+
const storageKey = `tanstack_router_reload:${error.message}`
|
|
57
|
+
if (!sessionStorage.getItem(storageKey)) {
|
|
58
|
+
sessionStorage.setItem(storageKey, '1')
|
|
59
|
+
reload = true
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
})
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return loadPromise
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const lazyComp = function Lazy(props: any) {
|
|
70
|
+
// Now that we're out of preload and into actual render path,
|
|
71
|
+
if (reload) {
|
|
72
|
+
// If it was a module loading error,
|
|
73
|
+
// throw eternal suspense while we wait for window to reload
|
|
74
|
+
window.location.reload()
|
|
75
|
+
throw new Promise(() => {})
|
|
76
|
+
}
|
|
77
|
+
if (error) {
|
|
78
|
+
// Otherwise, just throw the error
|
|
79
|
+
throw error
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if (!comp) {
|
|
83
|
+
if (reactUse) {
|
|
84
|
+
reactUse(load())
|
|
85
|
+
} else {
|
|
86
|
+
throw load()
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
return React.createElement(comp, props)
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
;(lazyComp as any).preload = load
|
|
94
|
+
|
|
95
|
+
return lazyComp as any
|
|
96
|
+
}
|