Fix layout segment optimization: move app-page imports to server-utility transition#91701
Merged
Merged
Conversation
…aredMultiple chunk group - Add 'turbopack-transition': 'next-server-utility' to all server-side imports in app-page.ts template so they are properly placed in the server utility layer - Remove next-server-utility transition from fillMetadataSegment import in app_page_loader_tree.rs (no longer needed) - Add SharedMultiple chunk group variant to support multiple shared entries without requiring a merge tag - Refactor app_module_graphs to combine client_shared_entries parameter with has_layout_segments into a single Option parameter - Simplify the module graph construction for the shared segment
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.35%
Performance Changes
Comparing Footnotes
|
mischnic
approved these changes
Mar 20, 2026
ijjk
pushed a commit
that referenced
this pull request
Mar 20, 2026
…ity transition (#91701) ## Summary - Add `'turbopack-transition': 'next-server-utility'` to all server-side imports in the `app-page.ts` template so they are properly placed in the server utility layer, rather than relying on `SharedMerged` chunk groups to handle them - Remove the now-unnecessary `next-server-utility` transition from `fillMetadataSegment` import in `app_page_loader_tree.rs` - Add `SharedMultiple` chunk group variant to support multiple shared entries without a merge tag - This avoid passing the `parent` into `SharedMerged`, which did break the layout segment optimization. - Refactor `app_module_graphs` to combine `client_shared_entries` + `has_layout_segments` into a single `Option` parameter, simplifying the API and removing the dead code path for non-page endpoints ## Test plan - [ ] Verify dev and production builds work with app pages that have layout segments - [ ] Verify route handlers still build correctly (no client runtime entries passed) - [ ] Run existing app-dir e2e tests
1 task
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
'turbopack-transition': 'next-server-utility'to all server-side imports in theapp-page.tstemplate so they are properly placed in the server utility layer, rather than relying onSharedMergedchunk groups to handle themnext-server-utilitytransition fromfillMetadataSegmentimport inapp_page_loader_tree.rsSharedMultiplechunk group variant to support multiple shared entries without a merge tagparentintoSharedMerged, which did break the layout segment optimization.app_module_graphsto combineclient_shared_entries+has_layout_segmentsinto a singleOptionparameter, simplifying the API and removing the dead code path for non-page endpointsTest plan