@tanstack/react-router 1.77.5 → 1.77.7
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/cjs/Matches.cjs.map +1 -1
- package/dist/cjs/Matches.d.cts +1 -0
- package/dist/cjs/route.cjs.map +1 -1
- package/dist/cjs/route.d.cts +2 -2
- package/dist/cjs/router.cjs +1 -0
- package/dist/cjs/router.cjs.map +1 -1
- package/dist/esm/Matches.d.ts +1 -0
- package/dist/esm/Matches.js.map +1 -1
- package/dist/esm/route.d.ts +2 -2
- package/dist/esm/route.js.map +1 -1
- package/dist/esm/router.js +1 -0
- package/dist/esm/router.js.map +1 -1
- package/package.json +2 -2
- package/src/Matches.tsx +10 -0
- package/src/route.ts +7 -2
- package/src/router.ts +2 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/react-router",
|
|
3
|
-
"version": "1.77.
|
|
3
|
+
"version": "1.77.7",
|
|
4
4
|
"description": "Modern and scalable routing for React applications",
|
|
5
5
|
"author": "Tanner Linsley",
|
|
6
6
|
"license": "MIT",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"peerDependencies": {
|
|
67
67
|
"react": ">=18",
|
|
68
68
|
"react-dom": ">=18",
|
|
69
|
-
"@tanstack/router-generator": "1.
|
|
69
|
+
"@tanstack/router-generator": "1.77.7"
|
|
70
70
|
},
|
|
71
71
|
"peerDependenciesMeta": {
|
|
72
72
|
"@tanstack/router-generator": {
|
package/src/Matches.tsx
CHANGED
|
@@ -121,6 +121,16 @@ export const isMatch = <TMatch, TPath extends string>(
|
|
|
121
121
|
return value != null
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
+
export type MakeRouteMatchFromRoute<TRoute extends AnyRoute> = RouteMatch<
|
|
125
|
+
TRoute['types']['id'],
|
|
126
|
+
TRoute['types']['fullPath'],
|
|
127
|
+
TRoute['types']['allParams'],
|
|
128
|
+
TRoute['types']['fullSearchSchema'],
|
|
129
|
+
TRoute['types']['loaderData'],
|
|
130
|
+
TRoute['types']['allContext'],
|
|
131
|
+
TRoute['types']['loaderDeps']
|
|
132
|
+
>
|
|
133
|
+
|
|
124
134
|
export interface RouteMatch<
|
|
125
135
|
TRouteId,
|
|
126
136
|
TFullPath,
|
package/src/route.ts
CHANGED
|
@@ -11,7 +11,12 @@ import { rootRouteId } from './root'
|
|
|
11
11
|
import type * as React from 'react'
|
|
12
12
|
import type { RootRouteId } from './root'
|
|
13
13
|
import type { UseNavigateResult } from './useNavigate'
|
|
14
|
-
import type {
|
|
14
|
+
import type {
|
|
15
|
+
MakeRouteMatch,
|
|
16
|
+
MakeRouteMatchFromRoute,
|
|
17
|
+
MakeRouteMatchUnion,
|
|
18
|
+
RouteMatch,
|
|
19
|
+
} from './Matches'
|
|
15
20
|
import type { NavigateOptions, ParsePathParams, ToMaskOptions } from './link'
|
|
16
21
|
import type { ParsedLocation } from './location'
|
|
17
22
|
import type { RouteById, RouteIds, RoutePaths } from './routeInfo'
|
|
@@ -591,7 +596,7 @@ export interface LoaderFnContext<
|
|
|
591
596
|
* @deprecated Use `throw redirect({ to: '/somewhere' })` instead
|
|
592
597
|
**/
|
|
593
598
|
navigate: (opts: NavigateOptions<AnyRouter>) => Promise<void>
|
|
594
|
-
parentMatchPromise?: Promise<
|
|
599
|
+
parentMatchPromise?: Promise<MakeRouteMatchFromRoute<TParentRoute>>
|
|
595
600
|
cause: 'preload' | 'enter' | 'stay'
|
|
596
601
|
route: Route
|
|
597
602
|
}
|
package/src/router.ts
CHANGED
|
@@ -2299,7 +2299,7 @@ export class Router<
|
|
|
2299
2299
|
}
|
|
2300
2300
|
|
|
2301
2301
|
const validResolvedMatches = matches.slice(0, firstBadMatchIndex)
|
|
2302
|
-
const matchPromises: Array<Promise<
|
|
2302
|
+
const matchPromises: Array<Promise<AnyRouteMatch>> = []
|
|
2303
2303
|
|
|
2304
2304
|
validResolvedMatches.forEach(({ id: matchId, routeId }, index) => {
|
|
2305
2305
|
matchPromises.push(
|
|
@@ -2535,6 +2535,7 @@ export class Router<
|
|
|
2535
2535
|
loaderPromise: undefined,
|
|
2536
2536
|
invalid: false,
|
|
2537
2537
|
}))
|
|
2538
|
+
return this.getMatch(matchId)!
|
|
2538
2539
|
})(),
|
|
2539
2540
|
)
|
|
2540
2541
|
})
|