react-router 7.11.0-pre.0 → 7.11.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.
Files changed (32) hide show
  1. package/CHANGELOG.md +20 -3
  2. package/dist/{production/chunk-M5W3Q3T5.js → development/chunk-2JY4UAJA.js} +93 -93
  3. package/dist/{production/chunk-YGB3JEIP.js → development/chunk-GNDLROV6.js} +7 -7
  4. package/dist/development/{chunk-KRMLYMWA.mjs → chunk-JMJ3UQ3L.mjs} +2 -2
  5. package/dist/development/{chunk-UO7KGW2U.js → chunk-SZQUWNVJ.js} +1 -1
  6. package/dist/{production/chunk-J4JITZ76.mjs → development/chunk-YNUBSHFH.mjs} +2 -2
  7. package/dist/development/dom-export.js +27 -27
  8. package/dist/development/dom-export.mjs +3 -3
  9. package/dist/development/index-react-server-client.js +4 -4
  10. package/dist/development/index-react-server-client.mjs +2 -2
  11. package/dist/development/index-react-server.js +1 -1
  12. package/dist/development/index-react-server.mjs +1 -1
  13. package/dist/development/index.js +82 -82
  14. package/dist/development/index.mjs +3 -3
  15. package/dist/development/lib/types/internal.js +1 -1
  16. package/dist/development/lib/types/internal.mjs +1 -1
  17. package/dist/production/{chunk-AO22ZXHI.js → chunk-2HFJAX7U.js} +1 -1
  18. package/dist/{development/chunk-OVG6YSZ5.js → production/chunk-BEXOWXJO.js} +7 -7
  19. package/dist/{development/chunk-QMKP6CC3.mjs → production/chunk-E6GYEQUT.mjs} +2 -2
  20. package/dist/production/{chunk-IDHO4Q57.mjs → chunk-TINMVEA2.mjs} +2 -2
  21. package/dist/{development/chunk-JKMHOZYW.js → production/chunk-ZMYPVUNZ.js} +93 -93
  22. package/dist/production/dom-export.js +27 -27
  23. package/dist/production/dom-export.mjs +3 -3
  24. package/dist/production/index-react-server-client.js +4 -4
  25. package/dist/production/index-react-server-client.mjs +2 -2
  26. package/dist/production/index-react-server.js +1 -1
  27. package/dist/production/index-react-server.mjs +1 -1
  28. package/dist/production/index.js +82 -82
  29. package/dist/production/index.mjs +3 -3
  30. package/dist/production/lib/types/internal.js +1 -1
  31. package/dist/production/lib/types/internal.mjs +1 -1
  32. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # `react-router`
2
2
 
3
- ## 7.11.0-pre.0
3
+ ## 7.11.0
4
4
 
5
5
  ### Minor Changes
6
6
 
@@ -9,23 +9,30 @@
9
9
  ### Patch Changes
10
10
 
11
11
  - add support for throwing redirect Response's at RSC render time ([#14596](https://github.com/remix-run/react-router/pull/14596))
