react-router 7.9.5 → 7.9.6-pre.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/CHANGELOG.md +31 -10
- package/dist/development/{browser-DM83uryY.d.ts → browser-BbBXFHbO.d.ts} +1 -1
- package/dist/development/{browser-DfMfSvsC.d.mts → browser-C07r42Tt.d.mts} +1 -1
- package/dist/development/{chunk-UIGDSWPH.mjs → chunk-7TW6LJC6.mjs} +71 -20
- package/dist/{production/chunk-CWEARR4H.js → development/chunk-DB25NZIA.js} +7 -7
- package/dist/{production/chunk-ERPFE3MR.js → development/chunk-IR7LYQCC.js} +93 -93
- package/dist/development/{chunk-JG3XND5A.mjs → chunk-P6ZEAD4C.mjs} +2 -2
- package/dist/development/{chunk-VNR6V74N.js → chunk-TUTX3ERH.js} +100 -49
- package/dist/development/dom-export.d.mts +2 -2
- package/dist/development/dom-export.d.ts +2 -2
- package/dist/development/dom-export.js +26 -26
- package/dist/development/dom-export.mjs +3 -3
- package/dist/{production/index-react-server-client-BSxMvS7Z.d.ts → development/index-react-server-client-Da3kmxNd.d.ts} +1 -1
- package/dist/development/{index-react-server-client-B0vnxMMk.d.mts → index-react-server-client-rcoGPJhU.d.mts} +1 -1
- package/dist/development/index-react-server-client.d.mts +2 -2
- package/dist/development/index-react-server-client.d.ts +2 -2
- package/dist/development/index-react-server-client.js +4 -4
- package/dist/development/index-react-server-client.mjs +2 -2
- package/dist/development/index-react-server.js +1 -1
- package/dist/development/index-react-server.mjs +1 -1
- package/dist/development/index.d.mts +8 -8
- package/dist/development/index.d.ts +8 -8
- package/dist/development/index.js +76 -76
- package/dist/development/index.mjs +3 -3
- package/dist/{production/instrumentation-iAqbU5Q4.d.ts → development/instrumentation-Unc20tLk.d.ts} +5 -1
- package/dist/development/lib/types/internal.d.mts +2 -2
- package/dist/development/lib/types/internal.d.ts +2 -2
- package/dist/development/lib/types/internal.js +1 -1
- package/dist/development/lib/types/internal.mjs +1 -1
- package/dist/development/{register-c-dooqKE.d.ts → register-BpU9rFBJ.d.ts} +1 -1
- package/dist/development/{register-_G476ptB.d.mts → register-QkB3HGjm.d.mts} +1 -1
- package/dist/development/{router-DIAPGK5f.d.mts → router-CAvh_Drx.d.mts} +5 -1
- package/dist/production/{browser-DM83uryY.d.ts → browser-BbBXFHbO.d.ts} +1 -1
- package/dist/production/{browser-DfMfSvsC.d.mts → browser-C07r42Tt.d.mts} +1 -1
- package/dist/production/{chunk-TPBVZP6U.mjs → chunk-4MBU4DF6.mjs} +2 -2
- package/dist/production/{chunk-RZ6LZWMW.mjs → chunk-GG2LAVOQ.mjs} +71 -20
- package/dist/{development/chunk-FQEOJFGW.js → production/chunk-MKF3AQDO.js} +7 -7
- package/dist/production/{chunk-EAE7427A.js → chunk-RBZEEJIK.js} +100 -49
- package/dist/{development/chunk-IXESJAGJ.js → production/chunk-ZHTTD7UY.js} +93 -93
- package/dist/production/dom-export.d.mts +2 -2
- package/dist/production/dom-export.d.ts +2 -2
- package/dist/production/dom-export.js +26 -26
- package/dist/production/dom-export.mjs +3 -3
- package/dist/{development/index-react-server-client-BSxMvS7Z.d.ts → production/index-react-server-client-Da3kmxNd.d.ts} +1 -1
- package/dist/production/{index-react-server-client-B0vnxMMk.d.mts → index-react-server-client-rcoGPJhU.d.mts} +1 -1
- package/dist/production/index-react-server-client.d.mts +2 -2
- package/dist/production/index-react-server-client.d.ts +2 -2
- package/dist/production/index-react-server-client.js +4 -4
- package/dist/production/index-react-server-client.mjs +2 -2
- package/dist/production/index-react-server.js +1 -1
- package/dist/production/index-react-server.mjs +1 -1
- package/dist/production/index.d.mts +8 -8
- package/dist/production/index.d.ts +8 -8
- package/dist/production/index.js +76 -76
- package/dist/production/index.mjs +3 -3
- package/dist/{development/instrumentation-iAqbU5Q4.d.ts → production/instrumentation-Unc20tLk.d.ts} +5 -1
- package/dist/production/lib/types/internal.d.mts +2 -2
- package/dist/production/lib/types/internal.d.ts +2 -2
- package/dist/production/lib/types/internal.js +1 -1
- package/dist/production/lib/types/internal.mjs +1 -1
- package/dist/production/{register-c-dooqKE.d.ts → register-BpU9rFBJ.d.ts} +1 -1
- package/dist/production/{register-_G476ptB.d.mts → register-QkB3HGjm.d.mts} +1 -1
- package/dist/production/{router-DIAPGK5f.d.mts → router-CAvh_Drx.d.mts} +5 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# `react-router`
|
|
2
2
|
|
|
3
|
+
## 7.9.6-pre.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [UNSTABLE] Add `location`/`params` as arguments to client-side `unstable_onError` to permit enhanced error reporting. ([#14509](https://github.com/remix-run/react-router/pull/14509))
|
|
8
|
+
|
|
9
|
+
⚠️ This is a breaking change if you've already adopted `unstable_onError`. The second `errorInfo` parameter is now an object with `location` and `params`:
|
|
10
|
+
|
|
11
|
+
```tsx
|
|
12
|
+
// Before
|
|
13
|
+
function errorHandler(error: unknown, errorInfo?: React.errorInfo) {
|
|
14
|
+
/*...*/
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// After
|
|
18
|
+
function errorHandler(
|
|
19
|
+
error: unknown,
|
|
20
|
+
info: {
|
|
21
|
+
location: Location;
|
|
22
|
+
params: Params;
|
|
23
|
+
errorInfo?: React.ErrorInfo;
|
|
24
|
+
},
|
|
25
|
+
) {
|
|
26
|
+
/*...*/
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
- Properly handle ancestor thrown middleware errors before `next()` on fetcher submissions ([#14517](https://github.com/remix-run/react-router/pull/14517))
|
|
31
|
+
- Fix issue with splat routes interfering with multiple calls to patchRoutesOnNavigation ([#14487](https://github.com/remix-run/react-router/pull/14487))
|
|
32
|
+
|
|
3
33
|
## 7.9.5
|
|
4
34
|
|
|
5
35
|
### Patch Changes
|
|
@@ -28,7 +58,6 @@
|
|
|
28
58
|
- Ensure action handlers run for routes with middleware even if no loader is present ([#14443](https://github.com/remix-run/react-router/pull/14443))
|
|
29
59
|
|
|
30
60
|
- Add `unstable_instrumentations` API to allow users to add observablity to their apps by instrumenting route loaders, actions, middlewares, lazy, as well as server-side request handlers and client side navigations/fetches ([#14412](https://github.com/remix-run/react-router/pull/14412))
|
|
31
|
-
|
|
32
61
|
- Framework Mode:
|
|
33
62
|
- `entry.server.tsx`: `export const unstable_instrumentations = [...]`
|
|
34
63
|
- `entry.client.tsx`: `<HydratedRouter unstable_instrumentations={[...]} />`
|
|
@@ -190,7 +219,6 @@
|
|
|
190
219
|
- Stabilize middleware and context APIs. ([#14215](https://github.com/remix-run/react-router/pull/14215))
|
|
191
220
|
|
|
192
221
|
We have removed the `unstable_` prefix from the following APIs and they are now considered stable and ready for production use:
|
|
193
|
-
|
|
194
222
|
- [`RouterContextProvider`](https://reactrouter.com/api/utils/RouterContextProvider)
|
|
195
223
|
- [`createContext`](https://reactrouter.com/api/utils/createContext)
|
|
196
224
|
- `createBrowserRouter` [`getContext`](https://reactrouter.com/api/data-routers/createBrowserRouter#optsgetcontext) option
|
|
@@ -217,7 +245,7 @@
|
|
|
217
245
|
|
|
218
246
|
- \[UNSTABLE] Add `<RouterProvider unstable_onError>`/`<HydratedRouter unstable_onError>` prop for client side error reporting ([#14162](https://github.com/remix-run/react-router/pull/14162))
|
|
219
247
|
|
|
220
|
-
- server action revalidation opt out via $
|
|
248
|
+
- server action revalidation opt out via $SKIP_REVALIDATION field ([#14154](https://github.com/remix-run/react-router/pull/14154))
|
|
221
249
|
|
|
222
250
|
- Properly escape interpolated param values in `generatePath()` ([#13530](https://github.com/remix-run/react-router/pull/13530))
|
|
223
251
|
|
|
@@ -266,7 +294,6 @@
|
|
|
266
294
|
- Remove dependency on `@types/node` in TypeScript declaration files ([#14059](https://github.com/remix-run/react-router/pull/14059))
|
|
267
295
|
|
|
268
296
|
- Fix types for `UIMatch` to reflect that the `loaderData`/`data` properties may be `undefined` ([#12206](https://github.com/remix-run/react-router/pull/12206))
|
|
269
|
-
|
|
270
297
|
- When an `ErrorBoundary` is being rendered, not all active matches will have loader data available, since it may have been their `loader` that threw to trigger the boundary
|
|
271
298
|
- The `UIMatch.data` type was not correctly handing this and would always reflect the presence of data, leading to the unexpected runtime errors when an `ErrorBoundary` was rendered
|
|
272
299
|
- ⚠️ This may cause some type errors to show up in your code for unguarded `match.data` accesses - you should properly guard for `undefined` values in those scenarios.
|
|
@@ -300,7 +327,6 @@
|
|
|
300
327
|
- \[UNSTABLE] When middleware is enabled, make the `context` parameter read-only (via `Readonly<unstable_RouterContextProvider>`) so that TypeScript will not allow you to write arbitrary fields to it in loaders, actions, or middleware. ([#14097](https://github.com/remix-run/react-router/pull/14097))
|
|
301
328
|
|
|
302
329
|
- \[UNSTABLE] Rename and alter the signature/functionality of the `unstable_respond` API in `staticHandler.query`/`staticHandler.queryRoute` ([#14103](https://github.com/remix-run/react-router/pull/14103))
|
|
303
|
-
|
|
304
330
|
- The API has been renamed to `unstable_generateMiddlewareResponse` for clarity
|
|
305
331
|
- The main functional change is that instead of running the loaders/actions before calling `unstable_respond` and handing you the result, we now pass a `query`/`queryRoute` function as a parameter and you execute the loaders/actions inside your callback, giving you full access to pre-processing and error handling
|
|
306
332
|
- The `query` version of the API now has a signature of `(query: (r: Request) => Promise<StaticHandlerContext | Response>) => Promise<Response>`
|
|
@@ -946,7 +972,6 @@
|
|
|
946
972
|
```
|
|
947
973
|
|
|
948
974
|
Similar to server-side requests, a fresh `context` will be created per navigation (or `fetcher` call). If you have initial data you'd like to populate in the context for every request, you can provide an `unstable_getContext` function at the root of your app:
|
|
949
|
-
|
|
950
975
|
- Library mode - `createBrowserRouter(routes, { unstable_getContext })`
|
|
951
976
|
- Framework mode - `<HydratedRouter unstable_getContext>`
|
|
952
977
|
|
|
@@ -1134,7 +1159,6 @@ _No changes_
|
|
|
1134
1159
|
- Remove `future.v7_normalizeFormMethod` future flag ([#11697](https://github.com/remix-run/react-router/pull/11697))
|
|
1135
1160
|
|
|
1136
1161
|
- For Remix consumers migrating to React Router, the `crypto` global from the [Web Crypto API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API) is now required when using cookie and session APIs. This means that the following APIs are provided from `react-router` rather than platform-specific packages: ([#11837](https://github.com/remix-run/react-router/pull/11837))
|
|
1137
|
-
|
|
1138
1162
|
- `createCookie`
|
|
1139
1163
|
- `createCookieSessionStorage`
|
|
1140
1164
|
- `createMemorySessionStorage`
|
|
@@ -1143,7 +1167,6 @@ _No changes_
|
|
|
1143
1167
|
For consumers running older versions of Node, the `installGlobals` function from `@remix-run/node` has been updated to define `globalThis.crypto`, using [Node's `require('node:crypto').webcrypto` implementation.](https://nodejs.org/api/webcrypto.html)
|
|
1144
1168
|
|
|
1145
1169
|
Since platform-specific packages no longer need to implement this API, the following low-level APIs have been removed:
|
|
1146
|
-
|
|
1147
1170
|
- `createCookieFactory`
|
|
1148
1171
|
- `createSessionStorageFactory`
|
|
1149
1172
|
- `createCookieSessionStorageFactory`
|
|
@@ -1299,7 +1322,6 @@ _No changes_
|
|
|
1299
1322
|
```
|
|
1300
1323
|
|
|
1301
1324
|
This initial implementation targets type inference for:
|
|
1302
|
-
|
|
1303
1325
|
- `Params` : Path parameters from your routing config in `routes.ts` including file-based routing
|
|
1304
1326
|
- `LoaderData` : Loader data from `loader` and/or `clientLoader` within your route module
|
|
1305
1327
|
- `ActionData` : Action data from `action` and/or `clientAction` within your route module
|
|
@@ -1314,7 +1336,6 @@ _No changes_
|
|
|
1314
1336
|
```
|
|
1315
1337
|
|
|
1316
1338
|
Check out our docs for more:
|
|
1317
|
-
|
|
1318
1339
|
- [_Explanations > Type Safety_](https://reactrouter.com/dev/guides/explanation/type-safety)
|
|
1319
1340
|
- [_How-To > Setting up type safety_](https://reactrouter.com/dev/guides/how-to/setting-up-type-safety)
|
|
1320
1341
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { L as Location, C as ClientActionFunction, a as ClientLoaderFunction, b as LinksFunction, M as MetaFunction, S as ShouldRevalidateFunction, P as Params, c as RouterContextProvider, A as ActionFunction, H as HeadersFunction, d as LoaderFunction, e as RouterInit } from './instrumentation-
|
|
2
|
+
import { L as Location, C as ClientActionFunction, a as ClientLoaderFunction, b as LinksFunction, M as MetaFunction, S as ShouldRevalidateFunction, P as Params, c as RouterContextProvider, A as ActionFunction, H as HeadersFunction, d as LoaderFunction, e as RouterInit } from './instrumentation-Unc20tLk.js';
|
|
3
3
|
|
|
4
4
|
type RSCRouteConfigEntryBase = {
|
|
5
5
|
action?: ActionFunction;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { L as Location, C as ClientActionFunction, a as ClientLoaderFunction, b as LinksFunction, M as MetaFunction, S as ShouldRevalidateFunction, P as Params, c as RouterContextProvider, A as ActionFunction, H as HeadersFunction, d as LoaderFunction, e as RouterInit } from './router-
|
|
2
|
+
import { L as Location, C as ClientActionFunction, a as ClientLoaderFunction, b as LinksFunction, M as MetaFunction, S as ShouldRevalidateFunction, P as Params, c as RouterContextProvider, A as ActionFunction, H as HeadersFunction, d as LoaderFunction, e as RouterInit } from './router-CAvh_Drx.mjs';
|
|
3
3
|
|
|
4
4
|
type RSCRouteConfigEntryBase = {
|
|
5
5
|
action?: ActionFunction;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v7.9.
|
|
2
|
+
* react-router v7.9.6-pre.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -2306,6 +2306,14 @@ function createRouter(init) {
|
|
|
2306
2306
|
key
|
|
2307
2307
|
);
|
|
2308
2308
|
let actionResult = actionResults[match.route.id];
|
|
2309
|
+
if (!actionResult) {
|
|
2310
|
+
for (let match2 of fetchMatches) {
|
|
2311
|
+
if (actionResults[match2.route.id]) {
|
|
2312
|
+
actionResult = actionResults[match2.route.id];
|
|
2313
|
+
break;
|
|
2314
|
+
}
|
|
2315
|
+
}
|
|
2316
|
+
}
|
|
2309
2317
|
if (fetchRequest.signal.aborted) {
|
|
2310
2318
|
if (fetchControllers.get(key) === abortController) {
|
|
2311
2319
|
fetchControllers.delete(key);
|
|
@@ -2962,23 +2970,43 @@ function createRouter(init) {
|
|
|
2962
2970
|
return { type: "aborted" };
|
|
2963
2971
|
}
|
|
2964
2972
|
let newMatches = matchRoutes(routesToUse, pathname, basename);
|
|
2973
|
+
let newPartialMatches = null;
|
|
2965
2974
|
if (newMatches) {
|
|
2966
|
-
|
|
2975
|
+
if (Object.keys(newMatches[0].params).length === 0) {
|
|
2976
|
+
return { type: "success", matches: newMatches };
|
|
2977
|
+
} else {
|
|
2978
|
+
newPartialMatches = matchRoutesImpl(
|
|
2979
|
+
routesToUse,
|
|
2980
|
+
pathname,
|
|
2981
|
+
basename,
|
|
2982
|
+
true
|
|
2983
|
+
);
|
|
2984
|
+
let matchedDeeper = newPartialMatches && partialMatches.length < newPartialMatches.length && compareMatches(
|
|
2985
|
+
partialMatches,
|
|
2986
|
+
newPartialMatches.slice(0, partialMatches.length)
|
|
2987
|
+
);
|
|
2988
|
+
if (!matchedDeeper) {
|
|
2989
|
+
return { type: "success", matches: newMatches };
|
|
2990
|
+
}
|
|
2991
|
+
}
|
|
2967
2992
|
}
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
)) {
|
|
2993
|
+
if (!newPartialMatches) {
|
|
2994
|
+
newPartialMatches = matchRoutesImpl(
|
|
2995
|
+
routesToUse,
|
|
2996
|
+
pathname,
|
|
2997
|
+
basename,
|
|
2998
|
+
true
|
|
2999
|
+
);
|
|
3000
|
+
}
|
|
3001
|
+
if (!newPartialMatches || compareMatches(partialMatches, newPartialMatches)) {
|
|
2977
3002
|
return { type: "success", matches: null };
|
|
2978
3003
|
}
|
|
2979
3004
|
partialMatches = newPartialMatches;
|
|
2980
3005
|
}
|
|
2981
3006
|
}
|
|
3007
|
+
function compareMatches(a, b) {
|
|
3008
|
+
return a.length === b.length && a.every((m, i) => m.route.id === b[i].route.id);
|
|
3009
|
+
}
|
|
2982
3010
|
function _internalSetRoutes(newRoutes) {
|
|
2983
3011
|
manifest = {};
|
|
2984
3012
|
inFlightDataRoutes = convertRoutesToDataRoutes(
|
|
@@ -5589,8 +5617,8 @@ var RenderErrorBoundary = class extends React2.Component {
|
|
|
5589
5617
|
};
|
|
5590
5618
|
}
|
|
5591
5619
|
componentDidCatch(error, errorInfo) {
|
|
5592
|
-
if (this.props.
|
|
5593
|
-
this.props.
|
|
5620
|
+
if (this.props.onError) {
|
|
5621
|
+
this.props.onError(error, errorInfo);
|
|
5594
5622
|
} else {
|
|
5595
5623
|
console.error(
|
|
5596
5624
|
"React Router caught the following error during render",
|
|
@@ -5668,6 +5696,13 @@ function _renderMatches(matches, parentMatches = [], dataRouterState = null, uns
|
|
|
5668
5696
|
}
|
|
5669
5697
|
}
|
|
5670
5698
|
}
|
|
5699
|
+
let onError = dataRouterState && unstable_onError ? (error, errorInfo) => {
|
|
5700
|
+
unstable_onError(error, {
|
|
5701
|
+
location: dataRouterState.location,
|
|
5702
|
+
params: dataRouterState.matches?.[0]?.params ?? {},
|
|
5703
|
+
errorInfo
|
|
5704
|
+
});
|
|
5705
|
+
} : void 0;
|
|
5671
5706
|
return renderedMatches.reduceRight(
|
|
5672
5707
|
(outlet, match, index) => {
|
|
5673
5708
|
let error;
|
|
@@ -5728,7 +5763,7 @@ function _renderMatches(matches, parentMatches = [], dataRouterState = null, uns
|
|
|
5728
5763
|
error,
|
|
5729
5764
|
children: getChildren(),
|
|
5730
5765
|
routeContext: { outlet: null, matches: matches2, isDataRoute: true },
|
|
5731
|
-
|
|
5766
|
+
onError
|
|
5732
5767
|
}
|
|
5733
5768
|
) : getChildren();
|
|
5734
5769
|
},
|
|
@@ -6140,7 +6175,10 @@ function RouterProvider({
|
|
|
6140
6175
|
if (newState.errors && unstable_onError) {
|
|
6141
6176
|
Object.entries(newState.errors).forEach(([routeId, error]) => {
|
|
6142
6177
|
if (prevState.errors?.[routeId] !== error) {
|
|
6143
|
-
unstable_onError(error
|
|
6178
|
+
unstable_onError(error, {
|
|
6179
|
+
location: newState.location,
|
|
6180
|
+
params: newState.matches[0]?.params ?? {}
|
|
6181
|
+
});
|
|
6144
6182
|
}
|
|
6145
6183
|
});
|
|
6146
6184
|
}
|
|
@@ -6469,12 +6507,25 @@ function Await({
|
|
|
6469
6507
|
resolve
|
|
6470
6508
|
}) {
|
|
6471
6509
|
let dataRouterContext = React3.useContext(DataRouterContext);
|
|
6510
|
+
let dataRouterStateContext = React3.useContext(DataRouterStateContext);
|
|
6511
|
+
let onError = React3.useCallback(
|
|
6512
|
+
(error, errorInfo) => {
|
|
6513
|
+
if (dataRouterContext && dataRouterContext.unstable_onError && dataRouterStateContext) {
|
|
6514
|
+
dataRouterContext.unstable_onError(error, {
|
|
6515
|
+
location: dataRouterStateContext.location,
|
|
6516
|
+
params: dataRouterStateContext.matches?.[0]?.params || {},
|
|
6517
|
+
errorInfo
|
|
6518
|
+
});
|
|
6519
|
+
}
|
|
6520
|
+
},
|
|
6521
|
+
[dataRouterContext, dataRouterStateContext]
|
|
6522
|
+
);
|
|
6472
6523
|
return /* @__PURE__ */ React3.createElement(
|
|
6473
6524
|
AwaitErrorBoundary,
|
|
6474
6525
|
{
|
|
6475
6526
|
resolve,
|
|
6476
6527
|
errorElement,
|
|
6477
|
-
|
|
6528
|
+
onError
|
|
6478
6529
|
},
|
|
6479
6530
|
/* @__PURE__ */ React3.createElement(ResolveAwait, null, children)
|
|
6480
6531
|
);
|
|
@@ -6488,8 +6539,8 @@ var AwaitErrorBoundary = class extends React3.Component {
|
|
|
6488
6539
|
return { error };
|
|
6489
6540
|
}
|
|
6490
6541
|
componentDidCatch(error, errorInfo) {
|
|
6491
|
-
if (this.props.
|
|
6492
|
-
this.props.
|
|
6542
|
+
if (this.props.onError) {
|
|
6543
|
+
this.props.onError(error, errorInfo);
|
|
6493
6544
|
} else {
|
|
6494
6545
|
console.error(
|
|
6495
6546
|
"<Await> caught the following error during render",
|
|
@@ -6523,7 +6574,7 @@ var AwaitErrorBoundary = class extends React3.Component {
|
|
|
6523
6574
|
promise = resolve.then(
|
|
6524
6575
|
(data2) => Object.defineProperty(resolve, "_data", { get: () => data2 }),
|
|
6525
6576
|
(error) => {
|
|
6526
|
-
this.props.
|
|
6577
|
+
this.props.onError?.(error);
|
|
6527
6578
|
Object.defineProperty(resolve, "_error", { get: () => error });
|
|
6528
6579
|
}
|
|
6529
6580
|
);
|
|
@@ -9466,7 +9517,7 @@ var isBrowser = typeof window !== "undefined" && typeof window.document !== "und
|
|
|
9466
9517
|
try {
|
|
9467
9518
|
if (isBrowser) {
|
|
9468
9519
|
window.__reactRouterVersion = // @ts-expect-error
|
|
9469
|
-
"7.9.
|
|
9520
|
+
"7.9.6-pre.0";
|
|
9470
9521
|
}
|
|
9471
9522
|
} catch (e) {
|
|
9472
9523
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/**
|
|
2
|
-
* react-router v7.9.
|
|
2
|
+
* react-router v7.9.6-pre.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var _chunkTUTX3ERHjs = require('./chunk-TUTX3ERH.js');
|
|
18
18
|
|
|
19
19
|
// lib/dom/ssr/hydration.tsx
|
|
20
20
|
function getHydrationData({
|
|
@@ -29,12 +29,12 @@ function getHydrationData({
|
|
|
29
29
|
...state,
|
|
30
30
|
loaderData: { ...state.loaderData }
|
|
31
31
|
};
|
|
32
|
-
let initialMatches =
|
|
32
|
+
let initialMatches = _chunkTUTX3ERHjs.matchRoutes.call(void 0, routes, location, basename);
|
|
33
33
|
if (initialMatches) {
|
|
34
34
|
for (let match of initialMatches) {
|
|
35
35
|
let routeId = match.route.id;
|
|
36
36
|
let routeInfo = getRouteInfo(routeId);
|
|
37
|
-
if (
|
|
37
|
+
if (_chunkTUTX3ERHjs.shouldHydrateRouteLoader.call(void 0,
|
|
38
38
|
routeId,
|
|
39
39
|
routeInfo.clientLoader,
|
|
40
40
|
routeInfo.hasLoader,
|
|
@@ -112,7 +112,7 @@ function RSCDefaultRootErrorBoundaryImpl({
|
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
);
|
|
115
|
-
if (
|
|
115
|
+
if (_chunkTUTX3ERHjs.isRouteErrorResponse.call(void 0, error)) {
|
|
116
116
|
return /* @__PURE__ */ _react2.default.createElement(
|
|
117
117
|
ErrorWrapper,
|
|
118
118
|
{
|
|
@@ -120,7 +120,7 @@ function RSCDefaultRootErrorBoundaryImpl({
|
|
|
120
120
|
title: "Unhandled Thrown Response!"
|
|
121
121
|
},
|
|
122
122
|
/* @__PURE__ */ _react2.default.createElement("h1", { style: { fontSize: "24px" } }, error.status, " ", error.statusText),
|
|
123
|
-
|
|
123
|
+
_chunkTUTX3ERHjs.ENABLE_DEV_WARNINGS ? heyDeveloper : null
|
|
124
124
|
);
|
|
125
125
|
}
|
|
126
126
|
let errorInstance;
|
|
@@ -146,7 +146,7 @@ function RSCDefaultRootErrorBoundaryImpl({
|
|
|
146
146
|
function RSCDefaultRootErrorBoundary({
|
|
147
147
|
hasRootLayout
|
|
148
148
|
}) {
|
|
149
|
-
let error =
|
|
149
|
+
let error = _chunkTUTX3ERHjs.useRouteError.call(void 0, );
|
|
150
150
|
if (hasRootLayout === void 0) {
|
|
151
151
|
throw new Error("Missing 'hasRootLayout' prop");
|
|
152
152
|
}
|