-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into release-next
- Loading branch information
Showing
23 changed files
with
1,980 additions
and
41 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 |
---|---|---|
|
@@ -41,15 +41,19 @@ You may need to make changes to a pre-release prior to publishing a final stable | |
- Commit the edited pre-release file along with any unpublished changesets, and push the `release-*` branch to GitHub. | ||
- Wait for the release workflow to finish. The Changesets action in the workflow will open a PR that will increment all versions and generate the changelogs for the stable release. | ||
- Review the updated `CHANGELOG` files and make any adjustments necessary. | ||
- `find packages -name 'CHANGELOG.md' -mindepth 2 -maxdepth 2 -exec code {} \;` | ||
- We should remove the changelogs for all pre-releases ahead of publishing the stable version. | ||
- [TODO: We should automate this] | ||
- Prepare the GitHub release notes | ||
- Copy the relevant changelog entries from all packages into the Release Notes and adjust accordingly, matching the format used by prior releases | ||
- Merge the PR into the `release-*` branch. | ||
- Once the PR is merged, the release workflow will publish the updated packages to npm. | ||
- Once the release is published: | ||
- merge the `release-*` branch into `main` and push it up to GitHub | ||
- merge the `release-*` branch into `dev` and push it up to GitHub | ||
- Pull the latest `release-*` branch containing the PR you just merged | ||
- Merge the `release-*` branch into `main` **using a non-fast-forward merge** and push it up to GitHub | ||
- `git checkout main; git merge --no-ff release-next` | ||
- Merge the `release-*` branch into `dev` **using a non-fast-forward merge** and push it up to GitHub | ||
- `git checkout dev; git merge --no-ff release-next` | ||
- Convert the `[email protected]` tag to a Release on GitHub with the name `v6.x.y` | ||
|
||
### Hotfix releases | ||
|
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
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
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
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
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
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
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
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
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,28 @@ | ||
--- | ||
title: Authentication (using RouterProvider) | ||
toc: false | ||
--- | ||
|
||
# Auth Example (using RouterProvider) | ||
|
||
This example demonstrates how to restrict access to routes to authenticated users when using `<RouterProvider>`. | ||
|
||
The primary difference compared to how authentication was handled in `BrowserRouter` is that since `RouterProvider` decouples fetching from rendering, we can no longer rely on React context and/or hooks to get our user authentication status. We need access to this information outside of the React tree so we can use it in our route `loader` and `action` functions. | ||
|
||
For some background information on this design choice, please check out the [Remixing React Router](https://remix.run/blog/remixing-react-router) blog post and Ryan's [When to Fetch](https://www.youtube.com/watch?v=95B8mnhzoCM) talk from Reactathon. | ||
|
||
Be sure to pay attention to the following features in this example: | ||
|
||
- The use of a standalone object _outside of the React tree_ that manages our authentication state | ||
- The use of `loader` functions to check for user authentication | ||
- The use of `redirect` from the `/protected` `loader` when the user is not logged in | ||
- The use of a `<Form>` and an `action` to perform the login | ||
- The use of a `from` search param and a `redirectTo` hidden input to preserve the previous location so you can send the user there after they authenticate | ||
- The use of `<Form replace>` to replace the `/login` route in the history stack so the user doesn't return to the login page when clicking the back button after logging in | ||
- The use of a `<fetcher.Form>` and an `action` to perform the logout | ||
|
||
## 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/auth-router-provider?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 - Auth Example</title> | ||
</head> | ||
<body> | ||
<div id="root"></div> | ||
<script type="module" src="/src/main.tsx"></script> | ||
</body> | ||
</html> |
Oops, something went wrong.