@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.
@@ -1570,7 +1570,10 @@ function createRouteMatch(router, route, opts) {
1570
1570
  var _ref, _ref2, _opts$maxAge;
1571
1571
 
1572
1572
  if (routeMatch.options.loader) {
1573
+ var _routeMatch$parentMat3;
1574
+
1573
1575
  const data = await routeMatch.options.loader({
1576
+ parentLoaderPromise: (_routeMatch$parentMat3 = routeMatch.parentMatch) == null ? void 0 : _routeMatch$parentMat3.__.dataPromise,
1574
1577
  params: routeMatch.params,
1575
1578
  search: routeMatch.routeSearch,
1576
1579
  signal: routeMatch.__.abortController.signal
@@ -1587,6 +1590,7 @@ function createRouteMatch(router, route, opts) {
1587
1590
  routeMatch.status = 'success';
1588
1591
  routeMatch.updatedAt = Date.now();
1589
1592
  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);
1593
+ return routeMatch.routeLoaderData;
1590
1594
  } catch (err) {
1591
1595
  if (id !== routeMatch.__.latestId) {
1592
1596
  return routeMatch.__.loadPromise;
@@ -1599,11 +1603,12 @@ function createRouteMatch(router, route, opts) {
1599
1603
  routeMatch.error = err;
1600
1604
  routeMatch.status = 'error';
1601
1605
  routeMatch.updatedAt = Date.now();
1606
+ throw err;
1602
1607
  }
1603
1608
  });
1604
1609
 
1605
1610
  try {
1606
- await Promise.all([routeMatch.__.componentsPromise, routeMatch.__.dataPromise]);
1611
+ await Promise.all([routeMatch.__.componentsPromise, routeMatch.__.dataPromise.catch(() => {})]);
1607
1612
 
1608
1613
  if (id !== routeMatch.__.latestId) {
1609
1614
  return routeMatch.__.loadPromise;
@@ -2085,6 +2090,7 @@ function createRouter(userOptions) {
2085
2090
  const interpolatedPath = interpolatePath(foundRoute.routePath, params);
2086
2091
  const matchId = interpolatePath(foundRoute.routeId, params, true);
2087
2092
  const match = existingMatches.find(d => d.matchId === matchId) || ((_router$matchCache$ma = router.matchCache[matchId]) == null ? void 0 : _router$matchCache$ma.match) || createRouteMatch(router, foundRoute, {
2093
+ parentMatch,
2088
2094
  matchId,
2089
2095
  params,
2090
2096
  pathname: joinPaths([pathname, interpolatedPath])
@@ -2445,9 +2451,9 @@ function createRouter(userOptions) {
2445
2451
  pathname: next.pathname,
2446
2452
  hash: next.hash,
2447
2453
  search: next.searchStr
2448
- }, {
2454
+ }, _extends({
2449
2455
  id
2450
- });
2456
+ }, next.state));
2451
2457
  } else {
2452
2458
  history.push({
2453
2459
  pathname: next.pathname,