refactor: make early/late checks stricter#94358
Merged
Merged
Conversation
Member
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
This was referenced Jun 2, 2026
Contributor
Tests PassedCommit: d3322df |
Contributor
Stats cancelledCommit: d3322df |
3fad83e to
ef5aa56
Compare
0f5dc1f to
2eeac8e
Compare
gnoff
approved these changes
Jun 2, 2026
| @@ -131,10 +131,13 @@ export type AsyncApiPromises = { | |||
| export function isInEarlyRenderStage(requestStore: RequestStore): boolean { | |||
Contributor
There was a problem hiding this comment.
the change is good, but it's odd this function even exists in this file? why not just move this whole thing into staged-rendering and import it from there everywher it is needed? gets rid of the duplicate name
Member
Author
There was a problem hiding this comment.
you tell me why it's in this file, you added it :p
agree we should get rid of, but i don't have the brainpower to untangle this right now, and i don't want to inline this Before check into every callsite. will follow up to clean this up later
ef5aa56 to
d3322df
Compare
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.

While working on #93801 , i added some stricter checks about early/late stages. In particular, if we're in the
Beforestage (generally, while runningcreateComponentTree), we can't know if we're supposed to use early or late stages. Making this stricter revealed thatcreateServerPathnameForMetadatawas accidentally always using the late stage because it runs inBefore. Instead, it should checkisRuntimePrefetchablelike we do forparamsandsearchParams, so i'm refactoring it to do that here.