@tanstack/react-router 1.136.3 → 1.136.5

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.
@@ -180,7 +180,7 @@ The \`MatchRouteOptions\` type is used to describe the options that can be used
180
180
  \`\`\`tsx
181
181
  interface MatchRouteOptions {
182
182
  pending?: boolean
183
- caseSensitive?: boolean
183
+ caseSensitive?: boolean /* @deprecated */
184
184
  includeSearch?: boolean
185
185
  fuzzy?: boolean
186
186
  }
@@ -196,11 +196,12 @@ The \`MatchRouteOptions\` type has the following properties:
196
196
  - Optional
197
197
  - If \`true\`, will match against pending location instead of the current location
198
198
 
199
- ### \`caseSensitive\` property
199
+ ### ~~\`caseSensitive\`~~ property (deprecated)
200
200
 
201
201
  - Type: \`boolean\`
202
202
  - Optional
203
203
  - If \`true\`, will match against the current location with case sensitivity
204
+ - Declare case sensitivity in the route definition instead, or globally for all routes using the \`caseSensitive\` option on the router
204
205
 
205
206
  ### \`includeSearch\` property
206
207
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/react-router",
3
- "version": "1.136.3",
3
+ "version": "1.136.5",
4
4
  "description": "Modern and scalable routing for React applications",
5
5
  "author": "Tanner Linsley",
6
6
  "license": "MIT",
@@ -80,7 +80,7 @@
80
80
  "tiny-invariant": "^1.3.3",
81
81
  "tiny-warning": "^1.0.3",
82
82
  "@tanstack/history": "1.133.28",
83
- "@tanstack/router-core": "1.136.3"
83
+ "@tanstack/router-core": "1.136.5"
84
84
  },
85
85
  "devDependencies": {
86
86
  "@testing-library/jest-dom": "^6.6.3",
@@ -155,7 +155,7 @@ export const useTags = () => {
155
155
  structuralSharing: true as any,
156
156
  })
157
157
 
158
- const headScripts = useRouterState({
158
+ const headScripts: Array<RouterManagedTag> = useRouterState({
159
159
  select: (state) =>
160
160
  (
161
161
  state.matches
@@ -173,12 +173,29 @@ export const useTags = () => {
173
173
  structuralSharing: true as any,
174
174
  })
175
175
 
176
+ let serverHeadScript: RouterManagedTag | undefined = undefined
177
+
178
+ if (router.serverSsr) {
179
+ const bufferedScripts = router.serverSsr.takeBufferedScripts()
180
+ if (bufferedScripts) {
181
+ serverHeadScript = {
182
+ tag: 'script',
183
+ attrs: {
184
+ nonce,
185
+ className: '$tsr',
186
+ },
187
+ children: bufferedScripts,
188
+ }
189
+ }
190
+ }
191
+
176
192
  return uniqBy(
177
193
  [
178
194
  ...meta,
179
195
  ...preloadMeta,
180
196
  ...links,
181
197
  ...styles,
198
+ ...(serverHeadScript ? [serverHeadScript] : []),
182
199
  ...headScripts,
183
200
  ] as Array<RouterManagedTag>,
184
201
  (d) => {
@@ -2,7 +2,6 @@ import { useRouter } from './useRouter'
2
2
 
3
3
  /**
4
4
  * Server-only helper to emit a script tag exactly once during SSR.
5
- * Appends an internal marker to signal hydration completion.
6
5
  */
7
6
  export function ScriptOnce({ children }: { children: string }) {
8
7
  const router = useRouter()
package/src/index.tsx CHANGED
@@ -8,10 +8,7 @@ export {
8
8
  trimPathRight,
9
9
  trimPath,
10
10
  resolvePath,
11
- parsePathname,
12
11
  interpolatePath,
13
- matchPathname,
14
- matchByPath,
15
12
  rootRouteId,
16
13
  defaultSerializeError,
17
14
  defaultParseSearch,
@@ -37,7 +34,6 @@ export type {
37
34
  RemoveTrailingSlashes,
38
35
  RemoveLeadingSlashes,
39
36
  ActiveOptions,
40
- Segment,
41
37
  ResolveRelativePath,
42
38
  RootRouteId,
43
39
  AnyPathParams,
@@ -177,10 +177,7 @@ export function useBlocker(
177
177
  location: HistoryLocation,
178
178
  ): AnyShouldBlockFnLocation {
179
179
  const parsedLocation = router.parseLocation(location)
180
- const matchedRoutes = router.getMatchedRoutes(
181
- parsedLocation.pathname,
182
- undefined,
183
- )
180
+ const matchedRoutes = router.getMatchedRoutes(parsedLocation.pathname)
184
181
  if (matchedRoutes.foundRoute === undefined) {
185
182
  throw new Error(`No route found for location ${location.href}`)
186
183
  }