@@ -31,10 +31,8 @@ import {NoFlags} from './ReactFiberFlags';
31
31
import getComponentNameFromFiber from 'react-reconciler/src/getComponentNameFromFiber' ;
32
32
import { resolveClassComponentProps } from './ReactFiberClassComponent' ;
33
33
import {
34
- recordLayoutEffectDuration ,
35
- startLayoutEffectTimer ,
36
- recordPassiveEffectDuration ,
37
- startPassiveEffectTimer ,
34
+ recordEffectDuration ,
35
+ startEffectTimer ,
38
36
isCurrentUpdateNested ,
39
37
} from './ReactProfilerTimer' ;
40
38
import { NoMode , ProfileMode } from './ReactTypeOfMode' ;
@@ -91,9 +89,9 @@ export function commitHookLayoutEffects(
91
89
// e.g. a destroy function in one component should never override a ref set
92
90
// by a create function in another component during the same commit.
93
91
if ( shouldProfile ( finishedWork ) ) {
94
- startLayoutEffectTimer ( ) ;
92
+ startEffectTimer ( ) ;
95
93
commitHookEffectListMount ( hookFlags , finishedWork ) ;
96
- recordLayoutEffectDuration ( finishedWork ) ;
94
+ recordEffectDuration ( finishedWork ) ;
97
95
} else {
98
96
commitHookEffectListMount ( hookFlags , finishedWork ) ;
99
97
}
@@ -110,13 +108,13 @@ export function commitHookLayoutUnmountEffects(
110
108
// e.g. a destroy function in one component should never override a ref set
111
109
// by a create function in another component during the same commit.
112
110
if ( shouldProfile ( finishedWork ) ) {
113
- startLayoutEffectTimer ( ) ;
111
+ startEffectTimer ( ) ;
114
112
commitHookEffectListUnmount (
115
113
hookFlags ,
116
114
finishedWork ,
117
115
nearestMountedAncestor ,
118
116
) ;
119
- recordLayoutEffectDuration ( finishedWork ) ;
117
+ recordEffectDuration ( finishedWork ) ;
120
118
} else {
121
119
commitHookEffectListUnmount (
122
120
hookFlags ,
@@ -292,9 +290,9 @@ export function commitHookPassiveMountEffects(
292
290
hookFlags : HookFlags ,
293
291
) {
294
292
if ( shouldProfile ( finishedWork ) ) {
295
- startPassiveEffectTimer ( ) ;
293
+ startEffectTimer ( ) ;
296
294
commitHookEffectListMount ( hookFlags , finishedWork ) ;
297
- recordPassiveEffectDuration ( finishedWork ) ;
295
+ recordEffectDuration ( finishedWork ) ;
298
296
} else {
299
297
commitHookEffectListMount ( hookFlags , finishedWork ) ;
300
298
}
@@ -306,13 +304,13 @@ export function commitHookPassiveUnmountEffects(
306
304
hookFlags : HookFlags ,
307
305
) {
308
306
if ( shouldProfile ( finishedWork ) ) {
309
- startPassiveEffectTimer ( ) ;
307
+ startEffectTimer ( ) ;
310
308
commitHookEffectListUnmount (
311
309
hookFlags ,
312
310
finishedWork ,
313
311
nearestMountedAncestor ,
314
312
) ;
315
- recordPassiveEffectDuration ( finishedWork ) ;
313
+ recordEffectDuration ( finishedWork ) ;
316
314
} else {
317
315
commitHookEffectListUnmount (
318
316
hookFlags ,
@@ -360,7 +358,7 @@ export function commitClassLayoutLifecycles(
360
358
}
361
359
}
362
360
if ( shouldProfile ( finishedWork ) ) {
363
- startLayoutEffectTimer ( ) ;
361
+ startEffectTimer ( ) ;
364
362
if ( __DEV__ ) {
365
363
runWithFiberInDEV (
366
364
finishedWork ,
@@ -375,7 +373,7 @@ export function commitClassLayoutLifecycles(
375
373
captureCommitPhaseError ( finishedWork , finishedWork . return , error ) ;
376
374
}
377
375
}
378
- recordLayoutEffectDuration ( finishedWork ) ;
376
+ recordEffectDuration ( finishedWork ) ;
379
377
} else {
380
378
if ( __DEV__ ) {
381
379
runWithFiberInDEV (
@@ -431,7 +429,7 @@ export function commitClassLayoutLifecycles(
431
429
}
432
430
}
433
431
if ( shouldProfile ( finishedWork ) ) {
434
- startLayoutEffectTimer ( ) ;
432
+ startEffectTimer ( ) ;
435
433
if ( __DEV__ ) {
436
434
runWithFiberInDEV (
437
435
finishedWork ,
@@ -453,7 +451,7 @@ export function commitClassLayoutLifecycles(
453
451
captureCommitPhaseError ( finishedWork , finishedWork . return , error ) ;
454
452
}
455
453
}
456
- recordLayoutEffectDuration ( finishedWork ) ;
454
+ recordEffectDuration ( finishedWork ) ;
457
455
} else {
458
456
if ( __DEV__ ) {
459
457
runWithFiberInDEV (
@@ -706,7 +704,7 @@ export function safelyCallComponentWillUnmount(
706
704
) ;
707
705
instance . state = current . memoizedState ;
708
706
if ( shouldProfile ( current ) ) {
709
- startLayoutEffectTimer ( ) ;
707
+ startEffectTimer ( ) ;
710
708
if ( __DEV__ ) {
711
709
runWithFiberInDEV (
712
710
current ,
@@ -722,7 +720,7 @@ export function safelyCallComponentWillUnmount(
722
720
captureCommitPhaseError ( current , nearestMountedAncestor , error ) ;
723
721
}
724
722
}
725
- recordLayoutEffectDuration ( current ) ;
723
+ recordEffectDuration ( current ) ;
726
724
} else {
727
725
if ( __DEV__ ) {
728
726
runWithFiberInDEV (
@@ -763,10 +761,10 @@ function commitAttachRef(finishedWork: Fiber) {
763
761
if (typeof ref === 'function') {
764
762
if ( shouldProfile ( finishedWork ) ) {
765
763
try {
766
- startLayoutEffectTimer ( ) ;
764
+ startEffectTimer ( ) ;
767
765
finishedWork . refCleanup = ref ( instanceToUse ) ;
768
766
} finally {
769
- recordLayoutEffectDuration ( finishedWork ) ;
767
+ recordEffectDuration ( finishedWork ) ;
770
768
}
771
769
} else {
772
770
finishedWork . refCleanup = ref ( instanceToUse ) ;
@@ -820,14 +818,14 @@ export function safelyDetachRef(
820
818
try {
821
819
if ( shouldProfile ( current ) ) {
822
820
try {
823
- startLayoutEffectTimer ( ) ;
821
+ startEffectTimer ( ) ;
824
822
if ( __DEV__ ) {
825
823
runWithFiberInDEV ( current , refCleanup ) ;
826
824
} else {
827
825
refCleanup ( ) ;
828
826
}
829
827
} finally {
830
- recordLayoutEffectDuration ( current ) ;
828
+ recordEffectDuration ( current ) ;
831
829
}
832
830
} else {
833
831
if ( __DEV__ ) {
@@ -850,14 +848,14 @@ export function safelyDetachRef(
850
848
try {
851
849
if ( shouldProfile ( current ) ) {
852
850
try {
853
- startLayoutEffectTimer ( ) ;
851
+ startEffectTimer ( ) ;
854
852
if ( __DEV__ ) {
855
853
( runWithFiberInDEV ( current , ref, null ) : void ) ;
856
854
} else {
857
855
ref ( null ) ;
858
856
}
859
857
} finally {
860
- recordLayoutEffectDuration ( current ) ;
858
+ recordEffectDuration ( current ) ;
861
859
}
862
860
} else {
863
861
if ( __DEV__ ) {
0 commit comments