Skip to content

Commit 3e04864

Browse files
committed
Update release notes
1 parent 403abbc commit 3e04864

File tree

2 files changed

+34
-41
lines changed

2 files changed

+34
-41
lines changed

packages/create-react-router/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## 7.8.0
44

5+
_No changes_
6+
57
## 7.7.1
68

79
_No changes_

packages/react-router/CHANGELOG.md

Lines changed: 32 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,50 @@
1111

1212
### Patch Changes
1313

14-
- \[UNSTABLE] Ensure resource route errors go through `handleError` w/middleware enabled ([#14078](https://github.com/remix-run/react-router/pull/14078))
15-
16-
- \[REMOVE] Few additional fixes for returning/throwing data from middleware - attach to #14093 ([#14128](https://github.com/remix-run/react-router/pull/14128))
17-
1814
- 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))
1915

2016
- Bubble client-side middleware errors prior to `next` to the appropriate ancestor error boundary ([#14138](https://github.com/remix-run/react-router/pull/14138))
2117

2218
- 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))
2319

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))
21+
22+
- Remove dependency on `@types/node` in TypeScript declaration files ([#14059](https://github.com/remix-run/react-router/pull/14059))
23+
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.
28+
29+
```tsx
30+
// app/root.tsx
31+
export function loader() {
32+
someFunctionThatThrows(); // ❌ Throws an Error
33+
return { title: "My Title" };
34+
}
35+
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; // 💥
42+
43+
return <html>...</html>;
44+
}
45+
```
46+
47+
- \[UNSTABLE] Ensure resource route errors go through `handleError` w/middleware enabled ([#14078](https://github.com/remix-run/react-router/pull/14078))
48+
2449
- \[UNSTABLE] Propagate returned Response from server middleware if next wasn't called ([#14093](https://github.com/remix-run/react-router/pull/14093))
2550

2651
- \[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))
2752

2853
- \[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))
2954

30-
- - \[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))
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))
3156

3257
- \[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))
33-
3458
- The API has been renamed to `unstable_generateMiddlewareResponse` for clarity
3559
- 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
3660
- The `query` version of the API now has a signature of `(query: (r: Request) => Promise<StaticHandlerContext | Response>) => Promise<Response>`
@@ -59,46 +83,18 @@
5983

6084
- \[UNSTABLE] Convert internal middleware implementations to use the new `unstable_generateMiddlewareResponse` API ([#14103](https://github.com/remix-run/react-router/pull/14103))
6185

62-
- 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))
63-
6486
- \[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))
6587
- This also removes the `type unstable_InitialContext` export
6688
- ⚠️ This is a breaking change if you have adopted middleware and are using a custom server with a `getLoadContext` function
6789

68-
- Remove dependency on `@types/node` in TypeScript declaration files ([#14059](https://github.com/remix-run/react-router/pull/14059))
69-
70-
- Fix types for `UIMatch` to reflect that the `loaderData`/`data` properties may be `undefined` ([#12206](https://github.com/remix-run/react-router/pull/12206))
71-
72-
- 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
73-
- 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
74-
- ⚠️ 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.
75-
76-
```tsx
77-
// app/root.tsx
78-
export function loader() {
79-
someFunctionThatThrows(); // ❌ Throws an Error
80-
return { title: "My Title" };
81-
}
82-
83-
export function Layout({ children }: { children: React.ReactNode }) {
84-
let matches = useMatches();
85-
let rootMatch = matches[0] as UIMatch<Awaited<ReturnType<typeof loader>>>;
86-
// ^ rootMatch.data is incorrectly typed here, so TypeScript does not
87-
// complain if you do the following which throws an error at runtime:
88-
let { title } = rootMatch.data; // 💥
89-
90-
return <html>...</html>;
91-
}
92-
```
93-
9490
- \[UNSTABLE] Run client middleware on client navigations even if no loaders exist ([#14106](https://github.com/remix-run/react-router/pull/14106))
9591

9692
- \[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))
9793
- ⚠️ This is a breaking change if you have adopted the `unstable_getContext` prop
9894

99-
- proxy server action side-effect redirects from actions for document and callServer requests ([#14131](https://github.com/remix-run/react-router/pull/14131))
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))
10096

101-
- 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))
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))
10298

10399
## 7.7.1
104100

@@ -704,7 +700,6 @@
704700
```
705701

706702
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:
707-
708703
- Library mode - `createBrowserRouter(routes, { unstable_getContext })`
709704
- Framework mode - `<HydratedRouter unstable_getContext>`
710705

@@ -892,7 +887,6 @@ _No changes_
892887
- Remove `future.v7_normalizeFormMethod` future flag ([#11697](https://github.com/remix-run/react-router/pull/11697))
893888

894889
- 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))
895-
896890
- `createCookie`
897891
- `createCookieSessionStorage`
898892
- `createMemorySessionStorage`
@@ -901,7 +895,6 @@ _No changes_
901895
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)
902896

903897
Since platform-specific packages no longer need to implement this API, the following low-level APIs have been removed:
904-
905898
- `createCookieFactory`
906899
- `createSessionStorageFactory`
907900
- `createCookieSessionStorageFactory`
@@ -1057,7 +1050,6 @@ _No changes_
10571050
```
10581051

10591052
This initial implementation targets type inference for:
1060-
10611053
- `Params` : Path parameters from your routing config in `routes.ts` including file-based routing
10621054
- `LoaderData` : Loader data from `loader` and/or `clientLoader` within your route module
10631055
- `ActionData` : Action data from `action` and/or `clientAction` within your route module
@@ -1072,7 +1064,6 @@ _No changes_
10721064
```
10731065

10741066
Check out our docs for more:
1075-
10761067
- [_Explanations > Type Safety_](https://reactrouter.com/dev/guides/explanation/type-safety)
10771068
- [_How-To > Setting up type safety_](https://reactrouter.com/dev/guides/how-to/setting-up-type-safety)
10781069

0 commit comments

Comments
 (0)