@@ -2891,6 +2891,25 @@ export function attach(
2891
2891
}
2892
2892
}
2893
2893
}
2894
+
2895
+ // If this Fiber was in the set of memoizedUpdaters we need to record
2896
+ // it to be included in the description of the commit.
2897
+ const fiberRoot : FiberRoot = currentRoot . data . stateNode ;
2898
+ const updaters = fiberRoot . memoizedUpdaters ;
2899
+ if (
2900
+ updaters != null &&
2901
+ ( updaters . has ( fiber ) ||
2902
+ // We check the alternate here because we're matching identity and
2903
+ // prevFiber might be same as fiber.
2904
+ ( fiber . alternate !== null && updaters . has ( fiber . alternate ) ) )
2905
+ ) {
2906
+ const metadata =
2907
+ ( ( currentCommitProfilingMetadata : any ) : CommitProfilingData ) ;
2908
+ if ( metadata . updaters === null ) {
2909
+ metadata . updaters = [ ] ;
2910
+ }
2911
+ metadata . updaters . push ( instanceToSerializedElement ( fiberInstance ) ) ;
2912
+ }
2894
2913
}
2895
2914
}
2896
2915
@@ -3591,35 +3610,20 @@ export function attach(
3591
3610
commitTime : getCurrentTime ( ) - profilingStartTime ,
3592
3611
maxActualDuration : 0 ,
3593
3612
priorityLevel : null ,
3594
- updaters : getUpdatersList ( root ) ,
3613
+ updaters : null ,
3595
3614
effectDuration : null ,
3596
3615
passiveEffectDuration : null ,
3597
3616
} ;
3598
3617
}
3599
3618
3600
3619
mountFiberRecursively ( root . current , false ) ;
3620
+
3601
3621
flushPendingEvents ( root ) ;
3602
3622
currentRoot = ( null : any ) ;
3603
3623
} ) ;
3604
3624
}
3605
3625
}
3606
3626
3607
- function getUpdatersList ( root : any ) : Array < SerializedElement > | null {
3608
- const updaters = root . memoizedUpdaters ;
3609
- if ( updaters == null ) {
3610
- return null ;
3611
- }
3612
- const result = [ ] ;
3613
- // eslint-disable-next-line no-for-of-loops/no-for-of-loops
3614
- for ( const updater of updaters ) {
3615
- const inst = getFiberInstanceUnsafe ( updater ) ;
3616
- if ( inst !== null ) {
3617
- result . push ( instanceToSerializedElement ( inst ) ) ;
3618
- }
3619
- }
3620
- return result ;
3621
- }
3622
-
3623
3627
function handleCommitFiberUnmount ( fiber : any ) {
3624
3628
// This Hook is no longer used. After having shipped DevTools everywhere it is
3625
3629
// safe to stop calling it from Fiber.
@@ -3684,9 +3688,7 @@ export function attach(
3684
3688
maxActualDuration : 0 ,
3685
3689
priorityLevel :
3686
3690
priorityLevel == null ? null : formatPriorityLevel ( priorityLevel ) ,
3687
-
3688
- updaters : getUpdatersList ( root ) ,
3689
-
3691
+ updaters : null ,
3690
3692
// Initialize to null; if new enough React version is running,
3691
3693
// these values will be read during separate handlePostCommitFiberRoot() call.
3692
3694
effectDuration : null ,
0 commit comments