@tanstack/router-core 1.130.6 → 1.130.8

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.130.6",
3
+ "version": "1.130.8",
4
4
  "description": "Modern and scalable routing for React applications",
5
5
  "author": "Tanner Linsley",
6
6
  "license": "MIT",
package/src/router.ts CHANGED
@@ -1848,7 +1848,7 @@ export class RouterCore<
1848
1848
  pendingMatches,
1849
1849
  // If a cached moved to pendingMatches, remove it from cachedMatches
1850
1850
  cachedMatches: s.cachedMatches.filter(
1851
- (d) => !pendingMatches.find((e) => e.id === d.id),
1851
+ (d) => !pendingMatches.some((e) => e.id === d.id),
1852
1852
  ),
1853
1853
  }))
1854
1854
  }
@@ -1906,14 +1906,14 @@ export class RouterCore<
1906
1906
  const newMatches = s.pendingMatches || s.matches
1907
1907
 
1908
1908
  exitingMatches = previousMatches.filter(
1909
- (match) => !newMatches.find((d) => d.id === match.id),
1909
+ (match) => !newMatches.some((d) => d.id === match.id),
1910
1910
  )
1911
1911
  enteringMatches = newMatches.filter(
1912
1912
  (match) =>
1913
- !previousMatches.find((d) => d.id === match.id),
1913
+ !previousMatches.some((d) => d.id === match.id),
1914
1914
  )
1915
1915
  stayingMatches = previousMatches.filter((match) =>
1916
- newMatches.find((d) => d.id === match.id),
1916
+ newMatches.some((d) => d.id === match.id),
1917
1917
  )
1918
1918
 
1919
1919
  return {
@@ -2107,12 +2107,12 @@ export class RouterCore<
2107
2107
  }
2108
2108
 
2109
2109
  const resolvePreload = (matchId: string) => {
2110
- return !!(allPreload && !this.state.matches.find((d) => d.id === matchId))
2110
+ return !!(allPreload && !this.state.matches.some((d) => d.id === matchId))
2111
2111
  }
2112
2112
 
2113
2113
  // make sure the pending component is immediately rendered when hydrating a match that is not SSRed
2114
2114
  // the pending component was already rendered on the server and we want to keep it shown on the client until minPendingMs is reached
2115
- if (!this.isServer && this.state.matches.find((d) => d._forcePending)) {
2115
+ if (!this.isServer && this.state.matches.some((d) => d._forcePending)) {
2116
2116
  triggerOnReady()
2117
2117
  }
2118
2118
 
@@ -2590,7 +2590,7 @@ export class RouterCore<
2590
2590
  loaderPromise: createControlledPromise<void>(),
2591
2591
  preload:
2592
2592
  !!preload &&
2593
- !this.state.matches.find((d) => d.id === matchId),
2593
+ !this.state.matches.some((d) => d.id === matchId),
2594
2594
  }))
2595
2595
 
2596
2596
  const runLoader = async () => {
@@ -2862,8 +2862,8 @@ export class RouterCore<
2862
2862
  const isError = d.status === 'error'
2863
2863
  if (isError) return true
2864
2864
 
2865
- const isStale = Date.now() - d.updatedAt >= gcTime
2866
- return isStale
2865
+ const gcEligible = Date.now() - d.updatedAt >= gcTime
2866
+ return gcEligible
2867
2867
  }
2868
2868
  this.clearCache({ filter })
2869
2869
  }