Skip to content

Commit

Permalink
chore: Update version for release (pre) (#10626)
Browse files Browse the repository at this point in the history
* chore: Update version for release (pre)

* Update changelogs

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Matt Brophy <matt@brophy.org>
  • Loading branch information
3 people authored Jun 21, 2023
1 parent d9b3941 commit 8b95f2b
Show file tree
Hide file tree
Showing 14 changed files with 182 additions and 31 deletions.
14 changes: 13 additions & 1 deletion .changeset/pre.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,17 @@
"react-router-native": "6.13.0",
"@remix-run/router": "1.6.3"
},
"changesets": []
"changesets": [
"blocker-key-strict-mode",
"formdata-submitter",
"purple-islands-cough",
"raw-payload-submission-router",
"raw-payload-submission",
"skip-fetcher-revalidate",
"smart-pots-repair",
"strip-basename-getkey",
"strip-blocker-basename",
"sync-window-location",
"tsc-skiplibcheck-react17"
]
}
14 changes: 6 additions & 8 deletions .changeset/raw-payload-submission-router.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ router.navigate("/", {
body: { key: "value" },
});

function action({ request }) {
// request.formData => FormData instance with entry [key=value]
// request.text => "key=value"
async function action({ request }) {
// await request.formData() => FormData instance with entry [key=value]
}
```

Expand All @@ -25,9 +24,8 @@ router.navigate("/", {
body: { key: "value" },
});

function action({ request }) {
// request.json => { key: "value" }
// request.text => '{ "key":"value" }'
async function action({ request }) {
// await request.json() => { key: "value" }
}
```

Expand All @@ -38,7 +36,7 @@ router.navigate("/", {
body: "Text submission",
});

function action({ request }) {
// request.text => "Text submission"
async function action({ request }) {
// await request.text() => "Text submission"
}
```
18 changes: 7 additions & 11 deletions .changeset/raw-payload-submission.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"react-router-dom": minor
---

Add support for `application/json` and `text/plain` encodings for `useSubmit`/`fetcher.submit`. To reflect these additional types, `useNavigation`/`useFetcher` now also contain `navigation.json`/`navigation.text` and `fetcher.json`/`fetcher.text` which are getter functions mimicking `request.json` and `request.text`. Just as a `Request` does, if you access one of these methods for the incorrect encoding type, it will throw an Error (i.e. accessing `navigation.formData` when `navigation.formEncType` is `application/json`).
Add support for `application/json` and `text/plain` encodings for `useSubmit`/`fetcher.submit`. To reflect these additional types, `useNavigation`/`useFetcher` now also contain `navigation.json`/`navigation.text` and `fetcher.json`/`fetcher.text` which include the json/text submission if applicable.

```jsx
// The default behavior will still serialize as FormData
Expand All @@ -12,13 +12,11 @@ function Component() {
submit({ key: "value" });
// navigation.formEncType => "application/x-www-form-urlencoded"
// navigation.formData => FormData instance
// navigation.text => "key=value"
}

function action({ request }) {
async function action({ request }) {
// request.headers.get("Content-Type") => "application/x-www-form-urlencoded"
// request.formData => FormData instance
// request.text => "key=value"
// await request.formData() => FormData instance
}
```

Expand All @@ -29,13 +27,11 @@ function Component() {
submit({ key: "value" }, { encType: "application/json" });
// navigation.formEncType => "application/json"
// navigation.json => { key: "value" }
// navigation.text => '{"key":"value"}'
}

function action({ request }) {
async function action({ request }) {
// request.headers.get("Content-Type") => "application/json"
// request.json => { key: "value" }
// request.text => '{"key":"value"}'
// await request.json => { key: "value" }
}
```

Expand All @@ -48,8 +44,8 @@ function Component() {
// navigation.text => "Text submission"
}

function action({ request }) {
async function action({ request }) {
// request.headers.get("Content-Type") => "text/plain"
// request.text => "Text submission"
// await request.text() => "Text submission"
}
```
2 changes: 1 addition & 1 deletion .changeset/smart-pots-repair.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
"@remix-run/router": patch
---

upgrade typescript to 5.1
Upgrade `typescript` to 5.1
9 changes: 9 additions & 0 deletions packages/react-router-dom-v5-compat/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# `react-router-dom-v5-compat`

## 6.14.0-pre.0

### Patch Changes

- upgrade typescript to 5.1 ([#10581](https://github.com/remix-run/react-router/pull/10581))
- Updated dependencies:
- `react-router@6.14.0-pre.0`
- `react-router-dom@6.14.0-pre.0`

## 6.13.0

### 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.13.0",
"version": "6.14.0-pre.0",
"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.13.0"
"react-router": "6.14.0-pre.0"
},
"peerDependencies": {
"react": ">=16.8",
Expand Down
62 changes: 62 additions & 0 deletions packages/react-router-dom/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,67 @@
# `react-router-dom`

## 6.14.0-pre.0

### Minor Changes

- Add support for `application/json` and `text/plain` encodings for `useSubmit`/`fetcher.submit`. To reflect these additional types, `useNavigation`/`useFetcher` now also contain `navigation.json`/`navigation.text` and `fetcher.json`/`fetcher.text` which include the json/text submission if applicable. ([#10413](https://github.com/remix-run/react-router/pull/10413))

```jsx
// The default behavior will still serialize as FormData
function Component() {
let navigation = useNavigation();
let submit = useSubmit();
submit({ key: "value" });
// navigation.formEncType => "application/x-www-form-urlencoded"
// navigation.formData => FormData instance
}

async function action({ request }) {
// request.headers.get("Content-Type") => "application/x-www-form-urlencoded"
// await request.formData() => FormData instance
}
```

```js
// Opt-into JSON encoding with `encType: "application/json"`
function Component() {
let submit = useSubmit();
submit({ key: "value" }, { encType: "application/json" });
// navigation.formEncType => "application/json"
// navigation.json => { key: "value" }
}
async function action({ request }) {
// request.headers.get("Content-Type") => "application/json"
// await request.json => { key: "value" }
}
```

```js
// Opt-into JSON encoding with `encType: "application/json"`
function Component() {
let submit = useSubmit();
submit("Text submission", { encType: "text/plain" });
// navigation.formEncType => "text/plain"
// navigation.text => "Text submission"
}
async function action({ request }) {
// request.headers.get("Content-Type") => "text/plain"
// await request.text() => "Text submission"
}
```

### Patch Changes

- When submitting a form from a `submitter` element, prefer the built-in `new FormData(form, submitter)` instead of the previous manual approach in modern browsers (those that support the new `submitter` parameter). For browsers that don't support it, we continue to just append the submit button's entry to the end, and we also add rudimentary support for `type="image"` buttons. If developers want full spec-compliant support for legacy browsers, they can use the `formdata-submitter-polyfill`. ([#9865](https://github.com/remix-run/react-router/pull/9865))
- upgrade `typescript` to 5.1 ([#10581](https://github.com/remix-run/react-router/pull/10581))
- Call `window.history.pushState/replaceState` before updating React Router state (instead of after) so that `window.location` matches `useLocation` during synchronous React 17 rendering. However, generally apps should not be relying on `window.location` and should always reference `useLocation` when possible, as `window.location` will not be in sync 100% of the time (due to `popstate` events, concurrent mode, etc.) ([#10211](https://github.com/remix-run/react-router/pull/10211))
- Fix `tsc --skipLibCheck:false` issues on React 17 ([#10622](https://github.com/remix-run/react-router/pull/10622))
- Updated dependencies:
- `react-router@6.14.0-pre.0`
- `@remix-run/router@1.7.0-pre.0`

## 6.13.0

### Minor 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.13.0",
"version": "6.14.0-pre.0",
"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.6.3",
"react-router": "6.13.0"
"@remix-run/router": "1.7.0-pre.0",
"react-router": "6.14.0-pre.0"
},
"devDependencies": {
"react": "^18.2.0",
Expand Down
8 changes: 8 additions & 0 deletions packages/react-router-native/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# `react-router-native`

## 6.14.0-pre.0

### Patch Changes

- upgrade typescript to 5.1 ([#10581](https://github.com/remix-run/react-router/pull/10581))
- Updated dependencies:
- `react-router@6.14.0-pre.0`

## 6.13.0

### 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.13.0",
"version": "6.14.0-pre.0",
"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.13.0"
"react-router": "6.14.0-pre.0"
},
"devDependencies": {
"react": "^18.2.0",
Expand Down
12 changes: 12 additions & 0 deletions packages/react-router/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# `react-router`

## 6.14.0-pre.0

### Patch Changes

- Strip `basename` from locations provided to `unstable_useBlocker` functions to match `useLocation` ([#10573](https://github.com/remix-run/react-router/pull/10573))
- Fix `generatePath` when passed a numeric `0` value parameter ([#10612](https://github.com/remix-run/react-router/pull/10612))
- Fix `unstable_useBlocker` key issues in `StrictMode` ([#10573](https://github.com/remix-run/react-router/pull/10573))
- Fix `tsc --skipLibCheck:false` issues on React 17 ([#10622](https://github.com/remix-run/react-router/pull/10622))
- upgrade `typescript` to 5.1 ([#10581](https://github.com/remix-run/react-router/pull/10581))
- Updated dependencies:
- `@remix-run/router@1.7.0-pre.0`

## 6.13.0

### Minor 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.13.0",
"version": "6.14.0-pre.0",
"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.6.3"
"@remix-run/router": "1.7.0-pre.0"
},
"devDependencies": {
"react": "^18.2.0"
Expand Down
54 changes: 54 additions & 0 deletions packages/router/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,59 @@
# `@remix-run/router`

## 1.7.0-pre.0

### Minor Changes

- Add support for `application/json` and `text/plain` encodings for `router.navigate`/`router.fetch` submissions. To leverage these encodings, pass your data in a `body` parameter and specify the desired `formEncType`: ([#10413](https://github.com/remix-run/react-router/pull/10413))

```js
// By default, the encoding is "application/x-www-form-urlencoded"
router.navigate("/", {
formMethod: "post",
body: { key: "value" },
});

async function action({ request }) {
let formData = await request.formData();
// formData => FormData instance with entry [key=value]
}
```

```js
// Pass `formEncType` to opt-into a different encoding
router.navigate("/", {
formMethod: "post",
formEncType: "application/json",
body: { key: "value" },
});
async function action({ request }) {
let json = await request.json();
// json => { key: "value" }
}
```

```js
router.navigate("/", {
formMethod: "post",
formEncType: "text/plain",
body: "Text submission",
});
async function action({ request }) {
let text = await request.text();
// text => "Text submission"
}
```

### Patch Changes

- Call `window.history.pushState/replaceState` before updating React Router state (instead of after) so that `window.location` matches `useLocation` during synchronous React 17 rendering. However, generally apps should not be relying on `window.location` and should always reference `useLocation` when possible, as `window.location` will not be in sync 100% of the time (due to `popstate` events, concurrent mode, etc.) ([#10211](https://github.com/remix-run/react-router/pull/10211))
- Avoid calling `shouldRevalidate` for fetchers that have not yet completed a data load ([#10623](https://github.com/remix-run/react-router/pull/10623))
- Strip `basename` from the `location` provided to `<ScrollRestoration getKey>` to match the `useLocation` behavior ([#10550](https://github.com/remix-run/react-router/pull/10550))
- Fix `unstable_useBlocker` key issues in `StrictMode` ([#10573](https://github.com/remix-run/react-router/pull/10573))
- Upgrade `typescript` to 5.1 ([#10581](https://github.com/remix-run/react-router/pull/10581))

## 1.6.3

### Patch Changes
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.6.3",
"version": "1.7.0-pre.0",
"description": "Nested/Data-driven/Framework-agnostic Routing",
"keywords": [
"remix",
Expand Down

0 comments on commit 8b95f2b

Please sign in to comment.