Resolve the .default export of a React.lazy as the canonical value#34906
Merged
sebmarkbage merged 3 commits intofacebook:mainfrom Oct 19, 2025
Merged
Resolve the .default export of a React.lazy as the canonical value#34906sebmarkbage merged 3 commits intofacebook:mainfrom
sebmarkbage merged 3 commits intofacebook:mainfrom
Conversation
|
Comparing: 40c7a7f...a12cc9a Critical size changesIncludes critical production bundles, as well as any change greater than 2%:
Significant size changesIncludes any change greater than 0.2%: Expand to show
|
c159918 to
29e1169
Compare
7e46974 to
9ed4f33
Compare
eps1lon
reviewed
Oct 19, 2025
Comment on lines
+111
to
+118
| // Surface the default export as the resolved "value" for debug purposes. | ||
| const debugValue = | ||
| moduleObject == null ? undefined : moduleObject.default; | ||
| resolveDebugValue(debugValue); | ||
| // $FlowFixMe | ||
| ioInfo.value.status = 'fulfilled'; | ||
| // $FlowFixMe | ||
| ioInfo.value.value = debugValue; |
Collaborator
There was a problem hiding this comment.
This block isn't gated on enableAsyncDebugInfo but resolveDebugValue is only callable with enableAsyncDebugInfo. enableAsyncDebugInfo isn't enabled everywhere at the moment.
Collaborator
There was a problem hiding this comment.
I guess this is implied via payload._ioInfo but still nice for DCE and readability to gate it.
Contributor
Author
There was a problem hiding this comment.
Fixed. The whole block should've been gated before just like the reject.
9ed4f33 to
a12cc9a
Compare
eps1lon
approved these changes
Oct 19, 2025
sebmarkbage
added a commit
that referenced
this pull request
Oct 19, 2025
) Stacked on #34906. Infer name from stack if it's the generic "lazy" name. It might be wrapped in an abstraction. E.g. `next/dynamic`. Also use the function name as a description of a resolved function value. <img width="310" height="166" alt="Screenshot 2025-10-18 at 10 42 05 AM" src="https://github.com/user-attachments/assets/c63170b9-2b19-4f30-be7a-6429bb3ef3d9" />
sebmarkbage
pushed a commit
to vercel/next.js
that referenced
this pull request
Oct 20, 2025
[diff facebook/react@1324e1bb...58bdc0bb](facebook/react@1324e1b...58bdc0b) <details> <summary>React upstream changes</summary> - facebook/react#34911 - facebook/react#34907 - facebook/react#34906 - facebook/react#34898 - facebook/react#34893 - facebook/react#34892 - facebook/react#34885 - facebook/react#34881 - facebook/react#34894 - facebook/react#34880 - facebook/react#34849 - facebook/react#34900 - facebook/react#34887 </details>
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.
For debug purposes this is the value that the
React.lazyresolves to. It also lets us look at that value for descriptions like its name.