-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into release-next
- Loading branch information
Showing
38 changed files
with
4,781 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"react-router-dom": patch | ||
--- | ||
|
||
Added pass-through event listener options argument to `useBeforeUnload` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@remix-run/router": minor | ||
--- | ||
|
||
Added support for navigation blocking APIs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"react-router-dom": minor | ||
--- | ||
|
||
Add `unstable_useBlocker` hook for blocking navigations within the app's location origin |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,39 @@ | ||
name: 🕊 Release | ||
name: 🦋 Changesets Release | ||
on: | ||
push: | ||
branches: | ||
- release | ||
- "release-*" | ||
- "!release-experimental" | ||
- "!release-experimental-*" | ||
|
||
concurrency: ${{ github.workflow }}-${{ github.ref }} | ||
|
||
env: | ||
CI: true | ||
- "!release-manual" | ||
- "!release-manual-*" | ||
|
||
jobs: | ||
release: | ||
name: 🦋 Changesets Release | ||
if: github.repository == 'remix-run/react-router' | ||
runs-on: ubuntu-latest | ||
|
||
outputs: | ||
publishedPackages: ${{ steps.changesets.outputs.publishedPackages }} | ||
published: ${{ steps.changesets.outputs.published }} | ||
steps: | ||
- name: 🛑 Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
|
||
- name: ⬇️ Checkout repo | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: ⎔ Setup Node | ||
- name: ⎔ Setup node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: ".nvmrc" | ||
cache: yarn | ||
cache: "yarn" | ||
|
||
- name: 📥 Install dependencies | ||
# even though this is called "npm-install" it does use yarn to install | ||
# because we have a yarn.lock and caches efficiently. | ||
uses: bahmutov/npm-install@v1 | ||
- name: 📥 Install deps | ||
run: yarn --frozen-lockfile | ||
|
||
- name: 🔐 Setup npm auth | ||
run: | | ||
|
@@ -52,16 +52,45 @@ jobs: | |
version: yarn run version | ||
commit: "chore: Update version for release" | ||
title: "chore: Update version for release" | ||
publish: yarn release | ||
publish: yarn run release | ||
createGithubReleases: false | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN_SO_OTHER_ACTIONS_RUN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
# comment: | ||
# needs: [release] | ||
# name: 📝 Comment on related issues and pull requests | ||
# if: github.repository == 'remix-run/react-router' | ||
# uses: remix-run/react-router/.github/workflows/release-comments.yml@main | ||
# with: | ||
# ref: ${{ github.ref }} | ||
findPackage: | ||
name: 🦋 Find Package | ||
needs: [release] | ||
runs-on: ubuntu-latest | ||
if: github.repository == 'remix-run/react-router' && needs.release.outputs.published == 'true' | ||
outputs: | ||
package: ${{ steps.findPackage.outputs.package }} | ||
steps: | ||
- name: 🛑 Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
|
||
- name: ⬇️ Checkout repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: ⎔ Setup node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
cache: "npm" | ||
|
||
- id: findPackage | ||
run: | | ||
package=$(node ./scripts/release/find-release-from-changeset.js) | ||
echo "package=${package}" >> $GITHUB_OUTPUT | ||
env: | ||
packageVersionToFollow: "react-router" | ||
publishedPackages: ${{ needs.release.outputs.publishedPackages }} | ||
|
||
comment: | ||
name: 📝 Comment on related issues and pull requests | ||
if: github.repository == 'remix-run/react-router' && needs.findPackage.outputs.package != '' | ||
needs: [release, findPackage] | ||
uses: ./.github/workflows/release-comments.yml | ||
with: | ||
ref: refs/tags/${{ needs.findPackage.outputs.package }} | ||
packageVersionToFollow: "react-router" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,4 +22,5 @@ node_modules/ | |
/packages/react-router-dom-v5-compat/react-router-dom | ||
|
||
.eslintcache | ||
/.env | ||
/.env | ||
/NOTES.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
node_modules | ||
.DS_Store | ||
dist | ||
dist-ssr | ||
*.local |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"installDependencies": true, | ||
"startCommand": "npm run dev" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
title: Navigation Blocking | ||
toc: false | ||
order: 1 | ||
--- | ||
|
||
# Navigation Blocking | ||
|
||
This example demonstrates using `unstable_useBlocker` to prevent navigating away from a page where you might lose user-entered form data. A potentially better UX for this is storing user-entered information in `sessionStorage` and pre-populating the form on return. | ||
|
||
## Preview | ||
|
||
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/main/examples/navigation-blocking?file=src/App.tsx) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>React Router - Navigation Blocking</title> | ||
</head> | ||
<body> | ||
<div id="root"></div> | ||
<script type="module" src="/src/main.tsx"></script> | ||
</body> | ||
</html> |
Oops, something went wrong.