@tanstack/router-core 0.0.1-beta.23 → 0.0.1-beta.25
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/route.js +1 -0
- package/build/cjs/packages/router-core/src/route.js.map +1 -1
- 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 +1 -0
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +128 -128
- package/build/types/index.d.ts +5 -4
- package/build/umd/index.development.js +1 -0
- package/build/umd/index.development.js.map +1 -1
- package/build/umd/index.production.js +1 -1
- package/build/umd/index.production.js.map +1 -1
- package/package.json +1 -1
- package/src/frameworks.ts +1 -0
- package/src/link.ts +3 -2
- package/src/route.ts +6 -1
- package/src/routeConfig.ts +1 -1
- package/src/routeMatch.ts +3 -3
- package/src/router.ts +1 -1
package/package.json
CHANGED
package/src/frameworks.ts
CHANGED
package/src/link.ts
CHANGED
|
@@ -142,8 +142,9 @@ type SearchParamOptions<
|
|
|
142
142
|
TTo,
|
|
143
143
|
TFromSchema = RouteInfoByPath<TAllRouteInfo, TFrom>['fullSearchSchema'],
|
|
144
144
|
TToSchema = RouteInfoByPath<TAllRouteInfo, TTo>['fullSearchSchema'],
|
|
145
|
-
> = StartsWith<TFrom, TTo> extends true
|
|
146
|
-
?
|
|
145
|
+
> = StartsWith<TFrom, TTo> extends true
|
|
146
|
+
? // If the next route search extend or cover the from route, params will be optional
|
|
147
|
+
{
|
|
147
148
|
search?: SearchReducer<TFromSchema, TToSchema>
|
|
148
149
|
}
|
|
149
150
|
: // Optional search params? Allow it
|
package/src/route.ts
CHANGED
|
@@ -29,6 +29,7 @@ export interface Route<
|
|
|
29
29
|
TAllRouteInfo extends AnyAllRouteInfo = DefaultAllRouteInfo,
|
|
30
30
|
TRouteInfo extends AnyRouteInfo = RouteInfo,
|
|
31
31
|
> {
|
|
32
|
+
routeInfo: TRouteInfo
|
|
32
33
|
routeId: TRouteInfo['id']
|
|
33
34
|
routeRouteId: TRouteInfo['routeId']
|
|
34
35
|
routePath: TRouteInfo['path']
|
|
@@ -56,7 +57,10 @@ export interface Route<
|
|
|
56
57
|
opts?: MatchRouteOptions,
|
|
57
58
|
) => RouteInfoByPath<TAllRouteInfo, TResolved>['allParams']
|
|
58
59
|
navigate: <TTo extends string = '.'>(
|
|
59
|
-
options: Omit<
|
|
60
|
+
options: Omit<
|
|
61
|
+
LinkOptions<TAllRouteInfo, TRouteInfo['fullPath'], TTo>,
|
|
62
|
+
'from'
|
|
63
|
+
>,
|
|
60
64
|
) => Promise<void>
|
|
61
65
|
action: unknown extends TRouteInfo['actionResponse']
|
|
62
66
|
?
|
|
@@ -185,6 +189,7 @@ export function createRoute<
|
|
|
185
189
|
})()
|
|
186
190
|
|
|
187
191
|
let route: Route<TAllRouteInfo, TRouteInfo> = {
|
|
192
|
+
routeInfo: undefined!,
|
|
188
193
|
routeId: id,
|
|
189
194
|
routeRouteId: routeId,
|
|
190
195
|
routePath,
|
package/src/routeConfig.ts
CHANGED
|
@@ -114,7 +114,7 @@ export type RouteOptions<
|
|
|
114
114
|
// The content to be rendered when the route is matched. If no component is provided, defaults to `<Outlet />`
|
|
115
115
|
component?: GetFrameworkGeneric<'Component'> // , NoInfer<TParentLoaderData>>
|
|
116
116
|
// The content to be rendered when the route encounters an error
|
|
117
|
-
errorComponent?: GetFrameworkGeneric<'
|
|
117
|
+
errorComponent?: GetFrameworkGeneric<'ErrorComponent'> // , NoInfer<TParentLoaderData>>
|
|
118
118
|
// If supported by your framework, the content to be rendered as the fallback content until the route is ready to render
|
|
119
119
|
pendingComponent?: GetFrameworkGeneric<'Component'> //, NoInfer<TParentLoaderData>>
|
|
120
120
|
// An asynchronous function responsible for preparing or fetching data for the route before it is rendered
|
package/src/routeMatch.ts
CHANGED
|
@@ -30,9 +30,9 @@ export interface RouteMatch<
|
|
|
30
30
|
isFetching: boolean
|
|
31
31
|
invalidAt: number
|
|
32
32
|
__: {
|
|
33
|
-
component?: GetFrameworkGeneric<'Component'>
|
|
34
|
-
errorComponent?: GetFrameworkGeneric<'
|
|
35
|
-
pendingComponent?: GetFrameworkGeneric<'Component'>
|
|
33
|
+
component?: GetFrameworkGeneric<'Component'>
|
|
34
|
+
errorComponent?: GetFrameworkGeneric<'ErrorComponent'>
|
|
35
|
+
pendingComponent?: GetFrameworkGeneric<'Component'>
|
|
36
36
|
loadPromise?: Promise<void>
|
|
37
37
|
componentsPromise?: Promise<void>
|
|
38
38
|
dataPromise?: Promise<TRouteInfo['routeLoaderData']>
|
package/src/router.ts
CHANGED
|
@@ -91,7 +91,7 @@ export interface RouterOptions<TRouteConfig extends AnyRouteConfig> {
|
|
|
91
91
|
defaultPreloadGcMaxAge?: number
|
|
92
92
|
defaultPreloadDelay?: number
|
|
93
93
|
defaultComponent?: GetFrameworkGeneric<'Component'>
|
|
94
|
-
defaultErrorComponent?: GetFrameworkGeneric<'
|
|
94
|
+
defaultErrorComponent?: GetFrameworkGeneric<'ErrorComponent'>
|
|
95
95
|
defaultPendingComponent?: GetFrameworkGeneric<'Component'>
|
|
96
96
|
defaultLoaderMaxAge?: number
|
|
97
97
|
defaultLoaderGcMaxAge?: number
|