@tanstack/react-router 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.
@@ -1538,7 +1538,10 @@ function createRouteMatch(router, route, opts) {
1538
1538
  var _ref, _ref2, _opts$maxAge;
1539
1539
 
1540
1540
  if (routeMatch.options.loader) {
1541
+ var _routeMatch$parentMat3;
1542
+
1541
1543
  const data = await routeMatch.options.loader({
1544
+ parentLoaderPromise: (_routeMatch$parentMat3 = routeMatch.parentMatch) == null ? void 0 : _routeMatch$parentMat3.__.dataPromise,
1542
1545
  params: routeMatch.params,
1543
1546
  search: routeMatch.routeSearch,
1544
1547
  signal: routeMatch.__.abortController.signal
@@ -1555,6 +1558,7 @@ function createRouteMatch(router, route, opts) {
1555
1558
  routeMatch.status = 'success';
1556
1559
  routeMatch.updatedAt = Date.now();
1557
1560
  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);
1561
+ return routeMatch.routeLoaderData;
1558
1562
  } catch (err) {
1559
1563
  if (id !== routeMatch.__.latestId) {
1560
1564
  return routeMatch.__.loadPromise;
@@ -1567,11 +1571,12 @@ function createRouteMatch(router, route, opts) {
1567
1571
  routeMatch.error = err;
1568
1572
  routeMatch.status = 'error';
1569
1573
  routeMatch.updatedAt = Date.now();
1574
+ throw err;
1570
1575
  }
1571
1576
  });
1572
1577
 
1573
1578
  try {
1574
- await Promise.all([routeMatch.__.componentsPromise, routeMatch.__.dataPromise]);
1579
+ await Promise.all([routeMatch.__.componentsPromise, routeMatch.__.dataPromise.catch(() => {})]);
1575
1580
 
1576
1581
  if (id !== routeMatch.__.latestId) {
1577
1582
  return routeMatch.__.loadPromise;
@@ -2053,6 +2058,7 @@ function createRouter(userOptions) {
2053
2058
  const interpolatedPath = interpolatePath(foundRoute.routePath, params);
2054
2059
  const matchId = interpolatePath(foundRoute.routeId, params, true);
2055
2060
  const match = existingMatches.find(d => d.matchId === matchId) || ((_router$matchCache$ma = router.matchCache[matchId]) == null ? void 0 : _router$matchCache$ma.match) || createRouteMatch(router, foundRoute, {
2061
+ parentMatch,
2056
2062
  matchId,
2057
2063
  params,
2058
2064
  pathname: joinPaths([pathname, interpolatedPath])
@@ -2413,9 +2419,9 @@ function createRouter(userOptions) {
2413
2419
  pathname: next.pathname,
2414
2420
  hash: next.hash,
2415
2421
  search: next.searchStr
2416
- }, {
2422
+ }, _extends({
2417
2423
  id
2418
- });
2424
+ }, next.state));
2419
2425
  } else {
2420
2426
  history.push({
2421
2427
  pathname: next.pathname,