Commit Graph
335 Commits
Author SHA1 Message Date
Niklas MischkulnigandGitHub cd3f86815f Disable Turbopack manifest (#81170)
- Don't create update PRs anymore for the manifests
- Don't read the manifest when running tests
2025-07-02 14:47:33 +02:00
JJ KasperandGitHub fb319ce1bf Update nextjs-bot config (#81138)
Follow-up from https://github.com/vercel/next.js/pull/81134 updating the
email used in commit messages as well.
2025-07-01 10:43:14 -07:00
JJ KasperandGitHub 890c11996a Update workflows for nextjs-bot (#81134)
This updates to use the new bot account specific for Next.js which we've
already been using for stale issues for a bit.
2025-07-01 10:23:05 -07:00
Sebastian "Sebbie" SilbermannandGitHub b2d6b36145 Fix preview builds for forks (#80833) 2025-06-25 11:38:52 +02:00
Wyatt JohnsonandGitHub 5cbee8aef9 fix: fixed merge driver output, does not expect debugging messages to output on stdout (#80736)
The git merge driver does not expect debugging messages to output on
stdout, and instead requires them to output on stderr. This changes the
`console.log` to a `console.error` to account for this requirement.
2025-06-22 12:33:05 +02:00
Benjamin WoodruffandGitHub 2502c0a40c chore(swc-wasm): Fix and clean up various issues with swc-wasm tests (#80471)
- Follow the naming conventions of other environment variables and prefix `TEST_WASM` with `NEXT_TEST_WASM` so that there's less chance of conflicts with user code
- Remove the logic in `setup-wasm.mjs` that modifies the repository (not great for running tests locally) and instead try to match the environment-variable-override behavior used for native (non-wasm) bindings via `NEXT_TEST_WASM_DIR`.
- Hard-fail if `NEXT_TEST_WASM` is set and we fail to load wasm bindings instead of silently using fallback logic that loads native bindings instead.
- We don't need to install `wasm-pack` with `curl | sh` for tests: `pnpm` already installs it (and pins a specific version).
- The whole dance of renaming the directory from `pkg` to `pkg-nextjs` is a hack we use when publishing the package, as we're building both "web" and "nextjs" targets. We don't need to do that for tests.
- Fix handling of `undefined` values in SWC options objects.
- Remove hacks for Next v12.2
2025-06-20 13:14:43 -07:00
Janka UrygaandGitHub 7446af4fce add git merge driver for errors.json (#80722)
Adds a merge driver that can automatically re-number messages added to
`errors.json` if a merge conflict occurs. Now, it would be easier to
just run `pnpm update-error-codes`, but that's slow and requires
installing deps + building everything, so i'm just manually merging +
renumbering instead.

To avoid disrupting people's workflows (in case this is buggy, or
something), it's currently *not enabled by default*. To enable the merge
driver, run:
```shell
scripts/merge-errors-json/install
```
which will add it to your `.git/config`. Once it's been confirmed to
work well, we can make this command run by default in `postinstall`.

### Testing

Other than the test i added (which doesn't run git), i've tested this
manually with this script that rebases some stacked branches:

<details>
<summary>merge-driver-test.sh</summary>

```bash
#!/usr/bin/env bash
set -eu -o pipefail

cd "$1"
current_branch="$(git branch --show-current)"

(
  set -eu -o pipefail
  
  git switch lubieowoce/errors-json-merge-driver

  git switch --force-create 'test/errors-json/base'
  echo '{
    "1": "base message"
  }
  ' > packages/next/errors.json
  git commit -am 'base commit'


  git switch --force-create 'test/errors-json/one';
  echo '{
    "1": "base message",
    "2": "message from branch one"
  }
  ' > packages/next/errors.json
  git commit -am 'commit 1'


  git switch 'test/errors-json/base'

  git switch --force-create 'test/errors-json/stacked-1'
  echo '{
    "1": "base message",
    "2": "message from stacked 1"
  }
  ' > packages/next/errors.json
  git commit -am 'stacked 1'


  git switch --force-create 'test/errors-json/stacked-2'
  echo '{
    "1": "base message",
    "2": "message from stacked 1",
    "3": "message from stacked 2"
  }
  ' > packages/next/errors.json
  git commit -am 'stacked 2'

  git rebase 'test/errors-json/one' --update-refs || true
  bat packages/next/errors.json
  git rebase --abort || true
)

git switch "$current_branch"
```
</details>

The script does a bunch of git operations, so it's easiest to put it
outside of your next.js repo and call `bash merge-driver-test.sh
path/to/next.js`.
2025-06-20 17:56:28 +02:00
Delba de OliveiraGitHubJosephgraphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
2e2ee08b60 Docs IA 2.0: Delete routing section, add BFF guide, polish getting started (#80365)
Closes:
https://linear.app/vercel/issue/DOC-4686/clean-up-routing-section
Redirects: https://github.com/vercel/front/pull/47151

---------

Co-authored-by: Joseph <[email protected]>
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
2025-06-16 13:42:20 +01:00
Sebastian "Sebbie" SilbermannandGitHub 257c3f8c51 Enable preview builds for forks (#79648) 2025-05-27 15:30:15 +00:00
Sebastian "Sebbie" SilbermannandGitHub 522793548a Enforce consistency between packages in preview builds (#79610) 2025-05-27 09:37:01 +02:00
Jiwon ChoiandGitHub e5f2e0f9c1 [release-new] fix: release pr commit contains (#number) at last (#79611)
When the "Version Packages" PR is merged, the created commit is the
format of "Version Packages (#number)". Therefore, the
check-is-release.js script won't match the current regex. Also, I
modified the workflows that use the `check-is-release.js` to consider
the new release as a release workflow as well.
2025-05-26 14:02:49 +02:00
Jiwon ChoiandGitHub 3175a22feb [release] use backport NPM dist tag for backports (#79538)
### Why?

When backport releases are published, they are marked as `latest` dist
tag, which makes `next@latest` not the "latest."

x-ref: [slack
thread](https://vercel.slack.com/archives/C04LGE5SYEB/p1747984846615469)

### How?

Use `stable` dist tag for backports.
2025-05-26 12:14:01 +02:00
2219ba0da9 [release] fix: correctly set tag during publish (#79548)
### Why?

The `process.env.RELEASE_TYPE` handling was set incorrectly. It
should've been set to the "trigger" workflow, but instead, it was set to
the "publish" workflow. Therefore, the "publish" workflow needs to know
which dist tag to set for publish.

---------

Co-authored-by: Sebastian Sebbie Silbermann <[email protected]>
2025-05-26 12:12:24 +02:00
Jiwon ChoiandGitHub 3ddc20a4fb [release-old] use backport NPM dist tag instead of stable for backports (#79612)
PR https://github.com/vercel/next.js/pull/79596 introduced setting
`stable` dist tag for backports, but due to
https://github.com/vercel/next.js/pull/79538#pullrequestreview-2866854431,

> This sounds like something users would use. However, it might point to
14.x when 15.x exists and we would certainly want people to use 14.x.
It's also weird that 14.x would have a `stable` tag but not 15.x.
> 
> That's why `backport` makes more sense since it's less specific and
not common vernacular when talking about release characteristics (e.g.
"experimental", "nightly", "stable", "unstable" etc.).
> 
> The tag could actually just be "internal-backport" and ideally we'd
remove it right after publish. The goal here isn't to come up with a
useful tag for backports. We just want to work around NPM requiring a
tag during publish.

better to use another dist tag: i.e.,`backport`.
2025-05-25 16:39:55 +02:00
JJ KasperandGitHub dc84c3f3e4 Ensure scripts are included in root tsconfig (#79600)
Validated in
https://github.com/vercel/next.js/actions/runs/15232503826/job/42842061880?pr=79600

x-ref: https://github.com/vercel/next.js/pull/79599
2025-05-24 19:38:39 -07:00
JJ KasperandGitHub 0e769b3283 Fix --tag argument in publish-release (#79599)
Somehow `@ts-check` didn't catch this array not being spread anymore.
2025-05-24 17:38:40 -07:00
Jiwon ChoiandGitHub 2bb5ed2103 [release-legacy] fix: set stable dist tag for backport releases instead of latest (#79596)
### Why?

If the current version is less than the latest, it means this is a
backport release. Since NPM sets the `latest` tag by default during
publishing, when users install `next@latest`, they might get the
backported version instead of the actual "latest" version. Therefore, we
explicitly set the tag as `stable` for backports.
2025-05-24 22:12:32 +02:00
56c3ae8191 [release] notify release status via slack (#79409)
This PR adds a step to send Slack notifications of the status of the
release.

---------

Co-authored-by: Sebastian "Sebbie" Silbermann <[email protected]>
2025-05-23 17:04:35 +02:00
d8be11a62b [release] use changesets/action for release-candidate (#79039)
Best to be reviewed with "Hide whitespace".

This PR added release candidate handling and used a switch case to
ensure the correct release type was given.

---------

Co-authored-by: Sebastian "Sebbie" Silbermann <[email protected]>
Co-authored-by: Zack Tanner <[email protected]>
2025-05-23 15:34:02 +02:00
Sebastian "Sebbie" SilbermannandGitHub ca6280dcd9 [sync-react] Base PR on target ref of workflow (#79466) 2025-05-21 21:03:19 +02:00
3fc7d17436 [release] create empty changeset for next when no changeset found during canary release (#79049)
### Why?

When there are no changesets for `next`, the canary release won't be
published even if there are new commits. If this is the case, add an
empty changeset for `next` to let the canary release proceed.

Note that this will result in an empty Changelog and GitHub Release, but
this PR does not cover handling that part.

### Testing Plan

Set env `RELEASE_TYPE=canary` and run `ci:version` locally to see the
result.

---------

Co-authored-by: JJ Kasper <[email protected]>
Co-authored-by: Sebastian "Sebbie" Silbermann <[email protected]>
2025-05-19 19:53:05 +02:00
85c6b3a03d [release] use changesets/action for canary release (#79038)
This PR uses `changesets/action` to handle the canary release. Since the
action creates a Version Packages PR by default, I added a GH Action
that checks if the PR is released from the correct release workflow. It
triple-verifies via the user login (`vercel-release-bot`), PR title
(`Version Packages (canary)`), and a label (`created-by: CI`) to ensure
the opened PR is not trying to spoof.

After the validation, the PR bypasses required checks, is merged into
the canary branch, and proceeds with the rest of the release process.

### Testing Plan

Try running `ci:version` and `ci:publish` locally, and handle the
release type via env `RELEASE_TYPE`.

Confirmed the CI force merge on
https://github.com/devjiwonchoi/lab-releases/pull/13

---------

Co-authored-by: Sebastian "Sebbie" Silbermann <[email protected]>
2025-05-19 19:48:41 +02:00
Jiwon ChoiandGitHub f3f6b6c452 [release] couple next and @next/swc versions (#79036)
### Why?

Since Next.js emits a debug warning to help catch when a stale
`@next/swc` version is being used, couple their versions to be published
together.


https://github.com/vercel/next.js/blob/3f2a3647ee619c92f2d576b83dfde748003a7f31/packages/next/src/build/swc/index.ts#L131-L139
2025-05-19 19:47:55 +02:00
Jiwon ChoiandGitHub 5333dda84f [release] add new ci to use changesets/action for stable release (#79037)
This PR added `.github/workflows/trigger_release_new.yml`, which is a port of `.github/workflows/trigger_release.yml` and modified [publishRelease](https://github.com/vercel/next.js/blob/8223eb86925e575cd641b55626b4bbc4a4d788c6/.github/workflows/build_and_deploy.yml#L529) to use the `changesets/action` to publish to NPM and GitHub Release.

This workflow uses [changesets/action](https://github.com/changesets/action) to publish NPM and GitHub Release. The main difference is that the GitHub Release will be published per package.

### Testing Plan

Try running `ci:version` and `ci:publish` locally.
2025-05-19 18:43:16 +02:00
Jiwon ChoiandGitHub 21c0b42709 Do not run CI for modifying changeset related files (#79315)
<!-- 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 #

-->
2025-05-16 23:23:03 +02:00
Will Binns-SmithandGitHub bd15740e48 Rust: Update safe crates to 2024 Edition (#79104)
These crates could be updated to the 2024 edition of Rust with ~no code
changes~ only formatting changes through `cargo fmt`.

Future PRs will address crates individually with code changes.
2025-05-12 14:27:08 -07:00
JJ KasperandGitHub 6665d5e2f1 Update test new tests for deploy mode (#78737)
This updates our workflow for testing new tests against deploy mode to
allow running against forks as we don't want to introduce flakey tests
in this mode even if opened from forks.
2025-05-01 11:07:37 -07:00
JJ KasperandGitHub 166251dac4 Fix externals doc validation (#78208)
This moves the `validate-externals-doc` job to the `lint` step so it's
not skipped for docs only changes.

x-ref:
https://github.com/vercel/next.js/actions/runs/14475138181/job/40601279813
2025-04-15 11:29:39 -07:00
ospiraandGitHub f53db59ddb [font] prefix leading numeric google-font name with underscore (#78127) 2025-04-14 10:18:56 +02:00
Sebastian "Sebbie" SilbermannandGitHub 1ee500b01e [test] Use React 19.1 everywhere (#77895) 2025-04-10 14:39:55 +02:00
Zack TannerandGitHub ab2ebb1d53 fix: flaky test detection needs to use new turbopack flag (#77908)
As of #77894, there's a new way to indicate Turbopack should run, which breaks flaky tests detection with Turbopack. This swaps out the flag to unblock my downstack PR.
2025-04-07 12:28:24 -07:00
Delba de OliveiraandGitHub 6bc472a788 Docs IA 2.0: Add Deep Dive section placeholder (#77724)
This section will be for developers who want to understand how things
work. It's not essential knowledge, but good to know.

A place for conceptual information and colorful diagrams that explain
the magic behind things ✨ 🌈
2025-04-04 16:24:56 +01:00
Will Binns-SmithandGitHub c11ff2b8e3 Scripts: migrate unpack-next to TypeScript (#77538)
## Convert unpack-next.cjs to TypeScript

### What?
Converted `scripts/unpack-next.cjs` to TypeScript, renaming it to
`scripts/unpack-next.ts` and updating the imports and type definitions.

### Why?
This change continues the ongoing TypeScript migration efforts in the
codebase, providing better type safety and developer experience.

### How?
- Renamed file from `.cjs` to `.ts`
- Converted CommonJS `require()` statements to ES module `import`
statements
- Added type annotation for the `path` parameter in the `realPathIfAny`
function

Fixes #
2025-04-01 16:08:43 -07:00
Will Binns-SmithandGitHub 9f76476ae4 pack-next: use default --js-build as option instead of --no-js-build (#77686)
Yargs automatically creates `--no-` variations of options. Using
`--no-js-build` as an option directly confuses it.

`--no-js-build` remains a valid cli argument.

Test Plan: Verify `pnpm pack-next` builds JS by default and `pnpm
pack-next --no-js-build` doesn’t.

Help now looks like this:

```
pack-next.ts

Options:
      --help      Show help                                            [boolean]
      --version   Show version number                                  [boolean]
      --js-build  Build JavaScript code (default). Use `--no-js-build` to skip
                  building JavaScript                  [boolean] [default: true]
  -p, --project                                                         [string]
      --tar       Create tarballs instead of direct reflinks           [boolean]
      --compress  How compress the binary, useful on platforms where tarballs
                  can exceed 2 GiB, which causes ERR_FS_FILE_TOO_LARGE with
                  pnpm. Defaults to "strip" on Linux, otherwise defaults to
                  "none". Requires `--tar` to be set.
                                             [string] [choices: "none", "strip"]
```
2025-04-01 21:32:21 +00:00
49b000831a chore(ci): Configure codspeed (#76884)
### What?

Configure codspeed

### Why?

To track performance changes of small functions correctly.

### How?

---------

Co-authored-by: Benjamin Woodruff <[email protected]>
2025-03-29 11:02:29 +09:00
Will Binns-SmithandGitHub a6375148dc Refactor build scripts and rewrite pack-next in TypeScript (#77536)
Written with @bgw.

- Transitions to using `tsx` for script execution
- Replaces `patch-package` with TypeScript implementation
- Implements argument parsing and help message with `yargs`
- Uses `execa` for some command execution

Test Plan: Run `pnpm pack-next`, `pnpm swc-build-wasm`, `pnpm unpack-next`, and `pnpm sweep` without errors.
2025-03-28 16:24:32 -07:00
Will Binns-SmithandGitHub 420fa8013b devlow-bench: wait for complete ready for server startup event (#77217)
Previously, we marked the server startup whenever a local url was shown
in stdio. Next.js shows this url as soon as it can to make it actionable
sooner, before the server is truly ready.

This changes makes the event record the time until the “Ready in Nms”
message is shown instead.

Test Plan: `./node_modules/.bin/devlow-bench ./scripts/devlow-bench.mjs`
and validate server startup is recorded.
2025-03-19 12:53:38 +01:00
JJ KasperandGitHub 32de0d9a0f Fix canary only warning for devlow-bench (#76772)
These are failing our canary only check for stable releases so adds
necessary env to avoid this.

x-ref:
https://github.com/vercel/next.js/actions/runs/13641536096/job/38133462655
2025-03-03 23:03:49 +00:00
Hendrik LiebauandGitHub a606ff7e27 Fix octokit.rest.issues.addLabels call (#76601)
Follow-up for #76544.

[Failed worflow
run](https://github.com/vercel/next.js/actions/runs/13560755436/job/37903278074)

The PR number was incorrectly retrieved from the
`octokit.rest.pulls.create` response.
2025-02-27 15:42:41 +01:00
JJ KasperandGitHub 6647a7706f Update more global turbo CLI usage (#76576)
Continues https://github.com/vercel/next.js/pull/76532 as it seems to be
alleviating the `npm` failures so replaces some more usage of global
`npm` installing the turbo CLI.

x-ref:
https://github.com/vercel/next.js/actions/runs/13554859494/job/37886841090#step:15:25
2025-02-27 01:01:38 +00:00
Hendrik LiebauandGitHub 3396eac787 Run React 18 tests for automated update PRs (#76544) 2025-02-26 13:15:47 +01:00
b84bd5221b [dev-overlay] docs: add readme (#76396)
This PR added the README for the dev overlay for future contributors.

[**View
Preview**](https://github.com/vercel/next.js/blob/9136b280a3e194b81c1ea9e4aa7236eeb895a843/packages/next/src/client/components/react-dev-overlay/README.md)

Closes NDX-656

---------

Co-authored-by: Lee Robinson <[email protected]>
2025-02-24 02:55:56 +09:00
Benjamin WoodruffandGitHub 1675073b8f build(scripts/pack-next): Add support for compressing debuginfo with zlib (#74662)
On Linux we must either compress or strip debuginfo, otherwise the debug tarball will be >2GiB, and pnpm (it's actually a node/libuv bug) has issues with files larger than 2GiB.

As far as I can tell Rust can generate line numbers for backtraces with zlib-compressed debuginfo, but not with newer zstd-compressed debuginfo.
2025-01-09 09:11:53 -08:00
832c77d01f examples: remove app-dir and with prefix in the mdx directory name (#73458)
## What?

1. Rename the following examples.

| Before | After |
|--------|--------|
|
[app-dir-mdx](https://github.com/vercel/next.js/tree/canary/examples/app-dir-mdx)
| mdx |
|
[with-mdx](https://github.com/vercel/next.js/tree/canary/examples/with-mdx)
| mdx-pages |
|
[with-mdx-remote](https://github.com/vercel/next.js/tree/canary/examples/with-mdx-remote)
| mdx-remote |

2. Change the example names at README.md in the repositories.
3. Update the mdx pathname in the test files.

## Why?

### Why remove `app-dir-` in the directory name?

The default has already been App Router anyways and a lot of examples
have migrated over.
x-ref:
https://github.com/vercel/next.js/pull/72642#issuecomment-2474415343

### Why remove `with-` in the directory name?

According to [examples
guidelines](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md),

> Example directories should not be prefixed with `with-`

## How did you verify your code works?

I have tested the new
[with-mdx.test.ts](https://github.com/vercel/next.js/blob/canary/test/e2e/yarn-pnp/test/with-mdx.test.ts)
and
[example.test.ts](https://github.com/vercel/next.js/blob/canary/test/examples/examples.test.ts).

### Adding or Updating Examples

- [x] The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- [x] Make sure the linting passes by running `pnpm build && pnpm lint`.
See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

CC: @samcx

Co-authored-by: Sam Ko <[email protected]>
2025-01-07 18:53:42 -08:00
Sebastian "Sebbie" SilbermannandGitHub 21565ff615 sync-react: Handle version bumps across SemVer minors and release channels (#74091) 2024-12-18 22:09:36 +01:00
Delba de OliveiraandGitHub 67921c23ef Docs: Create Examples section (#73858)
Closes: https://linear.app/vercel/issue/DOC-4047/create-examples-section

Redirects: https://github.com/vercel/front/pull/39878
2024-12-13 12:08:44 +00:00
JJ KasperandGitHub 4fdc2ac60e Add NEXT_PRIVATE_SKIP_CANARY_CHECK env for bench job (#73763)
Fixes:
https://github.com/vercel/next.js/actions/runs/12263653936/job/34217267903
2024-12-10 13:00:44 -08:00
a0f85705da test: change with-next-sass to with-sass (#73670)
## Summary

Follow up #73548 and #73633.
#73548 changed the `with-next-sass` to `with-sass` directory.
However, some tests still use old `with-next-sass` name.
This PR updates them.

Co-authored-by: Sam Ko <[email protected]>
2024-12-09 22:16:18 +00:00
Sebastian "Sebbie" SilbermannandGitHub 3c3fd7367e Use React 19 stable in Pages Router (#73562) 2024-12-05 21:19:20 +01:00
Sebastian "Sebbie" SilbermannandGitHub ca99500db3 sync-react: Add affordance to stop syncing Pages Router (#73533) 2024-12-05 19:21:07 +01:00