- 06 Jul, 2023 24 commits
-
-
vercel-release-bot authored
-
vercel-release-bot authored
-
doinki authored
You can specify keepAliveTimeout as an environment variable in standalone mode, but there is a problem with it not being properly applied. #46052 #### before <img width="574" alt="2023-05-24 12 49 12" src="https://github.com/vercel/next.js/assets/90969158/9014252e-dcac-4b32-805a-68e844e853b1"> <img width="574" alt="2023-05-24 12 49 20" src="https://github.com/vercel/next.js/assets/90969158/8c5672b2-8af8-4751-aa0c-7347428c3cbb"> #### after <img width="574" alt="2023-05-24 1 19 12" src="https://github.com/vercel/next.js/assets/90969158/96a83b0d-1dd1-45b7-b053-e0103185dd47">
-
Yiğithan authored
This pull request adds the missing `Metadata` type declaration to the root layout of the `create-next-app` templates. The metadata object was missing its type definition, which has been resolved by adding the appropriate type import and annotation. ---------
-
Hong Zheng You authored
There's a small typo: `[pagesExtension]` -> `[pageExtensions]`. Got confused why my instrumentation hook was not called. When I searched my source code for `pagesExtension` there was no occurrence so I thought I did not use it; soon after I realized the field in the docs has a typo .
-
Sebastian Markbåge authored
Adds a regression test for testing progressive enhancement of Server Actions. Both when passed from a Server Component and when imported into a Client Component. #51723 landed a bit too early which broke this but it'll be fixed again once React is upgraded. Co-authored-by:Shu Ding <g@shud.in>
-
Steven authored
This is a follow up to PR https://github.com/vercel/next.js/pull/52291 which removed the `next.config.js` which started causing an error during CI: ``` @next/swc:test-cargo-bench: error: couldn't read packages/next-swc/crates/next-dev/benches/next.config.js: No such file or directory (os error 2) @next/swc:test-cargo-bench: --> packages/next-swc/crates/next-dev/benches/bundler.rs:74:13 @next/swc:test-cargo-bench: | @next/swc:test-cargo-bench: 74 | include_bytes!("next.config.js"), @next/swc:test-cargo-bench: | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @next/swc:test-cargo-bench: | @next/swc:test-cargo-bench: = note: this error originates in the macro `include_bytes` (in Nightly builds, run with -Z macro-backtrace for more info) @next/swc:test-cargo-bench: @next/swc:test-cargo-bench: error: could not compile `next-dev` (bench "mod") due to previous error @next/swc:test-cargo-bench: warning: build failed, waiting for other jobs to finish... @next/swc:test-cargo-bench: ELIFECYCLE Command failed with exit code 101. ``` https://github.com/vercel/next.js/actions/runs/5476339074/jobs/9973767389#step:27:959
-
Tyler Lutz authored
- Add app router example to 03-environment-variables.mdx Co-authored-by:
Delba de Oliveira <32464864+delbaoliveira@users.noreply.github.com> Co-authored-by:
Steven <229881+styfle@users.noreply.github.com>
-
Muhammad Rio Ananta Firdaus authored
Fixes a link for the Dynamic Functions shortcut.
-
Delba de Oliveira authored
Fixes: https://github.com/vercel/next.js/issues/51938
-
Alex Kirszenberg authored
Depends on https://github.com/vercel/turbo/pull/5398 (and downstack) on the Turbo side. This PR makes it so the output path of Node.js entry chunks for pages is determined solely from the pathname. This isn't actually necessary for pages, but it makes for easier debugging anyway. See the Turbo PR for more details. This also changes the page structure so it also works if there is no `pages` directory. In this case, we still want to use pages' default _app, _document, and _error pages, even with existing app routes. So an empty page structure should still have an effect. ## Turbopack updates * https://github.com/vercel/turbo/pull/5415 <!-- Will Binns-Smith - Turbopack: Execution tests in node.js --> * https://github.com/vercel/turbo/pull/5461 <!-- Tobias Koppers - use a lock to ensure atomic invalidation from file changes --> * https://github.com/vercel/turbo/pull/5398 <!-- Alex Kirszenberg - Configure the path of the Node.js entry chunk --> * https://github.com/vercel/turbo/pull/5469 <!-- Tobias Koppers - allow hmr tests to correctly detect hmr event -->
-
Jimmy Lai authored
x-ref: https://github.com/vercel/next.js/actions/runs/5475379084/jobs/9971770362?pr=52320 --------- Co-authored-by:
Jiachi Liu <inbox@huozhi.im>
-
Andrew Clark authored
*This is a resubmit of https://github.com/vercel/next.js/pull/52268 because I neglected to run `pnpm install` last time and it was accidentally automerged before I could fix it.* 5.0.0-canary-7118f5dd7-20230705 includes a new lint error for hook calls inside an async component, a common mistake when refactoring Server Components to Client Components, or vice versa. This updates the dependency in eslint-config-next. <!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change(s) that you're making: ## For Contributors ### Improving Documentation - Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide ### Adding or Updating Examples - The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md ### Fixing a bug - Related issues linked using `fixes #number` - Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### Adding a feature - Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas) - Related issues/discussions are linked using `fixes #number` - e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Documentation added - Telemetry added. In case of a feature if it's used or not. - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ## For Maintainers - Minimal description (aim for explaining to someone not on the team to understand the PR) - When linking to a Slack thread, you might want to share details of the conclusion - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues - Add review comments if necessary to explain to the reviewer the logic behind a change ### What? ### Why? ### How? Closes NEXT- Fixes # --> Co-authored-by:
Tim Neutkens <tim@timneutkens.nl>
-
Steven authored
Fixes #49409 ### React upstream changes - https://github.com/facebook/react/pull/27045 - https://github.com/facebook/react/pull/27051 - https://github.com/facebook/react/pull/27032 - https://github.com/facebook/react/pull/27031 - https://github.com/facebook/react/pull/27029 - https://github.com/facebook/react/pull/27028 - https://github.com/facebook/react/pull/27027 - https://github.com/facebook/react/pull/27019 - https://github.com/facebook/react/pull/26954 - https://github.com/facebook/react/pull/26987 - https://github.com/facebook/react/pull/26985 - https://github.com/facebook/react/pull/26933 - https://github.com/facebook/react/pull/26625 - https://github.com/facebook/react/pull/27011 - https://github.com/facebook/react/pull/27008 - https://github.com/facebook/react/pull/26997 - https://github.com/facebook/react/pull/26989 - https://github.com/facebook/react/pull/26955 - https://github.com/facebook/react/pull/26963 - https://github.com/facebook/react/pull/26983 - https://github.com/facebook/react/pull/26914 - https://github.com/facebook/react/pull/26951 - https://github.com/facebook/react/pull/26977 - https://github.com/facebook/react/pull/26958 - https://github.com/facebook/react/pull/26940 - https://github.com/facebook/react/pull/26939 - https://github.com/facebook/react/pull/26887 - https://github.com/facebook/react/pull/26947 - https://github.com/facebook/react/pull/26945 - https://github.com/facebook/react/pull/26942 - https://github.com/facebook/react/pull/26938 - https://github.com/facebook/react/pull/26844 - https://github.com/facebook/react/pull/25510 - https://github.com/facebook/react/pull/26932 - https://github.com/facebook/react/pull/26896 - https://github.com/facebook/react/pull/26913 - https://github.com/facebook/react/pull/26888 - https://github.com/facebook/react/pull/26827 - https://github.com/facebook/react/pull/26889 - https://github.com/facebook/react/pull/26877 - https://github.com/facebook/react/pull/26873 - https://github.com/facebook/react/pull/26880 - https://github.com/facebook/react/pull/26842 - https://github.com/facebook/react/pull/26858 - https://github.com/facebook/react/pull/26754 - https://github.com/facebook/react/pull/26753 - https://github.com/facebook/react/pull/26881 --------- Co-authored-by:
Jiachi Liu <inbox@huozhi.im>
-
Shu Ding authored
Update some of the hash we're using in the framework to use `sha1` instead. It's usually up to 20% faster than `sha256` and slightly faster than `md5`. All these places are only using the algorithm to generate a checksum, so there's no security concern to switch the algorithm. - packages/next/src/build/index.ts: using the hash as the key to track the traced files - packages/next/src/build/webpack/config/blocks/css/loaders/getCssModuleLocalIdent.ts: CSS modules class name generation - packages/next/src/build/webpack/loaders/next-flight-css-loader.ts: checksum for server imported CSS's file content - packages/next/src/build/webpack/loaders/next-font-loader/index.ts: font asset hash - packages/next/src/cli/next-dev.ts: instrumentation file hash - packages/next/src/server/dev/hot-reloader.ts: module hash for HMR
-
bottxiang authored
<!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change(s) that you're making: ## For Contributors ### Improving Documentation - Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide ### Adding or Updating Examples - The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md ### Fixing a bug - Related issues linked using `fixes #number` - Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### Adding a feature - Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas) - Related issues/discussions are linked using `fixes #number` - e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Documentation added - Telemetry added. In case of a feature if it's used or not. - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ## For Maintainers - Minimal description (aim for explaining to someone not on the team to understand the PR) - When linking to a Slack thread, you might want to share details of the conclusion - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues - Add review comments if necessary to explain to the reviewer the logic behind a change ### What? This component cause Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined](https://stackoverflow.com/questions/69211200/next-js-error-element-type-is-invalid-expected-a-string-for-built-in-componen) ### Why? Wrong Link import, default export should be import as `import Link from "next/link"` instead of `import {Link} from "next/link"`; `; ` ### How? import Link from "next/link" Closes NEXT- Fixes # -->
-
Nourman Hajar authored
<!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change(s) that you're making: ## For Contributors ### Improving Documentation - Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide ### Adding or Updating Examples - The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md ### Fixing a bug - Related issues linked using `fixes #number` - Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### Adding a feature - Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas) - Related issues/discussions are linked using `fixes #number` - e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Documentation added - Telemetry added. In case of a feature if it's used or not. - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ## For Maintainers - Minimal description (aim for explaining to someone not on the team to understand the PR) - When linking to a Slack thread, you might want to share details of the conclusion - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues - Add review comments if necessary to explain to the reviewer the logic behind a change ### What? ### Why? ### How? Closes NEXT- Fixes # --> ### What? / Why? A follow up of previous fix #52148. This PR fixes the error `SyntaxError: Cannot use import statement outside a module` when developing with antd on next canary. I suspect this happens because ant doesn't have a `type: "module"` in their `package.json` files, but the previous `modularizeImports` config uses the `es` version of their lib. This is also reported in comments https://github.com/vercel/next.js/pull/52148#discussion_r1251408484 and https://github.com/vercel/next.js/pull/52148#issuecomment-1619563059 ### How? Use the non-ES version. Instead of importing from `antd/es` dir, we use `antd/lib` dir. and also change `@ant-design/icons/` into `@ant-design/icons/lib/icons/` This `modularizeImports` config has also been used in my company's project. Co-authored-by:
JJ Kasper <jj@jjsweb.site>
-
Lee Robinson authored
Now that we've improved `/messages` (https://github.com/vercel/next.js/pull/52038), we'd like to start updating some of the content as well
🙏 -
Steven authored
The experimental flag is no longer needed. https://nextjs.org/blog/next-13-4
-
Luba Kravchenko authored
### What? Adds 409 response handling for fetch cache ### Why? So we stop making data cache requests when it returns 409 for a specified amount of time ### How? Set a module scope variable `rateLimitedUntil` that we check against before making a request. If we receive a 409 then set `rateLimitedUntil` to now() + either a specified retry-after value returned from the api or 60s (can make this something else) --------- Co-authored-by:JJ Kasper <jj@jjsweb.site>
-
feikerwu authored
Co-authored-by:Lee Robinson <me@leerob.io>
-
Jiachi Liu authored
### Issue x-ref: https://github.com/vercel/next.js/actions/runs/5469070005/jobs/9957658991?pr=52282#step:27:526 metadata tests are failing as flaky recently, then after digging into it, noticed it as a hmr issue. **Steps to repro with metadata test app** The later (after the 1st one) visited page with client components imports sometimes throw an full reload refresh warning > Fast Refresh will perform a full reload when you edit a file that's imported by modules outside of the React rendering tree. Turns out there's some unexpected hmr events when `"sync"` event is triggered, and client tries to apply the updates but then failed. This PR excludes the triggering by `"sync"` for RSC pages updates. `'sync'` event with errors/warnings will still be handled and then `'built'` event will be handled with hot reload updates Possibly related to #40184
-
JJ Kasper authored
x-ref: [slack thread](https://vercel.slack.com/archives/C04KC8A53T7/p1688583522551569?thread_ts=1688581436.174189&cid=C04KC8A53T7)
-
- 05 Jul, 2023 16 commits
-
-
Jiachi Liu authored
* Remove legacy `head.js` from examples and use `metadata` exports instead * Update the report template ---------
-
Jiachi Liu authored
Found this function is used by `nextra` and log unexpected warning sometimes ``` // node_modules/.pnpm/nextra@2.8.0_2yzqpfdqpxhuhtk2arnb2je2cq/node_modules/nextra/dist/index.js // src/file-system.ts var findPagesDirImport = __toESM(require("next/dist/lib/find-pages-dir.js")); ``` -
Steven authored
https://nextjs.org/docs/app
-
Shu Ding authored
This helps getting rid of the ``` Error: connect ECONNREFUSED ::1:64696 at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1494:16) { errno: -61, code: 'ECONNREFUSED', syscall: 'connect', address: '::1', port: 64696 } ``` error for me when running the standalone server. cc @ijjk. I'm not sure if it's related to https://github.com/http-party/node-http-proxy/issues/835. Co-authored-by:JJ Kasper <22380829+ijjk@users.noreply.github.com>
-
Steven authored
The experimental flag is no longer needed. https://nextjs.org/blog/next-13-4
-
nauvalazhar authored
-
Steven authored
[Some readers](https://twitter.com/madebymutual/status/1676515579362942976 ) are confused about the docs using the term [Legacy](https://en.wikipedia.org/wiki/Legacy_system) thinking it means [Deprecated](https://en.wikipedia.org/wiki/Deprecation). Preview Mode only exists in Pages Router so technically both are legacy, but we don't need to call out Preview Mode specifically as legacy since we don't do that for any other Pages Router feature. This PR removes the term "Legacy" to avoid confusion.
-
JJ Kasper authored
Ensures we don't attempt using the wrong cache handler during build. x-ref: [slack thread](https://vercel.slack.com/archives/C03S8ED1DKM/p1688549526316949)
-
JJ Kasper authored
The test here seems to be failing after merge x-ref: https://github.com/vercel/next.js/actions/runs/5467319221/jobs/9953529745 x-ref: https://github.com/vercel/next.js/actions/runs/5467152519/jobs/9953132439 Reverts vercel/next.js#52157
-
JJ Kasper authored
This ensures we check all statuses properly as previously only one success was required. x-ref: https://github.com/vercel/next.js/pull/52272 x-ref: [slack thread](https://vercel.slack.com/archives/C04DUD7EB1B/p1688573457803739)
-
JJ Kasper authored
Reverts vercel/next.js#52268 x-ref: [slack thread](https://vercel.slack.com/archives/C04DUD7EB1B/p1688573457803739)
-
Justin Ridgewell authored
### What? I've found 2 more spots that didn't properly cancel the streaming response when the client disconnects. This fixes `RenderResult.pipe()` (called during dynamic render results) and `sendResponse()` (used during Route Handlers using `nodejs` runtime). It also (finally) adds tests for all the cases I'm aware of. ### Why? To allow disconnecting from an AI service when a client disconnects. $$$ ### How? Just checks for `response.closed`, which will be closed when the client's connection disconnects.
-
Andrew Clark authored
5.0.0-canary-7118f5dd7-20230705 includes a new [lint error for hook calls inside an async component](https://github.com/facebook/react/commit/7118f5dd7bf5f1c44d0d2944ef8ad58e423909ad), a common mistake when refactoring Server Components to Client Components, or vice versa. This updates the dependency in eslint-config-next.
-
Shu Ding authored
Fix a few KBs (depending on the tree state size) of leaked memory caused by closures. All the marked objects below are caused by `serverActionDispatcher` which are not cleaned up after SSR: 
-
OJ Kwon authored
### What? PR attempts to fix WEB-1214, provides a polyfill to globalThis.crypto.
-
Delba de Oliveira authored
This PR is part of a larger effort to migrate error messages to MDX and use App Router: https://github.com/vercel/front/pull/23459
-