fix(cache): DCE to avoid pulling server internals into browser bundles (4/8)#89865
Merged
timneutkens merged 2 commits intocanaryfrom Feb 19, 2026
Merged
fix(cache): DCE to avoid pulling server internals into browser bundles (4/8)#89865timneutkens merged 2 commits intocanaryfrom
timneutkens merged 2 commits intocanaryfrom
Conversation
This was referenced Feb 11, 2026
Contributor
Author
This was referenced Feb 11, 2026
4e5afea to
ab734ba
Compare
b5ee83a to
a174fe1
Compare
Collaborator
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: **398 kB** → **398 kB** ✅ -8 B80 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
|
timneutkens
approved these changes
Feb 12, 2026
ab734ba to
ab5300e
Compare
24732c7 to
a296e79
Compare
ab5300e to
38a8b92
Compare
unstubbable
reviewed
Feb 16, 2026
Contributor
unstubbable
left a comment
There was a problem hiding this comment.
Can we extend the example app in test/production/app-dir/browser-chunks to catch this? Under which circumstances do these modules even end up in the browser chunks?
a296e79 to
74b6486
Compare
38a8b92 to
abd151e
Compare
74b6486 to
f0c9ffe
Compare
Member
|
@unstubbable I asked Claude to write a test case for this. Seems the specific case is that we allow unstable_cache in client components... maybe that shouldn't be allowed in the first place? Given that it's noop function in that context. |
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
Fix dead-code elimination in
packages/next/cache.jsto prevent server-only internals from being pulled into browser bundles. Restructures the conditional exports so bundlers can properly tree-shake server paths.Test plan
pnpm --filter=next buildsucceeds