Remove webpack stats generation from Turbopack - #91515
Merged
Merged
Conversation
The TURBOPACK_STATS feature generated webpack-compatible stats.json files from Turbopack's output, but it is no longer needed. Remove the entire feature: the Rust implementation (webpack_stats.rs), all call sites in app.rs and pages.rs, the project flag, and all TypeScript manifest loading, merging, and writing code. Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
Tests Passed |
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
Server Middleware
Build DetailsBuild Manifests
π¦ WebpackClient Main Bundles
Polyfills
Pages
Server Edge SSR
Middleware
Build DetailsBuild Manifests
Build Cache
π Shared (bundler-independent)Runtimes
π Tarball URL |
Merging this PR will degrade performance by 3.99%
Performance Changes
Comparing Footnotes
|
wbinnssmith
approved these changes
Mar 17, 2026
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.
What?
Remove the
TURBOPACK_STATSfeature that generated webpack-compatiblewebpack-stats.jsonfiles from Turbopack's output.Deleted:
crates/next-api/src/webpack_stats.rsβ the entire 305-line Rust implementation that built webpack-format stats (assets, chunks, modules, entrypoints) from Turbopack's module graphRust changes:
crates/next-api/src/lib.rsβ removedmod webpack_stats;crates/next-api/src/project.rsβ removedshould_create_webpack_stats()which read theTURBOPACK_STATSenv varcrates/next-api/src/pages.rsβ removedgenerate_webpack_statsimport and stats output emissioncrates/next-api/src/app.rsβ sameTypeScript changes:
packages/next/src/shared/lib/constants.tsβ removedWEBPACK_STATS = 'webpack-stats.json'constantpackages/next/src/shared/lib/turbopack/manifest-loader.tsβ removedloadWebpackStats(),writeWebpackStats(),mergeWebpackStats(), thewebpackStatsfield, webpack type imports, and theTURBOPACK_STATSenv guard inwriteManifests()packages/next/src/server/dev/turbopack-utils.tsβ removedshouldCreateWebpackStatsflag and twoloadWebpackStats()call sitespackages/next/src/build/handle-entrypoints.tsβ sameWhy?
This feature is no longer needed and adds dead complexity. It was opt-in via
TURBOPACK_STATS=1but nothing in the current codebase or tooling depends on it.How?
Pure deletion β no behavior change for any existing user, as the feature was opt-in via an environment variable that is no longer checked.
Intentionally left untouched:
stats.jsongeneration (non-Turbopack path)analyzefeatureroute-bundle-stats.jsonin.next/diagnostics/