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 May 3, 2023
2 parents 4692667 + db696c1 commit 4ccdc11
Show file tree
Hide file tree
Showing 21 changed files with 118 additions and 70 deletions.
5 changes: 0 additions & 5 deletions .changeset/descendant-routes-component.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/empty-path-basename-navigation.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/navigate-from-routes.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/navigate-strict-mode.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/same-hash-links.md

This file was deleted.

7 changes: 4 additions & 3 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@ on:
- main
- dev

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
format:
if: github.repository == 'remix-run/react-router'
runs-on: ubuntu-latest

steps:
- name: 🛑 Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.11.0

- name: ⬇️ Checkout repo
uses: actions/checkout@v3
with:
Expand Down
29 changes: 11 additions & 18 deletions .github/workflows/no-response.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,18 @@ jobs:
- name: 🥺 Handle Ghosting
uses: actions/stale@v8
with:
days-before-close: 10
close-issue-message: >
This issue has been automatically closed because we didn't hear
anything from the original author after the previous notice.
This issue has been automatically closed because we haven't received a
response from the original author 🙈. This automation helps keep the issue
tracker clean from issues that aren't actionable. Please reach out if you
have more information for us! 🙂
close-pr-message: >
This PR has been automatically closed because we didn't hear
anything from the original author after the previous notice.
This PR has been automatically closed because we haven't received a
response from the original author 🙈. This automation helps keep the issue
tracker clean from PRs that aren't actionable. Please reach out if you
have more information for us! 🙂
# don't automatically mark issues/PRs as stale
days-before-stale: -1
stale-issue-label: needs-response
stale-issue-message: >
This issue has been automatically marked stale because we haven't
received a response from the original author in a while 🙈. This
automation helps keep the issue tracker clean from issues that are
not actionable. Please reach out if you have more information for us
or you think this issue shouldn't be closed! 🙂 If you don't do so
within 7 days, this issue will be automatically closed.
stale-pr-label: needs-response
stale-pr-message: >
This PR has been automatically marked stale because we haven't
received a response from the original author in a while 🙈. This
automation helps keep the issue tracker clean from issues that are
not actionable. Please reach out if you have more information for us
or you think this issue shouldn't be closed! 🙂 If you don't do so
within 7 days, this PR will be automatically closed.
10 changes: 4 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ on:
- "!release-manual"
- "!release-manual-*"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
release:
name: 🦋 Changesets Release
Expand All @@ -18,9 +22,6 @@ jobs:
published_packages: ${{ steps.changesets.outputs.publishedPackages }}
published: ${{ steps.changesets.outputs.published }}
steps:
- name: 🛑 Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.11.0

- name: ⬇️ Checkout repo
uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -66,9 +67,6 @@ jobs:
outputs:
package_version: ${{ steps.find_package_version.outputs.package_version }}
steps:
- name: 🛑 Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.11.0

- name: ⬇️ Checkout repo
uses: actions/checkout@v3

Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,16 @@ on:
- "docs/**"
- "**/*.md"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
name: 🧪 Test
runs-on: ubuntu-latest

steps:
- name: 🛑 Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.11.0

- name: ⬇️ Checkout repo
uses: actions/checkout@v3

Expand Down
5 changes: 3 additions & 2 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,19 @@ You may need to make changes to a pre-release prior to publishing a final stable
### Publishing the stable release

- Exit Changesets pre-release mode: `yarn changeset pre exit`.
- Commit the deleted pre-release file along with any unpublished changesets, and push the the `release-*` branch to GitHub.
- Commit the edited pre-release file along with any unpublished changesets, and push the 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.
- 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
- Convert the `react-router@6.x.y` tag to a Release on Github with the name `v6.x.y`
- Copy the relevant changelog entries from all packages into the Release Notes and adjust accordingly, matching the format used by prior releases

### Hotfix releases

Expand Down
45 changes: 42 additions & 3 deletions docs/routers/create-static-handler.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,52 @@ interface StaticHandler {

These are the same `routes`/`basename` you would pass to [`createBrowserRouter`][createbrowserrouter]

## `handler.query(request)`
## `handler.query(request, opts)`

The `handler.query()` method takes in a Fetch request, performs route matching, and executes all relevant route action/loader methods depending on the request. The return `context` value contains all of the information required to render the HTML document for the request (route-level `actionData`, `loaderData`, `errors`, etc.). If any of the matched routes return or throw a redirect response, then `query()` will return that redirect in the form of Fetch `Response`.

## `handler.queryRoute(request, routeId?)`
### `opts.requestContext`

The `handler.queryRoute` is a more-targeted version that queries a singular route and runs it's loader or action based on the request. You can specify a specific `routeId` or let it match the appropriate route automatically based on the request. The return value is the values returned from the loader or action, which is usually a `Response` object.
If you need to pass information from your server into Remix actions/loaders, you can do so with `opts.requestContext` and it will show up in your actions/loaders in the context parameter.

```ts
const routes = [{
path: '/',
loader({ request, context }) {
// Access `context.dataFormExpressMiddleware` here
},
}];

export async function render(req: express.Request) {
let { query, dataRoutes } = createStaticHandler(routes);
let remixRequest = createFetchRequest(request);
let staticHandlerContext = await query(remixRequest, {
// Pass data from the express layer to the remix layer here
requestContext: {
dataFromExpressMiddleware: req.something
}
});
...
}
```

## `handler.queryRoute(request, opts)`

The `handler.queryRoute` is a more-targeted version that queries a singular route and runs it's loader or action based on the request. By default, it will match the target route based on the request URL. The return value is the values returned from the loader or action, which is usually a `Response` object.

### `opts.routeId`

If you need to call a specific route action/loader that doesn't exactly correspond to the URL (for example, a parent route loader), you can specify a `routeId`:

```js
staticHandler.queryRoute(new Request("/parent/child"), {
routeId: "parent",
});
```

### `opts.requestContext`

If you need to pass information from your server into Remix actions/loaders, you can do so with `opts.requestContext` and it will show up in your actions/loaders in the context parameter. See the example in the `query()` section above.

**See also:**

Expand Down
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.11.1

### Patch Changes

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

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

## 6.11.1

### Patch Changes

- Updated dependencies:
- `react-router@6.11.1`
- `@remix-run/router@1.6.1`

## 6.11.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.11.0",
"version": "6.11.1",
"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.0",
"react-router": "6.11.0"
"@remix-run/router": "1.6.1",
"react-router": "6.11.1"
},
"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.11.1

### Patch Changes

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

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

## 6.11.1

### Patch Changes

- Fix usage of `Component` API within descendant `<Routes>` ([#10434](https://github.com/remix-run/react-router/pull/10434))
- Fix bug when calling `useNavigate` from `<Routes>` inside a `<RouterProvider>` ([#10432](https://github.com/remix-run/react-router/pull/10432))
- Fix usage of `<Navigate>` in strict mode when using a data router ([#10435](https://github.com/remix-run/react-router/pull/10435))
- Updated dependencies:
- `@remix-run/router@1.6.1`

## 6.11.0

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

## 1.6.1

### Patch Changes

- Fix `basename` handling when navigating without a path ([#10433](https://github.com/remix-run/react-router/pull/10433))
- "Same hash" navigations no longer re-run loaders to match browser behavior (i.e. `/path#hash -> /path#hash`) ([#10408](https://github.com/remix-run/react-router/pull/10408))

## 1.6.0

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

0 comments on commit 4ccdc11

Please sign in to comment.