Skip to content

refactor: make early/late checks stricter#94358

Merged
lubieowoce merged 1 commit into
canaryfrom
lubieowoce/strict-early-late
Jun 3, 2026
Merged

refactor: make early/late checks stricter#94358
lubieowoce merged 1 commit into
canaryfrom
lubieowoce/strict-early-late

Conversation

@lubieowoce
Copy link
Copy Markdown
Member

@lubieowoce lubieowoce commented Jun 2, 2026

While working on #93801 , i added some stricter checks about early/late stages. In particular, if we're in the Beforestage (generally, while running createComponentTree), we can't know if we're supposed to use early or late stages. Making this stricter revealed that createServerPathnameForMetadata was accidentally always using the late stage because it runs in Before. Instead, it should check isRuntimePrefetchable like we do for params and searchParams, so i'm refactoring it to do that here.

Copy link
Copy Markdown
Member Author

lubieowoce commented Jun 2, 2026

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 2, 2026

Tests Passed

Commit: d3322df

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 2, 2026

Stats cancelled

Commit: d3322df
View workflow run

@lubieowoce lubieowoce marked this pull request as ready for review June 2, 2026 17:12
@lubieowoce lubieowoce requested review from gnoff and unstubbable and removed request for gnoff June 2, 2026 17:16
@lubieowoce lubieowoce added the CI Bypass Graphite Optimization Ignore Graphite CI optimizations, run the full CI suite. https://graphite.dev/docs/stacking-and-ci label Jun 2, 2026
@lubieowoce lubieowoce force-pushed the lubieowoce/strict-early-late branch from 3fad83e to ef5aa56 Compare June 2, 2026 18:04
@lubieowoce lubieowoce force-pushed the lubieowoce/stage-controller-generic branch from 0f5dc1f to 2eeac8e Compare June 2, 2026 18:04
@@ -131,10 +131,13 @@ export type AsyncApiPromises = {
export function isInEarlyRenderStage(requestStore: RequestStore): boolean {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Base automatically changed from lubieowoce/stage-controller-generic to canary June 3, 2026 11:55
@lubieowoce lubieowoce force-pushed the lubieowoce/strict-early-late branch from ef5aa56 to d3322df Compare June 3, 2026 12:07
@lubieowoce lubieowoce enabled auto-merge (squash) June 3, 2026 12:19
@lubieowoce lubieowoce merged commit fbff994 into canary Jun 3, 2026
248 of 251 checks passed
@lubieowoce lubieowoce deleted the lubieowoce/strict-early-late branch June 3, 2026 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI Bypass Graphite Optimization Ignore Graphite CI optimizations, run the full CI suite. https://graphite.dev/docs/stacking-and-ci

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants