react-router 7.10.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.
Files changed (32) hide show
  1. package/CHANGELOG.md +17 -1
  2. package/dist/development/{chunk-26EFLBGX.js → chunk-FKYGG5Z2.js} +7 -7
  3. package/dist/{production/chunk-J25F7BL4.js → development/chunk-HMTWJNYB.js} +94 -94
  4. package/dist/development/{chunk-INCZGKXY.mjs → chunk-PMGK554W.mjs} +2 -2
  5. package/dist/development/{chunk-54KWOGSJ.js → chunk-RBZI3ZHD.js} +3 -2
  6. package/dist/development/{chunk-FGUA77HG.mjs → chunk-WWGJGFF6.mjs} +4 -3
  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 +76 -76
  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-RNH4J7KQ.mjs → chunk-ANIOYBQK.mjs} +4 -3
  18. package/dist/{development/chunk-AWUYHSQU.js → production/chunk-B3F6YMOF.js} +94 -94
  19. package/dist/production/{chunk-MFC2CGJA.mjs → chunk-TDCOAFPJ.mjs} +2 -2
  20. package/dist/production/{chunk-SKXBY33F.js → chunk-UQPBOMFP.js} +3 -2
  21. package/dist/production/{chunk-EKXDIDQN.js → chunk-YO5R3LGQ.js} +7 -7
  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 +76 -76
  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,5 +1,11 @@
1
1
  # `react-router`
2
2
 
3
+ ## 7.10.1
4
+
5
+ ### Patch Changes
6
+
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
+
3
9
  ## 7.10.0
4
10
 
5
11
  ### Minor Changes
@@ -8,6 +14,7 @@
8
14
  - ⚠️ This is a breaking change if you have begun using `fetcher.unstable_reset()`
9
15
 
10
16
  - Stabilize the `dataStrategy` `match.shouldRevalidateArgs`/`match.shouldCallHandler()` APIs. ([#14592](https://github.com/remix-run/react-router/pull/14592))
17
+
11
18
  - The `match.shouldLoad` API is now marked deprecated in favor of these more powerful alternatives
12
19
 
13
20
  - If you're using this API in a custom `dataStrategy` today, you can swap to the new API at your convenience:
@@ -136,6 +143,7 @@
136
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))
137
144
 
138
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
+
139
147
  - Framework Mode:
140
148
  - `entry.server.tsx`: `export const unstable_instrumentations = [...]`
141
149
  - `entry.client.tsx`: `<HydratedRouter unstable_instrumentations={[...]} />`
@@ -297,6 +305,7 @@
297
305
  - Stabilize middleware and context APIs. ([#14215](https://github.com/remix-run/react-router/pull/14215))
298
306
 
299
307
  We have removed the `unstable_` prefix from the following APIs and they are now considered stable and ready for production use:
308
+
300
309
  - [`RouterContextProvider`](https://reactrouter.com/api/utils/RouterContextProvider)
301
310
  - [`createContext`](https://reactrouter.com/api/utils/createContext)
302
311
  - `createBrowserRouter` [`getContext`](https://reactrouter.com/api/data-routers/createBrowserRouter#optsgetcontext) option
@@ -323,7 +332,7 @@
323
332
 
324
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))
325
334
 
326
- - server action revalidation opt out via $SKIP_REVALIDATION field ([#14154](https://github.com/remix-run/react-router/pull/14154))
335
+ - server action revalidation opt out via $SKIP\_REVALIDATION field ([#14154](https://github.com/remix-run/react-router/pull/14154))
327
336
 
328
337
  - Properly escape interpolated param values in `generatePath()` ([#13530](https://github.com/remix-run/react-router/pull/13530))
329
338
 
@@ -372,6 +381,7 @@
372
381
  - Remove dependency on `@types/node` in TypeScript declaration files ([#14059](https://github.com/remix-run/react-router/pull/14059))
373
382
 
374
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
+
375
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
376
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
377
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.
@@ -405,6 +415,7 @@
405
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))
406
416
 
407
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
+
408
419
  - The API has been renamed to `unstable_generateMiddlewareResponse` for clarity
409
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
410
421
  - The `query` version of the API now has a signature of `(query: (r: Request) => Promise<StaticHandlerContext | Response>) => Promise<Response>`
@@ -1050,6 +1061,7 @@
1050
1061
  ```
1051
1062
 
1052
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
+
1053
1065
  - Library mode - `createBrowserRouter(routes, { unstable_getContext })`
1054
1066
  - Framework mode - `<HydratedRouter unstable_getContext>`
1055
1067
 
@@ -1237,6 +1249,7 @@ _No changes_
1237
1249
  - Remove `future.v7_normalizeFormMethod` future flag ([#11697](https://github.com/remix-run/react-router/pull/11697))
1238
1250
 
1239
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
+
1240
1253
  - `createCookie`
1241
1254
  - `createCookieSessionStorage`
1242
1255
  - `createMemorySessionStorage`
@@ -1245,6 +1258,7 @@ _No changes_
1245
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)
1246
1259
 
1247
1260
  Since platform-specific packages no longer need to implement this API, the following low-level APIs have been removed:
1261
+
1248
1262
  - `createCookieFactory`
1249
1263
  - `createSessionStorageFactory`
1250
1264
  - `createCookieSessionStorageFactory`
@@ -1400,6 +1414,7 @@ _No changes_
1400
1414
  ```
1401
1415
 
1402
1416
  This initial implementation targets type inference for:
1417
+
1403
1418
  - `Params` : Path parameters from your routing config in `routes.ts` including file-based routing
1404
1419
  - `LoaderData` : Loader data from `loader` and/or `clientLoader` within your route module
1405
1420
  - `ActionData` : Action data from `action` and/or `clientAction` within your route module
@@ -1414,6 +1429,7 @@ _No changes_
1414
1429
  ```
1415
1430
 
1416
1431
  Check out our docs for more:
1432
+
1417
1433
  - [_Explanations > Type Safety_](https://reactrouter.com/dev/guides/explanation/type-safety)
1418
1434
  - [_How-To > Setting up type safety_](https://reactrouter.com/dev/guides/how-to/setting-up-type-safety)
1419
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.0
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 _chunk54KWOGSJjs = require('./chunk-54KWOGSJ.js');
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 = _chunk54KWOGSJjs.matchRoutes.call(void 0, routes, location, basename);
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 (_chunk54KWOGSJjs.shouldHydrateRouteLoader.call(void 0,
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 (_chunk54KWOGSJjs.isRouteErrorResponse.call(void 0, error)) {
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
- _chunk54KWOGSJjs.ENABLE_DEV_WARNINGS ? heyDeveloper : null
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 = _chunk54KWOGSJjs.useRouteError.call(void 0, );
149
+ let error = _chunkRBZI3ZHDjs.useRouteError.call(void 0, );
150
150
  if (hasRootLayout === void 0) {
151
151
  throw new Error("Missing 'hasRootLayout' prop");
152
152
  }