@tanstack/router-core 1.117.0 → 1.117.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/router-core",
3
- "version": "1.117.0",
3
+ "version": "1.117.1",
4
4
  "description": "Modern and scalable routing for React applications",
5
5
  "author": "Tanner Linsley",
6
6
  "license": "MIT",
package/src/router.ts CHANGED
@@ -2274,10 +2274,6 @@ export class RouterCore<
2274
2274
  return !!(allPreload && !this.state.matches.find((d) => d.id === matchId))
2275
2275
  }
2276
2276
 
2277
- if (!this.isServer && !this.state.matches.length) {
2278
- triggerOnReady()
2279
- }
2280
-
2281
2277
  const handleRedirectAndNotFound = (match: AnyRouteMatch, err: any) => {
2282
2278
  if (isResolvedRedirect(err)) {
2283
2279
  if (!err.reloadDocument) {
@@ -2383,7 +2379,9 @@ export class RouterCore<
2383
2379
  onReady &&
2384
2380
  !this.isServer &&
2385
2381
  !resolvePreload(matchId) &&
2386
- (route.options.loader || route.options.beforeLoad) &&
2382
+ (route.options.loader ||
2383
+ route.options.beforeLoad ||
2384
+ routeNeedsPreload(route)) &&
2387
2385
  typeof pendingMs === 'number' &&
2388
2386
  pendingMs !== Infinity &&
2389
2387
  (route.options.pendingComponent ??
@@ -2668,6 +2666,10 @@ export class RouterCore<
2668
2666
  loaderData,
2669
2667
  })
2670
2668
 
2669
+ // Last but not least, wait for the the components
2670
+ // to be preloaded before we resolve the match
2671
+ await route._componentsPromise
2672
+
2671
2673
  updateMatch(matchId, (prev) => ({
2672
2674
  ...prev,
2673
2675
  error: undefined,
@@ -2710,10 +2712,6 @@ export class RouterCore<
2710
2712
  router: this,
2711
2713
  match: this.getMatch(matchId)!,
2712
2714
  })
2713
-
2714
- // Last but not least, wait for the the components
2715
- // to be preloaded before we resolve the match
2716
- await route._componentsPromise
2717
2715
  } catch (err) {
2718
2716
  updateMatch(matchId, (prev) => ({
2719
2717
  ...prev,