Skip to content

Commit 13a4166

Browse files
committed
Merge branch 'main' into release-next
2 parents c4e9607 + 656ebc3 commit 13a4166

File tree

6 files changed

+68
-35
lines changed

6 files changed

+68
-35
lines changed

.github/workflows/format.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,16 @@ on:
66
- main
77
- dev
88

9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
913
jobs:
1014
format:
1115
if: github.repository == 'remix-run/react-router'
1216
runs-on: ubuntu-latest
1317

1418
steps:
15-
- name: 🛑 Cancel Previous Runs
16-
uses: styfle/[email protected]
17-
1819
- name: ⬇️ Checkout repo
1920
uses: actions/checkout@v3
2021
with:

.github/workflows/no-response.yml

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,18 @@ jobs:
1717
- name: 🥺 Handle Ghosting
1818
uses: actions/stale@v8
1919
with:
20+
days-before-close: 10
2021
close-issue-message: >
21-
This issue has been automatically closed because we didn't hear
22-
anything from the original author after the previous notice.
22+
This issue has been automatically closed because we haven't received a
23+
response from the original author 🙈. This automation helps keep the issue
24+
tracker clean from issues that aren't actionable. Please reach out if you
25+
have more information for us! 🙂
2326
close-pr-message: >
24-
This PR has been automatically closed because we didn't hear
25-
anything from the original author after the previous notice.
27+
This PR has been automatically closed because we haven't received a
28+
response from the original author 🙈. This automation helps keep the issue
29+
tracker clean from PRs that aren't actionable. Please reach out if you
30+
have more information for us! 🙂
31+
# don't automatically mark issues/PRs as stale
32+
days-before-stale: -1
2633
stale-issue-label: needs-response
27-
stale-issue-message: >
28-
This issue has been automatically marked stale because we haven't
29-
received a response from the original author in a while 🙈. This
30-
automation helps keep the issue tracker clean from issues that are
31-
not actionable. Please reach out if you have more information for us
32-
or you think this issue shouldn't be closed! 🙂 If you don't do so
33-
within 7 days, this issue will be automatically closed.
3434
stale-pr-label: needs-response
35-
stale-pr-message: >
36-
This PR has been automatically marked stale because we haven't
37-
received a response from the original author in a while 🙈. This
38-
automation helps keep the issue tracker clean from issues that are
39-
not actionable. Please reach out if you have more information for us
40-
or you think this issue shouldn't be closed! 🙂 If you don't do so
41-
within 7 days, this PR will be automatically closed.

.github/workflows/release.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ on:
99
- "!release-manual"
1010
- "!release-manual-*"
1111

12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
1216
jobs:
1317
release:
1418
name: 🦋 Changesets Release
@@ -18,9 +22,6 @@ jobs:
1822
published_packages: ${{ steps.changesets.outputs.publishedPackages }}
1923
published: ${{ steps.changesets.outputs.published }}
2024
steps:
21-
- name: 🛑 Cancel Previous Runs
22-
uses: styfle/[email protected]
23-
2425
- name: ⬇️ Checkout repo
2526
uses: actions/checkout@v3
2627
with:
@@ -66,9 +67,6 @@ jobs:
6667
outputs:
6768
package_version: ${{ steps.find_package_version.outputs.package_version }}
6869
steps:
69-
- name: 🛑 Cancel Previous Runs
70-
uses: styfle/[email protected]
71-
7270
- name: ⬇️ Checkout repo
7371
uses: actions/checkout@v3
7472

.github/workflows/test.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,16 @@ on:
1515
- "docs/**"
1616
- "**/*.md"
1717

18+
concurrency:
19+
group: ${{ github.workflow }}-${{ github.ref }}
20+
cancel-in-progress: true
21+
1822
jobs:
1923
test:
2024
name: 🧪 Test
2125
runs-on: ubuntu-latest
2226

2327
steps:
24-
- name: 🛑 Cancel Previous Runs
25-
uses: styfle/[email protected]
26-
2728
- name: ⬇️ Checkout repo
2829
uses: actions/checkout@v3
2930

DEVELOPMENT.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,19 @@ You may need to make changes to a pre-release prior to publishing a final stable
3838
### Publishing the stable release
3939

4040
- Exit Changesets pre-release mode: `yarn changeset pre exit`.
41-
- Commit the deleted pre-release file along with any unpublished changesets, and push the the `release-*` branch to GitHub.
41+
- Commit the edited pre-release file along with any unpublished changesets, and push the the `release-*` branch to GitHub.
4242
- 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.
4343
- Review the updated `CHANGELOG` files and make any adjustments necessary.
4444
- We should remove the changelogs for all pre-releases ahead of publishing the stable version.
4545
- [TODO: We should automate this]
46+
- Prepare the github release notes
47+
- Copy the relevant changelog entries from all packages into the Release Notes and adjust accordingly, matching the format used by prior releases
4648
- Merge the PR into the `release-*` branch.
4749
- Once the PR is merged, the release workflow will publish the updated packages to npm.
4850
- Once the release is published:
4951
- merge the `release-*` branch into `main` and push it up to GitHub
5052
- merge the `release-*` branch into `dev` and push it up to GitHub
5153
- Convert the `[email protected]` tag to a Release on Github with the name `v6.x.y`
52-
- Copy the relevant changelog entries from all packages into the Release Notes and adjust accordingly, matching the format used by prior releases
5354

5455
### Hotfix releases
5556

docs/routers/create-static-handler.md

Lines changed: 42 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,52 @@ interface StaticHandler {
8282

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

85-
## `handler.query(request)`
85+
## `handler.query(request, opts)`
8686

8787
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`.
8888

89-
## `handler.queryRoute(request, routeId?)`
89+
### `opts.requestContext`
9090

91-
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.
91+
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.
92+
93+
```ts
94+
const routes = [{
95+
path: '/',
96+
loader({ request, context }) {
97+
// Access `context.dataFormExpressMiddleware` here
98+
},
99+
}];
100+
101+
export async function render(req: express.Request) {
102+
let { query, dataRoutes } = createStaticHandler(routes);
103+
let remixRequest = createFetchRequest(request);
104+
let staticHandlerContext = await query(remixRequest, {
105+
// Pass data from the express layer to the remix layer here
106+
requestContext: {
107+
dataFromExpressMiddleware: req.something
108+
}
109+
});
110+
...
111+
}
112+
```
113+
114+
## `handler.queryRoute(request, opts)`
115+
116+
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.
117+
118+
### `opts.routeId`
119+
120+
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`:
121+
122+
```js
123+
staticHandler.queryRoute(new Request("/parent/child"), {
124+
routeId: "parent",
125+
});
126+
```
127+
128+
### `opts.requestContext`
129+
130+
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.
92131

93132
**See also:**
94133

0 commit comments

Comments
 (0)