Skip to content

Commit 0caca69

Browse files
Merge branch 'main' into bulk-codeowners
2 parents aa2cbdc + e1a1b5d commit 0caca69

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+11106
-6286
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,9 @@ body:
1212
id: description
1313
attributes:
1414
label: Summary
15-
description: A short description of the problem
15+
description: Describe the problem you're seeing.
1616
placeholder: |
17-
Include what you expected to happen, and what actually happened.
18-
validations:
19-
required: true
20-
- type: textarea
21-
id: steps-to-reproduce
22-
attributes:
23-
label: Steps to reproduce
24-
description: Steps to reproduce the behavior
25-
placeholder: |
26-
1. Go to '...'
27-
2. Click on '....'
28-
3. Scroll down to '....'
29-
4. See error
17+
Be as precise as you can. Feel free to share screenshots, videos, or data from the devtools of your browser.
3018
validations:
3119
required: true
3220
- type: input
@@ -35,11 +23,36 @@ body:
3523
label: A link to a reproduction repository
3624
description: The fastest way to describe your bug is to provide a reproduction repository.
3725
placeholder: https://github.com/project/link-to-your-reproduction-repo
38-
26+
validations:
27+
required: true
3928
- type: markdown
4029
attributes:
4130
value: |
42-
Check out [CONTRIBUTING.md](https://github.com/netlify/next-runtime/blob/main/CONTRIBUTING.md#what-is-a-reproducible-test-case) for advice on producing a reproduction repo.
31+
Check out [our contributing guide](https://github.com/netlify/next-runtime/blob/main/CONTRIBUTING.md#how-to-make-a-minimal-reproduction) for advice on producing a reproduction repo.
32+
- type: textarea
33+
attributes:
34+
label: Expected Result
35+
description: Describe what you expected to happen.
36+
validations:
37+
required: true
38+
- type: textarea
39+
attributes:
40+
label: Actual Result
41+
description: Describe what actually happened.
42+
validations:
43+
required: true
44+
- type: textarea
45+
id: steps-to-reproduce
46+
attributes:
47+
label: Steps to reproduce
48+
description: Steps to reproduce the behavior
49+
placeholder: |
50+
1.
51+
2.
52+
3.
53+
4.
54+
validations:
55+
required: true
4356
- type: input
4457
id: runtime-version
4558
attributes:
@@ -52,7 +65,7 @@ body:
5265
- type: checkboxes
5366
id: more-nextjs-info
5467
attributes:
55-
label: Is your issue related to the `app` directory (beta)?
68+
label: Is your issue related to the `app` directory?
5669
options:
5770
- label: Yes, I am using the `app` directory
5871

.github/pull_request_template.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
11
<!-- Before opening a pull request, ensure you've read our contributing guidelines, https://github.com/netlify/next-runtime/blob/main/CONTRIBUTING.md. -->
22

3-
### Summary
3+
## Description
44

55
<!-- Provide a brief summary of the change. -->
66

7-
### Test plan
7+
### Documentation
88

9-
1. Visit the Deploy Preview ([insert link to specific page]()) ...
9+
<!-- Where is this feature or API documented? Did you create an internal and/or external artifact to document this change? -->
1010

11-
### Relevant links (GitHub issues, Notion docs, etc.) or a picture of cute animal
11+
## Tests
1212

13-
### Standard checks:
13+
<!-- Did you add tests? How did you test this change? -->
1414

15-
<!-- Please delete any options that reviewers shouldn't check. -->
15+
You can test this change yourself like so:
1616

17-
- [ ] Check the Deploy Preview's Demo site for your PR's functionality
18-
- [ ] Add docs when necessary
17+
1. TODO
1918

20-
---
19+
## Relevant links (GitHub issues, etc.) or a picture of cute animal
2120

22-
🧪 Once merged, make sure to update the version if needed and that it was published correctly.
21+
<!-- Link to an issue that is fixed by this PR or related to this PR. -->

.github/workflows/e2e-appdir.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
push:
77
branches: [main]
88

9+
env:
10+
NEXT_SPLIT_API_ROUTES: true
11+
912
jobs:
1013
setup:
1114
runs-on: ubuntu-latest

.github/workflows/e2e-next.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ on:
88
schedule:
99
- cron: '0 0 * * *'
1010

11+
env:
12+
NEXT_SPLIT_API_ROUTES: true
13+
1114
jobs:
1215
setup:
1316
runs-on: ubuntu-latest

.github/workflows/test-integration.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ concurrency:
99
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
1010
cancel-in-progress: true
1111

12+
env:
13+
NEXT_SPLIT_API_ROUTES: true
14+
1215
jobs:
1316
build:
1417
name: Integration tests

.github/workflows/test.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ concurrency:
1111
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
1212
cancel-in-progress: true
1313

14+
env:
15+
NEXT_SPLIT_API_ROUTES: true
16+
1417
jobs:
1518
build:
1619
name: Unit tests

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,4 +152,6 @@ packages/*/lib
152152
cypress/screenshots
153153

154154
# Test cases have node module fixtures
155-
!test/**/node_modules
155+
!test/**/node_modules
156+
157+
/tmp

.release-please-manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"packages/runtime": "4.36.0",
3-
"packages/next": "1.4.5"
2+
"packages/runtime": "4.37.0",
3+
"packages/next": "1.4.6"
44
}

CONTRIBUTING.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,15 @@ Most common commit message prefixes are:
4545

4646
## Releasing
4747

48-
1. Merge the release PR
49-
2. Run `npm publish`
48+
This repository uses [release-please](https://github.com/googleapis/release-please) to automate its releases.
49+
50+
## How to make a minimal reproduction
51+
52+
A reproducible test case is a small Next.js site built to demonstrate a problem - often this problem is caused by a bug in Next.js, next-runtime or user code. Your reproducible test case should contain the bare minimum features needed to clearly demonstrate the bug.
53+
54+
Steps to create a reproducible test case:
55+
56+
- Create a new Next.js site: `npx create-next-app@latest`
57+
- Add any code or functionality related to the issue. For example, if you have problems with middleware functionality you should add all the necessary code of your middleware.
58+
- Verify that you're seeing the expected error(s) when running `netlify serve` and on a deployed version on [Netlify](https://www.netlify.com)
59+
- Publish the code (your GitHub account is a good place to do this) and then link to it when creating an issue. While creating the issue, please give as many details as possible. This could also include screenshots of error messages.

README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,44 @@ If your site uses pnpm to manage dependencies, currently you must
174174
public-hoist-pattern[]=*
175175
```
176176

177+
## Running the tests
178+
179+
To run the tests, ensure that the dependencies are installed as follows:
180+
181+
```shell
182+
npm install
183+
```
184+
185+
Then run the tests:
186+
187+
```shell
188+
npm test
189+
```
190+
191+
### End-to-end tests
192+
193+
In order to run the end-to-end (E2E) tests, you'll need to be logged in to Netlify. You can do this using the [Netlify CLI](https://github.com/netlify/cli) with the command:
194+
195+
```shell
196+
netlify login
197+
```
198+
199+
Alternatively, you can set an environment variable `NETLIFY_AUTH_TOKEN` to a valid Netlify personal access token. This can be obtained from the [Netlify UI](https://docs.netlify.com/cli/get-started/#obtain-a-token-in-the-netlify-ui).
200+
201+
Then run the E2E tests if logged in:
202+
203+
```shell
204+
npm run test:next
205+
```
206+
207+
Or if using an access token:
208+
209+
```shell
210+
NETLIFY_AUTH_TOKEN=your-token-here npm run test:next
211+
```
212+
213+
_Note: The E2E tests will be deployed to a Netlify owned site. To deploy to your own site then set the environment variable `NETLIFY_SITE_ID` to your site ID._
214+
177215
## Feedback
178216

179217
If you think you have found a bug in Next.js on Netlify,

cypress/e2e/default/revalidate.cy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ describe('On-demand revalidation', () => {
3333
cy.request({ url: '/api/revalidate/?select=5', failOnStatusCode: false }).then((res) => {
3434
expect(res.status).to.eq(500)
3535
expect(res.body).to.have.property('message')
36-
expect(res.body.message).to.include('Invalid response 404')
36+
expect(res.body.message).to.include('could not refresh content for path /getStaticProps/withRevalidate/3/, path is not handled by an odb')
3737
})
3838
})
3939
it('revalidates dynamic non-prerendered ISR route with fallback blocking', () => {

demos/default/netlify.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ CYPRESS_CACHE_FOLDER = "../node_modules/.CypressBinary"
1010
# set TERM variable for terminal output
1111
TERM = "xterm"
1212
NODE_VERSION = "16.15.1"
13+
NEXT_SPLIT_API_ROUTES = "true"
1314

1415
[[headers]]
1516
for = "/_next/image/*"

demos/middleware/netlify.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ command = "npm run build"
33
publish = ".next"
44
ignore = "if [ $CACHED_COMMIT_REF == $COMMIT_REF ]; then (exit 1); else git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF ../..; fi;"
55

6+
[build.environment]
7+
NEXT_SPLIT_API_ROUTES = "true"
8+
69
[[plugins]]
710
package = "@netlify/plugin-nextjs"
811

demos/nx-next-monorepo-demo/netlify.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ command = "npm run build"
33
publish = "dist/apps/demo-monorepo/.next"
44
ignore = "if [ $CACHED_COMMIT_REF == $COMMIT_REF ]; then (exit 1); else git diff --quiet $CACHED_COMMIT_REF $COMMIT_REF ../..; fi;"
55

6+
[build.environment]
7+
NEXT_SPLIT_API_ROUTES = "true"
8+
69
[dev]
710
command = "npm run start"
811
targetPort = 4200

0 commit comments

Comments
 (0)