react-router 7.10.1-pre.0 → 7.10.1
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 +13 -3
- package/dist/{production/chunk-3WZYQEC5.js → development/chunk-FKYGG5Z2.js} +7 -7
- package/dist/development/{chunk-NUGUL5OD.js → chunk-HMTWJNYB.js} +94 -94
- package/dist/development/{chunk-X3LLUSK4.mjs → chunk-PMGK554W.mjs} +2 -2
- package/dist/development/{chunk-BFZIIKOS.js → chunk-RBZI3ZHD.js} +1 -1
- package/dist/development/{chunk-SC4UA6B4.mjs → chunk-WWGJGFF6.mjs} +2 -2
- package/dist/development/dom-export.js +27 -27
- package/dist/development/dom-export.mjs +3 -3
- 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.js +76 -76
- package/dist/development/index.mjs +3 -3
- package/dist/development/lib/types/internal.js +1 -1
- package/dist/development/lib/types/internal.mjs +1 -1
- package/dist/production/{chunk-FI4GMOFC.mjs → chunk-ANIOYBQK.mjs} +2 -2
- package/dist/production/{chunk-7NETFFGG.js → chunk-B3F6YMOF.js} +94 -94
- package/dist/production/{chunk-KT4GS4WF.mjs → chunk-TDCOAFPJ.mjs} +2 -2
- package/dist/production/{chunk-322RSYEJ.js → chunk-UQPBOMFP.js} +1 -1
- package/dist/{development/chunk-VPK5G3S4.js → production/chunk-YO5R3LGQ.js} +7 -7
- package/dist/production/dom-export.js +27 -27
- package/dist/production/dom-export.mjs +3 -3
- 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.js +76 -76
- package/dist/production/index.mjs +3 -3
- package/dist/production/lib/types/internal.js +1 -1
- package/dist/production/lib/types/internal.mjs +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# `react-router`
|
|
2
2
|
|
|
3
|
-
## 7.10.1
|
|
3
|
+
## 7.10.1
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
-
-
|
|
7
|
+
- Update the `useOptimistic` stub we provide for React 18 users to use a stable setter function to avoid potential `useEffect` loops - specifically when using `<Link viewTransition>` ([#14628](https://github.com/remix-run/react-router/pull/14628))
|
|
8
8
|
|
|
9
9
|
## 7.10.0
|
|
10
10
|
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
- ⚠️ This is a breaking change if you have begun using `fetcher.unstable_reset()`
|
|
15
15
|
|
|
16
16
|
- Stabilize the `dataStrategy` `match.shouldRevalidateArgs`/`match.shouldCallHandler()` APIs. ([#14592](https://github.com/remix-run/react-router/pull/14592))
|
|
17
|
+
|
|
17
18
|
- The `match.shouldLoad` API is now marked deprecated in favor of these more powerful alternatives
|
|
18
19
|
|
|
19
20
|
- If you're using this API in a custom `dataStrategy` today, you can swap to the new API at your convenience:
|
|
@@ -142,6 +143,7 @@
|
|
|
142
143
|
- Ensure action handlers run for routes with middleware even if no loader is present ([#14443](https://github.com/remix-run/react-router/pull/14443))
|
|
143
144
|
|
|
144
145
|
- 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))
|
|
146
|
+
|
|
145
147
|
- Framework Mode:
|
|
146
148
|
- `entry.server.tsx`: `export const unstable_instrumentations = [...]`
|
|
147
149
|
- `entry.client.tsx`: `<HydratedRouter unstable_instrumentations={[...]} />`
|
|
@@ -303,6 +305,7 @@
|
|
|
303
305
|
- Stabilize middleware and context APIs. ([#14215](https://github.com/remix-run/react-router/pull/14215))
|
|
304
306
|
|
|
305
307
|
We have removed the `unstable_` prefix from the following APIs and they are now considered stable and ready for production use:
|
|
308
|
+
|
|
306
309
|
- [`RouterContextProvider`](https://reactrouter.com/api/utils/RouterContextProvider)
|
|
307
310
|
- [`createContext`](https://reactrouter.com/api/utils/createContext)
|
|
308
311
|
- `createBrowserRouter` [`getContext`](https://reactrouter.com/api/data-routers/createBrowserRouter#optsgetcontext) option
|
|
@@ -329,7 +332,7 @@
|
|
|
329
332
|
|
|
330
333
|
- \[UNSTABLE] Add `<RouterProvider unstable_onError>`/`<HydratedRouter unstable_onError>` prop for client side error reporting ([#14162](https://github.com/remix-run/react-router/pull/14162))
|
|
331
334
|
|
|
332
|
-
- server action revalidation opt out via $
|
|
335
|
+
- server action revalidation opt out via $SKIP\_REVALIDATION field ([#14154](https://github.com/remix-run/react-router/pull/14154))
|
|
333
336
|
|
|
334
337
|
- Properly escape interpolated param values in `generatePath()` ([#13530](https://github.com/remix-run/react-router/pull/13530))
|
|
335
338
|
|
|
@@ -378,6 +381,7 @@
|
|
|
378
381
|
- Remove dependency on `@types/node` in TypeScript declaration files ([#14059](https://github.com/remix-run/react-router/pull/14059))
|
|
379
382
|
|
|
380
383
|
- Fix types for `UIMatch` to reflect that the `loaderData`/`data` properties may be `undefined` ([#12206](https://github.com/remix-run/react-router/pull/12206))
|
|
384
|
+
|
|
381
385
|
- 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
|
|
382
386
|
- 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
|
|
383
387
|
- ⚠️ 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.
|
|
@@ -411,6 +415,7 @@
|
|
|
411
415
|
- \[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))
|
|
412
416
|
|
|
413
417
|
- \[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))
|
|
418
|
+
|
|
414
419
|
- The API has been renamed to `unstable_generateMiddlewareResponse` for clarity
|
|
415
420
|
- 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
|
|
416
421
|
- The `query` version of the API now has a signature of `(query: (r: Request) => Promise<StaticHandlerContext | Response>) => Promise<Response>`
|
|
@@ -1056,6 +1061,7 @@
|
|
|
1056
1061
|
```
|
|
1057
1062
|
|
|
1058
1063
|
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:
|
|
1064
|
+
|
|
1059
1065
|
- Library mode - `createBrowserRouter(routes, { unstable_getContext })`
|
|
1060
1066
|
- Framework mode - `<HydratedRouter unstable_getContext>`
|
|
1061
1067
|
|
|
@@ -1243,6 +1249,7 @@ _No changes_
|
|
|
1243
1249
|
- Remove `future.v7_normalizeFormMethod` future flag ([#11697](https://github.com/remix-run/react-router/pull/11697))
|
|
1244
1250
|
|
|
1245
1251
|
- 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))
|
|
1252
|
+
|
|
1246
1253
|
- `createCookie`
|
|
1247
1254
|
- `createCookieSessionStorage`
|
|
1248
1255
|
- `createMemorySessionStorage`
|
|
@@ -1251,6 +1258,7 @@ _No changes_
|
|
|
1251
1258
|
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)
|
|
1252
1259
|
|
|
1253
1260
|
Since platform-specific packages no longer need to implement this API, the following low-level APIs have been removed:
|
|
1261
|
+
|
|
1254
1262
|
- `createCookieFactory`
|
|
1255
1263
|
- `createSessionStorageFactory`
|
|
1256
1264
|
- `createCookieSessionStorageFactory`
|
|
@@ -1406,6 +1414,7 @@ _No changes_
|
|
|
1406
1414
|
```
|
|
1407
1415
|
|
|
1408
1416
|
This initial implementation targets type inference for:
|
|
1417
|
+
|
|
1409
1418
|
- `Params` : Path parameters from your routing config in `routes.ts` including file-based routing
|
|
1410
1419
|
- `LoaderData` : Loader data from `loader` and/or `clientLoader` within your route module
|
|
1411
1420
|
- `ActionData` : Action data from `action` and/or `clientAction` within your route module
|
|
@@ -1420,6 +1429,7 @@ _No changes_
|
|
|
1420
1429
|
```
|
|
1421
1430
|
|
|
1422
1431
|
Check out our docs for more:
|
|
1432
|
+
|
|
1423
1433
|
- [_Explanations > Type Safety_](https://reactrouter.com/dev/guides/explanation/type-safety)
|
|
1424
1434
|
- [_How-To > Setting up type safety_](https://reactrouter.com/dev/guides/how-to/setting-up-type-safety)
|
|
1425
1435
|
|
|
@@ -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.10.1
|
|
2
|
+
* react-router v7.10.1
|
|
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 _chunkRBZI3ZHDjs = require('./chunk-RBZI3ZHD.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 = _chunkRBZI3ZHDjs.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 (_chunkRBZI3ZHDjs.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 (_chunkRBZI3ZHDjs.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
|
+
_chunkRBZI3ZHDjs.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 = _chunkRBZI3ZHDjs.useRouteError.call(void 0, );
|
|
150
150
|
if (hasRootLayout === void 0) {
|
|
151
151
|
throw new Error("Missing 'hasRootLayout' prop");
|
|
152
152
|
}
|