@@ -17,6 +17,7 @@ import type {
17
17
BatchUID ,
18
18
Flamechart ,
19
19
NativeEvent ,
20
+ Phase ,
20
21
ReactLane ,
21
22
ReactComponentMeasure ,
22
23
ReactMeasureType ,
@@ -315,6 +316,7 @@ function processTimelineEvent(
315
316
let warning = null ;
316
317
if ( state . measureStack . find ( ( { type} ) => type === 'commit' ) ) {
317
318
// 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.
318
320
warning = WARNING_STRINGS . NESTED_UPDATE ;
319
321
}
320
322
@@ -331,6 +333,7 @@ function processTimelineEvent(
331
333
let warning = null ;
332
334
if ( state . measureStack . find ( ( { type} ) => type === 'commit' ) ) {
333
335
// 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.
334
337
warning = WARNING_STRINGS . NESTED_UPDATE ;
335
338
}
336
339
@@ -345,25 +348,18 @@ function processTimelineEvent(
345
348
346
349
// React Events - suspense
347
350
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 ) ;
349
355
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.
352
358
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 ;
367
363
}
368
364
}
369
365
@@ -392,7 +388,7 @@ function processTimelineEvent(
392
388
depth,
393
389
duration : null ,
394
390
id,
395
- phase,
391
+ phase : ( ( phase : any ) : Phase ) ,
396
392
resolution : 'unresolved' ,
397
393
resuspendTimestamps : null ,
398
394
timestamp : startTime ,
0 commit comments