3c87e1b52a
## 📖 What's in there? With Edge Function GA for API Routes, it would make sense to suggest developer to change their runtime key from `experimental-edge` to `edge`. Current behavior is: 1. when using `experimental-edge` in API route: > prints a warning _once:_ `warn - You are using an experimental edge runtime, the API might change.` 1. when using `experimental-edge` in pages: > prints a warning _once:_ `warn - You are using an experimental edge runtime, the API might change. ` 1. when using `edge` in pages: > throws an error _for each page_: `error - Page /xyz provided runtime 'edge', the edge runtime for rendering is currently experimental. Use runtime 'experimental-edge' instead.` This PR adjust case # 1 to indicates which API file is using `experimental-edge` (a warning per page), and suggest to migrate: `warn - /pages/api/xyz provided runtime 'experimental-edge'. It can be updated to 'edge' instead.` - [x] Integration tests added ## 🧪 How to test? Besides running e2e tests with `NEXT_TEST_MODE=dev pnpm testheadless --testPathPattern edge-configurable-runtime`, you can create a test app in `examples` folder: ```jsx // examples/edge-warnings/pages/api/edge.js export default () => new Response('ok') export const config = { runtime: 'experimental-edge' } // examples/edge-warnings/pages/index.jsx export default () => <p>hello world</p> export const runtime = 'experimental-edge' ``` Build next.js then run with `pnpm next dev examples/edge-warnings`. You can try adding more pages with `experimental-edge` runtime (will not produce more warnings), adding more API with `experimental-edge` (will produce new warnings), or change page runtime to `edge` (will produce errors). |
||
---|---|---|
.devcontainer | ||
.github | ||
.husky | ||
.vscode | ||
bench | ||
contributing | ||
docs | ||
errors | ||
examples | ||
packages | ||
scripts | ||
test | ||
.alexignore | ||
.alexrc | ||
.eslintignore | ||
.eslintrc.json | ||
.gitattributes | ||
.gitignore | ||
.npmrc | ||
.prettierignore | ||
.prettierignore_staged | ||
.prettierrc.json | ||
azure-pipelines.yml | ||
CODE_OF_CONDUCT.md | ||
contributing.md | ||
jest.config.js | ||
jest.replay.config.js | ||
lerna.json | ||
license.md | ||
lint-staged.config.js | ||
package.json | ||
plopfile.js | ||
pnpm-lock.yaml | ||
pnpm-workspace.yaml | ||
readme.md | ||
release.js | ||
run-tests.js | ||
test-file.txt | ||
tsconfig-tsec.json | ||
tsconfig.json | ||
tsec-exemptions.json | ||
turbo.json | ||
UPGRADING.md | ||
vercel.json |
Next.js
Getting Started
Visit https://nextjs.org/learn to get started with Next.js.
Documentation
Visit https://nextjs.org/docs to view the full documentation.
Who is using Next.js?
Next.js is used by the world's leading companies. Check out the Next.js Showcase to learn more.
Community
The Next.js community can be found on GitHub Discussions, where you can ask questions, voice ideas, and share your projects.
To chat with other community members you can join the Next.js Discord.
Our Code of Conduct applies to all Next.js community channels.
Contributing
Please see our contributing.md.
Good First Issues
We have a list of good first issues that contain bugs that have a relatively limited scope. This is a great place to get started, gain experience, and get familiar with our contribution process.
Authors
- Tim Neutkens (@timneutkens)
- Naoyuki Kanezawa (@nkzawa)
- Guillermo Rauch (@rauchg)
- Arunoda Susiripala (@arunoda)
- Tony Kovanen (@tonykovanen)
- Dan Zajdband (@impronunciable)
Security
If you believe you have found a security vulnerability in Next.js, we encourage you to responsibly disclose this and not open a public issue. We will investigate all legitimate reports. Email security@vercel.com
to disclose any security vulnerabilities.