@tanstack/react-router 1.33.6 → 1.33.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/src/router.ts CHANGED
@@ -27,6 +27,7 @@ import {
27
27
  } from './path'
28
28
  import { isRedirect, isResolvedRedirect } from './redirects'
29
29
  import { isNotFound } from './not-found'
30
+ import type { Manifest } from './manifest'
30
31
  import type * as React from 'react'
31
32
  import type {
32
33
  HistoryLocation,
@@ -393,6 +394,7 @@ export type DehydratedRouteMatch = Pick<
393
394
 
394
395
  export interface DehydratedRouter {
395
396
  state: DehydratedRouterState
397
+ manifest?: Manifest
396
398
  }
397
399
 
398
400
  export type RouterConstructorOptions<
@@ -484,6 +486,7 @@ export class Router<
484
486
  injectedHtml: Array<InjectedHtmlEntry> = []
485
487
  dehydratedData?: TDehydrated
486
488
  viewTransitionPromise?: ControlledPromise<true>
489
+ manifest?: Manifest
487
490
 
488
491
  // Must build in constructor
489
492
  __store!: Store<RouterState<TRouteTree>>
@@ -1717,13 +1720,13 @@ export class Router<
1717
1720
  handleRedirectAndNotFound(match, err)
1718
1721
  }
1719
1722
 
1720
- matches[index] = match = {
1723
+ matches[index] = match = updateMatch(match.id, () => ({
1721
1724
  ...match,
1722
1725
  error: err,
1723
1726
  status: 'error',
1724
1727
  updatedAt: Date.now(),
1725
1728
  abortController: new AbortController(),
1726
- }
1729
+ }))
1727
1730
  }
1728
1731
 
1729
1732
  if (match.paramsError) {
@@ -1739,8 +1742,8 @@ export class Router<
1739
1742
  parentMatch?.context ?? this.options.context ?? {}
1740
1743
 
1741
1744
  // Make sure the match has parent context set before going further
1742
- matches[index] = match = updateMatch(match.id, (prev) => ({
1743
- ...prev,
1745
+ matches[index] = match = updateMatch(match.id, () => ({
1746
+ ...match,
1744
1747
  routeContext: replaceEqualDeep(
1745
1748
  match.routeContext,
1746
1749
  parentContext,
@@ -2314,6 +2317,7 @@ export class Router<
2314
2317
  : undefined,
2315
2318
  })),
2316
2319
  },
2320
+ manifest: this.manifest,
2317
2321
  }
2318
2322
  }
2319
2323
 
@@ -2376,6 +2380,8 @@ export class Router<
2376
2380
  matches: matches as any,
2377
2381
  }
2378
2382
  })
2383
+
2384
+ this.manifest = ctx.router.manifest
2379
2385
  }
2380
2386
 
2381
2387
  handleNotFound = (matches: Array<AnyRouteMatch>, err: NotFoundError) => {