@tanstack/router-core 0.0.1-beta.14 → 0.0.1-beta.15
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 +6 -1
- package/build/cjs/packages/router-core/src/routeMatch.js.map +1 -1
- package/build/cjs/packages/router-core/src/router.js +1 -0
- package/build/cjs/packages/router-core/src/router.js.map +1 -1
- package/build/esm/index.js +7 -1
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +130 -130
- package/build/types/index.d.ts +23 -20
- package/build/umd/index.development.js +7 -1
- 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/routeConfig.ts +35 -10
- package/src/routeInfo.ts +7 -0
- package/src/routeMatch.ts +9 -2
- package/src/router.ts +1 -0
package/build/types/index.d.ts
CHANGED
|
@@ -39,7 +39,7 @@ interface RouteMatch<TAllRouteInfo extends AnyAllRouteInfo = DefaultAllRouteInfo
|
|
|
39
39
|
pendingComponent?: GetFrameworkGeneric<'Component'>;
|
|
40
40
|
loadPromise?: Promise<void>;
|
|
41
41
|
componentsPromise?: Promise<void>;
|
|
42
|
-
dataPromise?: Promise<
|
|
42
|
+
dataPromise?: Promise<TRouteInfo['routeLoaderData']>;
|
|
43
43
|
onExit?: void | ((matchContext: {
|
|
44
44
|
params: TRouteInfo['allParams'];
|
|
45
45
|
search: TRouteInfo['fullSearchSchema'];
|
|
@@ -67,6 +67,7 @@ interface RouteMatch<TAllRouteInfo extends AnyAllRouteInfo = DefaultAllRouteInfo
|
|
|
67
67
|
hasLoaders: () => boolean;
|
|
68
68
|
}
|
|
69
69
|
declare function createRouteMatch<TAllRouteInfo extends AnyAllRouteInfo = DefaultAllRouteInfo, TRouteInfo extends AnyRouteInfo = RouteInfo>(router: Router<any, any>, route: Route<TAllRouteInfo, TRouteInfo>, opts: {
|
|
70
|
+
parentMatch?: RouteMatch<any, any>;
|
|
70
71
|
matchId: string;
|
|
71
72
|
params: TRouteInfo['allParams'];
|
|
72
73
|
pathname: string;
|
|
@@ -354,8 +355,8 @@ declare type ParseRouteChildren<TRouteConfig> = TRouteConfig extends AnyRouteCon
|
|
|
354
355
|
declare type ParseRouteChild<TRouteConfig, TId> = TRouteConfig & {
|
|
355
356
|
id: TId;
|
|
356
357
|
} extends AnyRouteConfig ? ParseRouteConfig<TRouteConfig> : never;
|
|
357
|
-
declare type RouteConfigRoute<TRouteConfig> = TRouteConfig extends RouteConfig<infer TId, infer TRouteId, infer TPath, infer TFullPath, infer TRouteLoaderData, infer TLoaderData, infer TActionPayload, infer TActionResponse, infer TParentSearchSchema, infer TSearchSchema, infer TFullSearchSchema, infer TParentParams, infer TParams, infer TAllParams, any> ? string extends TRouteId ? never : RouteInfo<TId, TRouteId, TPath, TFullPath, TRouteLoaderData, TLoaderData, TActionPayload, TActionResponse, TParentSearchSchema, TSearchSchema, TFullSearchSchema, TParentParams, TParams, TAllParams> : never;
|
|
358
|
-
interface RoutesInfoInner<TRouteConfig extends AnyRouteConfig, TRouteInfo extends RouteInfo<string, string, any, any, any, any, any, any, any, any, any, any, any, any> = RouteInfo, TRouteInfoById = {
|
|
358
|
+
declare type RouteConfigRoute<TRouteConfig> = TRouteConfig extends RouteConfig<infer TId, infer TRouteId, infer TPath, infer TFullPath, infer TParentLoaderData, infer TRouteLoaderData, infer TLoaderData, infer TActionPayload, infer TActionResponse, infer TParentSearchSchema, infer TSearchSchema, infer TFullSearchSchema, infer TParentParams, infer TParams, infer TAllParams, any> ? string extends TRouteId ? never : RouteInfo<TId, TRouteId, TPath, TFullPath, TParentLoaderData, TRouteLoaderData, TLoaderData, TActionPayload, TActionResponse, TParentSearchSchema, TSearchSchema, TFullSearchSchema, TParentParams, TParams, TAllParams> : never;
|
|
359
|
+
interface RoutesInfoInner<TRouteConfig extends AnyRouteConfig, TRouteInfo extends RouteInfo<string, string, any, any, any, any, any, any, any, any, any, any, any, any, any> = RouteInfo, TRouteInfoById = {
|
|
359
360
|
[TInfo in TRouteInfo as TInfo['id']]: TInfo;
|
|
360
361
|
}, TRouteInfoByFullPath = {
|
|
361
362
|
[TInfo in TRouteInfo as TInfo['fullPath'] extends RootRouteId ? never : string extends TInfo['fullPath'] ? never : TInfo['fullPath']]: TInfo;
|
|
@@ -367,13 +368,14 @@ interface RoutesInfoInner<TRouteConfig extends AnyRouteConfig, TRouteInfo extend
|
|
|
367
368
|
routeIds: keyof TRouteInfoById;
|
|
368
369
|
routePaths: keyof TRouteInfoByFullPath;
|
|
369
370
|
}
|
|
370
|
-
interface AnyRouteInfo extends RouteInfo<any, any, any, any, any, any, any, any, any, any, any, any, any, any> {
|
|
371
|
+
interface AnyRouteInfo extends RouteInfo<any, any, any, any, any, any, any, any, any, any, any, any, any, any, any> {
|
|
371
372
|
}
|
|
372
|
-
interface RouteInfo<TId extends string = string, TRouteId extends string = string, TPath extends string = string, TFullPath extends string = string, TRouteLoaderData extends AnyLoaderData = {}, TLoaderData extends AnyLoaderData = {}, TActionPayload = unknown, TActionResponse = unknown, TParentSearchSchema extends {} = {}, TSearchSchema extends AnySearchSchema = {}, TFullSearchSchema extends AnySearchSchema = {}, TParentParams extends AnyPathParams = {}, TParams extends Record<ParsePathParams<TPath>, unknown> = Record<ParsePathParams<TPath>, string>, TAllParams extends AnyPathParams = {}> {
|
|
373
|
+
interface RouteInfo<TId extends string = string, TRouteId extends string = string, TPath extends string = string, TFullPath extends string = string, TParentRouteLoaderData extends AnyLoaderData = {}, TRouteLoaderData extends AnyLoaderData = {}, TLoaderData extends AnyLoaderData = {}, TActionPayload = unknown, TActionResponse = unknown, TParentSearchSchema extends {} = {}, TSearchSchema extends AnySearchSchema = {}, TFullSearchSchema extends AnySearchSchema = {}, TParentParams extends AnyPathParams = {}, TParams extends Record<ParsePathParams<TPath>, unknown> = Record<ParsePathParams<TPath>, string>, TAllParams extends AnyPathParams = {}> {
|
|
373
374
|
id: TId;
|
|
374
375
|
routeId: TRouteId;
|
|
375
376
|
path: TPath;
|
|
376
377
|
fullPath: TFullPath;
|
|
378
|
+
parentRouteLoaderData: TParentRouteLoaderData;
|
|
377
379
|
routeLoaderData: TRouteLoaderData;
|
|
378
380
|
loaderData: TLoaderData;
|
|
379
381
|
actionPayload: TActionPayload;
|
|
@@ -383,7 +385,7 @@ interface RouteInfo<TId extends string = string, TRouteId extends string = strin
|
|
|
383
385
|
parentParams: TParentParams;
|
|
384
386
|
params: TParams;
|
|
385
387
|
allParams: TAllParams;
|
|
386
|
-
options: RouteOptions<TRouteId, TPath, TRouteLoaderData, TLoaderData, TActionPayload, TActionResponse, TParentSearchSchema, TSearchSchema, TFullSearchSchema, TParentParams, TParams, TAllParams>;
|
|
388
|
+
options: RouteOptions<TRouteId, TPath, TParentRouteLoaderData, TRouteLoaderData, TLoaderData, TActionPayload, TActionResponse, TParentSearchSchema, TSearchSchema, TFullSearchSchema, TParentParams, TParams, TAllParams>;
|
|
387
389
|
}
|
|
388
390
|
declare type RoutesById<TAllRouteInfo extends AnyAllRouteInfo> = {
|
|
389
391
|
[K in keyof TAllRouteInfo['routeInfoById']]: Route<TAllRouteInfo, TAllRouteInfo['routeInfoById'][K]>;
|
|
@@ -410,15 +412,16 @@ declare type DefinedPathParamWarning = 'Path params cannot be redefined by child
|
|
|
410
412
|
declare type ParentParams<TParentParams> = AnyPathParams extends TParentParams ? {} : {
|
|
411
413
|
[Key in keyof TParentParams]?: DefinedPathParamWarning;
|
|
412
414
|
};
|
|
413
|
-
declare type LoaderFn<TRouteLoaderData extends AnyLoaderData, TFullSearchSchema extends AnySearchSchema = {}, TAllParams extends AnyPathParams = {}> = (loaderContext: LoaderContext<TFullSearchSchema, TAllParams>) => Promise<TRouteLoaderData>;
|
|
414
|
-
interface LoaderContext<TFullSearchSchema extends AnySearchSchema = {}, TAllParams extends AnyPathParams = {}> {
|
|
415
|
+
declare type LoaderFn<TParentRouteLoaderData extends AnyLoaderData = {}, TRouteLoaderData extends AnyLoaderData = {}, TFullSearchSchema extends AnySearchSchema = {}, TAllParams extends AnyPathParams = {}> = (loaderContext: LoaderContext<TParentRouteLoaderData, TFullSearchSchema, TAllParams>) => Promise<TRouteLoaderData>;
|
|
416
|
+
interface LoaderContext<TParentRouteLoaderData extends AnyLoaderData = {}, TFullSearchSchema extends AnySearchSchema = {}, TAllParams extends AnyPathParams = {}> {
|
|
415
417
|
params: TAllParams;
|
|
416
418
|
search: TFullSearchSchema;
|
|
417
419
|
signal?: AbortSignal;
|
|
420
|
+
parentLoaderPromise?: Promise<TParentRouteLoaderData>;
|
|
418
421
|
}
|
|
419
422
|
declare type ActionFn<TActionPayload = unknown, TActionResponse = unknown> = (submission: TActionPayload) => TActionResponse | Promise<TActionResponse>;
|
|
420
423
|
declare type UnloaderFn<TPath extends string> = (routeMatch: RouteMatch<any, RouteInfo<string, TPath>>) => void;
|
|
421
|
-
declare type RouteOptions<TRouteId extends string = string, TPath extends string = string, TRouteLoaderData extends AnyLoaderData = {}, TLoaderData extends AnyLoaderData = {}, TActionPayload = unknown, TActionResponse = unknown, TParentSearchSchema extends {} = {}, TSearchSchema extends AnySearchSchema = {}, TFullSearchSchema extends AnySearchSchema = TSearchSchema, TParentParams extends AnyPathParams = {}, TParams extends Record<ParsePathParams<TPath>, unknown> = Record<ParsePathParams<TPath>, string>, TAllParams extends AnyPathParams = {}> = ({
|
|
424
|
+
declare type RouteOptions<TRouteId extends string = string, TPath extends string = string, TParentRouteLoaderData extends AnyLoaderData = {}, TRouteLoaderData extends AnyLoaderData = {}, TLoaderData extends AnyLoaderData = {}, TActionPayload = unknown, TActionResponse = unknown, TParentSearchSchema extends {} = {}, TSearchSchema extends AnySearchSchema = {}, TFullSearchSchema extends AnySearchSchema = TSearchSchema, TParentParams extends AnyPathParams = {}, TParams extends Record<ParsePathParams<TPath>, unknown> = Record<ParsePathParams<TPath>, string>, TAllParams extends AnyPathParams = {}> = ({
|
|
422
425
|
path: TPath;
|
|
423
426
|
} | {
|
|
424
427
|
id: TRouteId;
|
|
@@ -430,7 +433,7 @@ declare type RouteOptions<TRouteId extends string = string, TPath extends string
|
|
|
430
433
|
component?: GetFrameworkGeneric<'Component'>;
|
|
431
434
|
errorComponent?: GetFrameworkGeneric<'Component'>;
|
|
432
435
|
pendingComponent?: GetFrameworkGeneric<'Component'>;
|
|
433
|
-
loader?: LoaderFn<TRouteLoaderData, TFullSearchSchema, TAllParams>;
|
|
436
|
+
loader?: LoaderFn<TParentRouteLoaderData, TRouteLoaderData, TFullSearchSchema, TAllParams>;
|
|
434
437
|
loaderMaxAge?: number;
|
|
435
438
|
loaderGcMaxAge?: number;
|
|
436
439
|
action?: ActionFn<TActionPayload, TActionResponse>;
|
|
@@ -455,31 +458,31 @@ declare type RouteOptions<TRouteId extends string = string, TPath extends string
|
|
|
455
458
|
stringifyParams: (params: TParams) => Record<ParsePathParams<TPath>, string>;
|
|
456
459
|
}) & (PickUnsafe<TParentParams, ParsePathParams<TPath>> extends never ? {} : 'Cannot redefined path params in child routes!');
|
|
457
460
|
declare type SearchFilter<T, U = T> = (prev: T) => U;
|
|
458
|
-
interface RouteConfig<TId extends string = string, TRouteId extends string = string, TPath extends string = string, TFullPath extends string = string, TRouteLoaderData extends AnyLoaderData = AnyLoaderData, TLoaderData extends AnyLoaderData = AnyLoaderData, TActionPayload = unknown, TActionResponse = unknown, TParentSearchSchema extends {} = {}, TSearchSchema extends AnySearchSchema = {}, TFullSearchSchema extends AnySearchSchema = {}, TParentParams extends AnyPathParams = {}, TParams extends Record<ParsePathParams<TPath>, unknown> = Record<ParsePathParams<TPath>, string>, TAllParams extends AnyPathParams = {}, TKnownChildren = unknown> {
|
|
461
|
+
interface RouteConfig<TId extends string = string, TRouteId extends string = string, TPath extends string = string, TFullPath extends string = string, TParentRouteLoaderData extends AnyLoaderData = AnyLoaderData, TRouteLoaderData extends AnyLoaderData = AnyLoaderData, TLoaderData extends AnyLoaderData = AnyLoaderData, TActionPayload = unknown, TActionResponse = unknown, TParentSearchSchema extends {} = {}, TSearchSchema extends AnySearchSchema = {}, TFullSearchSchema extends AnySearchSchema = {}, TParentParams extends AnyPathParams = {}, TParams extends Record<ParsePathParams<TPath>, unknown> = Record<ParsePathParams<TPath>, string>, TAllParams extends AnyPathParams = {}, TKnownChildren = unknown> {
|
|
459
462
|
id: TId;
|
|
460
463
|
routeId: TRouteId;
|
|
461
464
|
path: NoInfer<TPath>;
|
|
462
465
|
fullPath: TFullPath;
|
|
463
|
-
options: RouteOptions<TRouteId, TPath, TRouteLoaderData, TLoaderData, TActionPayload, TActionResponse, TParentSearchSchema, TSearchSchema, TFullSearchSchema, TParentParams, TParams, TAllParams>;
|
|
466
|
+
options: RouteOptions<TRouteId, TPath, TParentRouteLoaderData, TRouteLoaderData, TLoaderData, TActionPayload, TActionResponse, TParentSearchSchema, TSearchSchema, TFullSearchSchema, TParentParams, TParams, TAllParams>;
|
|
464
467
|
children?: TKnownChildren;
|
|
465
468
|
addChildren: IsAny<TId, any, <TNewChildren extends any>(children: TNewChildren extends AnyRouteConfig[] ? TNewChildren : {
|
|
466
469
|
error: 'Invalid route detected';
|
|
467
470
|
route: TNewChildren;
|
|
468
|
-
}) => RouteConfig<TId, TRouteId, TPath, TFullPath, TRouteLoaderData, TLoaderData, TActionPayload, TActionResponse, TParentSearchSchema, TSearchSchema, TFullSearchSchema, TParentParams, TParams, TAllParams, TNewChildren>>;
|
|
469
|
-
createChildren: IsAny<TId, any, <TNewChildren extends any>(cb: (createChildRoute: CreateRouteConfigFn<false, TId, TFullPath, TLoaderData, TFullSearchSchema, TAllParams>) => TNewChildren extends AnyRouteConfig[] ? TNewChildren : {
|
|
471
|
+
}) => RouteConfig<TId, TRouteId, TPath, TFullPath, TParentRouteLoaderData, TRouteLoaderData, TLoaderData, TActionPayload, TActionResponse, TParentSearchSchema, TSearchSchema, TFullSearchSchema, TParentParams, TParams, TAllParams, TNewChildren>>;
|
|
472
|
+
createChildren: IsAny<TId, any, <TNewChildren extends any>(cb: (createChildRoute: CreateRouteConfigFn<false, TId, TFullPath, TRouteLoaderData, TLoaderData, TFullSearchSchema, TAllParams>) => TNewChildren extends AnyRouteConfig[] ? TNewChildren : {
|
|
470
473
|
error: 'Invalid route detected';
|
|
471
474
|
route: TNewChildren;
|
|
472
|
-
}) => RouteConfig<TId, TRouteId, TPath, TFullPath, TRouteLoaderData, TLoaderData, TActionPayload, TActionResponse, TParentSearchSchema, TSearchSchema, TFullSearchSchema, TParentParams, TParams, TAllParams, TNewChildren>>;
|
|
473
|
-
createRoute: CreateRouteConfigFn<false, TId, TFullPath, TLoaderData, TFullSearchSchema, TAllParams>;
|
|
475
|
+
}) => RouteConfig<TId, TRouteId, TPath, TFullPath, TParentRouteLoaderData, TRouteLoaderData, TLoaderData, TActionPayload, TActionResponse, TParentSearchSchema, TSearchSchema, TFullSearchSchema, TParentParams, TParams, TAllParams, TNewChildren>>;
|
|
476
|
+
createRoute: CreateRouteConfigFn<false, TId, TFullPath, TRouteLoaderData, TLoaderData, TFullSearchSchema, TAllParams>;
|
|
474
477
|
}
|
|
475
|
-
declare type CreateRouteConfigFn<TIsRoot extends boolean = false, TParentId extends string = string, TParentPath extends string = string,
|
|
478
|
+
declare type CreateRouteConfigFn<TIsRoot extends boolean = false, TParentId extends string = string, TParentPath extends string = string, TParentRouteLoaderData extends AnyLoaderData = {}, TParentLoaderData extends AnyLoaderData = {}, TParentSearchSchema extends AnySearchSchema = {}, TParentParams extends AnyPathParams = {}> = <TRouteId extends string, TPath extends string, TRouteLoaderData extends AnyLoaderData, TActionPayload, TActionResponse, TSearchSchema extends AnySearchSchema = AnySearchSchema, TParams extends Record<ParsePathParams<TPath>, unknown> = Record<ParsePathParams<TPath>, string>, TAllParams extends AnyPathParams extends TParams ? Record<ParsePathParams<TPath>, string> : NoInfer<TParams> = AnyPathParams extends TParams ? Record<ParsePathParams<TPath>, string> : NoInfer<TParams>, TKnownChildren extends RouteConfig[] = RouteConfig[], TResolvedId extends string = string extends TRouteId ? string extends TPath ? string : TPath : TRouteId>(options?: TIsRoot extends true ? Omit<RouteOptions<TRouteId, TPath, TParentRouteLoaderData, TRouteLoaderData, Expand<TParentLoaderData & DeepAwaited<NoInfer<TRouteLoaderData>>>, TActionPayload, TActionResponse, TParentSearchSchema, TSearchSchema, Expand<TParentSearchSchema & TSearchSchema>, TParentParams, TParams, Expand<TParentParams & TAllParams>>, 'path'> & {
|
|
476
479
|
path?: never;
|
|
477
|
-
} : RouteOptions<TRouteId, TPath, TRouteLoaderData, Expand<
|
|
480
|
+
} : RouteOptions<TRouteId, TPath, TParentRouteLoaderData, TRouteLoaderData, Expand<TParentLoaderData & DeepAwaited<NoInfer<TRouteLoaderData>>>, TActionPayload, TActionResponse, TParentSearchSchema, TSearchSchema, Expand<TParentSearchSchema & TSearchSchema>, TParentParams, TParams, Expand<TParentParams & TAllParams>>, children?: TKnownChildren, isRoot?: boolean, parentId?: string, parentPath?: string) => RouteConfig<RoutePrefix<TParentId, TResolvedId>, TResolvedId, TPath, string extends TPath ? '' : RoutePath<RoutePrefix<TParentPath, TPath>>, TParentRouteLoaderData, TRouteLoaderData, Expand<TParentLoaderData & DeepAwaited<NoInfer<TRouteLoaderData>>>, TActionPayload, TActionResponse, TParentSearchSchema, TSearchSchema, Expand<TParentSearchSchema & TSearchSchema>, TParentParams, TParams, Expand<TParentParams & TAllParams>, TKnownChildren>;
|
|
478
481
|
declare type RoutePath<T extends string> = T extends RootRouteId ? '/' : TrimPathRight<`${T}`>;
|
|
479
482
|
declare type RoutePrefix<TPrefix extends string, TId extends string> = string extends TId ? RootRouteId : TId extends string ? `${TPrefix}/${TId}` extends '/' ? '/' : `/${TrimPathLeft<`${TrimPathRight<TPrefix>}/${TrimPath<TId>}`>}` : never;
|
|
480
|
-
interface AnyRouteConfig extends RouteConfig<any, any, any, any, any, any, any, any, any, any, any, any, any, any, any> {
|
|
483
|
+
interface AnyRouteConfig extends RouteConfig<any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any> {
|
|
481
484
|
}
|
|
482
|
-
interface AnyRouteConfigWithChildren<TChildren> extends RouteConfig<any, any, any, any, any, any, any, any, any, any, any, any, any, any, TChildren> {
|
|
485
|
+
interface AnyRouteConfigWithChildren<TChildren> extends RouteConfig<any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, TChildren> {
|
|
483
486
|
}
|
|
484
487
|
declare type TrimPath<T extends string> = '' extends T ? '' : TrimPathRight<TrimPathLeft<T>>;
|
|
485
488
|
declare type TrimPathLeft<T extends string> = T extends `${RootRouteId}/${infer U}` ? TrimPathLeft<U> : T extends `/${infer U}` ? TrimPathLeft<U> : T;
|
|
@@ -1524,7 +1524,10 @@
|
|
|
1524
1524
|
var _ref, _ref2, _opts$maxAge;
|
|
1525
1525
|
|
|
1526
1526
|
if (routeMatch.options.loader) {
|
|
1527
|
+
var _routeMatch$parentMat3;
|
|
1528
|
+
|
|
1527
1529
|
const data = await routeMatch.options.loader({
|
|
1530
|
+
parentLoaderPromise: (_routeMatch$parentMat3 = routeMatch.parentMatch) == null ? void 0 : _routeMatch$parentMat3.__.dataPromise,
|
|
1528
1531
|
params: routeMatch.params,
|
|
1529
1532
|
search: routeMatch.routeSearch,
|
|
1530
1533
|
signal: routeMatch.__.abortController.signal
|
|
@@ -1541,6 +1544,7 @@
|
|
|
1541
1544
|
routeMatch.status = 'success';
|
|
1542
1545
|
routeMatch.updatedAt = Date.now();
|
|
1543
1546
|
routeMatch.invalidAt = routeMatch.updatedAt + ((_ref = (_ref2 = (_opts$maxAge = opts == null ? void 0 : opts.maxAge) != null ? _opts$maxAge : routeMatch.options.loaderMaxAge) != null ? _ref2 : router.options.defaultLoaderMaxAge) != null ? _ref : 0);
|
|
1547
|
+
return routeMatch.routeLoaderData;
|
|
1544
1548
|
} catch (err) {
|
|
1545
1549
|
if (id !== routeMatch.__.latestId) {
|
|
1546
1550
|
return routeMatch.__.loadPromise;
|
|
@@ -1553,11 +1557,12 @@
|
|
|
1553
1557
|
routeMatch.error = err;
|
|
1554
1558
|
routeMatch.status = 'error';
|
|
1555
1559
|
routeMatch.updatedAt = Date.now();
|
|
1560
|
+
throw err;
|
|
1556
1561
|
}
|
|
1557
1562
|
});
|
|
1558
1563
|
|
|
1559
1564
|
try {
|
|
1560
|
-
await Promise.all([routeMatch.__.componentsPromise, routeMatch.__.dataPromise]);
|
|
1565
|
+
await Promise.all([routeMatch.__.componentsPromise, routeMatch.__.dataPromise.catch(() => {})]);
|
|
1561
1566
|
|
|
1562
1567
|
if (id !== routeMatch.__.latestId) {
|
|
1563
1568
|
return routeMatch.__.loadPromise;
|
|
@@ -2039,6 +2044,7 @@
|
|
|
2039
2044
|
const interpolatedPath = interpolatePath(foundRoute.routePath, params);
|
|
2040
2045
|
const matchId = interpolatePath(foundRoute.routeId, params, true);
|
|
2041
2046
|
const match = existingMatches.find(d => d.matchId === matchId) || ((_router$matchCache$ma = router.matchCache[matchId]) == null ? void 0 : _router$matchCache$ma.match) || createRouteMatch(router, foundRoute, {
|
|
2047
|
+
parentMatch,
|
|
2042
2048
|
matchId,
|
|
2043
2049
|
params,
|
|
2044
2050
|
pathname: joinPaths([pathname, interpolatedPath])
|