@tanstack/react-router 1.129.8 → 1.130.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.
- package/dist/cjs/Matches.cjs +4 -2
- package/dist/cjs/Matches.cjs.map +1 -1
- package/dist/esm/Matches.js +4 -2
- package/dist/esm/Matches.js.map +1 -1
- package/dist/llms/rules/api.d.ts +1 -1
- package/dist/llms/rules/api.js +77 -2
- package/dist/llms/rules/guide.d.ts +1 -1
- package/dist/llms/rules/guide.js +43 -49
- package/package.json +3 -3
- package/src/Matches.tsx +20 -13
package/dist/llms/rules/api.js
CHANGED
|
@@ -792,8 +792,8 @@ interface RouteMatch {
|
|
|
792
792
|
routeId: string
|
|
793
793
|
pathname: string
|
|
794
794
|
params: Route['allParams']
|
|
795
|
-
status: 'pending' | 'success' | 'error'
|
|
796
|
-
isFetching:
|
|
795
|
+
status: 'pending' | 'success' | 'error' | 'redirected' | 'notFound'
|
|
796
|
+
isFetching: false | 'beforeLoad' | 'loader'
|
|
797
797
|
showPending: boolean
|
|
798
798
|
error: unknown
|
|
799
799
|
paramsError: unknown
|
|
@@ -806,6 +806,7 @@ interface RouteMatch {
|
|
|
806
806
|
fetchedAt: number
|
|
807
807
|
abortController: AbortController
|
|
808
808
|
cause: 'enter' | 'stay'
|
|
809
|
+
ssr?: boolean | 'data-only'
|
|
809
810
|
}
|
|
810
811
|
\`\`\`
|
|
811
812
|
|
|
@@ -1109,6 +1110,72 @@ If you want to configure to remount a route component upon \`params\` change, us
|
|
|
1109
1110
|
remountDeps: ({ params }) => params
|
|
1110
1111
|
\`\`\`
|
|
1111
1112
|
|
|
1113
|
+
### \`headers\` method
|
|
1114
|
+
|
|
1115
|
+
- Type:
|
|
1116
|
+
|
|
1117
|
+
\`\`\`tsx
|
|
1118
|
+
type headers = (opts: {
|
|
1119
|
+
matches: Array<RouteMatch>
|
|
1120
|
+
match: RouteMatch
|
|
1121
|
+
params: TAllParams
|
|
1122
|
+
loaderData?: TLoaderData
|
|
1123
|
+
}) => Promise<Record<string, string>> | Record<string, string>
|
|
1124
|
+
\`\`\`
|
|
1125
|
+
|
|
1126
|
+
- Optional
|
|
1127
|
+
- Allows you to specify custom HTTP headers to be sent when this route is rendered during SSR. The function receives the current match context and should return a plain object of header name/value pairs.
|
|
1128
|
+
|
|
1129
|
+
### \`head\` method
|
|
1130
|
+
|
|
1131
|
+
- Type:
|
|
1132
|
+
|
|
1133
|
+
\`\`\`tsx
|
|
1134
|
+
type head = (ctx: {
|
|
1135
|
+
matches: Array<RouteMatch>
|
|
1136
|
+
match: RouteMatch
|
|
1137
|
+
params: TAllParams
|
|
1138
|
+
loaderData?: TLoaderData
|
|
1139
|
+
}) =>
|
|
1140
|
+
| Promise<{
|
|
1141
|
+
links?: RouteMatch['links']
|
|
1142
|
+
scripts?: RouteMatch['headScripts']
|
|
1143
|
+
meta?: RouteMatch['meta']
|
|
1144
|
+
styles?: RouteMatch['styles']
|
|
1145
|
+
}>
|
|
1146
|
+
| {
|
|
1147
|
+
links?: RouteMatch['links']
|
|
1148
|
+
scripts?: RouteMatch['headScripts']
|
|
1149
|
+
meta?: RouteMatch['meta']
|
|
1150
|
+
styles?: RouteMatch['styles']
|
|
1151
|
+
}
|
|
1152
|
+
\`\`\`
|
|
1153
|
+
|
|
1154
|
+
- Optional
|
|
1155
|
+
- Returns additional elements to inject into the document \`<head>\` for this route. Use it to add route-level SEO metadata, preload links, inline styles, or custom scripts.
|
|
1156
|
+
|
|
1157
|
+
### \`scripts\` method
|
|
1158
|
+
|
|
1159
|
+
- Type:
|
|
1160
|
+
|
|
1161
|
+
\`\`\`tsx
|
|
1162
|
+
type scripts = (ctx: {
|
|
1163
|
+
matches: Array<RouteMatch>
|
|
1164
|
+
match: RouteMatch
|
|
1165
|
+
params: TAllParams
|
|
1166
|
+
loaderData?: TLoaderData
|
|
1167
|
+
}) => Promise<RouteMatch['scripts']> | RouteMatch['scripts']
|
|
1168
|
+
\`\`\`
|
|
1169
|
+
|
|
1170
|
+
- Optional
|
|
1171
|
+
- A shorthand helper to return only \`<script>\` elements. Equivalent to returning the \`scripts\` field from the \`head\` method.
|
|
1172
|
+
|
|
1173
|
+
### \`codeSplitGroupings\` property
|
|
1174
|
+
|
|
1175
|
+
- Type: \`Array<Array<'loader' | 'component' | 'pendingComponent' | 'notFoundComponent' | 'errorComponent'>>\`
|
|
1176
|
+
- Optional
|
|
1177
|
+
- Fine-grained control over how the router groups lazy-loaded pieces of a route into chunks. Each inner array represents a group of assets that will be placed into the same bundle during code-splitting.
|
|
1178
|
+
|
|
1112
1179
|
# Route type
|
|
1113
1180
|
|
|
1114
1181
|
The \`Route\` type is used to describe a route instance.
|
|
@@ -1407,6 +1474,14 @@ The \`RouterOptions\` type accepts an object with the following properties and m
|
|
|
1407
1474
|
- Optional
|
|
1408
1475
|
- The default \`onCatch\` handler for errors caught by the Router ErrorBoundary
|
|
1409
1476
|
|
|
1477
|
+
### \`disableGlobalCatchBoundary\` property
|
|
1478
|
+
|
|
1479
|
+
- Type: \`boolean\`
|
|
1480
|
+
- Optional
|
|
1481
|
+
- Defaults to \`false\`
|
|
1482
|
+
- When \`true\`, disables the global catch boundary that normally wraps all route matches. This allows unhandled errors to bubble up to top-level error handlers in the browser.
|
|
1483
|
+
- Useful for testing tools, error reporting services, and debugging scenarios.
|
|
1484
|
+
|
|
1410
1485
|
### \`defaultViewTransition\` property
|
|
1411
1486
|
|
|
1412
1487
|
- Type: \`boolean | ViewTransitionOptions\`
|