Skip to content

Commit a8598d9

Browse files
committed
Update release notes
1 parent c924186 commit a8598d9

File tree

1 file changed

+22
-18
lines changed

1 file changed

+22
-18
lines changed

CHANGELOG.md

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ We manage release notes in this file instead of the paginated Github Releases Pa
1919
- [Unstable Changes](#unstable-changes)
2020
- [Middleware (unstable)](#middleware-unstable)
2121
- [Client-side `context` (unstable)](#client-side-context-unstable)
22+
- [`unstable_SerializesTo`](#unstable_serializesto)
2223
- [Changes by Package](#changes-by-package)
2324
- [v7.2.0](#v720)
2425
- [What's Changed](#whats-changed)
@@ -333,26 +334,12 @@ Date: 2025-03-06
333334
- `react-router` - Support middleware on routes (unstable) ([#12941](https://github.com/remix-run/react-router/pull/12941))
334335
- See below for more information
335336
- `react-router` - Add `context` support to client side data routers (unstable) ([#12941](https://github.com/remix-run/react-router/pull/12941))
337+
- See below for more information
338+
- `react-router` - Fix types for `loaderData` and `actionData` that contained `Record`s ([#13139](https://github.com/remix-run/react-router/pull/13139))
339+
- ⚠️ This is a breaking change for users who have already adopted `unstable_SerializesTo`
340+
- See below for more information
336341
- `@react-router/dev` - Fix errors with `future.unstable_viteEnvironmentApi` when the `ssr` environment has been configured by another plugin to be a custom `Vite.DevEnvironment` rather than the default `Vite.RunnableDevEnvironment` ([#13008](https://github.com/remix-run/react-router/pull/13008))
337342
- `@react-router/dev` - When `future.unstable_viteEnvironmentApi` is enabled and the `ssr` environment has `optimizeDeps.noDiscovery` disabled, define `optimizeDeps.entries` and `optimizeDeps.include` ([#13007](https://github.com/remix-run/react-router/pull/13007))
338-
- Fix types for `loaderData` and `actionData` that contained `Record`s ([#13139](https://github.com/remix-run/react-router/pull/13139))
339-
340-
- ⚠️ This is a breaking change for users who have already adopted `unstable_SerializesTo`
341-
- `unstable_SerializesTo` added a way to register custom serialization types in Single Fetch for other library and framework authors like Apollo
342-
- It was implemented with branded type whose branded property that was made optional so that casting arbitrary values was easy:
343-
344-
```ts
345-
// without the brand being marked as optional
346-
let x1 = 42 as unknown as unstable_SerializesTo<number>;
347-
// ^^^^^^^^^^
348-
349-
// with the brand being marked as optional
350-
let x2 = 42 as unstable_SerializesTo<number>;
351-
```
352-
353-
- However, this broke type inference in `loaderData` and `actionData` for any `Record` types as those would now (incorrectly) match `unstable_SerializesTo` - this affected all users, not just those that depended on `unstable_SerializesTo`
354-
- To fix this, the branded property of `unstable_SerializesTo` is marked as required instead of optional
355-
- For library and framework authors using `unstable_SerializesTo`, you may need to add `as unknown` casts before casting to `unstable_SerializesTo`
356343

357344
#### Middleware (unstable)
358345

@@ -579,6 +566,23 @@ function unstable_getContext() {
579566
}
580567
```
581568

569+
#### `unstable_SerializesTo`
570+
571+
`unstable_SerializesTo` added a way to register custom serialization types in Single Fetch for other library and framework authors like Apollo. It was implemented with branded type whose branded property that was made optional so that casting arbitrary values was easy:
572+
573+
```ts
574+
// without the brand being marked as optional
575+
let x1 = 42 as unknown as unstable_SerializesTo<number>;
576+
// ^^^^^^^^^^
577+
578+
// with the brand being marked as optional
579+
let x2 = 42 as unstable_SerializesTo<number>;
580+
```
581+
582+
However, this broke type inference in `loaderData` and `actionData` for any `Record` types as those would now (incorrectly) match `unstable_SerializesTo`. This affected all users, not just those that depended on `unstable_SerializesTo`. To fix this, the branded property of `unstable_SerializesTo` is marked as required instead of optional.
583+
584+
For library and framework authors using `unstable_SerializesTo`, you may need to add `as unknown` casts before casting to `unstable_SerializesTo`.
585+
582586
### Changes by Package
583587

584588
- [`create-react-router`](https://github.com/remix-run/react-router/blob/react-router%407.3.0/packages/create-react-router/CHANGELOG.md#730)

0 commit comments

Comments
 (0)