Skip to content

Commit

Permalink
Merge branch 'release-next' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
brophdawg11 committed Jul 18, 2023
2 parents aa65dbd + 1acea8b commit 172bad7
Show file tree
Hide file tree
Showing 22 changed files with 105 additions and 48 deletions.
5 changes: 0 additions & 5 deletions .changeset/decode-hash-scroll.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/defer-resolve-undefined.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/fetcher-redirect-interrupt.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/form-state-prop.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/hydrate-error-type.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/initial-load-fetcher.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/route-lazy-type.md

This file was deleted.

1 change: 1 addition & 0 deletions contributors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@
- turansky
- tyankatsu0105
- underager
- valerii15298
- ValiantCat
- vijaypushkin
- vikingviolinist
Expand Down
2 changes: 1 addition & 1 deletion docs/hooks/use-outlet-context.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export default function Dashboard() {
return (
<div>
<h1>Dashboard</h1>
<Outlet context={{ user }} />
<Outlet context={{ user } satisfies ContextType} />
</div>
);
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
"none": "12.8 kB"
},
"packages/react-router-dom/dist/umd/react-router-dom.production.min.js": {
"none": "18.7 kB"
"none": "18.71 kB"
}
}
}
8 changes: 8 additions & 0 deletions packages/react-router-dom-v5-compat/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# `react-router-dom-v5-compat`

## 6.14.2

### Patch Changes

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

## 6.14.1

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/react-router-dom-v5-compat/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-router-dom-v5-compat",
"version": "6.14.1",
"version": "6.14.2",
"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.14.1"
"react-router": "6.14.2"
},
"peerDependencies": {
"react": ">=16.8",
Expand Down
11 changes: 11 additions & 0 deletions packages/react-router-dom/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# `react-router-dom`

## 6.14.2

### Patch Changes

- Properly decode element id when emulating hash scrolling via `<ScrollRestoration>` ([#10682](https://github.com/remix-run/react-router/pull/10682))
- Add missing `<Form state>` prop to populate `history.state` on submission navigations ([#10630](https://github.com/remix-run/react-router/pull/10630))
- Support proper hydration of `Error` subclasses such as `ReferenceError`/`TypeError` ([#10633](https://github.com/remix-run/react-router/pull/10633))
- Updated dependencies:
- `@remix-run/router@1.7.2`
- `react-router@6.14.2`

## 6.14.1

### Patch Changes
Expand Down
6 changes: 3 additions & 3 deletions packages/react-router-dom/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-router-dom",
"version": "6.14.1",
"version": "6.14.2",
"description": "Declarative routing for React web applications",
"keywords": [
"react",
Expand All @@ -23,8 +23,8 @@
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"dependencies": {
"@remix-run/router": "1.7.1",
"react-router": "6.14.1"
"@remix-run/router": "1.7.2",
"react-router": "6.14.2"
},
"devDependencies": {
"react": "^18.2.0",
Expand Down
7 changes: 7 additions & 0 deletions packages/react-router-native/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# `react-router-native`

## 6.14.2

### Patch Changes

- Updated dependencies:
- `react-router@6.14.2`

## 6.14.1

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/react-router-native/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-router-native",
"version": "6.14.1",
"version": "6.14.2",
"description": "Declarative routing for React Native applications",
"keywords": [
"react",
Expand All @@ -22,7 +22,7 @@
"types": "./dist/index.d.ts",
"dependencies": {
"@ungap/url-search-params": "^0.1.4",
"react-router": "6.14.1"
"react-router": "6.14.2"
},
"devDependencies": {
"react": "^18.2.0",
Expand Down
7 changes: 7 additions & 0 deletions packages/react-router/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# `react-router`

## 6.14.2

### Patch Changes

- Updated dependencies:
- `@remix-run/router@1.7.2`

## 6.14.1

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/react-router/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-router",
"version": "6.14.1",
"version": "6.14.2",
"description": "Declarative routing for React",
"keywords": [
"react",
Expand All @@ -23,7 +23,7 @@
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"dependencies": {
"@remix-run/router": "1.7.1"
"@remix-run/router": "1.7.2"
},
"devDependencies": {
"react": "^18.2.0"
Expand Down
9 changes: 9 additions & 0 deletions packages/router/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# `@remix-run/router`

## 1.7.2

### Patch Changes

- Trigger an error if a `defer` promise resolves/rejects with `undefined` in order to match the behavior of loaders and actions which must return a value or `null` ([#10690](https://github.com/remix-run/react-router/pull/10690))
- Properly handle fetcher redirects interrupted by normal navigations ([#10674](https://github.com/remix-run/react-router/pull/10674), [#10709](https://github.com/remix-run/react-router/pull/10709))
- Initial-load fetchers should not automatically revalidate on GET navigations ([#10688](https://github.com/remix-run/react-router/pull/10688))
- Enhance the return type of `Route.lazy` to prohibit returning an empty object ([#10634](https://github.com/remix-run/react-router/pull/10634))

## 1.7.1

### Patch Changes
Expand Down
48 changes: 48 additions & 0 deletions packages/router/__tests__/router-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10073,6 +10073,54 @@ describe("a router", () => {
expect(t.router.state.fetchers.get(key)?.state).toBe("idle");
expect(t.router.state.fetchers.get(key)?.data).toBeUndefined();
});

it("ignores submission redirect navigation if preceded by a normal GET navigation (w/o loaders)", async () => {
let key = "key";
let t = setup({
routes: [
{
path: "",
id: "root",
children: [
{
path: "/",
id: "index",
},
{
path: "/foo",
id: "foo",
action: true,
},
{
path: "/bar",
id: "bar",
},
{
path: "/baz",
id: "baz",
},
],
},
],
});
let A = await t.fetch("/foo", key, {
formMethod: "post",
formData: createFormData({ key: "value" }),
});
await t.navigate("/bar");

// This redirect should be ignored
await A.actions.foo.redirect("/baz");
expect(t.router.state.fetchers.get(key)?.state).toBe("idle");

expect(t.router.state).toMatchObject({
navigation: IDLE_NAVIGATION,
location: { pathname: "/bar" },
loaderData: {},
});
expect(t.router.state.fetchers.get(key)?.state).toBe("idle");
expect(t.router.state.fetchers.get(key)?.data).toBeUndefined();
});
});

describe(`
Expand Down
2 changes: 1 addition & 1 deletion packages/router/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@remix-run/router",
"version": "1.7.1",
"version": "1.7.2",
"description": "Nested/Data-driven/Framework-agnostic Routing",
"keywords": [
"remix",
Expand Down
3 changes: 2 additions & 1 deletion packages/router/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1500,6 +1500,8 @@ export function createRouter(init: RouterInit): Router {
(matchesToLoad && matchesToLoad.some((m) => m.route.id === routeId))
);

pendingNavigationLoadId = ++incrementingLoadId;

// Short circuit if we have no loaders to run
if (matchesToLoad.length === 0 && revalidatingFetchers.length === 0) {
let updatedFetchers = markFetchRedirectsDone();
Expand Down Expand Up @@ -1541,7 +1543,6 @@ export function createRouter(init: RouterInit): Router {
});
}

pendingNavigationLoadId = ++incrementingLoadId;
revalidatingFetchers.forEach((rf) => {
if (fetchControllers.has(rf.key)) {
abortFetcher(rf.key);
Expand Down

0 comments on commit 172bad7

Please sign in to comment.