Turbopack: Pass asset_suffix_path as Vc#89899
Merged
Merged
Conversation
We need to pass it by vc instead of by value, otherwise we create a new chunking context Vc for every build, which duplicates the whole build in cache (and compiles it again)
Measure Turbopack cache size (.next/cache/turbopack/) before and after rebuild cycles to detect unbounded cache growth regressions. Normal changes are limited to 10% growth; renames allow up to 50% due to dead cache entries from old routes persisting.
Contributor
Tests Passed |
Merging this PR will not alter performance
Comparing Footnotes
|
Contributor
Stats from current PR✅ No significant changes detected📊 All Metrics📖 Metrics GlossaryDev Server Metrics:
Build Metrics:
Change Thresholds:
⚡ Dev Server
📦 Dev Server (Webpack) (Legacy)📦 Dev Server (Webpack)
⚡ Production Builds
📦 Production Builds (Webpack) (Legacy)📦 Production Builds (Webpack)
📦 Bundle SizesBundle Sizes⚡ TurbopackClient Main Bundles: **437 kB** → **437 kB** ✅ -3 B81 files with content-based hashes (individual files not comparable between builds) Server Middleware
Build DetailsBuild Manifests
📦 WebpackClient Main Bundles
Polyfills
Pages
Server Edge SSR
Middleware
Build DetailsBuild Manifests
Build Cache
🔄 Shared (bundler-independent)Runtimes
|
bgw
approved these changes
Feb 12, 2026
| let css_url_suffix = css_url_suffix.owned().await?; | ||
|
|
||
| let next_mode = mode.await?; | ||
| let asset_prefix = asset_prefix.owned().await?; |
Contributor
There was a problem hiding this comment.
[Re: line +513]
should you keep it as a VC through here as well?
See this comment inline on Graphite.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
asset_suffix_pathasVc<Option<RcStr>>instead of eagerly resolving it toOption<RcStr>in the chunking context option structsWhy
Previously,
css_url_suffixwas eagerly awaited inproject.rsbefore being passed intoClientChunkingContextOptions,ServerChunkingContextOptions, andEdgeChunkingContextOptions. This caused a new chunking contextVcto be created for every build, duplicating the entire build in cache and recompiling it.By keeping it as a
Vc, the chunking context identity is stable across builds, preventing unnecessary cache duplication.How
css_url_suffixfield fromOption<RcStr>toVc<Option<RcStr>>in all three chunking context option structs.owned().await?.clone()inproject.rs(3 call sites), passing theVcdirectly.owned().await?at the point of use in the 5 context builder functionsfilesystem-cache.test.ts: normal changes limited to 10% growth, renames allow up to 50% due to dead cache entries