@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/esm/index.js
CHANGED
|
@@ -1524,7 +1524,10 @@ function createRouteMatch(router, route, opts) {
|
|
|
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 @@ function createRouteMatch(router, route, opts) {
|
|
|
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 @@ function createRouteMatch(router, route, opts) {
|
|
|
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 @@ function createRouter(userOptions) {
|
|
|
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])
|