react-router 7.8.0-pre.3 → 7.8.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 +48 -51
- package/dist/development/{chunk-EMJKA2DP.js → chunk-EVX7OBGB.js} +1 -1
- package/dist/{production/chunk-FAP2Y6DN.mjs → development/chunk-HZX6U7MI.mjs} +2 -2
- package/dist/{production/chunk-P3LQNPHZ.js → development/chunk-VC6RBZTR.js} +130 -130
- package/dist/development/{chunk-3R2RUFHW.mjs → chunk-ZYFC6VSF.mjs} +2 -2
- package/dist/development/dom-export.js +3 -3
- 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 +98 -98
- 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-3DLLP6EB.js → chunk-BOD6JCOU.js} +1 -1
- package/dist/{development/chunk-XMXDJESK.js → production/chunk-O6DRQPUD.js} +130 -130
- package/dist/production/{chunk-3DKAIR2L.mjs → chunk-SIHON65V.mjs} +2 -2
- package/dist/{development/chunk-CQQ53FN5.mjs → production/chunk-XPGU3ZMH.mjs} +2 -2
- package/dist/production/dom-export.js +3 -3
- 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 +98 -98
- 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,42 +1,60 @@
|
|
|
1
1
|
# `react-router`
|
|
2
2
|
|
|
3
|
-
## 7.8.0
|
|
3
|
+
## 7.8.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Add `nonce` prop to `Links` & `PrefetchPageLinks` ([#14048](https://github.com/remix-run/react-router/pull/14048))
|
|
8
|
+
- Add `loaderData` arguments/properties alongside existing `data` arguments/properties to provide consistency and clarity between `loaderData` and `actionData` across the board ([#14047](https://github.com/remix-run/react-router/pull/14047))
|
|
9
|
+
- Updated types: `Route.MetaArgs`, `Route.MetaMatch`, `MetaArgs`, `MetaMatch`, `Route.ComponentProps.matches`, `UIMatch`
|
|
10
|
+
- `@deprecated` warnings have been added to the existing `data` properties to point users to new `loaderData` properties, in preparation for removing the `data` properties in a future major release
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
|
6
13
|
|
|
14
|
+
- Prevent _"Did not find corresponding fetcher result"_ console error when navigating during a `fetcher.submit` revalidation ([#14114](https://github.com/remix-run/react-router/pull/14114))
|
|
15
|
+
|
|
7
16
|
- Bubble client-side middleware errors prior to `next` to the appropriate ancestor error boundary ([#14138](https://github.com/remix-run/react-router/pull/14138))
|
|
8
17
|
|
|
9
|
-
|
|
18
|
+
- Switch Lazy Route Discovery manifest URL generation to usea standalone `URLSearchParams` instance instead of `URL.searchParams` to avoid a major performance bottleneck in Chrome ([#14084](https://github.com/remix-run/react-router/pull/14084))
|
|
10
19
|
|
|
11
|
-
|
|
20
|
+
- Adjust internal RSC usage of `React.use` to avoid Webpack compilation errors when using React 18 ([#14113](https://github.com/remix-run/react-router/pull/14113))
|
|
12
21
|
|
|
13
|
-
-
|
|
22
|
+
- Remove dependency on `@types/node` in TypeScript declaration files ([#14059](https://github.com/remix-run/react-router/pull/14059))
|
|
14
23
|
|
|
15
|
-
|
|
24
|
+
- Fix types for `UIMatch` to reflect that the `loaderData`/`data` properties may be `undefined` ([#12206](https://github.com/remix-run/react-router/pull/12206))
|
|
25
|
+
- 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
|
|
26
|
+
- 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
|
|
27
|
+
- ⚠️ 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.
|
|
16
28
|
|
|
17
|
-
|
|
29
|
+
```tsx
|
|
30
|
+
// app/root.tsx
|
|
31
|
+
export function loader() {
|
|
32
|
+
someFunctionThatThrows(); // ❌ Throws an Error
|
|
33
|
+
return { title: "My Title" };
|
|
34
|
+
}
|
|
18
35
|
|
|
19
|
-
|
|
36
|
+
export function Layout({ children }: { children: React.ReactNode }) {
|
|
37
|
+
let matches = useMatches();
|
|
38
|
+
let rootMatch = matches[0] as UIMatch<Awaited<ReturnType<typeof loader>>>;
|
|
39
|
+
// ^ rootMatch.data is incorrectly typed here, so TypeScript does not
|
|
40
|
+
// complain if you do the following which throws an error at runtime:
|
|
41
|
+
let { title } = rootMatch.data; // 💥
|
|
20
42
|
|
|
21
|
-
|
|
43
|
+
return <html>...</html>;
|
|
44
|
+
}
|
|
45
|
+
```
|
|
22
46
|
|
|
23
|
-
|
|
47
|
+
- \[UNSTABLE] Ensure resource route errors go through `handleError` w/middleware enabled ([#14078](https://github.com/remix-run/react-router/pull/14078))
|
|
24
48
|
|
|
25
|
-
-
|
|
26
|
-
- Add `loaderData` arguments/properties alongside existing `data` arguments/properties to provide consistency and clarity between `loaderData` and `actionData` across the board ([#14047](https://github.com/remix-run/react-router/pull/14047))
|
|
27
|
-
- Updated types: `Route.MetaArgs`, `Route.MetaMatch`, `MetaArgs`, `MetaMatch`, `Route.ComponentProps.matches`, `UIMatch`
|
|
28
|
-
- `@deprecated` warnings have been added to the existing `data` properties to point users to new `loaderData` properties, in preparation for removing the `data` properties in a future major release
|
|
49
|
+
- \[UNSTABLE] Propagate returned Response from server middleware if next wasn't called ([#14093](https://github.com/remix-run/react-router/pull/14093))
|
|
29
50
|
|
|
30
|
-
|
|
51
|
+
- \[UNSTABLE] Allow server middlewares to return `data()` values which will be converted into a `Response` ([#14093](https://github.com/remix-run/react-router/pull/14093))
|
|
31
52
|
|
|
32
|
-
- [UNSTABLE]
|
|
33
|
-
|
|
34
|
-
-
|
|
35
|
-
|
|
36
|
-
- [UNSTABLE]
|
|
37
|
-
- [UNSTABLE] Update middleware error handling so that the `next` function never throws and instead handles any middleware errors at the proper `ErrorBoundary` and returns the `Response` up through the ancestor `next` function ([#14118](https://github.com/remix-run/react-router/pull/14118))
|
|
38
|
-
- - [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))
|
|
39
|
-
- [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))
|
|
53
|
+
- \[UNSTABLE] Update middleware error handling so that the `next` function never throws and instead handles any middleware errors at the proper `ErrorBoundary` and returns the `Response` up through the ancestor `next` function ([#14118](https://github.com/remix-run/react-router/pull/14118))
|
|
54
|
+
|
|
55
|
+
- \[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))
|
|
56
|
+
|
|
57
|
+
- \[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))
|
|
40
58
|
- The API has been renamed to `unstable_generateMiddlewareResponse` for clarity
|
|
41
59
|
- 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
|
|
42
60
|
- The `query` version of the API now has a signature of `(query: (r: Request) => Promise<StaticHandlerContext | Response>) => Promise<Response>`
|
|
@@ -63,41 +81,20 @@
|
|
|
63
81
|
});
|
|
64
82
|
```
|
|
65
83
|
|
|
66
|
-
- [UNSTABLE] Convert internal middleware implementations to use the new `unstable_generateMiddlewareResponse` API ([#14103](https://github.com/remix-run/react-router/pull/14103))
|
|
67
|
-
|
|
68
|
-
- [UNSTABLE] Change `getLoadContext` signature (`type GetLoadContextFunction`) when `future.unstable_middleware` is enabled so that it returns an `unstable_RouterContextProvider` instance instead of a `Map` used to contruct the instance internally ([#14097](https://github.com/remix-run/react-router/pull/14097))
|
|
84
|
+
- \[UNSTABLE] Convert internal middleware implementations to use the new `unstable_generateMiddlewareResponse` API ([#14103](https://github.com/remix-run/react-router/pull/14103))
|
|
85
|
+
|
|
86
|
+
- \[UNSTABLE] Change `getLoadContext` signature (`type GetLoadContextFunction`) when `future.unstable_middleware` is enabled so that it returns an `unstable_RouterContextProvider` instance instead of a `Map` used to contruct the instance internally ([#14097](https://github.com/remix-run/react-router/pull/14097))
|
|
69
87
|
- This also removes the `type unstable_InitialContext` export
|
|
70
88
|
- ⚠️ This is a breaking change if you have adopted middleware and are using a custom server with a `getLoadContext` function
|
|
71
89
|
|
|
72
|
-
-
|
|
73
|
-
- Fix types for `UIMatch` to reflect that the `loaderData`/`data` properties may be `undefined` ([#12206](https://github.com/remix-run/react-router/pull/12206))
|
|
74
|
-
- 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
|
|
75
|
-
- 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
|
|
76
|
-
- ⚠️ 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.
|
|
77
|
-
|
|
78
|
-
```tsx
|
|
79
|
-
// app/root.tsx
|
|
80
|
-
export function loader() {
|
|
81
|
-
someFunctionThatThrows(); // ❌ Throws an Error
|
|
82
|
-
return { title: "My Title" };
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
export function Layout({ children }: { children: React.ReactNode }) {
|
|
86
|
-
let matches = useMatches();
|
|
87
|
-
let rootMatch = matches[0] as UIMatch<Awaited<ReturnType<typeof loader>>>;
|
|
88
|
-
// ^ rootMatch.data is incorrectly typed here, so TypeScript does not
|
|
89
|
-
// complain if you do the following which throws an error at runtime:
|
|
90
|
-
let { title } = rootMatch.data; // 💥
|
|
91
|
-
|
|
92
|
-
return <html>...</html>;
|
|
93
|
-
}
|
|
94
|
-
```
|
|
90
|
+
- \[UNSTABLE] Run client middleware on client navigations even if no loaders exist ([#14106](https://github.com/remix-run/react-router/pull/14106))
|
|
95
91
|
|
|
96
|
-
- [UNSTABLE]
|
|
97
|
-
- [UNSTABLE] Change the `unstable_getContext` signature on `RouterProvider`/`HydratedRouter`/`unstable_RSCHydratedRouter` so that it returns an `unstable_RouterContextProvider` instance instead of a `Map` used to contruct the instance internally ([#14097](https://github.com/remix-run/react-router/pull/14097))
|
|
92
|
+
- \[UNSTABLE] Change the `unstable_getContext` signature on `RouterProvider`/`HydratedRouter`/`unstable_RSCHydratedRouter` so that it returns an `unstable_RouterContextProvider` instance instead of a `Map` used to contruct the instance internally ([#14097](https://github.com/remix-run/react-router/pull/14097))
|
|
98
93
|
- ⚠️ This is a breaking change if you have adopted the `unstable_getContext` prop
|
|
99
94
|
|
|
100
|
-
-
|
|
95
|
+
- [UNSTABLE] proxy server action side-effect redirects from actions for document and callServer requests ([#14131](https://github.com/remix-run/react-router/pull/14131))
|
|
96
|
+
|
|
97
|
+
- [UNSTABLE] Fix RSC Data Mode issue where routes that return `false` from `shouldRevalidate` would be replaced by an `<Outlet />` ([#14071](https://github.com/remix-run/react-router/pull/14071))
|
|
101
98
|
|
|
102
99
|
## 7.7.1
|
|
103
100
|
|
|
@@ -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.8.0
|
|
2
|
+
* react-router v7.8.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v7.8.0
|
|
2
|
+
* react-router v7.8.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -57,7 +57,7 @@ import {
|
|
|
57
57
|
withComponentProps,
|
|
58
58
|
withErrorBoundaryProps,
|
|
59
59
|
withHydrateFallbackProps
|
|
60
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-ZYFC6VSF.mjs";
|
|
61
61
|
|
|
62
62
|
// lib/dom/ssr/server.tsx
|
|
63
63
|
import * as React from "react";
|