- 14 Aug, 2023 7 commits
-
-
vercel-release-bot authored
-
Tim Neutkens authored
Noticed a small typo, this fixed it. <!-- 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 # -->
-
vercel-release-bot authored
-
Ngô Đức Anh authored
### What? This PR makes it easier to use Next.js with IPv6 hostnames such as `::1` and `::`. ### How? It does so by removing rewrites from `localhost` to `127.0.0.1` introduced in #52492. It also fixes the issue where Next.js tries to fetch something like `http://::1:3000` when `--hostname` is `::1` as it is not a valid URL (browsers' `URL` class throws an error when constructed with such hosts). It also fixes `NextURL` so that it doesn't accept `http://::1:3000` but refuse `http://[::1]:3000`. It also changes `next/src/server/lib/setup-server-worker.ts` so that it uses the server's `address` method to retrieve the host instead of our provided `opts.hostname`, ensuring that no matter what `opts.hostname` is we will always get the correct one. ### Note I've verified that `next dev`, `next start` and `node .next/standalone/server.js` work with IPv6 hostnames (such as `::` and `::1`), IPv4 hostnames (such as `127.0.0.1`, `0.0.0.0`) and `localhost` - and with any of these hostnames fetching to `localhost` also works. Server Actions and middleware have no problems as well. This also removes `.next/standalone/server.js`'s logging as we now use `start-server`'s logging to avoid duplicates. `start-server`'s logging has also been updated to report the actual hostname.   The above pictures also demonstrate using Server Actions with Next.js after this PR.  Fixes #53171 Fixes #49578 Closes NEXT-1510 Co-authored-by:
Tim Neutkens <6324199+timneutkens@users.noreply.github.com> Co-authored-by:
Zack Tanner <1939140+ztanner@users.noreply.github.com>
-
vercel-release-bot authored
-
JJ Kasper authored
This ensures env variables are passed through as expected when building the next-swc binaries, also removes an extra GH actions that isn't really needed as it's just a wrapper around `docker run`. Validated changes against run here https://github.com/vercel/next.js/actions/runs/5851719808/job/15862899331
-
JJ Kasper authored
This fixes unexpected cache hits occurring causing latest next-swc changes to not be built for the docker based builds. Noticed in our turbo run summaries for these builds that no input files were detected most likely due to older Node.js/pnpm versions being used from the old Docker image. This also updates to leverage new runner labels for better build perf cutting build times down from over an hour down to around 20 min. Fixes build issue on aarch64-linux-musl due to `TurboMalloc` not being able to resolve. Test build done here https://github.com/vercel/next.js/actions/runs/5850893681/job/15860929304 x-ref: https://github.com/vercel/next.js/actions/runs/5843580924/job/15845848384 x-ref: https://github.com/vercel/next.js/actions/runs/5837652747/job/15833506858 x-ref: https://github.com/vercel/next.js/actions/runs/5837652747/job/15833506925 x-ref: https://github.com/vercel/next.js/actions/runs/5837652747/job/15833507067 x-ref: https://github.com/vercel/next.js/actions/runs/5837652747/job/15833507135
-
- 12 Aug, 2023 6 commits
-
-
vercel-release-bot authored
-
Hüsrev authored
-
Zack Tanner authored
`expect` is an unsupported header for undici: https://github.com/nodejs/undici/blob/c83b084879fa0bb8e0469d31ec61428ac68160d5/lib/core/request.js#L354 -- this filters it out so that the API routes don't throw an internal server error if that header is included. Also added a test case for the previously submitted PR that was added for `content-length: 0` - x-ref: #53843 Fixes #53822 (erroneously closed by a content-length issue being fixed)
-
Josh Story authored
Updated React from cb3404a0c to f359f9b41. ### React upstream changes - https://github.com/facebook/react/pull/27191 - https://github.com/facebook/react/pull/27209 - https://github.com/facebook/react/pull/27199 - https://github.com/facebook/react/pull/27218 - https://github.com/facebook/react/pull/27217 - https://github.com/facebook/react/pull/27212
-
Jiachi Liu authored
### What? We change the not-found rendering strategy to the origin one which recovers the not found error from the flight data, and hit the error boundary to display the closet not found component. For parallel `@slot` we shouldn't pass down the not-found boundary, the boundary is only for `@children`. ### Why? We're having a lot of not-found matching issues that manually searching for not found and layout won't be accurate as we have various scenarios like `(group)` routes, dynamic routes, etc. ### How? Only render html with empty body so that the error can recover from flight and render the proper not-found component during hydration. One change for metadata is that we need to get the "not-found" metadata in the initial render, so we'll catch the not-found error once there first and start render the "not-found" metadata and put it in the flight data. Then when it recovers it's still preserved. Fixes #53694
-
Kevin Pham authored
Previous of after (before in linked issue) ``` ❯ pnpm add --save-dev @next/eslint-plugin-next Already up to date Progress: resolved 525, reused 517, downloaded 0, added 0, done Done in 6.4s ``` Resolves #53937
-
- 11 Aug, 2023 16 commits
-
-
Artur Bień authored
Adds support for base64-encoded `placeholder`. Enables using placeholders without the "blur" effect. Fixes #47639 - [x] Add support for DataURL placeholder - [x] Add tests - [x] Update docs Co-authored-by:Steven <229881+styfle@users.noreply.github.com>
-
Dima Voytenko authored
-
Donny/강동윤 authored
### What? Update swc crates to https://github.com/swc-project/swc/commit/54f38cb47e4978b96f422c2ca2e7da1c7ae9283f ### Why? To apply minifier bugfixes. ### How? Closes WEB-1358 Fixes #53723 --- turbopack counterpart: https://github.com/vercel/turbo/pull/5699
-
Leah authored
### What? Now that we have wasm support (and support for `?module`) `@vercel/og` should be supported ### Turbopack updates * https://github.com/vercel/turbo/pull/5677 * https://github.com/vercel/turbo/pull/5660 Closes WEB-138
-
Banbarashik authored
remove misused pronoun "it" Co-authored-by:JJ Kasper <22380829+ijjk@users.noreply.github.com>
-
JJ Kasper authored
Adds a new label for distinguishing between runners, also fixes a couple flakey fixtures noticed while benchmarking.
-
Shu Ding authored
Sharp by default spawns #cpu_cores threads to process images which could lead to large memory consumption. This PR caps the `concurrency` value especially on dev. Locally I see a small memory improvement (10~20 MB) from this, but it will mostly affect long-running servers. Related: https://github.com/lovell/sharp/issues/2607Co-authored-by:
Steven <229881+styfle@users.noreply.github.com>
-
Shu Ding authored
Closes #53910.
-
Justin Ridgewell authored
### What? Updates the new `entrypoint.changed()` method to signal whether the server or client assets changed. Now, a `{ changed: 'server' | 'client' | 'both' }` will value will be yielded by the subscription. ### Why? So that client-only changes can be handled differently than server-only changes. ### How? We just needed to track the server and client output assets separately, so that we can detect changes to either individually. It's difficult to tell what `Vc` change triggered a recomputation on the Rust side (I'd have to involve mutable `State` into the Vc), and it's also hard to re-emit a duplicate value (eg, if a client change follows a client change, we need 2 emits). Instead, I tie the two different `server_changed()` and `client_changed()` functions into a single enum on the TS side. Depends on https://github.com/vercel/next.js/pull/53809, since I don't want to introduce merge conflicts while Tobias is on vacation. -
Jiachi Liu authored
This is an improvement for twitter card, if there's image present we could use `summary_large_image` to make the twitter card look better instead of using `summary` by default, so that users could benefit from the large image card display on twitter
-
Jan Nicklas authored
### Bug Fix fixes #53366 ### Change Add `query` and [`matchResource`](https://webpack.js.org/api/loaders/#inline-matchresource) to the module mapping. ### Why `mod.resource` and all other paths inside `packages/next/src/build/webpack/plugins/flight-client-entry-plugin.ts` are already using the query: https://github.com/vercel/next.js/blob/e127c51327ee9191098fb7b73c681db934505dcc/packages/next/src/build/webpack/plugins/flight-client-entry-plugin.ts#L506-L507 https://github.com/vercel/next.js/blob/e127c51327ee9191098fb7b73c681db934505dcc/packages/next/src/build/webpack/plugins/flight-client-entry-plugin.ts#L584-L585 ### Motivation We are using a static extraction css-in-js solution which uses the [inline match resource feature](https://webpack.js.org/api/loaders/#inline-matchresource) (see more in #53366) As a css-in-js file contains the TSX and the CSS code we have to split the file into two modules which share the same `resource.path`. This works well however there is a problem in the mapping inside `.next/server/app/page_client-reference-manifest.js`. The `ssrModuleMapping` from `addSSRIDMapping` in https://github.com/vercel/next.js/blob/e127c51327ee9191098fb7b73c681db934505dcc/packages/next/src/build/webpack/plugins/flight-manifest-plugin.ts#L270 links to the latest module (the css part) and not the the initial one (the js part). Therefore the css module is rendered [react-server-dom-webpack](https://www.npmjs.com/package/react-server-dom-webpack/v/0.0.1?activeTab=versions) and breaks. The SSR/SSG fails with the error `Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined.` Co-authored-by:
Shu Ding <3676859+shuding@users.noreply.github.com>
-
Justin Ridgewell authored
### What? #51883: > Node.js sets stdout to non-blocking by default, rust expects it to be blocking > > so when logging a lot of data, it can happen that rust receives an error while writing causing it to panic, the error is just that the resource is temporarily unavailable, but rust doesn't handle this case > > See https://github.com/napi-rs/napi-rs/issues/1630 ### Why? ### How? This moves the work done in #51883 into the `loadBindings` function used by both next-api and next-dev.
-
Shu Ding authored
As discussed [here](https://vercel.slack.com/archives/C0591D8EN4C/p1691752316347649?thread_ts=1691743605.677919&cid=C0591D8EN4C), there're other popular icon and component libraries to be added until we have a better solution.
-
vercel-release-bot authored
-
Delba de Oliveira authored
Fixes: https://github.com/vercel/next.js/issues/53787
-
Tobias Koppers authored
### What? * adds more HMR test cases * fixes bugs found ### Why? ### Turbopack changes * https://github.com/vercel/turbo/pull/5668 <!-- OJ Kwon - ci(test): temporarily increase test timeout --> * https://github.com/vercel/turbo/pull/5696 <!-- Tobias Koppers - Cleanup minify -->
-
- 10 Aug, 2023 7 commits
-
-
Colin McDonnell authored
## For Contributors ### Improving Documentation - [x] Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - [x] Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide ### What? Add instructions for using `bun/bunx` where relevant. I only added mentions where npm/yarn/pnpm were all already listed. ### Why Bun can be used as a runtime-agnostic [package manager](https://bun.sh/package-manager) and script runner in any project with a `package.json`. (Sorry, I probably should have consolidated this with https://github.com/vercel/next.js/pull/53467) Co-authored-by:
Steven <229881+styfle@users.noreply.github.com>
-
Dave Carlson authored
fixes https://github.com/vercel/next.js/issues/53822 PR https://github.com/vercel/next.js/pull/53368 introduced a regression causing fetch with custom headers to fail in safari. There are known issues with uncidi when a content-length: 0 header exists. When performing a custom fetch in safari, this header is present. When performing a custom fetch in chrome, this header is not present. Co-authored-by:
Zack Tanner <1939140+ztanner@users.noreply.github.com>
-
Steven authored
This normalizes the backslash for windows users who accidentally use `\` in the request paths instead of the expected `/`. For example, in https://github.com/nodejs/nodejs.org/pull/5617 the slash was hardcoded for split that caused the backlash to remain the the `getStaticPaths()` result. - Fixes #51225
-
Steven authored
You can technically get similar ISR behavior setting the `Cache-Control` in `getServerSideProps()`, but this won't be automatically bypassed when enabling Preview Mode or Draft Mode so this PR adds that to the documentation. x-ref: [slack discussion](https://vercel.slack.com/archives/C03S8ED1DKM/p1691514209722429)
-
Lee Robinson authored
Addressing comments from https://github.com/vercel/next.js/issues/49087. Introduced with https://github.com/vercel/next.js/pull/51869. Related https://github.com/vercel/next.js/issues/50105. This PR adds documentation for `next/link` and useRouter` about how to disable scroll restoration.
-
Tim Neutkens authored
Found that this type was duplicated. This just reuses the existing definition.
-
Steven authored
Follow up to https://github.com/vercel/next.js/pull/53760 This follows the same pattern as other demo links on this page.
-
- 09 Aug, 2023 4 commits
-
-
JJ Kasper authored
This ensures we don't accidentally allow caching server actions causing unexpected behavior.
-
Lucas Constantino Silva authored
This PR document the cache tagging semantics in Next.js, and how to benefit from it during cache revalidation.
-
Luud Janssen authored
Closes #48479. Couldn't find the source for the Next.js beta docs, so I didn't add documentation. Co-authored-by:Jiachi Liu <4800338+huozhi@users.noreply.github.com>
-
Zack Tanner authored
This is a follow-up to log both conflicting paths & a link to route group docs, which I believe is the only scenario someone could trigger this - https://github.com/vercel/next.js/pull/53752
-