- 04 Mar, 2026 1 commit
-
-
nextjs-bot authored
-
- 03 Mar, 2026 30 commits
-
-
Jiachi Liu authored
-
nextjs-bot authored
-
Andrew Clark authored
Remove the `parallelRoutesKeys.length === 0` condition from `renderComponentsOnThisLevel` in walk-tree-with-flight-router-state. This check was added to support the behavior where clicking the same link twice forces all page segments to re-render on the server. This should no longer be necessary because the client already adds a refetch marker on those segments, so there's no need to special-case leaf segments on the server side.
-
Luke Sandberg authored
Save space in the persisent store by only recording TaskType one time instead of twice. ## What? Instead of using an encoded TaskType struct as a key in persistent storage just use a 64 bit hash. Now when looking up we actually need to do a cascading read * read task ids that match the hash * restore all the tasks until we find one that matches our CachedTaskType Full cache misses perform the same and so do cache hits since we always end up reading the TaskData anyway (in the `connect_child` operation that immediately follows). This just slightly changes _when_ that second read happens, as such we shouldn't really expect it to slow down. In the case of a hash collisions we do end up doing strictly more work (reading and restoring TaskData entries for the wrong task), but this work is cached and this should be _extremely_ rare assuming a good hash function.. From measuring vercel-site this saves ~231M of data in the persistent cache. (The cache goes from from 3846M -> 3615 or -231M or about -6%). Finally this also addresses a narrow race condition where two racing calls to `get_persistent_task_id` for the same task could result in two entries being pusshed to the `persistent_task_log`, that is now addressed as well. ## Why? Currently we encode 2 copies of every `CachedTaskType` in the database. 1. as the key of the `TaskType`->`TaskId` map (aka `TaskCache` keyspace) 2. as a part of the `TaskStorage` struct stored in the `TaskData` keyspace This redundancy is wasteful. Instead we can make the `TaskCache` map much smaller and add a bit of complexity to lookups. ## Future Work ### Better hash functions Right now to compute the hashes we are just running `encode` and then hashing the bytes. This is not optimal, but we do not have a hash function that is suitable for this usecase. So we should create a new `PersistentHash` trait that TaskInputs implement in order to support this without encoding. Or perhaps a custom _encoder_ that accumulates encoding data to a hasher. This will be addressed in https://github.com/vercel/next.js/pull/89059 ### New SST ffile heuristics now that the TaskcCache keyspace is smaller our heuristics on 'maxiumum number of keys in a file' need to be rethought since we are now producing lots of 7Mb files for the taskcache. this will be addressed in https://github.com/vercel/next.js/pull/89058 ### New compaction semantics Right now we tolerate duplicates in the database but compaction will delete them. This is not too harmful for us since it means if there is a hash coliision we will tend to lose one of the results over time. A better option would be to change compaction semantics for this KeySpace to either tolerate duplicates, leverage values for comparison, or something wilder where we simply 'recompute' the TaskCache instead of compacting it. This will be addressed in https://github.com/vercel/next.js/pull/89075
-
Vercel Release Bot authored
This auto-generated PR updates the development integration test manifest used when testing Rspack.
-
nextjs-bot authored
-
Jiachi Liu authored
-
Sebastian "Sebbie" Silbermann authored
Co-authored-by:
Vercel <vercel[bot]@users.noreply.github.com> Co-authored-by:
Cursor Agent <cursoragent@cursor.com>
-
nextjs-bot authored
-
Sebastian "Sebbie" Silbermann authored
-
Tobias Koppers authored
Turbopack: add anyhow::Context to turbo-persistence mmap, file open, and decompress operations (#90769) ### What? Adds `anyhow::Context` (`.context()` / `.with_context()`) to error-prone operations in the `turbo-persistence` crate: file opens, memory mapping (`mmap`), and LZ4 decompression. ### Why? `get` / `batch_get` sometimes fail with a bare "Cannot allocate memory" error, but the anyhow error chain has no context about *which* file, block, or operation caused it. This makes debugging difficult since the raw OS error propagates through bare `?` operators without any identifying information. ### How? Split double-`?` expressions (e.g. `Mmap::map(&File::open(&path)?)?`) into separate statements so each operation gets its own context. Added `.with_context()` to: - **`compression.rs`** — `decompress()` call in `decompress_into_arc()`, reporting compressed and uncompressed sizes - **`db.rs`** — `File::open`, `Mmap::map`, and `read_u32` in `read_blob()`, reporting the blob file path and size - **`static_sorted_file.rs`** — `File::open` and `Mmap::map` in `open_internal()`, `get_raw_block_slice` and `decompress_into_arc` in `read_block()`, and block offset reads in `get_raw_block_slice()`, reporting SST filename and block index - **`meta_file.rs`** — `options.map()` in `open_internal()`, reporting the meta file path An ENOMEM error will now produce a chain like: ``` Unable to open static sorted file 00000042.sst Caused by: Failed to mmap SST file /path/to/00000042.sst (1234567 bytes) Caused by: Cannot allocate memory (os error 12) ``` -
Delba de Oliveira authored
This PRs unifies the caching story across the docs, making Cache Components the happy path, while still providing guidance to users in the old model. However, instead of explaining the old model and its caching layers, we've created a new guide focusing on what APIs to use and when. This follow-up PR aligns terminology across the docs: https://github.com/vercel/next.js/pull/90589 ## IA updates Getting Started section: - Improves Getting Started progression: - **Before:** CC → Fetching Data → Updating Data → Caching and Revalidating (old and new model mixed) - **After:** Fetching Data (Dynamic) → Mutating Data (Dynamic) → Caching with CC (Prerendering) → Revalidating with CC. - New: `caching.mdx` (CC-first) - Structure: - Enabling Cache Components - Data vs UI-level caching - Working with request time APIs - Passing request values to cached functions - Working with non-deterministic operations - Working with synchronous operations - How rendering works (PPR and static shell story) - New: `revalidating.mdx` (CC-first) - Explains how to use `cacheLife` and `cacheTag` Guides Section: - New: `caching-and-revalidating.mdx` (Previous Model) - For users who are not using CC, includes `fetch` options and route segment config - Moves route segment config options that don't apply to CC from API reference to this guide (for easy archiving in the future). - New: `migrating-to-cache-components.mdx` (WIP) - Del: `caching.mdx`
😌 ## Terminology We should remove caching layers from the docs. Users only needed to be exposed to them when they were configured independently, but the new CC APIs work across layers. To make it easier to review this PR, I'm consolidating terminology and fixing broken links in a new PR: https://github.com/vercel/next.js/pull/90589 --------- Co-authored-by:Vercel <vercel[bot]@users.noreply.github.com> Co-authored-by:
Joseph <joseph.chamochumbi@vercel.com>
-
Luke Sandberg authored
## What Replaces the `@babel/code-frame` dependency with a new Rust-based implementation (`next-code-[frame](https://github.com/arthurprs/qfilter/pull/20#issuecomment-3986882055)` crate) for rendering code frames in error messages. ### Why - **Crash fix**: `@babel/code-frame` uses the `js-tokens` library for syntax highlighting, which has [known issues](https://github.com/lydell/js-tokens?tab=readme-ov-file#known-failures) with large string literals and long lines. This can cause Next.js to throw RangeErrors when rendering errors, hiding the original issue! - **Long line support**: The old implementation had no concept of terminal width, dumping entire lines into the output. The new implementation uses "horizontal scrolling" — truncating lines and centering the error location in the visible window. - **Performance**: The Rust implementation only processes the visible line range (typically ~6 lines), not the entire file. Syntax highlighting uses a skip-scan heuristic to start tokenizing near the visible window rather than from byte 0. - **Dependency reduction**: Drops the semi-unmaintained `@babel/code-frame` bundled dependency in favor of code we control. ### Benchmarks In-process benchmarks comparing `render_code_frame()` (Rust, via criterion) against `codeFrameColumns()` (Babel, via hrtime with DCE prevention). Both have syntax highlighting and color output enabled. No process startup or file I/O is included in the measurement. | Scenario | `next-code-frame` (Rust) | `@babel/code-frame` | Speedup | |---|---|---|---| | Small file (~490 lines TSX) | **5.4 µs** | 507 µs | **~94x** | | Large file (~39k lines JS) | **143 µs** | 82.9 ms | **~580x** | | Large file minified | **51 µs** | - | **-** | The gap widens with file size because Babel's `highlight()` runs a regex tokenizer over the **entire source** before slicing to the visible window, while the Rust implementation uses a windowed line index and skip-scan heuristic — only processing the visible window regardless of file size. However, for minified files we do end up tokenizing the whole thing so we end up being only 8x faster ### How - New `crates/next-code-frame/` Rust crate with: - Frame rendering with terminal-width-aware horizontal scrolling - Regex-based syntax highlighting (matching Babel's color scheme) - Skip-scan heuristic for O(1)-ish highlighting regardless of file size - Windowed line index that only scans/stores offsets for the visible region - Comprehensive test suite (800+ lines) - Exposed via both NAPI (native) and WASM bindings - JS wrappers in `packages/next/src/shared/lib/errors/`: - `code-frame.ts` — primary wrapper using native bindings - `optional-code-frame.ts` — graceful fallback returning `undefined` if bindings are unavailable - All existing callsites (`diagnosticFormatter`, `parseScss`, dev overlay, turbopack utils) updated - for `patch-error-inspect.ts` i adopted an `injection` style approach to avoid coupling to the native dependency ### Concerns / review focus areas - **Reliability**: The regex-based tokenizer is best-effort and language-agnostic — it should never crash on invalid syntax, but highlighting accuracy may differ from Babel's `js-tokens` in edge cases. - **Native dependency**: This moves code frame rendering into the native binary. Performance should be better, but worth verifying there are no regressions in environments where native bindings behave differently (e.g. WASM fallback path). - **Regressions**: The output format and color scheme closely match Babel's, but there may be subtle differences. The horizontal scrolling behavior is new. Fixes #85357 Closes PACK-5754
-
Tobias Koppers authored
## Summary Refactors `extractExportedConstValue` and the internal `extractValue` function to use return values instead of exception-based control flow, improving performance during build analysis. ### Commit 1: Refactor `extractExportedConstValue` - Returns `{ value: any } | null` instead of throwing `NoSuchDeclarationError` - `null` when the exported const declaration is not found, `{ value }` when found - Removes `NoSuchDeclarationError` class ### Commit 2: Refactor `extractValue` - Returns `ExtractValueResult` (`{ value: any } | { unsupported: string; path?: string }`) instead of throwing `UnsupportedValueError` - Extracts path-formatting logic from `UnsupportedValueError` constructor into a standalone `formatCodePath` helper - All 6 throw sites become return statements; 3 recursive call sites propagate unsupported results - Removes `UnsupportedValueError` class entirely - Removes all try/catch blocks from the 4 callsites in `get-page-static-info.ts` - Updates `warnAboutUnsupportedValue` to accept the result type directly ## Motivation Both `extractExportedConstValue` and `extractValue` used throw/catch for expected control flow — a missing declaration and unsupported AST node types are normal cases during build analysis, not exceptional errors. Every page/route processed during build hits these functions multiple times. Constructing `Error` objects (which capture stack traces) and unwinding the stack is expensive in V8. Returning discriminated result types avoids this overhead entirely. ## Test Plan - Existing unit tests pass (`test/unit/parse-page-static-info.test.ts` — 5/5) - No behavioral change: callsites produce identical warnings/errors for unsupported values and silently skip missing declarations, same as before -
Tobias Koppers authored
### What? Fix a compilation error in `turbo-persistence` test code where the `StaticSortedFile::lookup` call was missing the required `FIND_ALL` const generic parameter. ### Why? After the `FIND_ALL: bool` const generic was added to `StaticSortedFile::lookup` in #90754, a call site in the test helper `assert_corruption_detected` was not updated, causing `cargo check --all-targets` to fail with: ``` error[E0284]: type annotations needed --> turbopack/crates/turbo-persistence/src/static_sorted_file_builder.rs:1661:19 | 1661 | match sst.lookup(entries[0].hash, &entries[0].key, &kc, &vc) { | ^^^^^^ cannot infer the value of the const parameter `FIND_ALL` ``` ### How? Added explicit turbofish `::<_, false>` to the `lookup` call in the test helper. `false` is the appropriate value since the test only needs to look up a single entry to verify corruption detection. -
Tobias Koppers authored
### What? Adds a lint script (`scripts/check-unused-turbo-tasks.mjs`) that detects unused `#[turbo_tasks::function]`, `#[turbo_tasks::value]`, and `#[turbo_tasks::value_trait]` definitions across the Rust codebase, and removes all currently unused items. ### Why? Dead turbo-tasks definitions add compilation overhead (each generates trait impls, registrations, etc.) and make the codebase harder to navigate. A lint check prevents regressions. ### How? **New script** (`scripts/check-unused-turbo-tasks.mjs`): 1. Discovers all `.rs` files in `turbopack/crates/` and `crates/` (excluding `turbo-tasks-macros-tests`) 2. Parses three kinds of turbo-tasks annotations: - `#[turbo_tasks::function]` → extracts `fn` name + context (free, inherent impl, trait impl, trait default) - `#[turbo_tasks::value]` → extracts `struct`/`enum` name - `#[turbo_tasks::value_trait]` → extracts `trait` name 3. Scans all files for identifier references, excluding definition sites 4. Reports any name that has no external references The script is added to the `pnpm lint` command (runs in parallel with other checks). **Removed 23 unused items** across 18 files: | Kind | Count | Examples | |------|-------|---------| | `value` (struct/enum) | 9 | `OutputAssetsWithAvailability`, `ModuleNameMap`, `OptionModuleIds`, `LockedVersions`, `AssetContentSnapshot` | | `function` | 14 | `client_env`, `next_js_file`, `convert_path`, `is_hot_module_replacement_enabled`, `any_content_changed_of_output_asset` | Also cleaned up imports that became unused after the removals.
-
Tobias Koppers authored
### What? Add a 4-byte CRC32 checksum to every block in turbo-persistence SST files. ### Why? Detect on-disk cache corruption early with a clear error message, rather than silently returning wrong data or hitting confusing LZ4 decompression failures. ### How? **New on-disk block format:** ``` [4B uncompressed_length] [4B CRC32 checksum] [block data] ``` (Previously the checksum field did not exist — header was just the 4B uncompressed_length.) - The checksum is computed on the **uncompressed** block data using `crc32fast` (hardware-accelerated CRC32C on modern CPUs). - On write, the checksum is computed before compression and stored in the block header. - On read, the checksum is verified after decompression (or directly for uncompressed blocks). A mismatch returns an `anyhow` error with a message like: `Cache corruption detected: checksum mismatch in block N of SST file seq:M`. - During compaction, medium values are copied as raw compressed blocks without decompression — the checksum is carried through the `MediumRaw`/`LazyLookupValue::Medium` path unchanged. - A `BLOCK_HEADER_SIZE` constant (= 8) replaces magic numbers across the write, read, and inspect code. **Files changed:** - `compression.rs` — `checksum_block()` helper wrapping `crc32fast::hash()` - `static_sorted_file_builder.rs` — write path (`write_raw_block_to_file`, `write_block_to_file`, `close()` index block), `EntryValue::MediumRaw` carries checksum - `static_sorted_file.rs` — read path (`get_raw_block_slice`, `read_block` with `verify_checksum()` helper) - `lookup_entry.rs` — `LazyLookupValue::Medium` carries checksum for compaction - `bin/sst_inspect.rs` — updated block parsing offsets - `README.md` — documented new format **Tests:** - All 48 existing tests pass (checksums are transparent to correct data) - 2 new corruption tests: one corrupts a compressed block's checksum, the other corrupts an uncompressed block's data — both verify the error is returned
-
nextjs-bot authored
-
Tim Neutkens authored
## What? No changes in functionality. Just skips requiring modules that are not used in the common hot path of builds. --------- Co-authored-by:Tobias Koppers <tobias.koppers@googlemail.com>
-
Jan Nicklas authored
### What? Skip the Pages Router global CSS restriction for `data:` URL imports (similar to app router and mixed app/pages router) ### Why? `data:text/css` should work the same no matter if pages router, app router or mixed router usage ### How? the validation in `crates/next-api/src/module_graph.rs` already had a carve-out for `node_modules`. This adds the same for data URL modules. fixes #89900 - [x] Related issues linked using `fixes #89900` - [x] Tests added --------- Co-authored-by:Tim Neutkens <tim@timneutkens.nl>
-
Tobias Koppers authored
## Summary - Add a `--wait` flag to `scripts/pr-status.js` that writes a partial report with currently available CI results, then blocks on `gh run watch` until CI completes, and re-runs the full analysis to produce the final report - Refactor `main()` into a reusable `runAnalysis()` function so it can be called twice (partial + final) - Update the `/pr-status` command to run the script with `--wait` in the background, present the partial report immediately while CI is still running, then poll for completion with 5-minute timeouts ### How it works 1. `/pr-status` launches `node scripts/pr-status.js --wait` in the background (1-minute Bash timeout) 2. The script writes the initial report (with whatever jobs have completed so far) and prints `Output written to ...` 3. The command polls for that message using `TaskOutput` with 20-second timeouts, then reads `index.md` and analyzes the partial results 4. Meanwhile, the script blocks on `gh run watch` until CI finishes, then re-runs the full analysis 5. After presenting the partial analysis, the command polls for the background script to complete using `TaskOutput` with 5-minute timeouts (repeating if needed) 6. When it finishes, the command re-reads the final report and analyzes any newly failed jobs ### Files changed - `scripts/pr-status.js` — Extracted `runAnalysis()` from `main()`, added `--wait` flag with `gh run watch` blocking and re-analysis - `.claude/commands/pr-status.md` — Updated workflow to use `--wait` with background execution, poll for readiness (20s timeouts), and poll for final results (5-min timeouts) ## Test plan - [ ] Run `node scripts/pr-status.js <completed-pr-number>` (no `--wait`) — should behave identically to before - [ ] Run `node scripts/pr-status.js <completed-pr-number> --wait` — should produce report and exit immediately (no waiting needed since CI is done) - [ ] Run `node scripts/pr-status.js --wait` on a branch with in-progress CI — should write partial report, block on `gh run watch`, then write final report - [ ] Run `/pr-status` command — should show partial results, then update with final results after CI completes --------- Co-authored-by:Claude <noreply@anthropic.com>
-
Luke Sandberg authored
## What Add support for multi-valued tables in `turbo-persistence`. A multi-valued table allows multiple distinct values to be associated with a single key. Each family is independently configured as `SingleValue` (existing behavior) or `MultiValue` via the new `FamilyKind` enum. ## Why This will support the `TaskCache` table (implemented in #88904), where keys will change to be _hashes_ instead of full `TaskType` values. This greatly decreases DB size and speeds up queries due to smaller key sizes, at the cost of hash collisions requiring multiple values per key. ## How ### API - New `FamilyKind` enum (`SingleValue` / `MultiValue`) and per-family `FamilyConfig` in `DbConfig` - `get()` for single-valued families (panics if called on multi-valued) - `get_multiple()` for multi-valued families, returns `SmallVec<[ArcBytes; 1]>` — stack-allocated for the common 0–1 result case, heap-scales when needed - `put()` and `delete()` are unchanged — the family kind controls dedup/compaction behavior ### Write path & compaction - **Single-valued** (unchanged): last-write-wins per key - **Multi-valued**: all values are maintained, deletions 'shadow' old values. - Deletion inserts a tombstone that shadows all older values for that key across SST layers. Values written *after* the tombstone in the same batch are retained. - To avoid extra buffering logic the `MergeIter` semantics were changed so it produces 'newest' entries first * for SingleValues families this is no different since we only keep one value * for MultiValued families this makes dealing with tombstones trivial, but does mean compaction will reverse the order of the set. For this reason we make no guarantees about ordering. ### Read path - Controlled by a `FIND_ALL` const generic on the internal lookup methods - **Single-valued** (`FIND_ALL=false`): binary search, return _last_ match, stop * This fixes a bug where we might return Deleted when there is a value in the SST depending on what the search algorithm found first - **Multi-valued** (`FIND_ALL=true`): scan all matching entries in the SST block, then continue to older SSTs. If a tombstone is found, stop searching older layers. --------- Co-authored-by:Tobias Koppers <tobias.koppers@googlemail.com>
-
Joseph authored
<!-- 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? Updated `installation.mdx` and `create-next-app.mdx` documentation. ### Why? To accurately reflect the `create-next-app` CLI's behavior regarding `AGENTS.md` and `CLAUDE.md` file generation, and to update the displayed default configuration. ### How? - **`docs/01-app/01-getting-started/01-installation.mdx`**: - Updated `--yes` flag description to mention `AGENTS.md` and `CLAUDE.md` inclusion. - Corrected the recommended defaults prompt to replace "Turbopack" with "AGENTS.md". - Added the `AGENTS.md` prompt to the customize settings section. - **`docs/01-app/03-api-reference/06-cli/create-next-app.mdx`**: - Added `--agents-md` flag to the options table. - Updated recommended defaults and customize settings prompts. Closes NEXT- Fixes # --> --- [Slack Thread](https://vercel.slack.com/archives/C07BS1WEYAZ/p1772483393984349?thread_ts=1772483393.984349&cid=C07BS1WEYAZ) <p><a href="https://cursor.com/agents/bc-2f6bce63-8c1b-544a-9a10-cb65f56b213d"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-web-light.png"><img alt="Open in Web" width="114" height="28" src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a> <a href="https://cursor.com/background-agent?bcId=bc-2f6bce63-8c1b-544a-9a10-cb65f56b213d"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img alt="Open in Cursor" width="131" height="28" src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a> </p> --------- Co-authored-by:
Cursor Agent <cursoragent@cursor.com> Co-authored-by:
Joseph <icyJoseph@users.noreply.github.com>
-
Tobias Koppers authored
### What? Updates outdated Rust dependencies used by `turbo-persistence` and `turbo-tasks-backend` crates. ### Why? Keep dependencies current to benefit from bug fixes, performance improvements, and security patches. ### How? Each dependency was updated in a separate commit. All crates were verified to compile and tests pass. **Direct dependency updates:** - `lzzzz` 1.1.0 → 2.0.0 (moved to workspace dependency, used by both crates) - `arc-swap` 1.7.1 → 1.8.2 (turbo-tasks-backend) **Workspace dependency updates:** - `bitfield` 0.18 → 0.19 - `either` 1.9 → 1.15 - `indexmap` 2.7 → 2.13 - `once_cell` 1.17 → 1.21 - `rand` 0.9 → 0.10 (required API migration: `Rng`/`RngCore` → `RngExt`) - `ringmap` 0.1 → 0.2 **Skipped:** - `hashbrown` 0.14 → 0.16: The `raw` module was removed in 0.15 and replaced with `HashTable` API. The codebase uses `RawTable`, `Bucket`, `InsertSlot` extensively, requiring a non-trivial migration.
-
Niklas Mischkulnig authored
`required-server-files.json` contains the `adapterPath` which might be nondeterministic across builds depending on where the adapter was installed.
-
Luke Sandberg authored
In a few `next build` commands i saw multiple snapshots due to this. Idle callbacks were firing near the end of the build. ``` Creating an optimized production build ... WARNING: The git repository is dirty, but File System Cache is still enabled. Manual removal of the filesystem cache database might be required. ✓ Finished writing to filesystem cache because: idle timeout in 6.1s ✓ Compiled successfully in 69s ✓ Collecting page data using 13 workers in 85ms Build ran with "compile" mode, to finalize the build run either "generate" or "generate-env" mode as well ✓ Finalizing page optimization in 32ms Route (app) ...ommitted route table... ✓ Finished writing to filesystem cache because: stop in 3.5s ``` This is a bit wasteful since it is more efficient to write everything in a single batch at the end. The solution is just to not schedule snapshotting operations in 'short sessions' (aka `next build`)
-
Tobias Koppers authored
### What? Adds two new subcommands to `scripts/pr-status.js`: - `reply-thread <threadNodeId> <body>` — posts a reply to a PR review thread - `resolve-thread <threadNodeId>` — marks a review thread as resolved Each generated `thread-N.md` file now includes a `## Commands` section at the bottom with ready-to-use commands pre-populated with the correct GraphQL node IDs. The resolve command is only shown for threads that are still open. Also updates the pr-status-triage skill to remind agents to reply to review threads with a description of actions taken before resolving them. ### Why? When an agent addresses review feedback, it should close the loop by replying to the thread (describing what was done) and resolving it. Previously there was no way to do this from the pr-status workflow — the agent would need to manually construct `gh api graphql` calls. ### How? - Fetches GraphQL node IDs for review threads (added `id` to the thread-level query) - Uses `execFileSync` with argument arrays (not shell strings) to safely pass the reply body to `gh api graphql` without shell escaping issues - GraphQL mutations used: `addPullRequestReviewThreadReply` and `resolveReviewThread` - Subcommand dispatch at the top of `main()` checks `process.argv[2]` against known subcommand names before falling through to the existing PR-number behavior
-
Tobias Koppers authored
## Summary Performance and readability improvements to `StreamingSstWriter` in turbo-persistence, based on a performance audit of the streaming SST file builder. ### Pre-allocate Vec fields (33eb3e8f) - Pre-allocate `compress_buffer`, `pending_small_value_block`, `key_buffer`, `block_offsets`, and `key_block_boundaries` with capacity estimates derived from `max_entry_count` - Eliminates ~10-15 reallocations during early writes (e.g. for 1M-entry compaction files, the pre-allocation is ~89 KB across all Vecs) ### Readability cleanup (3de7a45a) - Extract `KeyBlockAccumulator` struct from four loose `current_key_block_*` fields, with `should_flush`/`add`/`reset` methods - Add architectural diagram comment for `pending_keys` queue layout showing resolved vs. unresolved regions - Name magic constant `BLOCK_INDEX_CAPACITY_BUFFER` (was bare `16`) - Simplify `flush_remaining_key_blocks()` using local `KeyBlockAccumulator` and remove dead state resets after `close()` - Remove `try_flush_key_block()` — its logic is now split between `KeyBlockAccumulator::should_flush()` and inline flush calls, which is clearer - Deduplicate `TestEntry` constructors via shared `new()` helper ### Derive value block estimate from constants (580e5d4c) - Replace magic number `40` (entries per value block) with `MIN_SMALL_VALUE_BLOCK_SIZE / AVG_SMALL_VALUE_SIZE` (= 128) - Add `AVG_SMALL_VALUE_SIZE = 64` constant ## Test Plan - All 14 existing `static_sorted_file_builder` tests pass: `cargo test -p turbo-persistence --lib -- static_sorted_file_builder` - No behavioral changes — all changes are internal to the writer
-
Zack Tanner authored
<!-- 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 # -->
-
Josh Story authored
`unstable_instant` requires `cacheComponents` to function — without it, validation is entirely skipped and the config silently does nothing. This adds a compile-time error in the SWC transform that catches the misconfiguration early, matching the existing pattern used for segment configs like `revalidate` that are incompatible with `cacheComponents` (but inverted — `unstable_instant` requires it rather than being incompatible with it). The error points directly to the export in the user's source file.
-
- 02 Mar, 2026 9 commits
-
-
nextjs-bot authored
-
Niklas Mischkulnig authored
``` ● deterministic build - changing deployment id › build output API - cacheComponents adapter › should produce identical build outputs even when changing deployment id File content mismatch for .next/prerender-manifest.json in .vercel/output/functions/[variants].func/.vc-config.json - Expected + Received @@ -80,5 +80,5 @@ "/abc": { "initialHeaders": { - "link": "</_next/static/media/caa3a2e1cccd8315-s.p.853070df.woff2>; rel=preload; as=\"font\"; crossorigin=\"\"; type=\"font/woff2\", </_next/static/chunks/55fd2813a6ce3e20.css?dpl=foo-dpl-id>; rel=preload; as=\"style\"", + "link": "</_next/static/media/caa3a2e1cccd8315-s.p.853070df.woff2>; rel=preload; as=\"font\"; crossorigin=\"\"; type=\"font/woff2\", </_next/static/chunks/55fd2813a6ce3e20.css?dpl=bar-dpl-id>; rel=preload; as=\"style\"", "x-nextjs-stale-time": "300", "x-nextjs-prerender": "1", ``` -
Niklas Mischkulnig authored
-
Vercel Release Bot authored
This auto-generated PR updates the production integration test manifest used when testing Rspack.
-
Vercel Release Bot authored
This auto-generated PR updates the development integration test manifest used when testing Rspack.
-
Jiwon Choi authored
Adding docs for https://github.com/vercel/next.js/pull/89685
-
nextjs-bot authored
-
Tim Neutkens authored
## What? Skip bfcache handling server-side.
-
Sebastian "Sebbie" Silbermann authored
-