[Flight] Emit start time before an await if one wasn't emitted already#33646
Merged
sebmarkbage merged 1 commit intofacebook:mainfrom Jun 25, 2025
Merged
[Flight] Emit start time before an await if one wasn't emitted already#33646sebmarkbage merged 1 commit intofacebook:mainfrom
sebmarkbage merged 1 commit intofacebook:mainfrom
Conversation
|
Comparing: 9b2a545...0a51593 Critical size changesIncludes critical production bundles, as well as any change greater than 2%:
Significant size changesIncludes any change greater than 0.2%: (No significant changes) |
unstubbable
approved these changes
Jun 25, 2025
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.
There's a special case where if we create a new task, e.g. to serialize a promise like
<div>{promise}</div>then that row doesn't have any start time emitted but it has atask.timeinherited. We mostly don't need this because every other operation emits its own start time. E.g. when we started rendering a Server Component or the real start time of a realawait.For these implied awaits we don't have a start time. Ideally it would probably be when we started the serialization, like when we called
.then()but we can't just emit that eagerly and we can't just advance thetask.timebecause that time represents the last render or previous await and we use that to cut off awaits. However for this case we don't want to cut off any inner awaits inside the node we're serializing if they happened before the.then().Therefore, I just use the time of the previous operation - which is likely either the resolution of a previous promise that blocked the
<div>like the promise of the Server Component that rendered it, or just the start of the Server Component if it was sync.