@tanstack/router-core 0.0.1-beta.19 → 0.0.1-beta.21
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/build/cjs/packages/router-core/src/routeConfig.js.map +1 -1
- package/build/cjs/packages/router-core/src/routeMatch.js.map +1 -1
- package/build/cjs/packages/router-core/src/router.js.map +1 -1
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +126 -126
- package/build/types/index.d.ts +5 -5
- package/build/umd/index.development.js.map +1 -1
- package/build/umd/index.production.js.map +1 -1
- package/package.json +1 -1
- package/src/routeConfig.ts +2 -13
- package/src/routeMatch.ts +2 -2
- package/src/router.ts +1 -1
package/package.json
CHANGED
package/src/routeConfig.ts
CHANGED
|
@@ -50,20 +50,14 @@ export type ParentParams<TParentParams> = AnyPathParams extends TParentParams
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
export type LoaderFn<
|
|
53
|
-
TParentRouteLoaderData extends AnyLoaderData = {},
|
|
54
53
|
TRouteLoaderData extends AnyLoaderData = {},
|
|
55
54
|
TFullSearchSchema extends AnySearchSchema = {},
|
|
56
55
|
TAllParams extends AnyPathParams = {},
|
|
57
56
|
> = (
|
|
58
|
-
loaderContext: LoaderContext<
|
|
59
|
-
TParentRouteLoaderData,
|
|
60
|
-
TFullSearchSchema,
|
|
61
|
-
TAllParams
|
|
62
|
-
>,
|
|
57
|
+
loaderContext: LoaderContext<TFullSearchSchema, TAllParams>,
|
|
63
58
|
) => Promise<TRouteLoaderData>
|
|
64
59
|
|
|
65
60
|
export interface LoaderContext<
|
|
66
|
-
TParentRouteLoaderData extends AnyLoaderData = {},
|
|
67
61
|
TFullSearchSchema extends AnySearchSchema = {},
|
|
68
62
|
TAllParams extends AnyPathParams = {},
|
|
69
63
|
> {
|
|
@@ -123,12 +117,7 @@ export type RouteOptions<
|
|
|
123
117
|
// If supported by your framework, the content to be rendered as the fallback content until the route is ready to render
|
|
124
118
|
pendingComponent?: GetFrameworkGeneric<'Component'> //, NoInfer<TParentLoaderData>>
|
|
125
119
|
// An asynchronous function responsible for preparing or fetching data for the route before it is rendered
|
|
126
|
-
loader?: LoaderFn<
|
|
127
|
-
TParentRouteLoaderData,
|
|
128
|
-
TRouteLoaderData,
|
|
129
|
-
TFullSearchSchema,
|
|
130
|
-
TAllParams
|
|
131
|
-
>
|
|
120
|
+
loader?: LoaderFn<TRouteLoaderData, TFullSearchSchema, TAllParams>
|
|
132
121
|
// The max age to consider loader data fresh (not-stale) for this route in milliseconds from the time of fetch
|
|
133
122
|
// Defaults to 0. Only stale loader data is refetched.
|
|
134
123
|
loaderMaxAge?: number
|
package/src/routeMatch.ts
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
RouteInfo,
|
|
8
8
|
} from './routeInfo'
|
|
9
9
|
import { Router } from './router'
|
|
10
|
-
import { replaceEqualDeep
|
|
10
|
+
import { replaceEqualDeep } from './utils'
|
|
11
11
|
|
|
12
12
|
export interface RouteMatch<
|
|
13
13
|
TAllRouteInfo extends AnyAllRouteInfo = DefaultAllRouteInfo,
|
|
@@ -15,7 +15,7 @@ export interface RouteMatch<
|
|
|
15
15
|
> extends Route<TAllRouteInfo, TRouteInfo> {
|
|
16
16
|
matchId: string
|
|
17
17
|
pathname: string
|
|
18
|
-
params: TRouteInfo['
|
|
18
|
+
params: TRouteInfo['allParams']
|
|
19
19
|
parentMatch?: RouteMatch
|
|
20
20
|
childMatches: RouteMatch[]
|
|
21
21
|
routeSearch: TRouteInfo['searchSchema']
|
package/src/router.ts
CHANGED
|
@@ -169,7 +169,7 @@ export interface LoaderState<
|
|
|
169
169
|
TAllParams extends AnyPathParams = {},
|
|
170
170
|
> {
|
|
171
171
|
loadedAt: number
|
|
172
|
-
loaderContext: LoaderContext<
|
|
172
|
+
loaderContext: LoaderContext<TFullSearchSchema, TAllParams>
|
|
173
173
|
}
|
|
174
174
|
|
|
175
175
|
export interface RouterState {
|