Skip to content

Commit

Permalink
Merge branch 'release-6.4.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
brophdawg11 committed Nov 30, 2022
2 parents cf00c03 + 12e7c28 commit 12aa08a
Show file tree
Hide file tree
Showing 30 changed files with 1,671 additions and 384 deletions.
6 changes: 5 additions & 1 deletion contributors.yml
Expand Up @@ -75,8 +75,10 @@
- jonkoops
- jrakotoharisoa
- kantuni
- KAROTT7
- kddnewton
- kentcdodds
- kiliman
- kkirsche
- koojaa
- KostiantynPopovych
Expand Down Expand Up @@ -141,9 +143,11 @@
- tyankatsu0105
- underager
- vijaypushkin
- vikingviolinist
- vishwast03
- vikingviolinist
- willemarcel
- williamsdyyz
- xavier-lc
- xcsnowcity
- yuleicul
- m-shojaei
2 changes: 2 additions & 0 deletions docs/routers/picking-a-router.md
Expand Up @@ -31,6 +31,8 @@ The easiest way to quickly update to a v6.4 is to get the help from [`createRout
```jsx
import {
createBrowserRouter,
createRoutesFromElements,
Route,
RouterProvider,
} from "react-router-dom";

Expand Down
2 changes: 1 addition & 1 deletion examples/notes/README.md
Expand Up @@ -16,4 +16,4 @@ This example demonstrates some of the basic features of Data Router, including:

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

[![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)
[![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)
6 changes: 3 additions & 3 deletions package.json
Expand Up @@ -107,7 +107,7 @@
},
"filesize": {
"packages/router/dist/router.umd.min.js": {
"none": "34 kB"
"none": "35 kB"
},
"packages/react-router/dist/react-router.production.min.js": {
"none": "12.5 kB"
Expand All @@ -116,10 +116,10 @@
"none": "14.5 kB"
},
"packages/react-router-dom/dist/react-router-dom.production.min.js": {
"none": "10 kB"
"none": "10.5 kB"
},
"packages/react-router-dom/dist/umd/react-router-dom.production.min.js": {
"none": "16 kB"
"none": "16.5 kB"
}
}
}
8 changes: 8 additions & 0 deletions packages/react-router-dom-v5-compat/CHANGELOG.md
@@ -1,5 +1,13 @@
# `react-router-dom-v5-compat`

## 6.4.4

### Patch Changes

- Updated dependencies:
- `react-router-dom@6.4.4`
- `react-router@6.4.4`

## 6.4.3

### Patch Changes
Expand Down
8 changes: 8 additions & 0 deletions packages/react-router-dom-v5-compat/lib/components.tsx
Expand Up @@ -81,6 +81,14 @@ export function StaticRouter({
createHref(to: To) {
return typeof to === "string" ? to : createPath(to);
},
encodeLocation(to: To) {
let path = typeof to === "string" ? parsePath(to) : to;
return {
pathname: path.pathname || "",
search: path.search || "",
hash: path.hash || "",
};
},
push(to: To) {
throw new Error(
`You cannot use navigator.push() on the server because it is a stateless ` +
Expand Down
4 changes: 2 additions & 2 deletions packages/react-router-dom-v5-compat/package.json
@@ -1,6 +1,6 @@
{
"name": "react-router-dom-v5-compat",
"version": "6.4.3",
"version": "6.4.4",
"description": "Migration path to React Router v6 from v4/5",
"keywords": [
"react",
Expand All @@ -24,7 +24,7 @@
"types": "./dist/index.d.ts",
"dependencies": {
"history": "^5.3.0",
"react-router": "6.4.3"
"react-router": "6.4.4"
},
"peerDependencies": {
"react": ">=16.8",
Expand Down
11 changes: 11 additions & 0 deletions packages/react-router-dom/CHANGELOG.md
@@ -1,5 +1,16 @@
# `react-router-dom`

## 6.4.4

### Patch Changes

- 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))
- Properly serialize/deserialize `ErrorResponse` instances when using built-in hydration ([#9593](https://github.com/remix-run/react-router/pull/9593))
- Support `basename` in static data routers ([#9591](https://github.com/remix-run/react-router/pull/9591))
- Updated dependencies:
- `@remix-run/router@1.0.4`
- `react-router@6.4.4`

## 6.4.3

### Patch Changes
Expand Down
35 changes: 35 additions & 0 deletions packages/react-router-dom/__tests__/data-browser-router-test.tsx
Expand Up @@ -23,6 +23,7 @@ import {
Outlet,
createBrowserRouter,
createHashRouter,
isRouteErrorResponse,
useLoaderData,
useActionData,
useRouteError,
Expand Down Expand Up @@ -264,6 +265,40 @@ function testDomRouter(
`);
});

it("deserializes ErrorResponse instances from the window", async () => {
window.__staticRouterHydrationData = {
loaderData: {},
actionData: null,
errors: {
"0": {
status: 404,
statusText: "Not Found",
internal: false,
data: { not: "found" },
__type: "RouteErrorResponse",
},
},
};
let { container } = render(
<TestDataRouter window={getWindow("/")}>
<Route path="/" element={<h1>Nope</h1>} errorElement={<Boundary />} />
</TestDataRouter>
);

function Boundary() {
let error = useRouteError();
return isRouteErrorResponse(error) ? <h1>Yes!</h1> : <h2>No :(</h2>;
}

expect(getHtml(container)).toMatchInlineSnapshot(`
"<div>
<h1>
Yes!
</h1>
</div>"
`);
});

it("renders fallbackElement while first data fetch happens", async () => {
let fooDefer = createDeferred();
let { container } = render(
Expand Down

0 comments on commit 12aa08a

Please sign in to comment.