Repository navigation
Don't load the app-page runtime in proxy.ts - #100384
Merged
timneutkens merged 3 commits intoOct 19, 2026
Merged
Conversation
Contributor
Tests PassedCommit: c258d40 |
lubieowoce
reviewed
Oct 19, 2026
timneutkens
reviewed
Oct 19, 2026
Member
hmm wait what's causing this? this isn't obvious to me just from looking at this PR |
Contributor
Author
not true anymore! updated the initial description |
lubieowoce
approved these changes
Oct 19, 2026
lubieowoce
reviewed
Oct 19, 2026
Co-authored-by: Janka Uryga <lolzatu2@gmail.com>
timneutkens
approved these changes
Oct 19, 2026
acdlite
added a commit
that referenced
this pull request
Oct 20, 2026
Backports [Don't load the app-page runtime in proxy.ts (#100384)](#100384) to `releases/lts/active` for the next 16.4.x patch. The cherry-pick applied cleanly. <!-- NEXT_JS_LLM --> 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Tobias Lins <me@tobi.sh> Co-authored-by: Janka Uryga <lolzatu2@gmail.com>
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Cause
importing anything from next/server also loads connection(), which loads dynamic-rendering.ts. That file imported React at the top just to read an owner stack in development, and in a proxy build this pulled in the 688 KB app-page-turbo.runtime.prod.js.
Fix
React is now imported lazily. No public API change.
Effect on a minimal proxy, on canary: the cold path goes from 53.8 ms to 39.1 ms (−27%) and JS loaded from 1,466 KB to 748 KB. The page runtime and React also drop out of middleware.js.nft.json, so the deployed proxy function is smaller.
Test
the new
test/production/app-dir/proxy-no-page-runtimeasserts the proxy's trace has no page runtime or React in it. It fails without the fix and passes with it on Turbopack and webpack.Existing tests that still pass: app-middleware-proxy and proxy-missing-export in production with Turbopack, and the cache-components-errors suites in dev with Turbopack.