Skip to content

Commit fc0dbb8

Browse files
committed
Format event with "warning" yellow and prefix with "Event: "
1 parent c13986d commit fc0dbb8

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

packages/react-reconciler/src/ReactFiberPerformanceTrack.js

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,15 @@ export function logBlockingStart(
125125
reusableLaneDevToolDetails.track = 'Blocking';
126126
if (eventTime > 0 && eventType !== null) {
127127
// Log the time from the event timeStamp until we called setState.
128-
reusableLaneDevToolDetails.color = 'secondary-dark';
128+
reusableLaneDevToolDetails.color = eventIsRepeat
129+
? 'secondary-light'
130+
: 'warning';
129131
reusableLaneOptions.start = eventTime;
130132
reusableLaneOptions.end = updateTime > 0 ? updateTime : renderStartTime;
131-
performance.measure(eventIsRepeat ? '' : eventType, reusableLaneOptions);
133+
performance.measure(
134+
eventIsRepeat ? '' : 'Event: ' + eventType,
135+
reusableLaneOptions,
136+
);
132137
}
133138
if (updateTime > 0) {
134139
// Log the time from when we called setState until we started rendering.
@@ -152,15 +157,20 @@ export function logTransitionStart(
152157
reusableLaneDevToolDetails.track = 'Transition';
153158
if (eventTime > 0 && eventType !== null) {
154159
// Log the time from the event timeStamp until we started a transition.
155-
reusableLaneDevToolDetails.color = 'secondary-dark';
160+
reusableLaneDevToolDetails.color = eventIsRepeat
161+
? 'secondary-light'
162+
: 'warning';
156163
reusableLaneOptions.start = eventTime;
157164
reusableLaneOptions.end =
158165
startTime > 0
159166
? startTime
160167
: updateTime > 0
161168
? updateTime
162169
: renderStartTime;
163-
performance.measure(eventIsRepeat ? '' : eventType, reusableLaneOptions);
170+
performance.measure(
171+
eventIsRepeat ? '' : 'Event: ' + eventType,
172+
reusableLaneOptions,
173+
);
164174
}
165175
if (startTime > 0) {
166176
// Log the time from when we started an async transition until we called setState or started rendering.

0 commit comments

Comments
 (0)