Skip to content

Commit

Permalink
Format event with "warning" yellow and prefix with "Event: "
Browse files Browse the repository at this point in the history
  • Loading branch information
sebmarkbage committed Nov 14, 2024
1 parent c13986d commit fc0dbb8
Showing 1 changed file with 14 additions and 4 deletions.
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

0 comments on commit fc0dbb8

Please sign in to comment.