-
Notifications
You must be signed in to change notification settings - Fork 47.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Log Render Phases that Never Committed #31548
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -198,6 +198,54 @@ export function logRenderPhase(startTime: number, endTime: number): void { | |
} | ||
} | ||
|
||
export function logInterruptedRenderPhase( | ||
startTime: number, | ||
endTime: number, | ||
): void { | ||
if (supportsUserTiming) { | ||
reusableLaneDevToolDetails.color = 'primary-dark'; | ||
reusableLaneOptions.start = startTime; | ||
reusableLaneOptions.end = endTime; | ||
performance.measure('Interrupted Render', reusableLaneOptions); | ||
} | ||
} | ||
|
||
export function logSuspendedRenderPhase( | ||
startTime: number, | ||
endTime: number, | ||
): void { | ||
if (supportsUserTiming) { | ||
reusableLaneDevToolDetails.color = 'primary-dark'; | ||
reusableLaneOptions.start = startTime; | ||
reusableLaneOptions.end = endTime; | ||
performance.measure('Prewarm', reusableLaneOptions); | ||
} | ||
} | ||
|
||
export function logErroredRenderPhase( | ||
startTime: number, | ||
endTime: number, | ||
): void { | ||
if (supportsUserTiming) { | ||
reusableLaneDevToolDetails.color = 'error'; | ||
reusableLaneOptions.start = startTime; | ||
reusableLaneOptions.end = endTime; | ||
performance.measure('Errored Render', reusableLaneOptions); | ||
} | ||
} | ||
|
||
export function logInconsistentRender( | ||
startTime: number, | ||
endTime: number, | ||
): void { | ||
if (supportsUserTiming) { | ||
reusableLaneDevToolDetails.color = 'error'; | ||
reusableLaneOptions.start = startTime; | ||
reusableLaneOptions.end = endTime; | ||
performance.measure('Teared Render', reusableLaneOptions); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. PR description says "inconsistent" but here we use "teared". I like "teared" more since that's what we used before: reactwg/react-18#69. "tearing" is also easier to google for whereas "inconsistent" is too generic but maybe that's what we need here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I updated PR description. I just used inconsistent for the function name since that’s what it is called in the internals for now. |
||
} | ||
} | ||
|
||
export function logSuspenseThrottlePhase( | ||
startTime: number, | ||
endTime: number, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't an inconsistent render more similar to an interrupted render? It's not really an error if that happens, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue here is that it causes a synchronous render (from a transition) so it's more similar to a recoverable error. In fact, a recoverable error from concurrent is the same concept. An interrupted render doesn't have that issue since it'll be async in the update too.
This shows a downside of using a mutable store over an immutable one.