You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`react-router` - Support middleware on routes (unstable) ([#12941](https://github.com/remix-run/react-router/pull/12941))
334
335
- See below for more information
335
336
-`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
336
341
-`@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))
337
342
-`@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`
356
343
357
344
#### Middleware (unstable)
358
345
@@ -579,6 +566,23 @@ function unstable_getContext() {
579
566
}
580
567
```
581
568
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 =42asunknownasunstable_SerializesTo<number>;
576
+
// ^^^^^^^^^^
577
+
578
+
// with the brand being marked as optional
579
+
let x2 =42asunstable_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`.
0 commit comments