Skip to content

Conversation

@Dargon789
Copy link

No description provided.

Dargon789 and others added 6 commits January 17, 2026 16:00
* Create SECURITY.md

Documentation:

Introduce SECURITY.md with information on supported versions and placeholders for vulnerability reporting procedures.
Signed-off-by: Dargon789 <64915515+Dargon789@users.noreply.github.com>

* Update SECURITY.md

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Signed-off-by: Dargon789 <64915515+Dargon789@users.noreply.github.com>

---------

Signed-off-by: Dargon789 <64915515+Dargon789@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Signed-off-by: Dargon789 <64915515+Dargon789@users.noreply.github.com>
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
Signed-off-by: Dargon789 <64915515+Dargon789@users.noreply.github.com>
* Create SECURITY.md

Signed-off-by: Dargon789 <64915515+Dargon789@users.noreply.github.com>

* Update SECURITY.md

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Signed-off-by: Dargon789 <64915515+Dargon789@users.noreply.github.com>

---------

Signed-off-by: Dargon789 <64915515+Dargon789@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
CI:

Change the configured Node.js version in the Next.js workflow from a single version to a list of versions (18, 20, 22, 24) for the setup-node step.
Signed-off-by: Dargon789 <64915515+Dargon789@users.noreply.github.com>
* Update Rspack production test manifest (vercel#88403)

This auto-generated PR updates the production integration test manifest used when testing Rspack.

* Update Rspack development test manifest (vercel#88404)

This auto-generated PR updates the development integration test manifest used when testing Rspack.

* Turbopack: Update reqwest, remove experimental system TLS feature (vercel#88290)

I added this as an option in vercel#81818 as a solution for users with corporate firewalls that MITM TLS traffic.

Reqwest 0.13.x now uses `rustls-platform-verifier` by default, which doesn't have the tradeoffs that `rustls-native-certs` had. We should now pick up and work with system certs by default, and we no longer depend on shipping our own blob of trusted PKI roots! (though wasmer still pulls this in...)  

This PR was generated with Opus + OpenCode, but there was a ton of manual iteration to get it working on CI.

### TLS Provider

`reqwest` now defaults to `aws-lc-rs` instead of `ring`. This causes a few problems:
- On Windows, this requires cmake and NASM. There's a prebuilt NASM blob we can use, but it still appears to need cmake. We could install this in CI, but I don't want to make Windows development any more complicated than it already is.
- On Linux, there are issues with it picking up the wrong glibc version in our CI: aws/aws-lc-rs#673

We just use this for fetching Google Fonts, so it's not worth it: Fall back to using `ring` on these platforms.

### CI Testing

Manually triggered a build-and-release job so that it tries to build for the whole platform matrix: https://github.com/vercel/next.js/actions/runs/20936098900

### Manual Testing
  
Followed the test plan in vercel#81818

![Screenshot 2026-01-08 at 12.27.11 PM.png](https://app.graphite.com/user-attachments/assets/79ff941b-a828-4804-8695-b2400cd3680b.png)

* v16.1.1-canary.23

* Revert "prevent browser cache from using stale RSC responses from pre… (vercel#88457)

…vious builds (vercel#86554)"

This reverts commit 3bbb2e6.

Need to investigate some upstream constraints before we land this in a
stable release.

* v16.1.1-canary.24

* [test] Always run all tests without aborting on failure (vercel#88435)

It's more useful and efficient to run all tests and report all failures
instead of aborting on the first failure. This way, developers get a
complete picture of what needs to be fixed in a single run, and don't
have to go through multiple iterations of fixing one failure at a time.

* Turbopack: remove sourcemapping comments (vercel#88217)

Otherwise there are stray sourceMappingURL comments in the middle of the chunks.

* Turbopack: use mimalloc on Linux musl (vercel#88426)

Closes vercel#88174

With musl (i.e. Alpine), the system memory allocator can cause catastrophic slowdowns
- https://medium.com/p/stop-using-alpine-images-b51d12b0fde2
- https://nickb.dev/blog/default-musl-allocator-considered-harmful-to-performance/

We were seeing it cause a 10x slowdown, simply using mimalloc fixes this.

<img width="612" height="1091" alt="Bildschirmfoto 2026-01-12 um 15 00 29" src="https://github.com/user-attachments/assets/8de6dea3-012b-4c73-94e3-284d478bd7ef" />

<img width="1888" height="687" alt="Bildschirmfoto 2026-01-12 um 15 35 15" src="https://github.com/user-attachments/assets/d594d3ef-ae9b-468a-b022-032f1cf967e1" />

* Turbopack: add support for selective reads of keyed cell values (vercel#88303)

### What?

Previously cells could either be unchanged or changed. This falls short when updating Maps or Sets.
We can't have a dependency on a single key of a map or set.
The workaround for this was to create an "selector" turbo-tasks which picks the value and copies it into a new cell.
This allows more granular invalidation.

But it also creates a lot of extra tasks. And changing the map/set does invalidate all these selector tasks, which causes a lot of invalidation work.

This change adds support for dependencies on certain keys of cells.

On write side a turbo-tasks value need to opt-in into that behavior via `cell = "keyed"`.
This changes the `cell` method to compare the new value key-by-key and report the changed keys to the backend.

On read side the Vc need to be read via `.get(key).await?` or `.contains_key(key).await?`, which returns only the value resp. existance of the key and adds a dependency only to that key.

With this approach the "selector" tasks can be avoided, while maintaining the same level of invalidation.

### How?

On implementation side we only track the hash of the key for size reasons.
A dependency has an additional field `key: Option<u64>` which represents the key depending on.

When updating a cell we have a new optional argument `updated_key_hashes: Option<SmallVec<[u64; 2]>>` where the updates keys can be provided. The new `CellMode` (cell = "keyed") fills that.

* Turbopack: Reduce usage of parse_quote in turbo-tasks-macros (vercel#88454)

In theory, `parse_quote` is really nice because it lets you use type safety to assert more things about proc macro code.

However, it does invoke the syn parser, so there's probably some cost.

I had Claude find and remove trivial uses of `parse_quote`. There are still more uses, but they're not as easy to remove (e.g. because we need the real type, not just a `TokenStream`, and the type is annoying to construct by hand).

* Turbopack: don't cell in async map (vercel#88473)

This causes nondeterministic cell order

* Turbopack: replace is_reference_used with unused_references set (vercel#88304)

### What?

Replaces `is_reference_used` with `unused_references` and uses the new keyed invalidation. This avoid having a `is_reference_used` for each reference in the application

* Turbopack: add lint rule to not cell in async map (vercel#88474)

<!-- 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

### 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 #

-->

* Turbopack: Remove dead generic_type_macro code (vercel#88455)

I deleted the code that used this a long time ago in vercel#70817

The rational for why I deleted the uses of this code is here (generics in turbo-tasks would be nice, but this implementation was too limited to be worth the complexity): vercel/turborepo#8843 (comment)

* Turbopack: remove unused code (vercel#88497)

<!-- 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

### 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 #

-->

* Turbopack: improve cell order lint rule (vercel#88498)

Addresses the comments on this PR: vercel#88474 (comment)

"Merge when ready" had striked again

This did actually find another violation

* Turbopack: parallelize making dependent tasks dirty (vercel#86755)

<!-- 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

### 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 #

-->

* v16.1.1-canary.25

* Turbopack: fix bad performance edge case in production chunking (vercel#88508)

### What?

Fixes a edge case in production chunking performance where many dynamic
imports (like
https://app.unpkg.com/lucide-react@0.562.0/files/dist/esm/dynamicIconImports.js)
causes builds to become very slow under specific scenarios.

* v16.1.1-canary.26

* Turbopack: retain loader tree order for metadata (vercel#88487)

* v16.1.1-canary.27

* Turbopack: more dead code (vercel#88505)

* fix(build): prevent route handler manifests from inheriting unrelated client components (vercel#88419)

## Summary

Fixes vercel#88316

Route handlers (API routes) were generating bloated
`client-reference-manifest.js` files containing unrelated client
components from pages when using Webpack. This was caused by the
manifest merging logic in `flight-manifest-plugin.ts` which inherited
manifests from all parent path segments.

### Changes

- Modified `flight-manifest-plugin.ts` to detect route handlers
(`/route$` pattern)
- Route handlers now only get their own group's manifest, skipping
parent manifest inheritance
- Pages continue to inherit manifests from parent layouts as before

### Why this works

Route handlers:
- Don't render React components
- Return `Response` objects, not JSX
- Don't need client component references from parent layouts/pages

Turbopack already handles this correctly by doing targeted module graph
traversal per entry. This fix aligns Webpack's behavior.

## Test Plan

Added test suite `test/production/app-dir/route-handler-manifest-size/`:
- Verifies pure route handlers don't include unrelated page client
components
- Verifies pages still include their client components
- Verifies route handlers with direct client imports don't get page
components
- Tests pass for both Webpack and Turbopack

* Remove `lerna bootstrap` from the `clean` script in package.json (vercel#88527)

In vercel#87188 we upgraded lerna to v9 which no longer supports/requires the
`lerna bootstrap` command. This commit removes it from the `clean`
script in the root package.json to avoid errors when running `pnpm
clean`.

[More
info](https://lerna.js.org/docs/legacy-package-management#replacing-your-usage-of-lerna-bootstraplerna-link)

* Upgrade React from `65eec428-20251218` to `3e1abcc8-20260113` (vercel#88530)

* Better typesafety for `interopDefault` (vercel#88486)

* keep next-env.d.s unchanged between dev and build (vercel#88428)

* docs: add useSearchParams and useParams documentation for Pages Router (vercel#88429)

## Description

This PR adds dedicated documentation pages for `useSearchParams` and
`useParams` hooks in the Pages Router documentation.

### Changes

- Added
`docs/02-pages/04-api-reference/03-functions/use-search-params.mdx`
- Added `docs/02-pages/04-api-reference/03-functions/use-params.mdx`

### Why

Both `useSearchParams` and `useParams` from `next/navigation` work in
the Pages Router, but this was not well documented. The only mention was
a brief note in the App Router docs and a migration section in the Pages
Router `useRouter` docs.

### What's Documented

For both hooks:
- Basic usage with the fallback UI pattern for handling `null` during
pre-rendering
- Return values and behavior differences from App Router
- Usage with `getServerSideProps` (where params are immediately
available)
- Examples for sharing components between App Router and Pages Router

For `useParams` specifically:
- Comparison with `router.query` (which includes both dynamic params and
query string params)

### Related Test

The existing test at `test/e2e/app-dir/params-hooks-compat` validates
that these hooks work in both routers.

* Remove sibling caches from CacheNode tree (vercel#87991)

Instead of storing old sibling CacheNodes in the CacheNode tree, thisPR
puts them into a separate BFCache, backed by the same data structure and
LRU that's used by the prefetch cache.

* Upgrade React from `3e1abcc8-20260113` to `4a3d993e-20260114` (vercel#88547)

* Finish deleting Mutable from router implementation (vercel#88046)

Based on:

- vercel#87991

---

The Mutable type was used by an earlier implementation of App Router
when the reducer used to run during React's render phase. It was used to
prevent certain operations from running multiple times if an update was
reapplied by React.

Now that router "reducer" actions run outside React's render phase, we
no longer need this indirection — we can compute the next state object
directly.

Most of the Mutable-related logic was deleted in previous PRs; this
finishes the migration by inlining handleMutable into its callers.

* Turbopack: Clean up `VcRead::Repr` associated type (vercel#88456)

It used to be that a cell could contain a transmuted representation. This was a hack for the previous limited generic support that I removed in vercel#70817.

Clean this up! `Repr` and `T` are always the same type!

* [cna] Avoid error with out-of-box Netlify config (vercel#88546)

* [turbopack] Move some of the logic for issue filtering into the rust layer (vercel#88511)

# Optimize issue filtering in Next.js and Turbopack

## What?
This PR introduces an `IssueFilter` system to control which issues are reported based on severity and location

## Why?
To improve performance, we shouldn't spend time formatting issues that will never be displayed to a user.

## How?
- Added `IssueFilter` to control which issues are displayed based on severity and location
- Created a specialized `InNodeModules` context condition for better readability
- Implemented `warnings_and_foreign_errors()` filter that shows:
  - Warnings and errors from application code
  - Only errors from node_modules
- Applied the filter throughout Next.js and Turbopack's issue reporting system
- Refactored issue collection to filter early rather than collecting everything first

* Update Rspack production test manifest (vercel#88469)

This auto-generated PR updates the production integration test manifest used when testing Rspack.

* Update Rspack development test manifest (vercel#88470)

This auto-generated PR updates the development integration test manifest used when testing Rspack.

* v16.1.1-canary.28

* feat: add TaskStorage derive macro and schema infrastructure (vercel#88338)

Add a new derive macro for `TaskStorage` a replacement for `InnerStorage` and `CachedDataItem`, currently it is unused outside of tests.

## What

* add a new derive macro that generates code from the 'schema' in `storage_schema.rs`
* `storage_schema.rs` defines the layout of our new struct, for each field we specify
   * type and name
   * category ('data' 'meta' or 'transient')
   * location (inline or lazy or flags for bitfields)
   * whether we should `filter_transient` when encoding (not everything can contain transient data)
   * Logically this is a replacement for `CachedDataItem`
* From that we generate a few things
   * `TaskFlags` a bitfield to hold some data items as well as 'meta' information like the 'snapshot' and 'restore' bits replacing `InnerStorageState`
   * `LazyField`  enum, defines tall the fields that we dynamically allocate
   * `TaskStorage` the main storage struct, along with basic accessors for all the datatypes (which helps encapsualte storage strategy)
   * `TaskStorageAccessors` a trait with default implementations of every accessor which also handle
      * access checking, via `check_access`
      * mutation tracking via `track_mutation`
       * putting these behaviors in a trait allows some of the business logic around snapshotting to remain in normal rust code that implements the trait, while all the field updating logic can be autogenerated

  * Serialization and encoding infrastructure
      * routines to encode and decode the 'meta' or 'data' subsets
      * routines to create partial 'snapshots' of `meta` or `data` subsets
      * routines to restore data from deserialized snapshots

See https://gist.github.com/lukesandberg/ea35f0e92c1cdeddf80d0498f2978144 for a fully expanded version of the macro

### Why

There are a few goals from this redesign of `InnerStorage`

* (speculative) a single large `derive` macro will be easier to maintain than the current mix of `macro_rules` and derive macros we use for `CacheDataItem`
    * There is one macro to expand when inspecting and the macro generation code is pretty straightforward if voluminous
* We eliminate many `match` operations on `CachedDataItem`
    * Today to lookup a piece of data we need to execute several matches to get the the data category and find the storage location.  With this new approach those are handled by just calling the correct accessor which statically addresses the storage location
* serialization performance
    * we don't need to 'explode' the storage into `Vec<CachedDataItem>` anymore and instead can either directly snapshot the storage or encode directly to a buffer.  This should eliminate some temporary allocations and should enable a smaller serialization format
* more flexibility
    * mostly this is the same approach as before with a few small improvements, notably `invalidator` and `immutable` are now stored as single inline bits reducing lookupcosts and memory for tasks that have these.

### How

Most of the code was written by Claude with obviously a ton of feedback, so please review carefully.  For now all this code is unused but future PRs will integrate it into the backend

* docs: fix Pages Router fonts documentation showing App Router examples (vercel#88326)

## Summary

Fixes vercel#88291

The Pages Router fonts documentation was incorrectly showing App Router
examples (`app/layout.tsx`) which don't exist in Pages Router. This
confused users trying to use fonts with the Pages Router.

## Changes

Updated `docs/01-app/01-getting-started/13-fonts.mdx` to include proper
`<AppOnly>` and `<PagesOnly>` sections:

**For Pages Router users:**
- Added examples using `pages/_app.tsx` (Custom App) to wrap components
with font className
- Added examples using `pages/_document.tsx` (Custom Document) to apply
fonts to the `<html>` element

**For App Router users:**
- Wrapped existing `app/layout.tsx` examples in `<AppOnly>` sections

This follows the same pattern used in other shared documentation like
`docs/01-app/01-getting-started/11-css.mdx` which properly separates App
Router and Pages Router content.

* [ci] Don't retry/notify for failed deploy tests with custom tarball URLs (vercel#88576)

Fixes a regression from vercel#85981 where manual deploy tests with custom
tarball URLs incorrectly trigger retries and Slack notifications. Now
only release-triggered runs and manually-triggered canary tests are
retried/reported.

* fix(turbopack): Collect `declare global {}` in `VarDeclWithTsDeclareCollector` (vercel#88568)

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Niklas Mischkulnig <4586894+mischnic@users.noreply.github.com>

* Update labeler.json (vercel#88591)

* Fix optional `parent_task_id` compile failure w/`tokio_tracing` enabled (vercel#88598)

* Turbopack: support disabling tsconfig lookup (vercel#88529)

Introduce `TsConfigHandling::Disabled`

* Turbopack: run tasks with priority based on distance to leaf (vercel#87662)

### What?

* Compute the approximate distance to leaf in the dependency graph
* Prioritize tasks re-computing by distance to leaf, running leaf tasks first

This ensures that it's less likely that tasks are re-executed multiple times due to bad ordering.
This adresses the "diamond" problem where a task is invalidated multiple times due to multiple paths of invalidation to that task.

* fetch(next/image): reduce maximumResponseBody from 300MB to 50MB (vercel#88588)

Based on our metrics, the P99.9 for a source image is 47 MB so we can
adjust the default setting to be much lower (by changing from from 300
MB to 50 MB) in favor of reducing memory.

* [CC] Fix dev validation error from server action bound args (vercel#88600)

In Cache Components, bound args encryption needs to be cached (and
tracked with cacheSignal) because it's tasky. We use the serialized
bound args themselves as a cache key. However, in dev, the key ends up
containing debug info (in particular, timing information) so it's
different every time . This causes a cache miss and results in a static
shell validation failure.

The fix is to use a dummy debug channel to pipe the problematic debug
info into the void and thus make the key be deterministic.

* v16.1.1-canary.29

* Turbopack: avoid removing cells for erroring tasks (vercel#88305)

### What?

* avoid flagging tasks dirty when removing cells
* For errored tasks: avoid removing cell content
* For ok tasks: remove cell content later to collect more stale signals

* [ci] Use native `concurrency` feature in build-and-test (vercel#87287)

Last remaining workflow using our custom cancel workflow.

Using the same concurrency logic as build-and-deploy

* Fix incorrect 'Ready in' time for next start (vercel#88589)

## What

Fix the incorrect "Ready in" time displayed when running `next start`.
The bug caused the time to show impossibly large values like "Ready in
29474457.7min" instead of the actual startup duration.

## Why

The `NEXT_PRIVATE_START_TIME` environment variable was not being
properly set/propagated when `startServer()` read it. When the variable
was missing, the code defaulted to `0`, causing the calculation
`Date.now() - 0` to equal the entire Unix timestamp (~1.77 trillion
milliseconds ≈ 29 million minutes).

## How

1. Added a fallback in `cli/next-start.ts` to set
`NEXT_PRIVATE_START_TIME` if it's not already set by `bin/next.ts`
2. Updated the calculation in `start-server.ts` to use `0` as the
duration if `startTime` is falsy, preventing the bug
3. Removed unused performance mark code that was leftover

## Test Plan

Run `next start` on a production build and verify the "Ready in" time
shows a reasonable value (e.g., "Ready in 523ms" instead of millions of
minutes).

* doc: add details of mcp client integration (vercel#88543)

add link to the mcp client configuration details section before the code
block of example

---------

Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
Co-authored-by: timneutkens <tim@timneutkens.nl>

* Turbopack: unflake unit test (vercel#88620)

### What?

Too few tasks leave no space for tokio to act.

* Turbopack: snapshot the ModuleGraph to avoid (eventual) inconsistent graphs (vercel#88340)

### What?

Refactor ModuleGraph to be a strongly consistent snapshot of the module graph. This should avoid eventually consistency problems where different versions of single module graphs do not fit together.

* Turbopack: Consistency for compute_async_module_info (vercel#88409)

### What?

Use strongly consistent reads for compute_async_module_info to avoid double execution.

* Turbopack: follow tracing spans through aggregation update queue (vercel#88410)

### What?

follow spans through the aggregation update queue

* Turbopack: avoid chunk_item_id task and use selective cell access instead (vercel#88411)

### What?

Use selection reads for module id to avoid functions

* Turbopack: MappedReadRef should be Send and Sync (vercel#88558)

### What?

To be able to used MappedReadRefs in async context, they need to be Send.

* feat: server action logging (vercel#88277)

* Log browser error and warnings in terminal (vercel#88352)

* Turbopack: selective read for module_chunk_groups in ChunkGroupInfo (vercel#88559)

### What?

Use selective reads for module chunk groups from chunk group info

This is a preparation to make chunking be less dependent on module graph changes.

* Turbopack: use selective reads for merged modules (vercel#88560)

### What?

Use selective reads for merged modules data.

This is a preparation to make chunking be less dependent on module graph changes.

* Turbopack: add caching to chunking (vercel#88561)

### What?

Make make_chunks a cached function to allow it to be cached even when the module graph changes (assuming that chunk group's chunk items are not affected by the change)

* v16.1.1-canary.30

* Upgrade React from `4a3d993e-20260114` to `bef88f7c-20260116` (vercel#88649)

* fix: make RedirectType constant properties literal types (vercel#88653)

### What?

Fixed TypeScript error where `RedirectType.replace` and
`RedirectType.push` were typed as `string` instead of literal types,
causing compilation errors when used with `redirect()`.

### Why?

`RedirectType` constant properties weren't properly typed as literal
types, causing TypeScript to see them as generic `string` values instead
of the expected `'push' | 'replace'` union.

### How?

- Added `as const` to `RedirectType` properties in
`packages/next/src/client/components/navigation.react-server.ts`.

Fixes vercel#88627

---------

Co-authored-by: Zack Tanner <1939140+ztanner@users.noreply.github.com>

* Turbopack: add support for matching loaders on resource queries (vercel#88644)

### What?

Part of  PACK-1007

Adds `condition.query` support to Turbopack's loader rules, enabling loaders to match based on import query strings (e.g., `import './file?raw'`). This mirrors webpack's `resourceQuery` functionality.

The `query` condition accepts either a string (exact match) or RegExp (pattern match).

Adds tests and documentation for the new `condition.query` option.

### How to use

```js
// next.config.js
module.exports = {
  turbopack: {
    rules: {
      '*.txt': [
        // String: exact match
        { condition: { query: '?raw' }, loaders: ['raw-loader'], as: '*.js' },
        // RegExp: pattern match  
        { condition: { query: /\?transform/ }, loaders: ['transform-loader'], as: '*.js' },
      ],
    },
  },
}
```

* Turbopack: use bugs.nextjs.org for Turbopack panic error reports (vercel#88356)

Update the bug report link to use the new bugs.nextjs.org service
instead of the direct GitHub discussions URL. Also shares more code when
handling terminals that don't support links.

Test Plan: Added a deliberate panic to a turbotask, verified the link.

* fix: capture promisified setImmediate separately (vercel#88346)

### What?

Capture `setImmediate[promisify.custom]` at module initialization
instead of lazily accessing it when needed.

```
    RangeError: Maximum call stack size exceeded

      at patchedSetImmediatePromise (node_modules/.pnpm/next@16.1.1_@babel+core@7.28.5_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/next/src/server/node-environment-extensions/fast-set-immediate.external.ts:626:27)
      at originalPromisify (node_modules/.pnpm/next@16.1.1_@babel+core@7.28.5_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/next/src/server/node-environment-extensions/fast-set-immediate.external.ts:627:12)
```

  This was discovered upgrading from `16.0.10` to `16.1.0`

  ### Why?

When `util.promisify(setImmediate)` is called and `currentExecution ===
null`, the code was accessing `originalSetImmediate[promisify.custom]`
at call time. However, `promisify.custom` can get lost or return
`undefined` after the module patches `setImmediate`, causing
`promisify(setImmediate)` to fail. Specifically, when used with `jest`.

Reproduction:
https://github.com/jgeschwendt/nextjs-setimmediate-promisify-repro
- Failing:
https://github.com/jgeschwendt/nextjs-setimmediate-promisify-repro/actions/runs/20864170776
- Passing (with fix):
https://github.com/jgeschwendt/nextjs-setimmediate-promisify-repro/actions/runs/20864380068
-
jgeschwendt/nextjs-setimmediate-promisify-repro#1

  ### How?

Move the capture of `originalSetImmediate[promisify.custom]` to module
initialization time (alongside `originalSetImmediate`,
`originalClearImmediate`, and `originalNextTick`), ensuring the original
promisified implementation is preserved before any patching occurs.

* Turbopack: docs: condition.query will ship in 16.2.0, not 16.1.1 (vercel#88663)

Follow up to vercel#88644

* v16.1.1-canary.31

* [turbopack] Add bundling support for worker_threads (vercel#87746)

Add support for bundling worker_threads workers

Previously we only supported tracing dependencies of worker threads.  However, this could trigger issues if the callsite was getting bundled since we would believe that the file was both bundled and unbundled.

The solution is to support bundling modules using worker threads and implementing the threads.  This requires a new reference and loader module type which follows the patter of async-loaders and webworkers. 

An interesting consideration is about file extensions.  `new Worker(...)` takes a relative or absolute filepath, in node 23+ that means you can load typescript files directly, so we support the same.  If you want to load a `.ts` file you need to write `foo.ts` we don't do any pattern rewriting.

This fixes a bug reported by an X user: https://x.com/strugglercss/status/2002504736860484008?s=20.  The problem with the previous approach is that we would record the reference as 'traced', but if you did `new Worker(__filename,...)` then we would end up with 'traced references' to a file that was bundled.  This caused issues during tracing when we tried to add CachedExternalModule references to the nft json files

```
Error [TurbopackInternalError]: NftJsonAsset: cannot handle filepath url

Debug info:
- Execution of get_all_written_entrypoints_with_issues_operation failed
- Execution of EntrypointsOperation::new failed
- Execution of all_entrypoints_write_to_disk_operation failed
- Execution of Project::emit_all_output_assets failed
- Execution of emit_assets failed
- Execution of emit failed
- Execution of <NftJsonAsset as Asset>::content failed
- NftJsonAsset: cannot handle filepath url
    at <unknown> (TurbopackInternalError: NftJsonAsset: cannot handle filepath url) {
```

there `url` was due to a `require('url')` statement in a bundled file this caused us to produce an external shim, but a `new Worker(__filename)` caused us to also create a traced reference to the same file.  The problem there was simply that the `ident()` for a `CachedExternalModule` contains a dummy filepath that broke the nft.json asset production.   The root issue here is that the `FilePathModuleReference` was using the wrong `AssetContext` to construct the referenced module which lead to the wrong files being traced.   After investigation @mischnic and I determined that that was an insufficient fix since we really do need to rewrite the reference.   Proper bundling support fixes this directly and the pattern here paves the way for more worker support in the future.

This doesn't seem like the only way a synthetic module (like an extern module) might end up as a dependency of traced module, so a more robust solution is probably in order.

* [cna] Ensure created app is not considered the workspace root in pnpm (vercel#88647)

---------

Co-authored-by: Vercel Release Bot <88769842+vercel-release-bot@users.noreply.github.com>
Co-authored-by: Benjamin Woodruff <benjamin.woodruff@vercel.com>
Co-authored-by: nextjs-bot <it+nextjs-bot@vercel.com>
Co-authored-by: Zack Tanner <1939140+ztanner@users.noreply.github.com>
Co-authored-by: Hendrik Liebau <mail@hendrik-liebau.de>
Co-authored-by: Niklas Mischkulnig <4586894+mischnic@users.noreply.github.com>
Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
Co-authored-by: Jiachi Liu <inbox@huozhi.im>
Co-authored-by: Andrew Clark <git@andrewclark.io>
Co-authored-by: Karl Horky <karl.horky@gmail.com>
Co-authored-by: Luke Sandberg <lukesandberg@users.noreply.github.com>
Co-authored-by: Donny/강동윤 <kdy1997.dev@gmail.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Matt Mastracci <matthew@mastracci.com>
Co-authored-by: Steven <steven@ceriously.com>
Co-authored-by: Janka Uryga <lolzatu2@gmail.com>
Co-authored-by: Sebastian "Sebbie" Silbermann <sebastian.silbermann@vercel.com>
Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
Co-authored-by: Neha Prasad <neh6a683@gmail.com>
Co-authored-by: Will Binns-Smith <wbinnssmith@gmail.com>
Co-authored-by: jgeschwendt <9220949+jgeschwendt@users.noreply.github.com>
Copy link
Author

@Dargon789 Dargon789 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant