Skip to content

Commit 12aa08a

Browse files
committed
Merge branch 'release-6.4.4'
2 parents cf00c03 + 12e7c28 commit 12aa08a

30 files changed

+1671
-384
lines changed

contributors.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,10 @@
7575
- jonkoops
7676
- jrakotoharisoa
7777
- kantuni
78+
- KAROTT7
7879
- kddnewton
7980
- kentcdodds
81+
- kiliman
8082
- kkirsche
8183
- koojaa
8284
- KostiantynPopovych
@@ -141,9 +143,11 @@
141143
- tyankatsu0105
142144
- underager
143145
- vijaypushkin
144-
- vikingviolinist
145146
- vishwast03
147+
- vikingviolinist
148+
- willemarcel
146149
- williamsdyyz
147150
- xavier-lc
148151
- xcsnowcity
149152
- yuleicul
153+
- m-shojaei

docs/routers/picking-a-router.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ The easiest way to quickly update to a v6.4 is to get the help from [`createRout
3131
```jsx
3232
import {
3333
createBrowserRouter,
34+
createRoutesFromElements,
35+
Route,
3436
RouterProvider,
3537
} from "react-router-dom";
3638

examples/notes/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ This example demonstrates some of the basic features of Data Router, including:
1616

1717
Open this example on [StackBlitz](https://stackblitz.com):
1818

19-
[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/remix-run/react-router/tree/remixing/examples/notes?file=src/main.tsx)
19+
[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/remix-run/react-router/tree/dev/examples/notes?file=src/main.tsx)

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107
},
108108
"filesize": {
109109
"packages/router/dist/router.umd.min.js": {
110-
"none": "34 kB"
110+
"none": "35 kB"
111111
},
112112
"packages/react-router/dist/react-router.production.min.js": {
113113
"none": "12.5 kB"
@@ -116,10 +116,10 @@
116116
"none": "14.5 kB"
117117
},
118118
"packages/react-router-dom/dist/react-router-dom.production.min.js": {
119-
"none": "10 kB"
119+
"none": "10.5 kB"
120120
},
121121
"packages/react-router-dom/dist/umd/react-router-dom.production.min.js": {
122-
"none": "16 kB"
122+
"none": "16.5 kB"
123123
}
124124
}
125125
}

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

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

3+
## 6.4.4
4+
5+
### Patch Changes
6+
7+
- Updated dependencies:
8+
9+
10+
311
## 6.4.3
412

513
### Patch Changes

packages/react-router-dom-v5-compat/lib/components.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,14 @@ export function StaticRouter({
8181
createHref(to: To) {
8282
return typeof to === "string" ? to : createPath(to);
8383
},
84+
encodeLocation(to: To) {
85+
let path = typeof to === "string" ? parsePath(to) : to;
86+
return {
87+
pathname: path.pathname || "",
88+
search: path.search || "",
89+
hash: path.hash || "",
90+
};
91+
},
8492
push(to: To) {
8593
throw new Error(
8694
`You cannot use navigator.push() on the server because it is a stateless ` +

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.4.3",
3+
"version": "6.4.4",
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.4.3"
27+
"react-router": "6.4.4"
2828
},
2929
"peerDependencies": {
3030
"react": ">=16.8",

packages/react-router-dom/CHANGELOG.md

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

3+
## 6.4.4
4+
5+
### Patch Changes
6+
7+
- Fix issues with encoded characters in `NavLink` and descendant `<Routes>` ([#9589](https://github.com/remix-run/react-router/pull/9589), [#9647](https://github.com/remix-run/react-router/pull/9647))
8+
- Properly serialize/deserialize `ErrorResponse` instances when using built-in hydration ([#9593](https://github.com/remix-run/react-router/pull/9593))
9+
- Support `basename` in static data routers ([#9591](https://github.com/remix-run/react-router/pull/9591))
10+
- Updated dependencies:
11+
- `@remix-run/[email protected]`
12+
13+
314
## 6.4.3
415

516
### Patch Changes

packages/react-router-dom/__tests__/data-browser-router-test.tsx

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import {
2323
Outlet,
2424
createBrowserRouter,
2525
createHashRouter,
26+
isRouteErrorResponse,
2627
useLoaderData,
2728
useActionData,
2829
useRouteError,
@@ -264,6 +265,40 @@ function testDomRouter(
264265
`);
265266
});
266267

268+
it("deserializes ErrorResponse instances from the window", async () => {
269+
window.__staticRouterHydrationData = {
270+
loaderData: {},
271+
actionData: null,
272+
errors: {
273+
"0": {
274+
status: 404,
275+
statusText: "Not Found",
276+
internal: false,
277+
data: { not: "found" },
278+
__type: "RouteErrorResponse",
279+
},
280+
},
281+
};
282+
let { container } = render(
283+
<TestDataRouter window={getWindow("/")}>
284+
<Route path="/" element={<h1>Nope</h1>} errorElement={<Boundary />} />
285+
</TestDataRouter>
286+
);
287+
288+
function Boundary() {
289+
let error = useRouteError();
290+
return isRouteErrorResponse(error) ? <h1>Yes!</h1> : <h2>No :(</h2>;
291+
}
292+
293+
expect(getHtml(container)).toMatchInlineSnapshot(`
294+
"<div>
295+
<h1>
296+
Yes!
297+
</h1>
298+
</div>"
299+
`);
300+
});
301+
267302
it("renders fallbackElement while first data fetch happens", async () => {
268303
let fooDefer = createDeferred();
269304
let { container } = render(

0 commit comments

Comments
 (0)