@tanstack/router-core 0.0.1-beta.14 → 0.0.1-beta.16

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.
@@ -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])
@@ -2399,9 +2405,9 @@ function createRouter(userOptions) {
2399
2405
  pathname: next.pathname,
2400
2406
  hash: next.hash,
2401
2407
  search: next.searchStr
2402
- }, {
2408
+ }, _extends({
2403
2409
  id
2404
- });
2410
+ }, next.state));
2405
2411
  } else {
2406
2412
  history.push({
2407
2413
  pathname: next.pathname,