@@ -17,6 +17,7 @@ import type {
1717 BatchUID ,
1818 Flamechart ,
1919 NativeEvent ,
20+ Phase ,
2021 ReactLane ,
2122 ReactComponentMeasure ,
2223 ReactMeasureType ,
@@ -315,6 +316,7 @@ function processTimelineEvent(
315316 let warning = null ;
316317 if ( state . measureStack . find ( ( { type} ) => type === 'commit' ) ) {
317318 // TODO (scheduling profiler) Only warn if the subsequent update is longer than some threshold.
319+ // This might be easier to do if we separated warnings into a second pass.
318320 warning = WARNING_STRINGS . NESTED_UPDATE ;
319321 }
320322
@@ -331,6 +333,7 @@ function processTimelineEvent(
331333 let warning = null ;
332334 if ( state . measureStack . find ( ( { type} ) => type === 'commit' ) ) {
333335 // TODO (scheduling profiler) Only warn if the subsequent update is longer than some threshold.
336+ // This might be easier to do if we separated warnings into a second pass.
334337 warning = WARNING_STRINGS . NESTED_UPDATE ;
335338 }
336339
@@ -345,25 +348,18 @@ function processTimelineEvent(
345348
346349 // React Events - suspense
347350 else if ( name . startsWith ( '--suspense-suspend-' ) ) {
348- const [ id , componentName , ...rest ] = name . substr ( 19 ) . split ( '-' ) ;
351+ const [ id , componentName , phase , laneBitmaskString ] = name
352+ . substr ( 19 )
353+ . split ( '-' ) ;
354+ const lanes = getLanesFromTransportDecimalBitmask ( laneBitmaskString ) ;
349355
350- // Older versions of the scheduling profiler data didn't contain phase or lane values.
351- let phase = null ;
356+ // TODO It's possible we don't have lane-to-label mapping yet (since it's logged during commit phase)
357+ // We may need to do this sort of error checking in a separate pass.
352358 let warning = null ;
353- if ( rest . length === 3 ) {
354- switch ( rest [ 0 ] ) {
355- case 'mount' :
356- case 'update' :
357- phase = rest [ 0 ] ;
358- break ;
359- }
360-
361- if ( phase === 'update' ) {
362- const laneLabels = rest [ 2 ] ;
363- // HACK This is a bit gross but the numeric lane value might change between render versions.
364- if ( ! laneLabels . includes ( 'Transition' ) ) {
365- warning = WARNING_STRINGS . SUSPENDD_DURING_UPATE ;
366- }
359+ if ( phase === 'update' ) {
360+ // HACK This is a bit gross but the numeric lane value might change between render versions.
361+ if ( lanes . some ( lane => laneToLabelMap . get ( lane ) === 'Transition' ) ) {
362+ warning = WARNING_STRINGS . SUSPENDD_DURING_UPATE ;
367363 }
368364 }
369365
@@ -392,7 +388,7 @@ function processTimelineEvent(
392388 depth,
393389 duration : null ,
394390 id,
395- phase,
391+ phase : ( ( phase : any ) : Phase ) ,
396392 resolution : 'unresolved' ,
397393 resuspendTimestamps : null ,
398394 timestamp : startTime ,
0 commit comments