12
+
12
13
  - Support for throwing `data()` and Response from server component render phase. Response body is not serialized as async work is not allowed as error encoding phase. If you wish to transmit data to the boundary, throw `data()` instead. ([#14632](https://github.com/remix-run/react-router/pull/14632))
14
+
13
15
  - Fix `unstable_useTransitions` prop on `<Router>` component to permit omission for backewards compatibility ([#14646](https://github.com/remix-run/react-router/pull/14646))
16
+
14
17
  - `routeRSCServerRequest` replace `fetchServer` with `serverResponse` ([#14597](https://github.com/remix-run/react-router/pull/14597))
15
- - [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))
18
+
19
+ - \[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))
16
20
 
17
21
  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.
22
+
18
23
  - `<Form method="post" unstable_defaultShouldRevalidate={false}>`
19
24
  - `submit(data, { method: "post", unstable_defaultShouldRevalidate: false })`
20
25
  - `<fetcher.Form method="post" unstable_defaultShouldRevalidate={false}>`
21
26
  - `fetcher.submit(data, { method: "post", unstable_defaultShouldRevalidate: false })`
22
27
 
23
28
  This is also available on non-submission APIs that may trigger revalidations due to changing search params:
29
+
24
30
  - `<Link to="/" unstable_defaultShouldRevalidate={false}>`
25
31
  - `navigate("/?foo=bar", { unstable_defaultShouldRevalidate: false })`
26
32
  - `setSearchParams(params, { unstable_defaultShouldRevalidate: false })`
27
33
 
28
34
  - Allow redirects to be returned from client side middleware ([#14598](https://github.com/remix-run/react-router/pull/14598))
35
+
29
36
  - Handle `dataStrategy` implementations that return insufficient result sets by adding errors for routes without any available result ([#14627](https://github.com/remix-run/react-router/pull/14627))
30
37
 
31
38
  ## 7.10.1
@@ -42,6 +49,7 @@
42
49
  - ⚠️ This is a breaking change if you have begun using `fetcher.unstable_reset()`
43
50
 
44
51
  - Stabilize the `dataStrategy` `match.shouldRevalidateArgs`/`match.shouldCallHandler()` APIs. ([#14592](https://github.com/remix-run/react-router/pull/14592))
52
+
45
53
  - The `match.shouldLoad` API is now marked deprecated in favor of these more powerful alternatives
46
54
 
47
55
  - If you're using this API in a custom `dataStrategy` today, you can swap to the new API at your convenience:
@@ -170,6 +178,7 @@
170
178
  - Ensure action handlers run for routes with middleware even if no loader is present ([#14443](https://github.com/remix-run/react-router/pull/14443))
171
179
 
172
180
  - 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))
181
+
173
182
  - Framework Mode:
174
183
  - `entry.server.tsx`: `export const unstable_instrumentations = [...]`
175
184
  - `entry.client.tsx`: `<HydratedRouter unstable_instrumentations={[...]} />`
@@ -331,6 +340,7 @@
331
340
  - Stabilize middleware and context APIs. ([#14215](https://github.com/remix-run/react-router/pull/14215))
332
341
 
333
342
  We have removed the `unstable_` prefix from the following APIs and they are now considered stable and ready for production use:
343
+
334
344
  - [`RouterContextProvider`](https://reactrouter.com/api/utils/RouterContextProvider)
335
345
  - [`createContext`](https://reactrouter.com/api/utils/createContext)
336
346
  - `createBrowserRouter` [`getContext`](https://reactrouter.com/api/data-routers/createBrowserRouter#optsgetcontext) option
@@ -357,7 +367,7 @@
357
367
 
358
368
  - \[UNSTABLE] Add `<RouterProvider unstable_onError>`/`<HydratedRouter unstable_onError>` prop for client side error reporting ([#14162](https://github.com/remix-run/react-router/pull/14162))
359
369
 
360
- - server action revalidation opt out via $SKIP_REVALIDATION field ([#14154](https://github.com/remix-run/react-router/pull/14154))
370
+ - server action revalidation opt out via $SKIP\_REVALIDATION field ([#14154](https://github.com/remix-run/react-router/pull/14154))
361
371
 
362
372
  - Properly escape interpolated param values in `generatePath()` ([#13530](https://github.com/remix-run/react-router/pull/13530))
363
373
 
@@ -406,6 +416,7 @@
406
416
  - Remove dependency on `@types/node` in TypeScript declaration files ([#14059](https://github.com/remix-run/react-router/pull/14059))
407
417
 
408
418
  - Fix types for `UIMatch` to reflect that the `loaderData`/`data` properties may be `undefined` ([#12206](https://github.com/remix-run/react-router/pull/12206))
419
+
409
420
  - 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
410
421
  - 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
411
422
  - ⚠️ 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.
@@ -439,6 +450,7 @@
439
450
  - \[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))
440
451
 
441
452
  - \[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))
453
+
442
454
  - The API has been renamed to `unstable_generateMiddlewareResponse` for clarity
443
455
  - 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
444
456
  - The `query` version of the API now has a signature of `(query: (r: Request) => Promise<StaticHandlerContext | Response>) => Promise<Response>`
@@ -1084,6 +1096,7 @@
1084
1096
  ```
1085
1097
 
1086
1098
  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:
1099
+
1087
1100
  - Library mode - `createBrowserRouter(routes, { unstable_getContext })`
1088
1101
  - Framework mode - `<HydratedRouter unstable_getContext>`
1089
1102
 
@@ -1271,6 +1284,7 @@ _No changes_
1271
1284
  - Remove `future.v7_normalizeFormMethod` future flag ([#11697](https://github.com/remix-run/react-router/pull/11697))
1272
1285
 
1273
1286
  - 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))
1287
+
1274
1288
  - `createCookie`
1275
1289
  - `createCookieSessionStorage`
1276
1290
  - `createMemorySessionStorage`
@@ -1279,6 +1293,7 @@ _No changes_
1279
1293
  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)
1280
1294
 
1281
1295
  Since platform-specific packages no longer need to implement this API, the following low-level APIs have been removed:
1296
+
1282
1297
  - `createCookieFactory`
1283
1298
  - `createSessionStorageFactory`
1284
1299
  - `createCookieSessionStorageFactory`
@@ -1434,6 +1449,7 @@ _No changes_
1434
1449
  ```
1435
1450
 
1436
1451
  This initial implementation targets type inference for:
1452
+
1437
1453
  - `Params` : Path parameters from your routing config in `routes.ts` including file-based routing
1438
1454
  - `LoaderData` : Loader data from `loader` and/or `clientLoader` within your route module
1439
1455
  - `ActionData` : Action data from `action` and/or `clientAction` within your route module
@@ -1448,6 +1464,7 @@ _No changes_
1448
1464
  ```
1449
1465
 
1450
1466
  Check out our docs for more:
1467
+
1451
1468
  - [_Explanations > Type Safety_](https://reactrouter.com/dev/guides/explanation/type-safety)
1452
1469
  - [_How-To > Setting up type safety_](https://reactrouter.com/dev/guides/how-to/setting-up-type-safety)
1453
1470