@@ -957,6 +957,12 @@ export default class Store extends EventEmitter<{
957957 if ( root === null ) {
958958 continue ;
959959 }
960+ const rendererID = this . _rootIDToRendererID . get ( rootID ) ;
961+ if ( rendererID === undefined ) {
962+ throw new Error (
963+ 'Failed to find renderer ID for root. This is a bug in React DevTools.' ,
964+ ) ;
965+ }
960966 // TODO: This includes boundaries that can't be suspended due to no support from the renderer.
961967
962968 const suspense = this . getSuspenseByID ( rootID ) ;
@@ -972,6 +978,7 @@ export default class Store extends EventEmitter<{
972978 id : suspense . id ,
973979 environment : environmentName ,
974980 endTime : suspense . endTime ,
981+ rendererID,
975982 } ;
976983 target . push ( rootStep ) ;
977984 } else {
@@ -990,6 +997,7 @@ export default class Store extends EventEmitter<{
990997 uniqueSuspendersOnly ,
991998 environments ,
992999 0 , // Don't pass a minimum end time at the root. The root is always first so doesn't matter.
1000+ rendererID ,
9931001 ) ;
9941002 }
9951003 }
@@ -1039,6 +1047,7 @@ export default class Store extends EventEmitter<{
10391047 */
10401048 getSuspendableDocumentOrderSuspenseTransition (
10411049 uniqueSuspendersOnly : boolean ,
1050+ rendererID : number ,
10421051 ) : Array < SuspenseTimelineStep > {
10431052 const target : Array < SuspenseTimelineStep > = [ ] ;
10441053 const focusedTransitionID = this . _focusedTransition ;
@@ -1051,6 +1060,7 @@ export default class Store extends EventEmitter<{
10511060 // TODO: Get environment for Activity
10521061 environment : null ,
10531062 endTime : 0 ,
1063+ rendererID,
10541064 } ) ;
10551065
10561066 const transitionChildren = this . getSuspenseChildren ( focusedTransitionID ) ;
@@ -1062,6 +1072,7 @@ export default class Store extends EventEmitter<{
10621072 // TODO: Get environment for Activity
10631073 [ ] ,
10641074 0 , // Don't pass a minimum end time at the root. The root is always first so doesn't matter.
1075+ rendererID ,
10651076 ) ;
10661077
10671078 return target ;
@@ -1073,6 +1084,7 @@ export default class Store extends EventEmitter<{
10731084 uniqueSuspendersOnly : boolean ,
10741085 parentEnvironments : Array < string > ,
10751086 parentEndTime : number ,
1087+ rendererID : number ,
10761088 ) : void {
10771089 for ( let i = 0 ; i < children . length ; i ++ ) {
10781090 const child = this . getSuspenseByID ( children [ i ] ) ;
@@ -1106,6 +1118,7 @@ export default class Store extends EventEmitter<{
11061118 id : child . id ,
11071119 environment : environmentName ,
11081120 endTime : maxEndTime ,
1121+ rendererID,
11091122 } ) ;
11101123 }
11111124 this . pushTimelineStepsInDocumentOrder (
@@ -1114,21 +1127,40 @@ export default class Store extends EventEmitter<{
11141127 uniqueSuspendersOnly ,
11151128 unionEnvironments ,
11161129 maxEndTime ,
1130+ rendererID ,
11171131 ) ;
11181132 }
11191133 }
11201134
11211135 getEndTimeOrDocumentOrderSuspense (
11221136 uniqueSuspendersOnly : boolean ,
11231137 ) : $ReadOnlyArray < SuspenseTimelineStep > {
1124- const timeline =
1125- this . _focusedTransition === 0
1126- ? this . getSuspendableDocumentOrderSuspenseInitialPaint (
1127- uniqueSuspendersOnly ,
1128- )
1129- : this . getSuspendableDocumentOrderSuspenseTransition (
1130- uniqueSuspendersOnly ,
1131- ) ;
1138+ let timeline : SuspenseTimelineStep [ ] ;
1139+ if ( this . _focusedTransition === 0 ) {
1140+ timeline =
1141+ this . getSuspendableDocumentOrderSuspenseInitialPaint (
1142+ uniqueSuspendersOnly ,
1143+ ) ;
1144+ } else {
1145+ const focusedTransitionRootID = this . getRootIDForElement (
1146+ this . _focusedTransition ,
1147+ ) ;
1148+ if ( focusedTransitionRootID === null ) {
1149+ throw new Error (
1150+ 'Failed to find root ID for focused transition. This is a bug in React DevTools.' ,
1151+ ) ;
1152+ }
1153+ const rendererID = this . _rootIDToRendererID . get ( focusedTransitionRootID ) ;
1154+ if ( rendererID === undefined ) {
1155+ throw new Error (
1156+ 'Failed to find renderer ID for focused transition root. This is a bug in React DevTools.' ,
1157+ ) ;
1158+ }
1159+ timeline = this . getSuspendableDocumentOrderSuspenseTransition (
1160+ uniqueSuspendersOnly ,
1161+ rendererID ,
1162+ ) ;
1163+ }
11321164
11331165 if ( timeline . length === 0 ) {
11341166 return timeline ;
0 commit comments