react-router 7.9.5-pre.0 → 7.9.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.
- package/CHANGELOG.md +13 -2
- package/dist/{production/chunk-4SZHQXEM.js → development/chunk-FQEOJFGW.js} +7 -7
- package/dist/development/{chunk-FXLUBU25.js → chunk-IXESJAGJ.js} +93 -93
- package/dist/{production/chunk-4JX2RDWY.mjs → development/chunk-JG3XND5A.mjs} +2 -2
- package/dist/development/{chunk-76L3QNAV.mjs → chunk-UIGDSWPH.mjs} +2 -2
- package/dist/development/{chunk-TSYPWE43.js → chunk-VNR6V74N.js} +1 -1
- package/dist/development/dom-export.js +26 -26
- 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/{development/chunk-KXZSW2DO.js → production/chunk-CWEARR4H.js} +7 -7
- package/dist/production/{chunk-ARKB3I5K.js → chunk-EAE7427A.js} +1 -1
- package/dist/production/{chunk-OB3KSCCZ.js → chunk-ERPFE3MR.js} +93 -93
- package/dist/production/{chunk-7EXEUENX.mjs → chunk-RZ6LZWMW.mjs} +2 -2
- package/dist/{development/chunk-B6QYCHJF.mjs → production/chunk-TPBVZP6U.mjs} +2 -2
- package/dist/production/dom-export.js +26 -26
- 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,11 @@
|
|
|
1
1
|
# `react-router`
|
|
2
2
|
|
|
3
|
-
## 7.9.5
|
|
3
|
+
## 7.9.5
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
7
|
- Move RSCHydratedRouter and utils to `/dom` export. ([#14457](https://github.com/remix-run/react-router/pull/14457))
|
|
8
|
+
|
|
8
9
|
- useRoute: return type-safe `handle` ([#14462](https://github.com/remix-run/react-router/pull/14462))
|
|
9
10
|
|
|
10
11
|
For example:
|
|
@@ -25,7 +26,9 @@
|
|
|
25
26
|
```
|
|
26
27
|
|
|
27
28
|
- 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
|
+
|
|
28
30
|
- 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
|
+
|
|
29
32
|
- Framework Mode:
|
|
30
33
|
- `entry.server.tsx`: `export const unstable_instrumentations = [...]`
|
|
31
34
|
- `entry.client.tsx`: `<HydratedRouter unstable_instrumentations={[...]} />`
|
|
@@ -187,6 +190,7 @@
|
|
|
187
190
|
- Stabilize middleware and context APIs. ([#14215](https://github.com/remix-run/react-router/pull/14215))
|
|
188
191
|
|
|
189
192
|
We have removed the `unstable_` prefix from the following APIs and they are now considered stable and ready for production use:
|
|
193
|
+
|
|
190
194
|
- [`RouterContextProvider`](https://reactrouter.com/api/utils/RouterContextProvider)
|
|
191
195
|
- [`createContext`](https://reactrouter.com/api/utils/createContext)
|
|
192
196
|
- `createBrowserRouter` [`getContext`](https://reactrouter.com/api/data-routers/createBrowserRouter#optsgetcontext) option
|
|
@@ -213,7 +217,7 @@
|
|
|
213
217
|
|
|
214
218
|
- \[UNSTABLE] Add `<RouterProvider unstable_onError>`/`<HydratedRouter unstable_onError>` prop for client side error reporting ([#14162](https://github.com/remix-run/react-router/pull/14162))
|
|
215
219
|
|
|
216
|
-
- server action revalidation opt out via $
|
|
220
|
+
- server action revalidation opt out via $SKIP\_REVALIDATION field ([#14154](https://github.com/remix-run/react-router/pull/14154))
|
|
217
221
|
|
|
218
222
|
- Properly escape interpolated param values in `generatePath()` ([#13530](https://github.com/remix-run/react-router/pull/13530))
|
|
219
223
|
|
|
@@ -262,6 +266,7 @@
|
|
|
262
266
|
- Remove dependency on `@types/node` in TypeScript declaration files ([#14059](https://github.com/remix-run/react-router/pull/14059))
|
|
263
267
|
|
|
264
268
|
- 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
|
+
|
|
265
270
|
- 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
|
|
266
271
|
- 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
|
|
267
272
|
- ⚠️ 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.
|
|
@@ -295,6 +300,7 @@
|
|
|
295
300
|
- \[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))
|
|
296
301
|
|
|
297
302
|
- \[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
|
+
|
|
298
304
|
- The API has been renamed to `unstable_generateMiddlewareResponse` for clarity
|
|
299
305
|
- 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
|
|
300
306
|
- The `query` version of the API now has a signature of `(query: (r: Request) => Promise<StaticHandlerContext | Response>) => Promise<Response>`
|
|
@@ -940,6 +946,7 @@
|
|
|
940
946
|
```
|
|
941
947
|
|
|
942
948
|
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
|
+
|
|
943
950
|
- Library mode - `createBrowserRouter(routes, { unstable_getContext })`
|
|
944
951
|
- Framework mode - `<HydratedRouter unstable_getContext>`
|
|
945
952
|
|
|
@@ -1127,6 +1134,7 @@ _No changes_
|
|
|
1127
1134
|
- Remove `future.v7_normalizeFormMethod` future flag ([#11697](https://github.com/remix-run/react-router/pull/11697))
|
|
1128
1135
|
|
|
1129
1136
|
- 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
|
+
|
|
1130
1138
|
- `createCookie`
|
|
1131
1139
|
- `createCookieSessionStorage`
|
|
1132
1140
|
- `createMemorySessionStorage`
|
|
@@ -1135,6 +1143,7 @@ _No changes_
|
|
|
1135
1143
|
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)
|
|
1136
1144
|
|
|
1137
1145
|
Since platform-specific packages no longer need to implement this API, the following low-level APIs have been removed:
|
|
1146
|
+
|
|
1138
1147
|
- `createCookieFactory`
|
|
1139
1148
|
- `createSessionStorageFactory`
|
|
1140
1149
|
- `createCookieSessionStorageFactory`
|
|
@@ -1290,6 +1299,7 @@ _No changes_
|
|
|
1290
1299
|
```
|
|
1291
1300
|
|
|
1292
1301
|
This initial implementation targets type inference for:
|
|
1302
|
+
|
|
1293
1303
|
- `Params` : Path parameters from your routing config in `routes.ts` including file-based routing
|
|
1294
1304
|
- `LoaderData` : Loader data from `loader` and/or `clientLoader` within your route module
|
|
1295
1305
|
- `ActionData` : Action data from `action` and/or `clientAction` within your route module
|
|
@@ -1304,6 +1314,7 @@ _No changes_
|
|
|
1304
1314
|
```
|
|
1305
1315
|
|
|
1306
1316
|
Check out our docs for more:
|
|
1317
|
+
|
|
1307
1318
|
- [_Explanations > Type Safety_](https://reactrouter.com/dev/guides/explanation/type-safety)
|
|
1308
1319
|
- [_How-To > Setting up type safety_](https://reactrouter.com/dev/guides/how-to/setting-up-type-safety)
|
|
1309
1320
|
|
|
@@ -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.5
|
|
2
|
+
* react-router v7.9.5
|
|
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 _chunkVNR6V74Njs = require('./chunk-VNR6V74N.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 = _chunkVNR6V74Njs.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 (_chunkVNR6V74Njs.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 (_chunkVNR6V74Njs.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
|
+
_chunkVNR6V74Njs.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 = _chunkVNR6V74Njs.useRouteError.call(void 0, );
|
|
150
150
|
if (hasRootLayout === void 0) {
|
|
151
151
|
throw new Error("Missing 'hasRootLayout' prop");
|
|
152
152
|
}
|