react-router 7.14.0-pre.0 → 7.14.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 +27 -11
- package/dist/development/{chunk-D73YQQSY.mjs → chunk-2UH5WJXA.mjs} +2 -2
- package/dist/development/{chunk-GE4J47XT.js → chunk-IK6APEEG.js} +1 -1
- package/dist/{production/chunk-QIHLB25G.js → development/chunk-NXTEWSJO.js} +99 -99
- package/dist/development/{chunk-47HDNIOI.mjs → chunk-QFMPRPBF.mjs} +2 -2
- package/dist/development/{chunk-MA52INJ5.js → chunk-WAVMRYR2.js} +7 -7
- 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 +82 -82
- 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-G3YAUWGC.js → chunk-355DUZMC.js} +7 -7
- package/dist/production/{chunk-OBXCYSYK.js → chunk-4TJ7T2OQ.js} +1 -1
- package/dist/{development/chunk-KLEV7K4H.js → production/chunk-FPT5DLVJ.js} +99 -99
- package/dist/production/{chunk-MQKMC5YB.mjs → chunk-HZQGQD2X.mjs} +2 -2
- package/dist/production/{chunk-XM7AQRW7.mjs → chunk-X5LK27NZ.mjs} +2 -2
- 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 +82 -82
- 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,6 +1,6 @@
|
|
|
1
1
|
# `react-router`
|
|
2
2
|
|
|
3
|
-
## 7.14.0
|
|
3
|
+
## 7.14.0
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
@@ -62,7 +62,9 @@
|
|
|
62
62
|
```
|
|
63
63
|
|
|
64
64
|
- rsc Link prefetch ([#14902](https://github.com/remix-run/react-router/pull/14902))
|
|
65
|
+
|
|
65
66
|
- Remove recursion from turbo-stream v2 allowing for encoding / decoding of massive payloads. ([#14838](https://github.com/remix-run/react-router/pull/14838))
|
|
67
|
+
|
|
66
68
|
- encodeViaTurboStream leaked memory via unremoved AbortSignal listener ([#14900](https://github.com/remix-run/react-router/pull/14900))
|
|
67
69
|
|
|
68
70
|
## 7.13.2
|
|
@@ -80,6 +82,7 @@
|
|
|
80
82
|
By default, React Router normalizes the `request.url` passed to your `loader`, `action`, and `middleware` functions by removing React Router's internal implementation details (`.data` suffixes, `index` + `_routes` query params).
|
|
81
83
|
|
|
82
84
|
Enabling this flag removes that normalization and passes the raw HTTP `request` instance to your handlers. This provides a few benefits:
|
|
85
|
+
|
|
83
86
|
- Reduces server-side overhead by eliminating multiple `new Request()` calls on the critical path
|
|
84
87
|
- Allows you to distinguish document from data requests in your handlers base don the presence of a `.data` suffix (useful for observability purposes)
|
|
85
88
|
|
|
@@ -129,9 +132,9 @@
|
|
|
129
132
|
|
|
130
133
|
- Fix matchPath optional params matching without a "/" separator. ([#14689](https://github.com/remix-run/react-router/pull/14689))
|
|
131
134
|
- matchPath("/users/:id?", "/usersblah") now returns null.
|
|
132
|
-
- matchPath("/
|
|
135
|
+
- matchPath("/test\_route/:part?", "/test\_route\_more") now returns null.
|
|
133
136
|
|
|
134
|
-
- add RSC
|
|
137
|
+
- add RSC unstable\_getRequest ([#14758](https://github.com/remix-run/react-router/pull/14758))
|
|
135
138
|
|
|
136
139
|
- Fix `HydrateFallback` rendering during initial lazy route discovery with matching splat route ([#14740](https://github.com/remix-run/react-router/pull/14740))
|
|
137
140
|
|
|
@@ -177,6 +180,7 @@
|
|
|
177
180
|
```
|
|
178
181
|
|
|
179
182
|
Notes:
|
|
183
|
+
|
|
180
184
|
- The masked location, if present, will be available on `useLocation().unstable_mask` so you can detect whether you are currently masked or not.
|
|
181
185
|
- Masked URLs only work for SPA use cases, and will be removed from `history.state` during SSR.
|
|
182
186
|
- This provides a first-class API to mask URLs in Data Mode to achieve the same behavior you could do in Declarative Mode via [manual `backgroundLocation` management](https://github.com/remix-run/react-router/tree/main/examples/modal).
|
|
@@ -222,25 +226,25 @@
|
|
|
222
226
|
|
|
223
227
|
| URL `/a/b/c` | **HTTP pathname** | **`request` pathname\`** |
|
|
224
228
|
| ------------ | ----------------- | ------------------------ |
|
|
225
|
-
| **Document** | `/a/b/c` | `/a/b/c` ✅
|
|
226
|
-
| **Data** | `/a/b/c.data` | `/a/b/c` ✅
|
|
229
|
+
| **Document** | `/a/b/c` | `/a/b/c` ✅ |
|
|
230
|
+
| **Data** | `/a/b/c.data` | `/a/b/c` ✅ |
|
|
227
231
|
|
|
228
232
|
| URL `/a/b/c/` | **HTTP pathname** | **`request` pathname\`** |
|
|
229
233
|
| ------------- | ----------------- | ------------------------ |
|
|
230
|
-
| **Document** | `/a/b/c/` | `/a/b/c/` ✅
|
|
234
|
+
| **Document** | `/a/b/c/` | `/a/b/c/` ✅ |
|
|
231
235
|
| **Data** | `/a/b/c.data` | `/a/b/c` ⚠️ |
|
|
232
236
|
|
|
233
237
|
With this flag enabled, these pathnames will be made consistent though a new `_.data` format for client-side `.data` requests:
|
|
234
238
|
|
|
235
239
|
| URL `/a/b/c` | **HTTP pathname** | **`request` pathname\`** |
|
|
236
240
|
| ------------ | ----------------- | ------------------------ |
|
|
237
|
-
| **Document** | `/a/b/c` | `/a/b/c` ✅
|
|
238
|
-
| **Data** | `/a/b/c.data` | `/a/b/c` ✅
|
|
241
|
+
| **Document** | `/a/b/c` | `/a/b/c` ✅ |
|
|
242
|
+
| **Data** | `/a/b/c.data` | `/a/b/c` ✅ |
|
|
239
243
|
|
|
240
244
|
| URL `/a/b/c/` | **HTTP pathname** | **`request` pathname\`** |
|
|
241
245
|
| ------------- | ------------------ | ------------------------ |
|
|
242
|
-
| **Document** | `/a/b/c/` | `/a/b/c/` ✅
|
|
243
|
-
| **Data** | `/a/b/c/_.data` ⬅️ | `/a/b/c/` ✅
|
|
246
|
+
| **Document** | `/a/b/c/` | `/a/b/c/` ✅ |
|
|
247
|
+
| **Data** | `/a/b/c/_.data` ⬅️ | `/a/b/c/` ✅ |
|
|
244
248
|
|
|
245
249
|
This a bug fix but we are putting it behind an opt-in flag because it has the potential to be a "breaking bug fix" if you are relying on the URL format for any other application or caching logic.
|
|
246
250
|
|
|
@@ -267,12 +271,14 @@
|
|
|
267
271
|
- \[UNSTABLE] Add a new `unstable_defaultShouldRevalidate` flag to various APIs to allow opt-ing out of standard revalidation behaviors. ([#14542](https://github.com/remix-run/react-router/pull/14542))
|
|
268
272
|
|
|
269
273
|
If active routes include a `shouldRevalidate` function, then your value will be passed as `defaultShouldRevalidate` in those function so that the route always has the final revalidation determination.
|
|
274
|
+
|
|
270
275
|
- `<Form method="post" unstable_defaultShouldRevalidate={false}>`
|
|
271
276
|
- `submit(data, { method: "post", unstable_defaultShouldRevalidate: false })`
|
|
272
277
|
- `<fetcher.Form method="post" unstable_defaultShouldRevalidate={false}>`
|
|
273
278
|
- `fetcher.submit(data, { method: "post", unstable_defaultShouldRevalidate: false })`
|
|
274
279
|
|
|
275
280
|
This is also available on non-submission APIs that may trigger revalidations due to changing search params:
|
|
281
|
+
|
|
276
282
|
- `<Link to="/" unstable_defaultShouldRevalidate={false}>`
|
|
277
283
|
- `navigate("/?foo=bar", { unstable_defaultShouldRevalidate: false })`
|
|
278
284
|
- `setSearchParams(params, { unstable_defaultShouldRevalidate: false })`
|
|
@@ -295,6 +301,7 @@
|
|
|
295
301
|
- ⚠️ This is a breaking change if you have begun using `fetcher.unstable_reset()`
|
|
296
302
|
|
|
297
303
|
- Stabilize the `dataStrategy` `match.shouldRevalidateArgs`/`match.shouldCallHandler()` APIs. ([#14592](https://github.com/remix-run/react-router/pull/14592))
|
|
304
|
+
|
|
298
305
|
- The `match.shouldLoad` API is now marked deprecated in favor of these more powerful alternatives
|
|
299
306
|
|
|
300
307
|
- If you're using this API in a custom `dataStrategy` today, you can swap to the new API at your convenience:
|
|
@@ -423,6 +430,7 @@
|
|
|
423
430
|
- Ensure action handlers run for routes with middleware even if no loader is present ([#14443](https://github.com/remix-run/react-router/pull/14443))
|
|
424
431
|
|
|
425
432
|
- 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))
|
|
433
|
+
|
|
426
434
|
- Framework Mode:
|
|
427
435
|
- `entry.server.tsx`: `export const unstable_instrumentations = [...]`
|
|
428
436
|
- `entry.client.tsx`: `<HydratedRouter unstable_instrumentations={[...]} />`
|
|
@@ -584,6 +592,7 @@
|
|
|
584
592
|
- Stabilize middleware and context APIs. ([#14215](https://github.com/remix-run/react-router/pull/14215))
|
|
585
593
|
|
|
586
594
|
We have removed the `unstable_` prefix from the following APIs and they are now considered stable and ready for production use:
|
|
595
|
+
|
|
587
596
|
- [`RouterContextProvider`](https://reactrouter.com/api/utils/RouterContextProvider)
|
|
588
597
|
- [`createContext`](https://reactrouter.com/api/utils/createContext)
|
|
589
598
|
- `createBrowserRouter` [`getContext`](https://reactrouter.com/api/data-routers/createBrowserRouter#optsgetcontext) option
|
|
@@ -610,7 +619,7 @@
|
|
|
610
619
|
|
|
611
620
|
- \[UNSTABLE] Add `<RouterProvider unstable_onError>`/`<HydratedRouter unstable_onError>` prop for client side error reporting ([#14162](https://github.com/remix-run/react-router/pull/14162))
|
|
612
621
|
|
|
613
|
-
- server action revalidation opt out via $
|
|
622
|
+
- server action revalidation opt out via $SKIP\_REVALIDATION field ([#14154](https://github.com/remix-run/react-router/pull/14154))
|
|
614
623
|
|
|
615
624
|
- Properly escape interpolated param values in `generatePath()` ([#13530](https://github.com/remix-run/react-router/pull/13530))
|
|
616
625
|
|
|
@@ -659,6 +668,7 @@
|
|
|
659
668
|
- Remove dependency on `@types/node` in TypeScript declaration files ([#14059](https://github.com/remix-run/react-router/pull/14059))
|
|
660
669
|
|
|
661
670
|
- Fix types for `UIMatch` to reflect that the `loaderData`/`data` properties may be `undefined` ([#12206](https://github.com/remix-run/react-router/pull/12206))
|
|
671
|
+
|
|
662
672
|
- 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
|
|
663
673
|
- 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
|
|
664
674
|
- ⚠️ 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.
|
|
@@ -692,6 +702,7 @@
|
|
|
692
702
|
- \[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))
|
|
693
703
|
|
|
694
704
|
- \[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))
|
|
705
|
+
|
|
695
706
|
- The API has been renamed to `unstable_generateMiddlewareResponse` for clarity
|
|
696
707
|
- 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
|
|
697
708
|
- The `query` version of the API now has a signature of `(query: (r: Request) => Promise<StaticHandlerContext | Response>) => Promise<Response>`
|
|
@@ -1337,6 +1348,7 @@
|
|
|
1337
1348
|
```
|
|
1338
1349
|
|
|
1339
1350
|
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:
|
|
1351
|
+
|
|
1340
1352
|
- Library mode - `createBrowserRouter(routes, { unstable_getContext })`
|
|
1341
1353
|
- Framework mode - `<HydratedRouter unstable_getContext>`
|
|
1342
1354
|
|
|
@@ -1524,6 +1536,7 @@ _No changes_
|
|
|
1524
1536
|
- Remove `future.v7_normalizeFormMethod` future flag ([#11697](https://github.com/remix-run/react-router/pull/11697))
|
|
1525
1537
|
|
|
1526
1538
|
- 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))
|
|
1539
|
+
|
|
1527
1540
|
- `createCookie`
|
|
1528
1541
|
- `createCookieSessionStorage`
|
|
1529
1542
|
- `createMemorySessionStorage`
|
|
@@ -1532,6 +1545,7 @@ _No changes_
|
|
|
1532
1545
|
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)
|
|
1533
1546
|
|
|
1534
1547
|
Since platform-specific packages no longer need to implement this API, the following low-level APIs have been removed:
|
|
1548
|
+
|
|
1535
1549
|
- `createCookieFactory`
|
|
1536
1550
|
- `createSessionStorageFactory`
|
|
1537
1551
|
- `createCookieSessionStorageFactory`
|
|
@@ -1687,6 +1701,7 @@ _No changes_
|
|
|
1687
1701
|
```
|
|
1688
1702
|
|
|
1689
1703
|
This initial implementation targets type inference for:
|
|
1704
|
+
|
|
1690
1705
|
- `Params` : Path parameters from your routing config in `routes.ts` including file-based routing
|
|
1691
1706
|
- `LoaderData` : Loader data from `loader` and/or `clientLoader` within your route module
|
|
1692
1707
|
- `ActionData` : Action data from `action` and/or `clientAction` within your route module
|
|
@@ -1701,6 +1716,7 @@ _No changes_
|
|
|
1701
1716
|
```
|
|
1702
1717
|
|
|
1703
1718
|
Check out our docs for more:
|
|
1719
|
+
|
|
1704
1720
|
- [_Explanations > Type Safety_](https://reactrouter.com/dev/guides/explanation/type-safety)
|
|
1705
1721
|
- [_How-To > Setting up type safety_](https://reactrouter.com/dev/guides/how-to/setting-up-type-safety)
|
|
1706
1722
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v7.14.0
|
|
2
|
+
* react-router v7.14.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -51,7 +51,7 @@ import {
|
|
|
51
51
|
withComponentProps,
|
|
52
52
|
withErrorBoundaryProps,
|
|
53
53
|
withHydrateFallbackProps
|
|
54
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-QFMPRPBF.mjs";
|
|
55
55
|
|
|
56
56
|
// lib/dom/ssr/server.tsx
|
|
57
57
|
import * as React from "react";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }/**
|
|
2
|
-
* react-router v7.14.0
|
|
2
|
+
* react-router v7.14.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|