@tanstack/react-router 1.125.6 → 1.127.0

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.
@@ -2174,7 +2174,7 @@ Tools that are able can integrate with TanStack Router's convenient Dehydration/
2174
2174
 
2175
2175
  **For critical data needed for the first render/paint**, TanStack Router supports **\`dehydrate\` and \`hydrate\`** options when configuring the \`Router\`. These callbacks are functions that are automatically called on the server and client when the router dehydrates and hydrates normally and allow you to augment the dehydrated data with your own data.
2176
2176
 
2177
- The \`dehydrate\` function can return any serializable JSON data which will get merged and injected into the dehydrated payload that is sent to the client. This payload is delivered via the \`DehydrateRouter\` component which, when rendered, provides the data back to you in the \`hydrate\` function on the client.
2177
+ The \`dehydrate\` function can return any serializable JSON data which will get merged and injected into the dehydrated payload that is sent to the client.
2178
2178
 
2179
2179
  For example, let's dehydrate and hydrate a TanStack Query \`QueryClient\` so that our data we fetched on the server will be available for hydration on the client.
2180
2180
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/react-router",
3
- "version": "1.125.6",
3
+ "version": "1.127.0",
4
4
  "description": "Modern and scalable routing for React applications",
5
5
  "author": "Tanner Linsley",
6
6
  "license": "MIT",
@@ -81,7 +81,7 @@
81
81
  "tiny-warning": "^1.0.3",
82
82
  "isbot": "^5.1.22",
83
83
  "@tanstack/history": "1.121.34",
84
- "@tanstack/router-core": "1.125.4"
84
+ "@tanstack/router-core": "1.127.0"
85
85
  },
86
86
  "devDependencies": {
87
87
  "@testing-library/jest-dom": "^6.6.3",
package/src/Matches.tsx CHANGED
@@ -48,7 +48,7 @@ export function Matches() {
48
48
 
49
49
  // Do not render a root Suspense during SSR or hydrating from SSR
50
50
  const ResolvedSuspense =
51
- router.isServer || (typeof document !== 'undefined' && router.clientSsr)
51
+ router.isServer || (typeof document !== 'undefined' && router.ssr)
52
52
  ? SafeFragment
53
53
  : React.Suspense
54
54
 
@@ -14,7 +14,7 @@ export function ScriptOnce({
14
14
 
15
15
  return (
16
16
  <script
17
- className="tsr-once"
17
+ className="$tsr"
18
18
  dangerouslySetInnerHTML={{
19
19
  __html: [
20
20
  children,
@@ -22,7 +22,7 @@ export function ScriptOnce({
22
22
  ? `console.info(\`Injected From Server:
23
23
  ${jsesc(children.toString(), { quotes: 'backtick' })}\`)`
24
24
  : '',
25
- 'if (typeof __TSR_SSR__ !== "undefined") __TSR_SSR__.cleanScripts()',
25
+ 'if (typeof $_TSR !== "undefined") $_TSR.c()',
26
26
  ]
27
27
  .filter(Boolean)
28
28
  .join('\n'),
@@ -69,7 +69,8 @@ export function Transitioner() {
69
69
  // Try to load the initial location
70
70
  useLayoutEffect(() => {
71
71
  if (
72
- (typeof window !== 'undefined' && router.clientSsr) ||
72
+ // if we are hydrating from SSR, loading is triggered in ssr-client
73
+ (typeof window !== 'undefined' && router.ssr) ||
73
74
  (mountLoadForRouter.current.router === router &&
74
75
  mountLoadForRouter.current.mounted)
75
76
  ) {
package/src/index.tsx CHANGED
@@ -39,13 +39,6 @@ export {
39
39
 
40
40
  export type {
41
41
  AnyRoute,
42
- TsrSerializer,
43
- StartSerializer,
44
- Serializable,
45
- SerializerParse,
46
- SerializerParseBy,
47
- SerializerStringify,
48
- SerializerStringifyBy,
49
42
  DeferredPromiseState,
50
43
  DeferredPromise,
51
44
  ParsedLocation,
@@ -93,10 +86,6 @@ export type {
93
86
  SearchSerializer,
94
87
  SearchParser,
95
88
  TrailingSlashOption,
96
- ExtractedEntry,
97
- ExtractedStream,
98
- ExtractedPromise,
99
- StreamState,
100
89
  Manifest,
101
90
  RouterManagedTag,
102
91
  ControlledPromise,
@@ -125,12 +114,9 @@ export type {
125
114
  FileRoutesByPath,
126
115
  RouteById,
127
116
  RootRouteOptions,
128
- SerializerExtensions,
129
117
  CreateFileRoute,
130
118
  } from '@tanstack/router-core'
131
119
 
132
- export type * from './serializer'
133
-
134
120
  export {
135
121
  createHistory,
136
122
  createBrowserHistory,
@@ -228,7 +214,6 @@ export type {
228
214
  ControllablePromise,
229
215
  InjectedHtmlEntry,
230
216
  RouterOptions,
231
- RouterErrorSerializer,
232
217
  RouterState,
233
218
  ListenerFn,
234
219
  BuildNextOptions,
@@ -1,6 +0,0 @@
1
- import type * as React from 'react';
2
- declare module '@tanstack/router-core' {
3
- interface SerializerExtensions {
4
- ReadableStream: React.JSX.Element;
5
- }
6
- }
@@ -1,6 +0,0 @@
1
- import type * as React from 'react';
2
- declare module '@tanstack/router-core' {
3
- interface SerializerExtensions {
4
- ReadableStream: React.JSX.Element;
5
- }
6
- }
package/src/serializer.ts DELETED
@@ -1,7 +0,0 @@
1
- import type * as React from 'react'
2
-
3
- declare module '@tanstack/router-core' {
4
- export interface SerializerExtensions {
5
- ReadableStream: React.JSX.Element
6
- }
7
- }