Skip to content

Commit 428ab74

Browse files
committedFeb 28, 2024·
Merge branch 'release-next'
2 parents 74f8676 + 78c843b commit 428ab74

File tree

13 files changed

+199
-57
lines changed

13 files changed

+199
-57
lines changed
 

‎CHANGELOG.md

+57-45
Original file line numberDiff line numberDiff line change
@@ -13,143 +13,145 @@ We manage release notes in this file instead of the paginated Github Releases Pa
1313
<summary>Table of Contents</summary>
1414

1515
- [React Router Releases](#react-router-releases)
16-
- [v6.22.1](#v6221)
16+
- [v6.22.2](#v6222)
1717
- [Patch Changes](#patch-changes)
18+
- [v6.22.1](#v6221)
19+
- [Patch Changes](#patch-changes-1)
1820
- [v6.22.0](#v6220)
1921
- [What's Changed](#whats-changed)
2022
- [Core Web Vitals Technology Report Flag](#core-web-vitals-technology-report-flag)
2123
- [Minor Changes](#minor-changes)
22-
- [Patch Changes](#patch-changes-1)
23-
- [v6.21.3](#v6213)
2424
- [Patch Changes](#patch-changes-2)
25-
- [v6.21.2](#v6212)
25+
- [v6.21.3](#v6213)
2626
- [Patch Changes](#patch-changes-3)
27-
- [v6.21.1](#v6211)
27+
- [v6.21.2](#v6212)
2828
- [Patch Changes](#patch-changes-4)
29+
- [v6.21.1](#v6211)
30+
- [Patch Changes](#patch-changes-5)
2931
- [v6.21.0](#v6210)
3032
- [What's Changed](#whats-changed-1)
3133
- [`future.v7_relativeSplatPath`](#futurev7_relativesplatpath)
3234
- [Partial Hydration](#partial-hydration)
3335
- [Minor Changes](#minor-changes-1)
34-
- [Patch Changes](#patch-changes-5)
35-
- [v6.20.1](#v6201)
3636
- [Patch Changes](#patch-changes-6)
37+
- [v6.20.1](#v6201)
38+
- [Patch Changes](#patch-changes-7)
3739
- [v6.20.0](#v6200)
3840
- [Minor Changes](#minor-changes-2)
39-
- [Patch Changes](#patch-changes-7)
41+
- [Patch Changes](#patch-changes-8)
4042
- [v6.19.0](#v6190)
4143
- [What's Changed](#whats-changed-2)
4244
- [`unstable_flushSync` API](#unstable_flushsync-api)
4345
- [Minor Changes](#minor-changes-3)
44-
- [Patch Changes](#patch-changes-8)
46+
- [Patch Changes](#patch-changes-9)
4547
- [v6.18.0](#v6180)
4648
- [What's Changed](#whats-changed-3)
4749
- [New Fetcher APIs](#new-fetcher-apis)
4850
- [Persistence Future Flag (`future.v7_fetcherPersist`)](#persistence-future-flag-futurev7_fetcherpersist)
4951
- [Minor Changes](#minor-changes-4)
50-
- [Patch Changes](#patch-changes-9)
52+
- [Patch Changes](#patch-changes-10)
5153
- [v6.17.0](#v6170)
5254
- [What's Changed](#whats-changed-4)
5355
- [View Transitions 🚀](#view-transitions-)
5456
- [Minor Changes](#minor-changes-5)
55-
- [Patch Changes](#patch-changes-10)
57+
- [Patch Changes](#patch-changes-11)
5658
- [v6.16.0](#v6160)
5759
- [Minor Changes](#minor-changes-6)
58-
- [Patch Changes](#patch-changes-11)
60+
- [Patch Changes](#patch-changes-12)
5961
- [v6.15.0](#v6150)
6062
- [Minor Changes](#minor-changes-7)
61-
- [Patch Changes](#patch-changes-12)
62-
- [v6.14.2](#v6142)
6363
- [Patch Changes](#patch-changes-13)
64-
- [v6.14.1](#v6141)
64+
- [v6.14.2](#v6142)
6565
- [Patch Changes](#patch-changes-14)
66+
- [v6.14.1](#v6141)
67+
- [Patch Changes](#patch-changes-15)
6668
- [v6.14.0](#v6140)
6769
- [What's Changed](#whats-changed-5)
6870
- [JSON/Text Submissions](#jsontext-submissions)
6971
- [Minor Changes](#minor-changes-8)
70-
- [Patch Changes](#patch-changes-15)
72+
- [Patch Changes](#patch-changes-16)
7173
- [v6.13.0](#v6130)
7274
- [What's Changed](#whats-changed-6)
7375
- [Minor Changes](#minor-changes-9)
74-
- [Patch Changes](#patch-changes-16)
75-
- [v6.12.1](#v6121)
7676
- [Patch Changes](#patch-changes-17)
77+
- [v6.12.1](#v6121)
78+
- [Patch Changes](#patch-changes-18)
7779
- [v6.12.0](#v6120)
7880
- [What's Changed](#whats-changed-7)
7981
- [`React.startTransition` support](#reactstarttransition-support)
8082
- [Minor Changes](#minor-changes-10)
81-
- [Patch Changes](#patch-changes-18)
82-
- [v6.11.2](#v6112)
8383
- [Patch Changes](#patch-changes-19)
84-
- [v6.11.1](#v6111)
84+
- [v6.11.2](#v6112)
8585
- [Patch Changes](#patch-changes-20)
86+
- [v6.11.1](#v6111)
87+
- [Patch Changes](#patch-changes-21)
8688
- [v6.11.0](#v6110)
8789
- [Minor Changes](#minor-changes-11)
88-
- [Patch Changes](#patch-changes-21)
90+
- [Patch Changes](#patch-changes-22)
8991
- [v6.10.0](#v6100)
9092
- [What's Changed](#whats-changed-8)
9193
- [Minor Changes](#minor-changes-12)
92-
- [Patch Changes](#patch-changes-22)
94+
- [Patch Changes](#patch-changes-23)
9395
- [v6.9.0](#v690)
9496
- [What's Changed](#whats-changed-9)
9597
- [`Component`/`ErrorBoundary` route properties](#componenterrorboundary-route-properties)
9698
- [Introducing Lazy Route Modules](#introducing-lazy-route-modules)
9799
- [Minor Changes](#minor-changes-13)
98-
- [Patch Changes](#patch-changes-23)
99-
- [v6.8.2](#v682)
100100
- [Patch Changes](#patch-changes-24)
101-
- [v6.8.1](#v681)
101+
- [v6.8.2](#v682)
102102
- [Patch Changes](#patch-changes-25)
103+
- [v6.8.1](#v681)
104+
- [Patch Changes](#patch-changes-26)
103105
- [v6.8.0](#v680)
104106
- [Minor Changes](#minor-changes-14)
105-
- [Patch Changes](#patch-changes-26)
107+
- [Patch Changes](#patch-changes-27)
106108
- [v6.7.0](#v670)
107109
- [Minor Changes](#minor-changes-15)
108-
- [Patch Changes](#patch-changes-27)
109-
- [v6.6.2](#v662)
110110
- [Patch Changes](#patch-changes-28)
111-
- [v6.6.1](#v661)
111+
- [v6.6.2](#v662)
112112
- [Patch Changes](#patch-changes-29)
113+
- [v6.6.1](#v661)
114+
- [Patch Changes](#patch-changes-30)
113115
- [v6.6.0](#v660)
114116
- [What's Changed](#whats-changed-10)
115117
- [Minor Changes](#minor-changes-16)
116-
- [Patch Changes](#patch-changes-30)
118+
- [Patch Changes](#patch-changes-31)
117119
- [v6.5.0](#v650)
118120
- [What's Changed](#whats-changed-11)
119121
- [Minor Changes](#minor-changes-17)
120-
- [Patch Changes](#patch-changes-31)
121-
- [v6.4.5](#v645)
122122
- [Patch Changes](#patch-changes-32)
123-
- [v6.4.4](#v644)
123+
- [v6.4.5](#v645)
124124
- [Patch Changes](#patch-changes-33)
125-
- [v6.4.3](#v643)
125+
- [v6.4.4](#v644)
126126
- [Patch Changes](#patch-changes-34)
127-
- [v6.4.2](#v642)
127+
- [v6.4.3](#v643)
128128
- [Patch Changes](#patch-changes-35)
129-
- [v6.4.1](#v641)
129+
- [v6.4.2](#v642)
130130
- [Patch Changes](#patch-changes-36)
131+
- [v6.4.1](#v641)
132+
- [Patch Changes](#patch-changes-37)
131133
- [v6.4.0](#v640)
132134
- [What's Changed](#whats-changed-12)
133135
- [Remix Data APIs](#remix-data-apis)
134-
- [Patch Changes](#patch-changes-37)
136+
- [Patch Changes](#patch-changes-38)
135137
- [v6.3.0](#v630)
136138
- [Minor Changes](#minor-changes-18)
137139
- [v6.2.2](#v622)
138-
- [Patch Changes](#patch-changes-38)
139-
- [v6.2.1](#v621)
140140
- [Patch Changes](#patch-changes-39)
141+
- [v6.2.1](#v621)
142+
- [Patch Changes](#patch-changes-40)
141143
- [v6.2.0](#v620)
142144
- [Minor Changes](#minor-changes-19)
143-
- [Patch Changes](#patch-changes-40)
144-
- [v6.1.1](#v611)
145145
- [Patch Changes](#patch-changes-41)
146+
- [v6.1.1](#v611)
147+
- [Patch Changes](#patch-changes-42)
146148
- [v6.1.0](#v610)
147149
- [Minor Changes](#minor-changes-20)
148-
- [Patch Changes](#patch-changes-42)
149-
- [v6.0.2](#v602)
150150
- [Patch Changes](#patch-changes-43)
151-
- [v6.0.1](#v601)
151+
- [v6.0.2](#v602)
152152
- [Patch Changes](#patch-changes-44)
153+
- [v6.0.1](#v601)
154+
- [Patch Changes](#patch-changes-45)
153155
- [v6.0.0](#v600)
154156

155157
</details>
@@ -173,6 +175,16 @@ Date: YYYY-MM-DD
173175
**Full Changelog**: [`v6.X.Y...v6.X.Y`](https://github.com/remix-run/react-router/compare/react-router@6.X.Y...react-router@6.X.Y)
174176
-->
175177

178+
## v6.22.2
179+
180+
Date: 2024-02-28
181+
182+
### Patch Changes
183+
184+
- Preserve hydrated errors during partial hydration runs ([#11305](https://github.com/remix-run/react-router/pull/11305))
185+
186+
**Full Changelog**: [`v6.22.1...v6.22.2`](https://github.com/remix-run/react-router/compare/react-router@6.22.1...react-router@6.22.2)
187+
176188
## v6.22.1
177189

178190
Date: 2024-02-16

‎packages/react-router-dom-v5-compat/CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# `react-router-dom-v5-compat`
22

3+
## 6.22.2
4+
5+
### Patch Changes
6+
7+
- Updated dependencies:
8+
- `react-router@6.22.2`
9+
- `react-router-dom@6.22.2`
10+
311
## 6.22.1
412

513
### Patch Changes

‎packages/react-router-dom-v5-compat/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-router-dom-v5-compat",
3-
"version": "6.22.1",
3+
"version": "6.22.2",
44
"description": "Migration path to React Router v6 from v4/5",
55
"keywords": [
66
"react",
@@ -24,7 +24,7 @@
2424
"types": "./dist/index.d.ts",
2525
"dependencies": {
2626
"history": "^5.3.0",
27-
"react-router": "6.22.1"
27+
"react-router": "6.22.2"
2828
},
2929
"peerDependencies": {
3030
"react": ">=16.8",

‎packages/react-router-dom/CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# `react-router-dom`
22

3+
## 6.22.2
4+
5+
### Patch Changes
6+
7+
- Updated dependencies:
8+
- `@remix-run/router@1.15.2`
9+
- `react-router@6.22.2`
10+
311
## 6.22.1
412

513
### Patch Changes

‎packages/react-router-dom/__tests__/partial-hydration-test.tsx

+86-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import "@testing-library/jest-dom";
2-
import { render, screen, waitFor } from "@testing-library/react";
2+
import { act, render, screen, waitFor } from "@testing-library/react";
33
import * as React from "react";
44
import type { LoaderFunction } from "react-router";
55
import { RouterProvider as ReactRouter_RouterPRovider } from "react-router";
@@ -650,4 +650,89 @@ function testPartialHydration(
650650
</div>"
651651
`);
652652
});
653+
654+
it("preserves hydrated errors for non-hydrating loaders", async () => {
655+
let dfd = createDeferred();
656+
let rootSpy: LoaderFunction = jest.fn(() => dfd.promise);
657+
rootSpy.hydrate = true;
658+
659+
let indexSpy = jest.fn();
660+
661+
let router = createTestRouter(
662+
[
663+
{
664+
id: "root",
665+
path: "/",
666+
loader: rootSpy,
667+
Component() {
668+
let data = useLoaderData() as string;
669+
return (
670+
<>
671+
<h1>{`Home - ${data}`}</h1>
672+
<Outlet />
673+
</>
674+
);
675+
},
676+
children: [
677+
{
678+
id: "index",
679+
index: true,
680+
loader: indexSpy,
681+
Component() {
682+
let data = useLoaderData() as string;
683+
return <h2>{`Index - ${data}`}</h2>;
684+
},
685+
ErrorBoundary() {
686+
let error = useRouteError() as string;
687+
return <p>{error}</p>;
688+
},
689+
},
690+
],
691+
},
692+
],
693+
{
694+
hydrationData: {
695+
loaderData: {
696+
root: "HYDRATED ROOT",
697+
},
698+
errors: {
699+
index: "INDEX ERROR",
700+
},
701+
},
702+
future: {
703+
v7_partialHydration: true,
704+
},
705+
}
706+
);
707+
let { container } = render(<RouterProvider router={router} />);
708+
709+
expect(getHtml(container)).toMatchInlineSnapshot(`
710+
"<div>
711+
<h1>
712+
Home - HYDRATED ROOT
713+
</h1>
714+
<p>
715+
INDEX ERROR
716+
</p>
717+
</div>"
718+
`);
719+
720+
expect(router.state.initialized).toBe(false);
721+
722+
await act(() => dfd.resolve("UPDATED ROOT"));
723+
724+
expect(getHtml(container)).toMatchInlineSnapshot(`
725+
"<div>
726+
<h1>
727+
Home - UPDATED ROOT
728+
</h1>
729+
<p>
730+
INDEX ERROR
731+
</p>
732+
</div>"
733+
`);
734+
735+
expect(rootSpy).toHaveBeenCalledTimes(1);
736+
expect(indexSpy).not.toHaveBeenCalled();
737+
});
653738
}

‎packages/react-router-dom/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-router-dom",
3-
"version": "6.22.1",
3+
"version": "6.22.2",
44
"description": "Declarative routing for React web applications",
55
"keywords": [
66
"react",
@@ -23,8 +23,8 @@
2323
"module": "./dist/index.js",
2424
"types": "./dist/index.d.ts",
2525
"dependencies": {
26-
"@remix-run/router": "1.15.1",
27-
"react-router": "6.22.1"
26+
"@remix-run/router": "1.15.2",
27+
"react-router": "6.22.2"
2828
},
2929
"devDependencies": {
3030
"react": "^18.2.0",

‎packages/react-router-native/CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# `react-router-native`
22

3+
## 6.22.2
4+
5+
### Patch Changes
6+
7+
- Updated dependencies:
8+
- `react-router@6.22.2`
9+
310
## 6.22.1
411

512
### Patch Changes

‎packages/react-router-native/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-router-native",
3-
"version": "6.22.1",
3+
"version": "6.22.2",
44
"description": "Declarative routing for React Native applications",
55
"keywords": [
66
"react",
@@ -22,7 +22,7 @@
2222
"types": "./dist/index.d.ts",
2323
"dependencies": {
2424
"@ungap/url-search-params": "^0.2.2",
25-
"react-router": "6.22.1"
25+
"react-router": "6.22.2"
2626
},
2727
"devDependencies": {
2828
"react": "^18.2.0",

‎packages/react-router/CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# `react-router`
22

3+
## 6.22.2
4+
5+
### Patch Changes
6+
7+
- Updated dependencies:
8+
- `@remix-run/router@1.15.2`
9+
310
## 6.22.1
411

512
### Patch Changes

‎packages/react-router/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-router",
3-
"version": "6.22.1",
3+
"version": "6.22.2",
44
"description": "Declarative routing for React",
55
"keywords": [
66
"react",
@@ -23,7 +23,7 @@
2323
"module": "./dist/index.js",
2424
"types": "./dist/index.d.ts",
2525
"dependencies": {
26-
"@remix-run/router": "1.15.1"
26+
"@remix-run/router": "1.15.2"
2727
},
2828
"devDependencies": {
2929
"react": "^18.2.0"

‎packages/router/CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# `@remix-run/router`
22

3+
## 1.15.2
4+
5+
### Patch Changes
6+
7+
- Preserve hydrated errors during partial hydration runs ([#11305](https://github.com/remix-run/react-router/pull/11305))
8+
39
## 1.15.1
410

511
### Patch Changes

‎packages/router/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@remix-run/router",
3-
"version": "1.15.1",
3+
"version": "1.15.2",
44
"description": "Nested/Data-driven/Framework-agnostic Routing",
55
"keywords": [
66
"remix",

‎packages/router/router.ts

+10-1
Original file line numberDiff line numberDiff line change
@@ -1718,7 +1718,7 @@ export function createRouter(init: RouterInit): Router {
17181718
// preserving any new action data or existing action data (in the case of
17191719
// a revalidation interrupting an actionReload)
17201720
// If we have partialHydration enabled, then don't update the state for the
1721-
// initial data load since iot's not a "navigation"
1721+
// initial data load since it's not a "navigation"
17221722
if (
17231723
!isUninterruptedRevalidation &&
17241724
(!future.v7_partialHydration || !initialHydration)
@@ -1835,6 +1835,15 @@ export function createRouter(init: RouterInit): Router {
18351835
});
18361836
});
18371837

1838+
// During partial hydration, preserve SSR errors for routes that don't re-run
1839+
if (future.v7_partialHydration && initialHydration && state.errors) {
1840+
Object.entries(state.errors)
1841+
.filter(([id]) => !matchesToLoad.some((m) => m.route.id === id))
1842+
.forEach(([routeId, error]) => {
1843+
errors = Object.assign(errors || {}, { [routeId]: error });
1844+
});
1845+
}
1846+
18381847
let updatedFetchers = markFetchRedirectsDone();
18391848
let didAbortFetchLoads = abortStaleFetchLoads(pendingNavigationLoadId);
18401849
let shouldUpdateFetchers =

0 commit comments

Comments
 (0)
Please sign in to comment.