Commit Graph
28952 Commits
Author SHA1 Message Date
Cong-Cong PanandGitHub 401bfe05f4 feat: using eval source map plugin for Rspack (#79199)
Use rspack.EvalSourceMapDevToolPlugin when running with Rspack

The modification specifically pass the test case in:
test/integration/server-side-dev-errors/test/index.test.js
2025-05-29 02:30:36 +00:00
Benjamin WoodruffandGitHub 8fa42deefd refactor(napi): Implement napi traits for RcStr (#79806)
This lets us use `RcStr` directly in function arguments and as part of `#[napi(object)]`s.

*You can just `RcStr` things!*

Here's an example of rspack doing something similar for a custom napi type: https://github.com/web-infra-dev/rspack/blob/35f1126963d5ba6860e9eba939fd5d62f9aa217f/crates/rspack_regex/src/napi.rs
2025-05-28 17:09:45 -07:00
42487f26da fix: preload fonts in template.js (#79417)
Fonts imported in a template module do not preload or preconnect when
used in a template.js file. This PR adds a small fix and a e2e test.

Co-authored-by: Zack Tanner <[email protected]>
2025-05-28 23:54:24 +00:00
vercel-release-bot fea5c8ccc3 v15.4.0-canary.56 v15.4.0-canary.56 2025-05-28 23:24:39 +00:00
Donny/강동윤andGitHub 2c142f0854 fix(next-swc): Fix specificity issue of styled-jsx in lightningcss mode (#79802)
### What?

Update the `styled-jsx` SWC plugin to the latest

### Why?

Apply https://github.com/swc-project/plugins/pull/464

x-ref: https://vercel.slack.com/archives/C08GMHRF7NC/p1748451540079049?thread_ts=1741381916.437039&cid=C08GMHRF7NC
2025-05-28 14:49:16 -07:00
Vercel Release BotandGitHub ebd87edb01 Update Turbopack production test manifest (#79773)
This auto-generated PR updates the production integration test manifest used when testing Turbopack.
2025-05-28 12:57:36 -07:00
Vercel Release BotandGitHub 89720b583e Update Turbopack development test manifest (#79774)
This auto-generated PR updates the development integration test manifest used when testing Turbopack.
2025-05-28 12:51:20 -07:00
Donny/강동윤andGitHub 6f07684afc chore(ci): Add large benchmark (#79793)
### What?

Configure a large benchmark for turbopack.

### Why?

We may want to run a full benchmark for some PRs.
2025-05-28 12:02:12 -07:00
Luke SandbergandGitHub 21182268f7 [turbopack] Reduce the size of module graph datastructures (#79706)
## Refactor module graph to reduce memory usage

### What?
This PR refactors the module graph implementation to reduce memory usage by:
1. Changing `graph_idx` from `usize` to `u32` to reduce memory footprint
2. Removing unused fields from `SingleModuleGraphModuleNode` (layer and issues)
3. Moving layer resolution to the point of use in dynamic imports and server actions

This is a small progression in runtime:

![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/AwJ29EfoPcPdLSwCZxAz/d669023b-9ac4-44d5-ac9f-54e42b71d341.png)

### Why?
These changes optimize memory usage in the module graph, which is particularly important for large applications. By removing unused fields and using more compact types, we can reduce the memory footprint of the graph.

Notably, SingleModuleGraphNode is now 24 bytes instead of  48.  To make it smaller still we would need to reduce the size of visited moduel, perhaps by storing a reference to the graph that did the original visit?  This would be tricky from a lifetimes perspective but much more optimal.
2025-05-28 11:53:29 -07:00
Donny/강동윤andGitHub 6e80e56bfc chore(ci): Configure automated benchmark for turbopack (#79791)
### What?

This PR configures an automated benchmark for turbopack. We can run small benchmarks for all turbopack PRs, and I'll add more benchmarks with follow-up PRs.


### Why?

We need a way to track performance consistently.
2025-05-28 11:20:39 -07:00
2b7a259169 chore: Update the with-supabase example to use the Supabase Auth block (#78913)
This PR updates the `with-supabase` template to better auth pages,
Tailwind v4 and newest `components.json` for full compatibility with
shadcn/ui.

The `(auth-pages)` folder has been removed. For auth, the template is
now using the [password based auth
block](https://supabase.com/ui/docs/nextjs/password-based-auth) from the
Supabase UI Library which makes it easier to update it and keep it
up-to-date.

---------

Co-authored-by: Lee Robinson <[email protected]>
2025-05-28 12:19:55 -05:00
Sebastian "Sebbie" SilbermannandGitHub ea1a76a601 Update script location used in pnpm unpack-next (#79626) 2025-05-28 19:10:22 +02:00
Tobias KoppersandGitHub f3a6889ea2 Turbopack: split meta data and AQMF into separate files (#79659)
### What?

Split the SST meta data and AQMF into a separate `*.meta` file. A single meta file can contain meta data and AQMFs of multiple SST files.

On database startup only the meta data files need to be read and SST files are lazily mmapped and read only when the AQM-Filter is successful. This ensures that only SST files with a high likelyhood need to be read at all.

Currently this has not much benefit as keys are randomly distributed in SST files, so all files need to be read anyway.
There is a small benefit after a bunch of incremental builds, when some SST files become unused as they have been overwritten.

In future we want to split keys into recently used and not recently used keys and place them in separate SST files. This ensures that less SST files need to be read. This change is a pre-requirement to that change.
2025-05-28 18:39:28 +02:00
JosephandGitHub df846a296b docs: force-static w/ revalidate, revalidatePath, and revalidateTag (#79780)
Closes:
https://linear.app/vercel/issue/DOC-4713/force-static-w-revalidatetagrevalidatepathrevalidate
2025-05-28 11:24:12 -05:00
Donny/강동윤andGitHub bfeb2216d7 refactor(turbopack): Preserve indents in dev mode codegen (#79786)
### What?

Preserve indents in dev modes (inverts #79754)

### Why?

Indent can be useful for debugging.
2025-05-28 18:22:40 +02:00
Hendrik LiebauandGitHub 6654a98a9b Run tsc in watch mode during pnpm dev (#79785)
Now that `tsc` can be run repeatedly without erroring, we can run it in
watch mode during `pnpm dev` to ensure that type errors are always
up-to-date while developing. Previously, we had to restart `pnpm dev`,
like animals.
2025-05-28 15:36:18 +00:00
Jude GaoandGitHub 6492a52b53 re-enable vary header deploy test (#79753)
Since the corresponding change has been released in Vercel CLI, we can
re-enable the test.
2025-05-28 10:40:08 -04:00
Donny/강동윤andGitHub 455de27170 chore(turbopack): Update swc_core to v26.2.2 (#79756)
### What?

ChangeLog for `swc_core`: https://github.com/swc-project/swc/compare/swc_core%40v26.0.1...swc_core%40v26.2.2

### Why?

 - Apply https://github.com/swc-project/plugins/pull/463
2025-05-28 14:33:38 +00:00
Sebastian "Sebbie" SilbermannandGitHub cb331ae317 Enable repeated tsc runs in packages/next without having to build first (#79782) 2025-05-28 14:32:35 +00:00
Tim NeutkensandGitHub 54acbd4347 Turbopack Build: Fix metadata test (#79776)
## What?

Changes the test to not use the `.next` folder but instead fetch the
running server which makes sure it does not rely on specific formats.
2025-05-28 12:58:37 +02:00
Delba de OliveiraandGitHub e66680dcf9 Docs: Fix headings (#79777) 2025-05-28 11:31:06 +01:00
Cong-Cong PanandGitHub 3168c1a028 chore: update rspack to 1.3.12 (#79428)
Upgrade Rspack to version 1.3.11

This update includes several important improvements and new features:

1. Runtime source map generation
- Pass test cases:
test/production/generate-middleware-source-maps/index.test.ts

2. JS API now provides access to buildInfo.assets
   - Pass test cases: test/e2e/app-dir/next-font/next-font.test.ts

3. Full options support for EvalSourceMapDevToolPlugin

4. New built-in CssChunkingPlugin implementation
   - Pass test cases: test/e2e/app-dir/css-order/css-order.test.ts
 
 - test dev `test/e2e/app-dir/dynamic-data/dynamic-data.test.ts`
Test fails due to Rspack's lack of support for
`compilation.codeGenerationResults` JS API.
2025-05-27 16:26:45 -07:00
vercel-release-bot 3be2d66eca v15.4.0-canary.55 v15.4.0-canary.55 2025-05-27 23:24:24 +00:00
Donny/강동윤andGitHub 0ee8d5c7a8 fix(turbopack): Use comments instead of AST nodes for unreachables (#79703)
### What?

Use unreachable comments instead of AST nodes for statically analyzable unreachable AST nodes.

### Why?

It causes fewer problems for Firefox and potentially reduces RSS.

### How?

 - Closes PACK-3843
 - Closes #74185
2025-05-27 22:46:51 +00:00
Donny/강동윤andGitHub 123524832c perf(turbopack): Remove indent in intermediate string (#79754)
### What?

Remove `  ` (two whitespaces) in intermediate texts.

### Why?

 - In dev, browser devtools will provide formatting anyway.
 - In production, we are going to parse it again and feed it to the SWC minifier regardless.

### How?

---

x-ref: numbers at https://vercel.slack.com/archives/C06PPGZ0FD3/p1748380301451689
2025-05-27 14:17:20 -07:00
Sebastian "Sebbie" SilbermannandGitHub 4ab6eba5c0 [dev-overlay] Move Redbox open/close into dispatcher (#79698) 2025-05-27 23:16:19 +02:00
826da1f786 update(turbopack): Update the messaging UX for timing writing files to disk (#79469)
## Refactor Turbopack Compilation Events and Timing Reporting

### What?
This PR refactors how compilation events are created, displayed, and
formatted in Turbopack. It introduces a dedicated `TimingEvent` type for
timing-related messages and improves the formatting of duration
displays.

Additionally we now display all compilation events now that it has been
shown to be stable with no breakages.

### Why?
To provide more consistent and user-friendly output for compilation
events, especially for timing information. The new approach makes
duration formatting more readable by automatically selecting appropriate
units (ms, s, min) based on the duration length.

### How?
- Added a new `TimingEvent` struct that properly formats durations based
on their duration
- Updated the `DiagnosticEvent` constructor to take severity first, then
message
- Improved event handling in the build process to properly categorize
and display different severity levels
- Enhanced file I/O benchmarking to use the new timing event format
- Fixed the formatting of compilation events in the UI

---------

Co-authored-by: Niklas Mischkulnig <[email protected]>
2025-05-27 16:52:11 -04:00
Andrew ClarkandGitHub fc05711d58 Verify cache-busting param during segment prefetch (#79563)
Not all CDNs respect the Vary header when caching. We must assume that
only the URL is used to vary the responses. The Next client computes a
hash of the header values and sends it as a search param.

Before responding to a request, we must verify that the hash matches the
expected value. Neglecting to do this properly can lead to cache
poisoning attacks on certain CDNs.

In this initial PR, the verification I've added only runs during per-
segment prefetch requests, since those are the only ones that both vary
on a custom header and are also cacheable. But for safety, we should run
this verification for all requests, once we confirm the behavior is
correct. Will need to update our test suite, since there are a handful
of unit tests that send fetch requests with custom headers but without a
corresponding cache-busting search param.

It would be even better if we stopped using custom request headers, and
instead fully encoded everything into the search param. At least for
cacheable requests.
2025-05-27 16:28:20 -04:00
Vercel Release BotandGitHub 7187dc2417 Update Rspack development test manifest (#79644) 2025-05-27 20:23:23 +00:00
Vercel Release BotandGitHub 49f1ad9b04 Update Turbopack development test manifest (#79646) 2025-05-27 20:22:00 +00:00
Vercel Release BotandGitHub 89e617202b Update Rspack production test manifest (#79645) 2025-05-27 20:16:19 +00:00
JJ KasperandGitHub e869be76ab Update flakey empty-project test (#79734)
This test case has been flaking quite a bit so this increases the fetch
timeout delay as we mainly want to ensure the correct content is
rendered and it works not the duration.
2025-05-27 20:06:05 +00:00
Tim NeutkensandGitHub 89d40df2ef Turbopack Build: Fix middleware rewrite test (#79697)
## What?

The reason this test fails seems to be that the `browser.on('request'`
gets registered too late and the requests are not tracked because of
that. Seems it can flake with webpack too. Switched to `beforePageLoad`
to register it always. That switch makes the test consistently pass with
Turbopack too.
2025-05-27 21:55:57 +02:00
Sebastian "Sebbie" SilbermannandGitHub 0bcbab529e [dev-overlay] Move error handlers into dispatcher in /app (#79660)
The dispatcher will later be the bridge between user code and the dev overlay so it should house all logic that communicates with the Dev Overlay frontend.
2025-05-27 20:55:33 +02:00
Sebastian "Sebbie" SilbermannandGitHub c51300807e [dev-overlay] Show error overlay on any thrown value in /app (#79658)
May have been a leftover from earlier. 

We always consider any throw. Even without a sync stack, we might still have an async stack to show. And even if we have no stack at all, the message is still relevant. Basically, never hide errors.
2025-05-27 20:17:38 +02:00
d55e2f8493 cleanup(turbopack): Embed Global vs Specific channel type in the Rust type system (#79291)
## Refactor CompilationEventQueue to use enum for event channel types

### What?
Introduces a new `EventChannelType` enum to replace string-based event
channel identification in the `CompilationEventQueue`.

### Why?
This change improves type safety by replacing string-based channel
identification with a proper enum. Using an enum instead of string
literals makes the code more robust and more self-evident in what it's
trying to accomplish.

### How?
- Created a new `EventChannelType` enum with two variants: `Global` and
`Type(String)`
- Updated the `subscribers` map to use `EventChannelType` as keys
instead of strings
- Replaced string literals like `"*"` with the appropriate enum variant
(`EventChannelType::Global`)
- Modified the event subscription and publishing logic to work with the
new enum-based approach

---------

Co-authored-by: Tobias Koppers <[email protected]>
2025-05-27 13:29:49 -04:00
9ba8c169f5 misc: remove leftover clientInstrumentationHook type (#79701)
Remaining of https://github.com/vercel/next.js/pull/77649

Co-authored-by: devjiwonchoi <[email protected]>
2025-05-27 17:22:39 +00:00
vercel-release-bot 64810bf984 v15.4.0-canary.54 v15.4.0-canary.54 2025-05-27 16:39:32 +00:00
Sebastian "Sebbie" SilbermannandGitHub 257c3f8c51 Enable preview builds for forks (#79648) 2025-05-27 15:30:15 +00:00
Hendrik LiebauandGitHub 1f25118390 Fix name tracking for closures in server actions transform (#79657)
When a server function passes a closure to a method on a closed-over
value (e.g. an array), we must correctly track the value itself so that
it's included in the bound arguments.

For example, in this snippet, `list` must be bound to the server action:

```js
export function Component({ list }) {
  return (
    <form
      action={async () => {
        'use server'
        console.log(list.find((x) => !!x))
      }}
    >
      <button>submit</button>
    </form>
  )
}
```

This use case used to work but was accidentally broken by #73189.

fixes #79608
fixes #77247
closes NAR-8
2025-05-27 17:23:25 +02:00
Tim NeutkensandGitHub ac680c49bf Turbopack Build: Skip edge stacktrace test (#79661)
## What?

This test is checking a specific path that is not actually sourcemapped
when using webpack either. This won't fail for both webpack/Turbopack
once edge runtime supports sourcemaps.
2025-05-27 17:17:36 +02:00
Delba de OliveiraandGitHub fffb2eb6fb Docs IA 2.0: Delete Error Handling page (#79495)
The content has already been migrated to
https://nextjs.org/docs/app/getting-started/error-handling.

Closes:
https://linear.app/vercel/issue/DOC-4700/bya-delete-error-handling-page
Redirects: https://github.com/vercel/front/pull/46127
2025-05-27 14:58:40 +00:00
JJ KasperandGitHub 97c9fc485a Avoid bundling dev overlay in page template (#79641)
As noticed in https://github.com/vercel/next.js/pull/79632 we increased
compile times for pages routes in development which is due to us
including the dev-overlay component in the page bundle itself instead of
just in the server runtime.

x-ref: https://github.com/vercel/next.js/pull/79632/files

<details>

<summary>Before</summary>

```sh
✓ Compiled /_error in 1238ms (1385 modules)
✓ Compiled /_error in 1245ms (1386 modules)
✓ Compiled /_error in 1225ms (1394 modules)
✓ Compiled /_error in 944ms (1385 modules)
✓ Compiled /_error in 1232ms (1385 modules)
```

</details>

<details>

<summary>After</summary>

```sh
 ✓ Compiled /_error in 927ms (1009 modules)
 ✓ Compiled /_error in 922ms (1010 modules)
 ✓ Compiled /_error in 935ms (1018 modules)
 ✓ Compiled /_error in 626ms (1009 modules)
 ✓ Compiled /_error in 916ms (1009 modules)
```

</details>
2025-05-27 14:44:36 +00:00
Vercel Release BotandGitHub b3d78ea809 Update font data (#79642)
This auto-generated PR updates font data with latest available
2025-05-27 07:29:47 -07:00
Tim NeutkensandGitHub 9225917fdc Turbopack Build: Fix runtime value test (#79654)
## What?

Ensures the warning message is the same between webpack/Turbopack.

Found that Turbopack does have the info we check in the test but it's
currently not logged, seems intentionally. Need to check with
@wbinnssmith because it was commented out here:
https://github.com/vercel/next.js/blob/d1d64ea12ff819035d1abdb6f9e9b8aac950457f/packages/next/src/shared/lib/turbopack/utils.ts#L198

When `detail` is logged it will include more information like what
exactly was wrong.
2025-05-27 15:44:39 +02:00
7cbc15ab70 Turbopack Build: Fix conflicting page error (#79634)
## What?

Implements the missing part of the error to make the test pass.

Small difference between webpack/Turbopack is that Turbopack will spot
the conflict earlier and because of that errors earlier too, making the
path still correct but shorter, not a problem in my opinion.

---------

Co-authored-by: Niklas Mischkulnig <[email protected]>
2025-05-27 15:43:43 +02:00
Tim NeutkensandGitHub 0eb276b4ca Turbopack Build: Fix edge _document test (#79628)
## What?

Currently there's a specific case when you set `runtime:
'experimental-edge'` for `_document.js` or `_app.js` where we
incorrectly write a bundle that is wrapped with the route handling code
to disk. This in turn causes `_document.js` to break during
prerendering. Seems no users ran into this one yet since it was
experimental. This change ensures that we always write the module code
for _app / _document instead. This has no negative effect on edge
runtime modules because those include the direct imports for _app /
_document already in the single route module.
2025-05-27 15:43:29 +02:00
JosephandGitHub fc17ba9710 Docs: scrub html in ld+json script (#79627)
Closes:
https://linear.app/vercel/issue/DOC-4708/json-ld-security-w-jsonstringify
Fixes: https://github.com/vercel/next.js/issues/79593
2025-05-27 15:23:05 +02:00
Delba de OliveiraandGitHub 8b7f937e36 Docs IA 2.0: Add Caching and Revalidating page (#79493)
Closes:
https://linear.app/vercel/issue/DOC-3700/getting-started-caching-and-revalidating-page
Redirects: https://github.com/vercel/front/pull/46120
2025-05-27 13:35:36 +01:00
Delba de OliveiraandGitHub 63ed70ba41 Docs IA 2.0: Move Redirects page to guides (#79447)
Closes: https://linear.app/vercel/issue/DOC-4695/guide-redirects
Redirects: https://github.com/vercel/front/pull/46041
2025-05-27 12:20:11 +01:00