- 23 Jan, 2026 20 commits
-
-
nextjs-bot authored
-
Tobias Koppers authored
### What? Closes PACK-6554 All asset urls returned by Turbopack should include a `?dpl` suffix.
-
Tobias Koppers authored
Improve performance and token usage of `/ci-failures` command include type in failure table, provide more instructions use subagents <!-- 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 # -->
-
Vercel Release Bot authored
This auto-generated PR updates the development integration test manifest used when testing Rspack.
-
Vercel Release Bot authored
This auto-generated PR updates the production integration test manifest used when testing Rspack.
-
nextjs-bot authored
-
Luke Sandberg authored
Enhance our debugging output to include information about TaskType values example output: ``` Task type cache stats: 337.82MiB (364.22MiB) 49.98MiB (53.43MiB) <ModuleAssetContext as AssetContext>::resolve_asset x 417238 avg 125B (134B) 29.38MiB (31.46MiB) resolve x 297288 avg 103B (110B) 17.97MiB (22.58MiB) AssetIdent::new_inner x 135310 avg 139B (174B) 15.16MiB (21.86MiB) <ExternalCjsModulesResolvePlugin as AfterResolvePlugin>::after_resolve x 90748 avg 175B (252B) 12.36MiB (13.32MiB) resolve_internal x 138970 avg 93B (100B) 8.44MiB (7.86MiB) ResolveOrigin::resolve_options x 301586 avg 29B (27B) 8.43MiB (9.47MiB) AfterResolvePluginCondition::matches x 87740 avg 100B (113B) 6.70MiB (6.23MiB) <EsmAssetReference as ModuleReference>::resolve_reference x 472105 avg 14B (13B) 6.48MiB (7.81MiB) read_matches x 81046 avg 83B (101B) 6.40MiB (5.95MiB) <EsmAssetReference as ChunkableModuleReference>::chunking_type x 451598 avg 14B (13B) 6.39MiB (5.94MiB) <EsmAssetReference as ChunkableModuleReference>::binding_usage x 450844 avg 14B (13B) 6.03MiB (5.68MiB) <ModuleAssetContext as AssetContext>::process_resolve_result x 184982 avg 34B (32B) 5.99MiB (5.57MiB) EsmAssetReference::get_referenced_asset x 422883 avg 14B (13B) ``` also add summary stats to the 'task cache stats' ``` Task cache stats: 3.23GiB (6.49GiB) 302.72MiB (769.45MiB) <Code as GenerateSourceMap>::generate_source_map = 313.04KiB (308.92KiB) meta 8524 x 37B (37B), 302.42MiB (769.15MiB) data 8524 x 36.33KiB (92.40KiB) 212.75MiB (592.88MiB) module_factory_with_code_generation_issue = 1.59MiB (1.51MiB) meta 45906 x 36B (34B), 211.16MiB (591.37MiB) data 45906 x 4.71KiB (13.19KiB) 207.89MiB (526.37MiB) EcmascriptBuildNodeChunkContent::code = 1.08MiB (1.12MiB) meta 5163 x 219B (228B), 206.81MiB (525.24MiB) data 5163 x 41.02KiB (104.17KiB) 205.21MiB (577.16MiB) EcmascriptChunkItemContent::new = 1.56MiB (1.63MiB) meta 24577 x 66B (69B), 203.65MiB (575.53MiB) data 24577 x 8.48KiB (23.98KiB) 179.00MiB (441.68MiB) EcmascriptBrowserChunkContent::code = 905.40KiB (967.46KiB) meta 2485 x 373B (398B), 178.11MiB (440.74MiB) data 2485 x 73.40KiB (181.62KiB) ``` Using this information i can see that the largest task type is ~365b so we can safely decrease the size of our scratch buffer
-
Joseph authored
Closes: https://github.com/vercel/next.js/issues/86781
-
nextjs-bot authored
-
Tim Neutkens authored
### What? Adds a Cursor command file (`.cursor/commands/gt-workflow.md`) that provides guidance on using Graphite (gt) instead of git for branch and commit operations. ### Why? To make the Graphite workflow easily accessible within Cursor IDE via the `/gt-workflow` command, helping contributors follow the repository's git workflow conventions. ### How? Creates a new Markdown command file that includes: - Quick reference table of Graphite commands - Safety rules for stack operations - Multi-branch fix workflow example - Checklist for verification
-
Delba de Oliveira authored
Add next.js glossary so we can reference concepts in guides without having to re-explain them. Guides should be succint, like a skill :) Closes: https://linear.app/vercel/issue/DOC-5574/nextjs-glossary --------- Co-authored-by:
vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
-
Sebastian "Sebbie" Silbermann authored
-
Tobias Koppers authored
### What? Cache the before plugin matching
-
Tobias Koppers authored
### What? Allow keys for selective reads to be something equivalent to the key instead of only exactly a reference of the key.
-
Tobias Koppers authored
### What? improve module type error message
-
Tobias Koppers authored
typo
-
Tobias Koppers authored
### What? do not persist EcmascriptChunkItemContent It's already stored as part of the module factory
-
Tobias Koppers authored
### What? save a few bits
-
Tobias Koppers authored
### What? * task type is stored as CachedDataItem * reverse task cache is removed
-
Jiachi Liu authored
Add a hydration diff indicator on the top right corner to tell users which line is from client and which line is from server. Heard feedback from users that sometimes they got confused about which line is from where. Now they'll clear know that: - `+ Client` shows `+` is client rendered content - `- Server` shows `+` is server rendered content <img width="579" height="225" alt="image" src="https://github.com/user-attachments/assets/5285709a-044a-4d7f-87f9-08f1199eed4e" />
-
- 22 Jan, 2026 20 commits
-
-
Jiachi Liu authored
-
nextjs-bot authored
-
Brooke authored
Original [PR](https://github.com/vercel/next.js/pull/88012/) has a bug that attempted to validate on environment variables. Edited function to not run validations on environment variables, only on the user provided deployment id. <!-- 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 # --> --------- Co-authored-by:
vercel[bot] <35613825+vercel[bot]@users.noreply.github.com> Co-authored-by:
JJ Kasper <jj@jjsweb.site>
-
Sebastian "Sebbie" Silbermann authored
-
Sebastian "Sebbie" Silbermann authored
-
nextjs-bot authored
-
Wyatt Johnson authored
## Summary Implements an LRU cache with compound keys for the minimal mode response cache to improve cache hit rates during parallel revalidation scenarios. **Problem**: The previous single-entry cache (`previousCacheItem`) keyed by pathname caused cache collisions when multiple concurrent invocations (e.g., during ISR revalidation) accessed the same pathname. Each invocation would overwrite the previous entry, leading to cache misses and redundant work. **Solution**: An LRU cache using compound keys (`pathname + invocationID`) that allows multiple invocations to cache entries for the same pathname independently: ``` Cache Key Structure ───────────────────── /blog/post-1\0inv-abc → {entry, expiresAt} /blog/post-1\0inv-def → {entry, expiresAt} /blog/post-1\0__ttl__ → {entry, expiresAt} (TTL fallback) /api/data\0inv-ghi → {entry, expiresAt} ``` ### Cache Key Strategy - **With `x-invocation-id` header**: Entries are keyed by invocation ID for exact-match lookups (always a cache hit if the entry exists) - **Without header (TTL fallback)**: Entries use a `__ttl__` sentinel key and validate via expiration timestamp ### Configuration via Environment Variables Cache sizing can be tuned via environment variables (using `NEXT_PRIVATE_*` prefix for infrastructure-level settings): | Environment Variable | Default | Description | |---------------------|---------|-------------| | `NEXT_PRIVATE_RESPONSE_CACHE_MAX_SIZE` | 150 | Max entries in the LRU cache | | `NEXT_PRIVATE_RESPONSE_CACHE_TTL` | 10000 | TTL in ms for cache entries (fallback validation) | ### LRU Cache Enhancement Added an optional `onEvict` callback to `LRUCache` that fires when entries are evicted due to capacity limits. This enables tracking evicted invocation IDs for warning detection without introducing timer-based cleanup. ### Eviction Warnings When a cache entry is evicted and later accessed by the same invocation, a warning is logged suggesting to increase `NEXT_PRIVATE_RESPONSE_CACHE_MAX_SIZE`. This helps developers tune cache sizes for their workload. ### Additional Changes - Renamed header from `x-vercel-id` to `x-invocation-id` for clarity - Added `withInvocationId()` test helper for cache testing ## Test Plan - Existing response cache tests pass with updated header name - Unit tests for `LRUCache` including `onEvict` callback behavior - Updated standalone mode tests to use `withInvocationId()` helper -
Vercel Release Bot authored
This auto-generated PR updates the production integration test manifest used when testing Rspack.
-
Niklas Mischkulnig authored
-
nextjs-bot authored
-
Tim Neutkens authored
## What? This PR fixes font preloading for MDX pages in Turbopack and adds an e2e test to verify the fix. ## Why? When using `next/font` with MDX pages, font preloading was failing with Turbopack because the LoaderTree was storing the **transformed module path** instead of the **original source path**. ## The Bug In Turbopack, MDX files are transformed by adding a `.tsx` extension: - Source file: `app/page.mdx` - After transform: `app/page.mdx.tsx` The `create_module_tuple_code` function in `base_loader_tree.rs` was using `module.ident().path()` (the transformed path) instead of the original `path` parameter. This caused a mismatch at runtime: - Font manifest key: `[project]/app/page` - LoaderTree stored: `[project]/app/page.mdx.tsx` - After stripping `.tsx`: `[project]/app/page.mdx` - **No match** → fonts not preloaded ## The Fix Changed `crates/next-core/src/base_loader_tree.rs` to use the original source path: ```rust // Before let module_path = module.ident().path().to_string().await?; // After let module_path = path.value_to_string().await?; ``` Now the LoaderTree stores `[project]/app/page.mdx`, which after stripping `.mdx` at runtime becomes `[project]/app/page`, matching the font manifest key. ## Test Added `test/e2e/app-dir/mdx-font-preload/` which verifies: 1. MDX page renders correctly 2. Font class from layout is applied 3. Font is correctly preloaded ## How I tested these changes ```bash pnpm test-start-turbo test/e2e/app-dir/mdx-font-preload/mdx-font-preload.test.ts ``` --------- Co-authored-by:Niklas Mischkulnig <4586894+mischnic@users.noreply.github.com>
-
Tim Neutkens authored
### What? This PR fixes `create-next-app` update notifications for prerelease versions by checking against the correct npm dist-tag. ### Why? Users running `pnpx create-next-app@canary` were incorrectly prompted to update to the stable version because: 1. The `update-check` library queries npm's `latest` dist-tag by default 2. Version comparison using `localeCompare` considers `16.1.1-canary.32` less than `16.1.3` (since base version `16.1.1 < 16.1.3`) 3. This incorrectly triggered an update notification ### How? Instead of skipping the update check entirely for prerelease versions, this PR: 1. Extracts the dist-tag from the current version (e.g., `canary` from `16.1.1-canary.32`) 2. Passes this as the `distTag` option to `update-check` 3. Updates the suggested command to include the correct tag (e.g., `pnpm add -g create-next-app@canary`) This ensures: - Stable users are notified about newer stable releases - Canary users are notified about newer canary releases - Beta/RC users are notified about newer versions of their respective channels Co-authored-by:Cursor Agent <cursoragent@cursor.com>
-
Tobias Koppers authored
Rebase of https://github.com/vercel/next.js/pull/87291
-
Sebastian "Sebbie" Silbermann authored
-
Sebastian "Sebbie" Silbermann authored
https://github.com/user-attachments/assets/0594744b-5dd5-4550-90b8-77071962f666 See [overflow-wrap docs](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/overflow-wrap) for break-word vs anywhere. Just a one-line CSS change. The other changes are renaming functions to disambiguate source/codeframe and the filename.
-
Jiachi Liu authored
-
Matt Mastracci authored
# What? Fix some unimportant `check` warnings that appear as noise in the build logs.
-
Wyatt Johnson authored
### What? Adds a new Claude Code skill `/update-docs` that guides maintainers through updating Next.js documentation based on code changes. ### Why? To help ensure PRs include complete and accurate documentation updates by providing a structured workflow, code-to-docs mappings, and quick reference materials for Next.js doc conventions. ### How? The skill includes: - Main workflow in `SKILL.md` with step-by-step guidance for analyzing changes, updating docs, and scaffolding new feature documentation - `references/DOC-CONVENTIONS.md` - Complete frontmatter schema, code block formatting, and MDX component usage - `references/CODE-TO-DOCS-MAPPING.md` - Maps source code directories to their corresponding documentation paths ### Usage **Manual invocation:** ``` /update-docs ``` **Automatic triggers** - the skill activates when you mention: - "update documentation for my changes" - "check docs for this PR" - "what docs need updating" - "sync docs with code" - "scaffold docs for this feature" - "document this feature" - "review docs completeness" - "add docs for this change" - "what documentation is affected" - "docs impact" - References to `docs/`, `docs/01-app`, `docs/02-pages`, or `.mdx files`
-
Luke Sandberg authored
Adopt the new generated accessor methods in turbo-tasks-backend. Remove the CachedDataItem enum and related support macros. This new approach is more ergonomic, memory efficient, and generates slightly smaller serialized payloads. From measuring vercel-site: ``` canary@e05510ab3bf91c02c7381e2c471363561ffa1198: $ hyperfine -p 'rm -rf .next' -w 2 -r 10 'pnpm next build --turbopack --experimental-build-mode=compile' Benchmark 1: pnpm next build --turbopack --experimental-build-mode=compile Time (mean ± σ): 55.981 s ± 0.885 s [User: 386.683 s, System: 111.484 s] Range (min … max): 54.438 s … 57.723 s 10 runs ``` ``` 01-09-migrate-to-typed-accessors@d343fad5bf92af9c5271c62a24aedcf02c3d83d4 $ hyperfine -p 'rm -rf .next' -w 2 -r 10 'pnpm next build --turbopack --experimental-build-mode=compile' Benchmark 1: pnpm next build --turbopack --experimental-build-mode=compile Time (mean ± σ): 54.897 s ± 0.496 s [User: 389.400 s, System: 127.353 s] Range (min … max): 54.298 s … 55.681 s 10 runs ``` so a small savings of a little over a second. Not too bad for mostly removing a bunch of `match` expressions that were required in the old model. similarly we should expect a small progression in disk size since we no longer explode into `Vec<CachedDataItem>` which induces some overhead from redundantly encoding enum descriminents and not being able to 'length prefix' collections. from a clean `.next` dir on vercel-site, and a production build with caching enabled, the cache size is before ``` $ du -h .next/cache 4.3G .next/cache/turbopack/v16.1.0-canary.0-518-ge05510ab ``` after ``` $ du -h .next/cache 4.1G .next/cache/turbopack/v16.1.0-canary.0-546-gd343fad5bf92 ``` Which is expected, the main thing we are winning in terms of cache size is the CachedDataItem descriminent values, and in this build we were serializing about 260M items, so we save 1 byte for each of them. In some measurements i saw much more dramatic wins of >1gb, which i do not have a great explanation for.
-
Benjamin Woodruff authored
Turbopack: Use webpki-root-certs in addition to rustls-platform-verifier on Linux for bare-bones Linux images without root CA stores (#88869) This should fix the user-reported issue here: https://github.com/vercel/next.js/pull/88290#issuecomment-3762940063 That issue occurs when building with bare-bones docker images that contain no root CA store. It's inconvenient to test inside of a bare-bones docker image, but I did at least test this works on a normal (Debian) Linux install when fetching fonts for shadcn-ui.
-