File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed
packages/react-reconciler/src Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -269,6 +269,7 @@ import {
269
269
startYieldTimer ,
270
270
yieldStartTime ,
271
271
yieldReason ,
272
+ startPingTimerByLanes ,
272
273
} from './ReactProfilerTimer' ;
273
274
import { setCurrentTrackFromLanes } from './ReactFiberPerformanceTrack' ;
274
275
@@ -3961,6 +3962,10 @@ function pingSuspendedRoot(
3961
3962
3962
3963
markRootPinged ( root , pingedLanes ) ;
3963
3964
3965
+ if ( enableProfilerTimer && enableComponentPerformanceTrack ) {
3966
+ startPingTimerByLanes ( pingedLanes ) ;
3967
+ }
3968
+
3964
3969
warnIfSuspenseResolutionNotWrappedWithActDEV ( root ) ;
3965
3970
3966
3971
if (
Original file line number Diff line number Diff line change @@ -108,6 +108,24 @@ export function startUpdateTimerByLane(lane: Lane): void {
108
108
}
109
109
}
110
110
111
+ export function startPingTimerByLanes ( lanes : Lanes ) : void {
112
+ if ( ! enableProfilerTimer || ! enableComponentPerformanceTrack ) {
113
+ return ;
114
+ }
115
+ // Mark the update time and clamp anything before it because we don't want
116
+ // to show the event time for pings but we also don't want to clear it
117
+ // because we still need to track if this was a repeat.
118
+ if ( includesSyncLane ( lanes ) || includesBlockingLane ( lanes ) ) {
119
+ if ( blockingUpdateTime < 0 ) {
120
+ blockingClampTime = blockingUpdateTime = now ( ) ;
121
+ }
122
+ } else if ( includesTransitionLane ( lanes ) ) {
123
+ if ( transitionUpdateTime < 0 ) {
124
+ transitionClampTime = transitionUpdateTime = now ( ) ;
125
+ }
126
+ }
127
+ }
128
+
111
129
export function trackSuspendedTime ( lanes : Lanes , renderEndTime : number ) {
112
130
if ( ! enableProfilerTimer || ! enableComponentPerformanceTrack ) {
113
131
return ;
You can’t perform that action at this time.
0 commit comments