@tanstack/router-core 1.134.20 → 1.135.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.
@@ -213,7 +213,7 @@ const isBeforeLoadSsr = (
213
213
 
214
214
  // in SPA mode, only SSR the root route
215
215
  if (inner.router.isShell()) {
216
- existingMatch.ssr = matchId === rootRouteId
216
+ existingMatch.ssr = route.id === rootRouteId
217
217
  return
218
218
  }
219
219
 
package/src/path.ts CHANGED
@@ -377,7 +377,6 @@ function baseParsePathname(pathname: string): ReadonlyArray<Segment> {
377
377
  interface InterpolatePathOptions {
378
378
  path?: string
379
379
  params: Record<string, unknown>
380
- leaveWildcards?: boolean
381
380
  leaveParams?: boolean
382
381
  // Map of encoded chars to decoded chars (e.g. '%40' -> '@') that should remain decoded in path params
383
382
  decodeCharMap?: Map<string, string>
@@ -403,7 +402,6 @@ type InterPolatePathResult = {
403
402
  export function interpolatePath({
404
403
  path,
405
404
  params,
406
- leaveWildcards,
407
405
  leaveParams,
408
406
  decodeCharMap,
409
407
  parseCache,
@@ -446,9 +444,6 @@ export function interpolatePath({
446
444
  if (!params._splat) {
447
445
  isMissingParams = true
448
446
  // For missing splat parameters, just return the prefix and suffix without the wildcard
449
- if (leaveWildcards) {
450
- return `${segmentPrefix}${segment.value}${segmentSuffix}`
451
- }
452
447
  // If there is a prefix or suffix, return them joined, otherwise omit the segment
453
448
  if (segmentPrefix || segmentSuffix) {
454
449
  return `${segmentPrefix}${segmentSuffix}`
@@ -457,9 +452,6 @@ export function interpolatePath({
457
452
  }
458
453
 
459
454
  const value = encodeParam('_splat')
460
- if (leaveWildcards) {
461
- return `${segmentPrefix}${segment.value}${value ?? ''}${segmentSuffix}`
462
- }
463
455
  return `${segmentPrefix}${value}${segmentSuffix}`
464
456
  }
465
457
 
@@ -487,9 +479,6 @@ export function interpolatePath({
487
479
 
488
480
  // Check if optional parameter is missing or undefined
489
481
  if (!(key in params) || params[key] == null) {
490
- if (leaveWildcards) {
491
- return `${segmentPrefix}${key}${segmentSuffix}`
492
- }
493
482
  // For optional params with prefix/suffix, keep the prefix/suffix but omit the param
494
483
  if (segmentPrefix || segmentSuffix) {
495
484
  return `${segmentPrefix}${segmentSuffix}`
@@ -504,9 +493,6 @@ export function interpolatePath({
504
493
  const value = encodeParam(segment.value)
505
494
  return `${segmentPrefix}${segment.value}${value ?? ''}${segmentSuffix}`
506
495
  }
507
- if (leaveWildcards) {
508
- return `${segmentPrefix}${key}${encodeParam(key) ?? ''}${segmentSuffix}`
509
- }
510
496
  return `${segmentPrefix}${encodeParam(key) ?? ''}${segmentSuffix}`
511
497
  }
512
498
 
package/src/router.ts CHANGED
@@ -1364,13 +1364,12 @@ export class RouterCore<
1364
1364
  // Existing matches are matches that are already loaded along with
1365
1365
  // pending matches that are still loading
1366
1366
  const matchId =
1367
- interpolatePath({
1368
- path: route.id,
1369
- params: routeParams,
1370
- leaveWildcards: true,
1371
- decodeCharMap: this.pathParamsDecodeCharMap,
1372
- parseCache: this.parsePathnameCache,
1373
- }).interpolatedPath + loaderDepsHash
1367
+ // route.id for disambiguation
1368
+ route.id +
1369
+ // interpolatedPath for param changes
1370
+ interpolatedPath +
1371
+ // explicit deps
1372
+ loaderDepsHash
1374
1373
 
1375
1374
  const existingMatch = this.getMatch(matchId)
1376
1375
 
@@ -1690,7 +1689,6 @@ export class RouterCore<
1690
1689
  // This preserves the original parameter syntax including optional parameters
1691
1690
  path: nextTo,
1692
1691
  params: nextParams,
1693
- leaveWildcards: false,
1694
1692
  leaveParams: opts.leaveParams,
1695
1693
  decodeCharMap: this.pathParamsDecodeCharMap,
1696
1694
  parseCache: this.parsePathnameCache,