Skip to content

Commit bb107c9

Browse files
committed
Merge branch 'release-next'
2 parents fdadc70 + 3a66719 commit bb107c9

File tree

21 files changed

+637
-111
lines changed

21 files changed

+637
-111
lines changed

CHANGELOG.md

Lines changed: 102 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -13,136 +13,141 @@ 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.21.3](#v6213)
16+
- [v6.22.0](#v6220)
17+
- [What's Changed](#whats-changed)
18+
- [Core Web Vitals Technology Report Flag](#core-web-vitals-technology-report-flag)
19+
- [Minor Changes](#minor-changes)
1720
- [Patch Changes](#patch-changes)
18-
- [v6.21.2](#v6212)
21+
- [v6.21.3](#v6213)
1922
- [Patch Changes](#patch-changes-1)
20-
- [v6.21.1](#v6211)
23+
- [v6.21.2](#v6212)
2124
- [Patch Changes](#patch-changes-2)
25+
- [v6.21.1](#v6211)
26+
- [Patch Changes](#patch-changes-3)
2227
- [v6.21.0](#v6210)
23-
- [What's Changed](#whats-changed)
28+
- [What's Changed](#whats-changed-1)
2429
- [`future.v7_relativeSplatPath`](#futurev7_relativesplatpath)
2530
- [Partial Hydration](#partial-hydration)
26-
- [Minor Changes](#minor-changes)
27-
- [Patch Changes](#patch-changes-3)
28-
- [v6.20.1](#v6201)
29-
- [Patch Changes](#patch-changes-4)
30-
- [v6.20.0](#v6200)
3131
- [Minor Changes](#minor-changes-1)
32+
- [Patch Changes](#patch-changes-4)
33+
- [v6.20.1](#v6201)
3234
- [Patch Changes](#patch-changes-5)
33-
- [v6.19.0](#v6190)
34-
- [What's Changed](#whats-changed-1)
35-
- [`unstable_flushSync` API](#unstable_flushsync-api)
35+
- [v6.20.0](#v6200)
3636
- [Minor Changes](#minor-changes-2)
3737
- [Patch Changes](#patch-changes-6)
38-
- [v6.18.0](#v6180)
38+
- [v6.19.0](#v6190)
3939
- [What's Changed](#whats-changed-2)
40-
- [New Fetcher APIs](#new-fetcher-apis)
41-
- [Persistence Future Flag (`future.v7_fetcherPersist`)](#persistence-future-flag-futurev7_fetcherpersist)
40+
- [`unstable_flushSync` API](#unstable_flushsync-api)
4241
- [Minor Changes](#minor-changes-3)
4342
- [Patch Changes](#patch-changes-7)
44-
- [v6.17.0](#v6170)
43+
- [v6.18.0](#v6180)
4544
- [What's Changed](#whats-changed-3)
46-
- [View Transitions 🚀](#view-transitions-)
45+
- [New Fetcher APIs](#new-fetcher-apis)
46+
- [Persistence Future Flag (`future.v7_fetcherPersist`)](#persistence-future-flag-futurev7_fetcherpersist)
4747
- [Minor Changes](#minor-changes-4)
4848
- [Patch Changes](#patch-changes-8)
49-
- [v6.16.0](#v6160)
49+
- [v6.17.0](#v6170)
50+
- [What's Changed](#whats-changed-4)
51+
- [View Transitions 🚀](#view-transitions-)
5052
- [Minor Changes](#minor-changes-5)
5153
- [Patch Changes](#patch-changes-9)
52-
- [v6.15.0](#v6150)
54+
- [v6.16.0](#v6160)
5355
- [Minor Changes](#minor-changes-6)
5456
- [Patch Changes](#patch-changes-10)
55-
- [v6.14.2](#v6142)
57+
- [v6.15.0](#v6150)
58+
- [Minor Changes](#minor-changes-7)
5659
- [Patch Changes](#patch-changes-11)
57-
- [v6.14.1](#v6141)
60+
- [v6.14.2](#v6142)
5861
- [Patch Changes](#patch-changes-12)
59-
- [v6.14.0](#v6140)
60-
- [What's Changed](#whats-changed-4)
61-
- [JSON/Text Submissions](#jsontext-submissions)
62-
- [Minor Changes](#minor-changes-7)
62+
- [v6.14.1](#v6141)
6363
- [Patch Changes](#patch-changes-13)
64-
- [v6.13.0](#v6130)
64+
- [v6.14.0](#v6140)
6565
- [What's Changed](#whats-changed-5)
66+
- [JSON/Text Submissions](#jsontext-submissions)
6667
- [Minor Changes](#minor-changes-8)
6768
- [Patch Changes](#patch-changes-14)
68-
- [v6.12.1](#v6121)
69-
- [Patch Changes](#patch-changes-15)
70-
- [v6.12.0](#v6120)
69+
- [v6.13.0](#v6130)
7170
- [What's Changed](#whats-changed-6)
72-
- [`React.startTransition` support](#reactstarttransition-support)
7371
- [Minor Changes](#minor-changes-9)
72+
- [Patch Changes](#patch-changes-15)
73+
- [v6.12.1](#v6121)
7474
- [Patch Changes](#patch-changes-16)
75-
- [v6.11.2](#v6112)
75+
- [v6.12.0](#v6120)
76+
- [What's Changed](#whats-changed-7)
77+
- [`React.startTransition` support](#reactstarttransition-support)
78+
- [Minor Changes](#minor-changes-10)
7679
- [Patch Changes](#patch-changes-17)
77-
- [v6.11.1](#v6111)
80+
- [v6.11.2](#v6112)
7881
- [Patch Changes](#patch-changes-18)
79-
- [v6.11.0](#v6110)
80-
- [Minor Changes](#minor-changes-10)
82+
- [v6.11.1](#v6111)
8183
- [Patch Changes](#patch-changes-19)
82-
- [v6.10.0](#v6100)
83-
- [What's Changed](#whats-changed-7)
84+
- [v6.11.0](#v6110)
8485
- [Minor Changes](#minor-changes-11)
8586
- [Patch Changes](#patch-changes-20)
86-
- [v6.9.0](#v690)
87+
- [v6.10.0](#v6100)
8788
- [What's Changed](#whats-changed-8)
88-
- [`Component`/`ErrorBoundary` route properties](#componenterrorboundary-route-properties)
89-
- [Introducing Lazy Route Modules](#introducing-lazy-route-modules)
9089
- [Minor Changes](#minor-changes-12)
9190
- [Patch Changes](#patch-changes-21)
92-
- [v6.8.2](#v682)
91+
- [v6.9.0](#v690)
92+
- [What's Changed](#whats-changed-9)
93+
- [`Component`/`ErrorBoundary` route properties](#componenterrorboundary-route-properties)
94+
- [Introducing Lazy Route Modules](#introducing-lazy-route-modules)
95+
- [Minor Changes](#minor-changes-13)
9396
- [Patch Changes](#patch-changes-22)
94-
- [v6.8.1](#v681)
97+
- [v6.8.2](#v682)
9598
- [Patch Changes](#patch-changes-23)
96-
- [v6.8.0](#v680)
97-
- [Minor Changes](#minor-changes-13)
99+
- [v6.8.1](#v681)
98100
- [Patch Changes](#patch-changes-24)
99-
- [v6.7.0](#v670)
101+
- [v6.8.0](#v680)
100102
- [Minor Changes](#minor-changes-14)
101103
- [Patch Changes](#patch-changes-25)
102-
- [v6.6.2](#v662)
104+
- [v6.7.0](#v670)
105+
- [Minor Changes](#minor-changes-15)
103106
- [Patch Changes](#patch-changes-26)
104-
- [v6.6.1](#v661)
107+
- [v6.6.2](#v662)
105108
- [Patch Changes](#patch-changes-27)
106-
- [v6.6.0](#v660)
107-
- [What's Changed](#whats-changed-9)
108-
- [Minor Changes](#minor-changes-15)
109+
- [v6.6.1](#v661)
109110
- [Patch Changes](#patch-changes-28)
110-
- [v6.5.0](#v650)
111+
- [v6.6.0](#v660)
111112
- [What's Changed](#whats-changed-10)
112113
- [Minor Changes](#minor-changes-16)
113114
- [Patch Changes](#patch-changes-29)
114-
- [v6.4.5](#v645)
115+
- [v6.5.0](#v650)
116+
- [What's Changed](#whats-changed-11)
117+
- [Minor Changes](#minor-changes-17)
115118
- [Patch Changes](#patch-changes-30)
116-
- [v6.4.4](#v644)
119+
- [v6.4.5](#v645)
117120
- [Patch Changes](#patch-changes-31)
118-
- [v6.4.3](#v643)
121+
- [v6.4.4](#v644)
119122
- [Patch Changes](#patch-changes-32)
120-
- [v6.4.2](#v642)
123+
- [v6.4.3](#v643)
121124
- [Patch Changes](#patch-changes-33)
122-
- [v6.4.1](#v641)
125+
- [v6.4.2](#v642)
123126
- [Patch Changes](#patch-changes-34)
127+
- [v6.4.1](#v641)
128+
- [Patch Changes](#patch-changes-35)
124129
- [v6.4.0](#v640)
125-
- [What's Changed](#whats-changed-11)
130+
- [What's Changed](#whats-changed-12)
126131
- [Remix Data APIs](#remix-data-apis)
127-
- [Patch Changes](#patch-changes-35)
132+
- [Patch Changes](#patch-changes-36)
128133
- [v6.3.0](#v630)
129-
- [Minor Changes](#minor-changes-17)
134+
- [Minor Changes](#minor-changes-18)
130135
- [v6.2.2](#v622)
131-
- [Patch Changes](#patch-changes-36)
132-
- [v6.2.1](#v621)
133136
- [Patch Changes](#patch-changes-37)
134-
- [v6.2.0](#v620)
135-
- [Minor Changes](#minor-changes-18)
137+
- [v6.2.1](#v621)
136138
- [Patch Changes](#patch-changes-38)
137-
- [v6.1.1](#v611)
138-
- [Patch Changes](#patch-changes-39)
139-
- [v6.1.0](#v610)
139+
- [v6.2.0](#v620)
140140
- [Minor Changes](#minor-changes-19)
141+
- [Patch Changes](#patch-changes-39)
142+
- [v6.1.1](#v611)
141143
- [Patch Changes](#patch-changes-40)
142-
- [v6.0.2](#v602)
144+
- [v6.1.0](#v610)
145+
- [Minor Changes](#minor-changes-20)
143146
- [Patch Changes](#patch-changes-41)
144-
- [v6.0.1](#v601)
147+
- [v6.0.2](#v602)
145148
- [Patch Changes](#patch-changes-42)
149+
- [v6.0.1](#v601)
150+
- [Patch Changes](#patch-changes-43)
146151
- [v6.0.0](#v600)
147152

148153
</details>
@@ -166,6 +171,36 @@ Date: YYYY-MM-DD
166171
**Full Changelog**: [`v6.X.Y...v6.X.Y`](https://github.com/remix-run/react-router/compare/[email protected]@6.X.Y)
167172
-->
168173

174+
## v6.22.0
175+
176+
Date: 2024-02-01
177+
178+
### What's Changed
179+
180+
#### Core Web Vitals Technology Report Flag
181+
182+
In 2021, the HTTP Archive launched the [Core Web Vitals Technology Report dashboard](https://discuss.httparchive.org/t/new-dashboard-the-core-web-vitals-technology-report/2178):
183+
184+
> By combining the powers of real-user experiences in the Chrome UX Report 26 (CrUX) dataset with web technology detections in HTTP Archive 30, we can get a glimpse into how architectural decisions like choices of CMS platform or JavaScript framework play a role in sites’ CWV performance.
185+
186+
They use a tool called [`wappalyzer`](https://github.com/HTTPArchive/wappalyzer) to identify what technologies a given website is using by looking for certain scripts, global JS variables, or other identifying characteristics. For example, for Remix applications, they [look for the global `__remixContext`](https://github.com/HTTPArchive/wappalyzer/blob/c2a24ee7c2d07bf9c521f02584ae2dcf603ac0b7/src/technologies/r.json#L1328) variable to identify that a website is using Remix.
187+
188+
It was brought to our attention that React Router was unable to be reliably identified because there are no identifying global aspects. They are currently [looking for external scripts with `react-router`](https://github.com/HTTPArchive/wappalyzer/blob/c2a24ee7c2d07bf9c521f02584ae2dcf603ac0b7/src/technologies/r.json#L637) in the name. This will identify sites using React Router from a CDN such as `unpkg` - but it will miss the **vast** majority of sites that are installing React Router from the npm registry and bundling it into their JS files. This results in [drastically under-reporting](https://lookerstudio.google.com/s/pixHkNmGbN4) the usage of React Router on the web.
189+
190+
Starting with version `6.22.0`, sites using `react-router-dom` will begin adding a `window.__reactRouterVersion` variable that will be set to a string value of the SemVer major version number (i.e., `window.__reactRouterVersion = "6";`) so that they can be properly identified.
191+
192+
### Minor Changes
193+
194+
- Include a `window.__reactRouterVersion` for CWV Report detection ([#11222](https://github.com/remix-run/react-router/pull/11222))
195+
- Add a `createStaticHandler` `future.v7_throwAbortReason` flag to throw `request.signal.reason` (defaults to a `DOMException`) when a request is aborted instead of an `Error` such as `new Error("query() call aborted: GET /path")` ([#11104](https://github.com/remix-run/react-router/pull/11104))
196+
- Please note that `DOMException` was added in Node v17 so you will not get a `DOMException` on Node 16 and below.
197+
198+
### Patch Changes
199+
200+
- Respect the `ErrorResponse` status code if passed to `getStaticContextFormError` ([#11213](https://github.com/remix-run/react-router/pull/11213))
201+
202+
**Full Changelog**: [`v6.21.3...v6.22.0`](https://github.com/remix-run/react-router/compare/[email protected]@6.22.0)
203+
169204
## v6.21.3
170205

171206
Date: 2024-01-18

docs/guides/api-development-strategy.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,23 @@ const router = createBrowserRouter(routes, {
7171
| `v7_prependBasename` | Prepend the router basename to navigate/fetch paths |
7272
| [`v7_relativeSplatPath`][relativesplatpath] | Fix buggy relative path resolution in splat routes |
7373

74+
#### `createStaticHandler` Future Flags
75+
76+
These flags are only applicable when [SSR][ssr]-ing a React Router app:
77+
78+
```js
79+
const handler = createStaticHandler(routes, {
80+
future: {
81+
v7_throwAbortReason: true,
82+
},
83+
});
84+
```
85+
86+
| Flag | Description |
87+
| ------------------------------------------- | ----------------------------------------------------------------------- |
88+
| [`v7_relativeSplatPath`][relativesplatpath] | Fix buggy relative path resolution in splat routes |
89+
| [`v7_throwAbortReason`][abortreason] | Throw `request.signal.reason` if a `query`/`queryRoute` call is aborted |
90+
7491
### React Router Future Flags
7592

7693
These flags apply to both Data and non-Data Routers and are passed to the rendered React component:
@@ -98,3 +115,5 @@ These flags apply to both Data and non-Data Routers and are passed to the render
98115
[starttransition]: https://react.dev/reference/react/startTransition
99116
[partialhydration]: ../routers/create-browser-router#partial-hydration-data
100117
[relativesplatpath]: ../hooks/use-resolved-path#splat-paths
118+
[ssr]: ../guides/ssr
119+
[abortreason]: ../routers/create-static-handler#handlerqueryrequest-opts

docs/routers/create-static-handler.md

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,27 @@ export async function renderHtml(req) {
5454

5555
```ts
5656
declare function createStaticHandler(
57-
routes: RouteObject[],
58-
opts?: {
59-
basename?: string;
60-
}
57+
routes: AgnosticRouteObject[],
58+
opts?: CreateStaticHandlerOptions
6159
): StaticHandler;
6260

61+
interface CreateStaticHandlerOptions {
62+
basename?: string;
63+
future?: Partial<StaticHandlerFutureConfig>;
64+
mapRouteProperties?: MapRoutePropertiesFunction;
65+
}
66+
67+
interface StaticHandlerFutureConfig {
68+
v7_relativeSplatPath: boolean;
69+
v7_throwAbortReason: boolean;
70+
}
71+
72+
interface MapRoutePropertiesFunction {
73+
(route: AgnosticRouteObject): {
74+
hasErrorBoundary: boolean;
75+
} & Record<string, any>;
76+
}
77+
6378
interface StaticHandler {
6479
dataRoutes: AgnosticDataRouteObject[];
6580
query(
@@ -86,6 +101,8 @@ These are the same `routes`/`basename` you would pass to [`createBrowserRouter`]
86101

87102
The `handler.query()` method takes in a Fetch request, performs route matching, and executes all relevant route action/loader methods depending on the request. The return `context` value contains all of the information required to render the HTML document for the request (route-level `actionData`, `loaderData`, `errors`, etc.). If any of the matched routes return or throw a redirect response, then `query()` will return that redirect in the form of Fetch `Response`.
88103

104+
If a request is aborted, `query` will throw an error such as `Error("query() call aborted: GET /path")`. If you want to throw the native `AbortSignal.reason` (by default a `DOMException`) you can opt-in into the `future.v7_throwAbortReason` future flag. `DOMException` was added in Node 17 so you must be on Node 17 or higher for this to work properly.
105+
89106
### `opts.requestContext`
90107

91108
If you need to pass information from your server into Remix actions/loaders, you can do so with `opts.requestContext` and it will show up in your actions/loaders in the context parameter.
@@ -115,6 +132,8 @@ export async function render(req: express.Request) {
115132

116133
The `handler.queryRoute` is a more-targeted version that queries a singular route and runs it's loader or action based on the request. By default, it will match the target route based on the request URL. The return value is the values returned from the loader or action, which is usually a `Response` object.
117134

135+
If a request is aborted, `query` will throw an error such as `Error("queryRoute() call aborted: GET /path")`. If you want to throw the native `AbortSignal.reason` (by default a `DOMException`) you can opt-in into the `future.v7_throwAbortReason` future flag. `DOMException` was added in Node 17 so you must be on Node 17 or higher for this to work properly.
136+
118137
### `opts.routeId`
119138

120139
If you need to call a specific route action/loader that doesn't exactly correspond to the URL (for example, a parent route loader), you can specify a `routeId`:

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,10 @@
125125
"none": "17.1 kB"
126126
},
127127
"packages/react-router-dom/dist/react-router-dom.production.min.js": {
128-
"none": "16.9 kB"
128+
"none": "17.0 kB"
129129
},
130130
"packages/react-router-dom/dist/umd/react-router-dom.production.min.js": {
131-
"none": "23.1 kB"
131+
"none": "23.2 kB"
132132
}
133133
}
134134
}

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# `react-router-dom-v5-compat`
22

3+
## 6.22.0
4+
5+
### Minor Changes
6+
7+
- Include a `window__reactRouterVersion` tag for CWV Report detection ([#11222](https://github.com/remix-run/react-router/pull/11222))
8+
9+
### Patch Changes
10+
11+
- Updated dependencies:
12+
13+
14+
315
## 6.21.3
416

517
### Patch Changes

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-router-dom-v5-compat",
3-
"version": "6.21.3",
3+
"version": "6.22.0",
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.21.3"
27+
"react-router": "6.22.0"
2828
},
2929
"peerDependencies": {
3030
"react": ">=16.8",

0 commit comments

Comments
 (0)