Skip to content
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

Format event with "warning" yellow and prefix with "Event: " #31536

Merged
merged 1 commit into from
Nov 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions packages/react-reconciler/src/ReactFiberPerformanceTrack.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,15 @@ export function logBlockingStart(
reusableLaneDevToolDetails.track = 'Blocking';
if (eventTime > 0 && eventType !== null) {
// Log the time from the event timeStamp until we called setState.
reusableLaneDevToolDetails.color = 'secondary-dark';
reusableLaneDevToolDetails.color = eventIsRepeat
? 'secondary-light'
: 'warning';
reusableLaneOptions.start = eventTime;
reusableLaneOptions.end = updateTime > 0 ? updateTime : renderStartTime;
performance.measure(eventIsRepeat ? '' : eventType, reusableLaneOptions);
performance.measure(
eventIsRepeat ? '' : 'Event: ' + eventType,
reusableLaneOptions,
);
}
if (updateTime > 0) {
// Log the time from when we called setState until we started rendering.
Expand All @@ -152,15 +157,20 @@ export function logTransitionStart(
reusableLaneDevToolDetails.track = 'Transition';
if (eventTime > 0 && eventType !== null) {
// Log the time from the event timeStamp until we started a transition.
reusableLaneDevToolDetails.color = 'secondary-dark';
reusableLaneDevToolDetails.color = eventIsRepeat
? 'secondary-light'
: 'warning';
reusableLaneOptions.start = eventTime;
reusableLaneOptions.end =
startTime > 0
? startTime
: updateTime > 0
? updateTime
: renderStartTime;
performance.measure(eventIsRepeat ? '' : eventType, reusableLaneOptions);
performance.measure(
eventIsRepeat ? '' : 'Event: ' + eventType,
reusableLaneOptions,
);
}
if (startTime > 0) {
// Log the time from when we started an async transition until we called setState or started rendering.
Expand Down
Loading