@tanstack/router-core 1.162.1 → 1.162.2

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.162.1",
3
+ "version": "1.162.2",
4
4
  "description": "Modern and scalable routing for React applications",
5
5
  "author": "Tanner Linsley",
6
6
  "license": "MIT",
package/src/router.ts CHANGED
@@ -1852,32 +1852,23 @@ export class RouterCore<
1852
1852
  functionalUpdate(dest.params as any, fromParams),
1853
1853
  )
1854
1854
 
1855
- // Interpolate the path first to get the actual resolved path, then match against that
1856
- const interpolatedNextTo = interpolatePath({
1857
- path: nextTo,
1858
- params: nextParams,
1859
- decoder: this.pathParamsDecoder,
1860
- server: this.isServer,
1861
- }).interpolatedPath
1862
-
1863
1855
  // Use lightweight getMatchedRoutes instead of matchRoutesInternal
1864
1856
  // This avoids creating full match objects (AbortController, ControlledPromise, etc.)
1865
1857
  // which are expensive and not needed for buildLocation
1866
- const destMatchResult = this.getMatchedRoutes(interpolatedNextTo)
1858
+ const destMatchResult = this.getMatchedRoutes(nextTo)
1867
1859
  let destRoutes = destMatchResult.matchedRoutes
1868
1860
 
1869
1861
  // Compute globalNotFoundRouteId using the same logic as matchRoutesInternal
1870
- const isGlobalNotFound = destMatchResult.foundRoute
1871
- ? destMatchResult.foundRoute.path !== '/' &&
1872
- destMatchResult.routeParams['**']
1873
- : trimPathRight(interpolatedNextTo)
1862
+ const isGlobalNotFound =
1863
+ !destMatchResult.foundRoute ||
1864
+ (destMatchResult.foundRoute.path !== '/' &&
1865
+ destMatchResult.routeParams['**'])
1874
1866
 
1875
1867
  if (isGlobalNotFound && this.options.notFoundRoute) {
1876
1868
  destRoutes = [...destRoutes, this.options.notFoundRoute]
1877
1869
  }
1878
1870
 
1879
1871
  // If there are any params, we need to stringify them
1880
- let changedParams = false
1881
1872
  if (Object.keys(nextParams).length > 0) {
1882
1873
  for (const route of destRoutes) {
1883
1874
  const fn =
@@ -1885,7 +1876,6 @@ export class RouterCore<
1885
1876
  if (fn) {
1886
1877
  try {
1887
1878
  Object.assign(nextParams, fn(nextParams))
1888
- changedParams = true
1889
1879
  } catch {
1890
1880
  // Ignore errors here. When a paired parseParams is defined,
1891
1881
  // extractStrictParams will re-throw during route matching,
@@ -1902,14 +1892,12 @@ export class RouterCore<
1902
1892
  // This preserves the original parameter syntax including optional parameters
1903
1893
  nextTo
1904
1894
  : decodePath(
1905
- !changedParams
1906
- ? interpolatedNextTo
1907
- : interpolatePath({
1908
- path: nextTo,
1909
- params: nextParams,
1910
- decoder: this.pathParamsDecoder,
1911
- server: this.isServer,
1912
- }).interpolatedPath,
1895
+ interpolatePath({
1896
+ path: nextTo,
1897
+ params: nextParams,
1898
+ decoder: this.pathParamsDecoder,
1899
+ server: this.isServer,
1900
+ }).interpolatedPath,
1913
1901
  ).path
1914
1902
 
1915
1903
  // Resolve the next search