121
legacyRender(<div />);
122
123
expect(clearedMarks).toMatchInlineSnapshot(`
124
- [
125
- "--schedule-render-1",
126
- "--render-start-1",
127
- "--render-stop",
128
- "--commit-start-1",
129
- "--react-version-<filtered-version>",
130
- "--profiler-version-1",
131
- "--react-internal-module-start- at filtered (<anonymous>:0:0)",
132
- "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
133
- "--react-lane-labels-Sync,InputContinuousHydration,InputContinuous,DefaultHydration,Default,TransitionHydration,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Retry,Retry,Retry,Retry,Retry,SelectiveHydration,IdleHydration,Idle,Offscreen",
134
- "--layout-effects-start-1",
135
- "--layout-effects-stop",
136
- "--commit-stop",
137
- ]
138
- `);
124
+ [
125
+ "--schedule-render-1",
126
+ "--render-start-1",
127
+ "--render-stop",
128
+ "--commit-start-1",
129
+ "--react-version-<filtered-version>",
130
+ "--profiler-version-1",
131
+ "--react-internal-module-start- at filtered (<anonymous>:0:0)",
132
+ "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
133
+ "--react-lane-labels-Sync,InputContinuousHydration,InputContinuous,DefaultHydration,Default,TransitionHydration,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Retry,Retry,Retry,Retry,Retry,SelectiveHydration,IdleHydration,Idle,Offscreen",
134
+ "--layout-effects-start-1",
135
+ "--layout-effects-stop",
136
+ "--commit-stop",
137
+ ]
138
+ `);
139
});
140
141
// TODO(hoxyq): investigate why running this test with React 18 fails
154
);
155
156
expect(clearedMarks).toMatchInlineSnapshot(`
157
- [
158
- "--schedule-render-2",
159
- "--render-start-2",
160
- "--component-render-start-Example",
161
- "--component-render-stop",
162
- "--suspense-suspend-0-Example-mount-2-",
163
- "--render-stop",
164
- "--commit-start-2",
165
- "--react-version-<filtered-version>",
166
- "--profiler-version-1",
167
- "--react-internal-module-start- at filtered (<anonymous>:0:0)",
168
- "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
169
- "--react-lane-labels-SyncHydrationLane,Sync,InputContinuousHydration,InputContinuous,DefaultHydration,Default,TransitionHydration,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Retry,Retry,Retry,Retry,SelectiveHydration,IdleHydration,Idle,Offscreen,Deferred",
170
- "--layout-effects-start-2",
171
- "--layout-effects-stop",
172
- "--commit-stop",
173
- ]
174
- `);
157
+ [
158
+ "--schedule-render-2",
159
+ "--render-start-2",
160
+ "--component-render-start-Example",
161
+ "--component-render-stop",
162
+ "--suspense-suspend-0-Example-mount-2-",
163
+ "--render-stop",
164
+ "--commit-start-2",
165
+ "--react-version-<filtered-version>",
166
+ "--profiler-version-1",
167
+ "--react-internal-module-start- at filtered (<anonymous>:0:0)",
168
+ "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
169
+ "--react-lane-labels-SyncHydrationLane,Sync,InputContinuousHydration,InputContinuous,DefaultHydration,Default,TransitionHydration,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Retry,Retry,Retry,Retry,SelectiveHydration,IdleHydration,Idle,Offscreen,Deferred",
170
+ "--layout-effects-start-2",
171
+ "--layout-effects-stop",
172
+ "--commit-stop",
173
+ ]
174
+ `);
175
176
clearPendingMarks();
177
199
);
200
201
expect(clearedMarks).toMatchInlineSnapshot(`
202
- [
203
- "--schedule-render-2",
204
- "--render-start-2",
205
- "--component-render-start-Example",
206
- "--component-render-stop",
207
- "--suspense-suspend-0-Example-mount-2-",
208
- "--render-stop",
209
- "--commit-start-2",
210
- "--react-version-<filtered-version>",
211
- "--profiler-version-1",
212
- "--react-internal-module-start- at filtered (<anonymous>:0:0)",
213
- "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
214
- "--react-lane-labels-SyncHydrationLane,Sync,InputContinuousHydration,InputContinuous,DefaultHydration,Default,TransitionHydration,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Retry,Retry,Retry,Retry,SelectiveHydration,IdleHydration,Idle,Offscreen,Deferred",
215
- "--layout-effects-start-2",
216
- "--layout-effects-stop",
217
- "--commit-stop",
218
- ]
219
- `);
202
+ [
203
+ "--schedule-render-2",
204
+ "--render-start-2",
205
+ "--component-render-start-Example",
206
+ "--component-render-stop",
207
+ "--suspense-suspend-0-Example-mount-2-",
208
+ "--render-stop",
209
+ "--commit-start-2",
210
+ "--react-version-<filtered-version>",
211
+ "--profiler-version-1",
212
+ "--react-internal-module-start- at filtered (<anonymous>:0:0)",
213
+ "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
214
+ "--react-lane-labels-SyncHydrationLane,Sync,InputContinuousHydration,InputContinuous,DefaultHydration,Default,TransitionHydration,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Retry,Retry,Retry,Retry,SelectiveHydration,IdleHydration,Idle,Offscreen,Deferred",
215
+ "--layout-effects-start-2",
216
+ "--layout-effects-stop",
217
+ "--commit-stop",
218
+ ]
219
+ `);
220
221
clearPendingMarks();
222
253
);
254
255
expect(clearedMarks).toMatchInlineSnapshot(`
256
- [
257
- "--schedule-render-1",
258
- "--render-start-1",
259
- "--component-render-start-ErrorBoundary",
260
- "--component-render-stop",
261
- "--component-render-start-ExampleThatThrows",
262
- "--component-render-start-ExampleThatThrows",
263
- "--component-render-stop",
264
- "--error-ExampleThatThrows-mount-Expected error",
265
- "--render-stop",
266
- "--commit-start-1",
267
- "--react-version-<filtered-version>",
268
- "--profiler-version-1",
269
- "--react-internal-module-start- at filtered (<anonymous>:0:0)",
270
- "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
271
- "--react-lane-labels-Sync,InputContinuousHydration,InputContinuous,DefaultHydration,Default,TransitionHydration,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Retry,Retry,Retry,Retry,Retry,SelectiveHydration,IdleHydration,Idle,Offscreen",
272
- "--layout-effects-start-1",
273
- "--schedule-state-update-1-ErrorBoundary",
274
- "--layout-effects-stop",
275
- "--commit-stop",
276
- "--render-start-1",
277
- "--component-render-start-ErrorBoundary",
278
- "--component-render-stop",
279
- "--render-stop",
280
- "--commit-start-1",
281
- "--react-version-<filtered-version>",
282
- "--profiler-version-1",
283
- "--react-internal-module-start- at filtered (<anonymous>:0:0)",
284
- "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
285
- "--react-lane-labels-Sync,InputContinuousHydration,InputContinuous,DefaultHydration,Default,TransitionHydration,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Retry,Retry,Retry,Retry,Retry,SelectiveHydration,IdleHydration,Idle,Offscreen",
286
- "--commit-stop",
287
- ]
288
- `);
256
+ [
257
+ "--schedule-render-1",
258
+ "--render-start-1",
259
+ "--component-render-start-ErrorBoundary",
260
+ "--component-render-stop",
261
+ "--component-render-start-ExampleThatThrows",
262
+ "--component-render-start-ExampleThatThrows",
263
+ "--component-render-stop",
264
+ "--error-ExampleThatThrows-mount-Expected error",
265
+ "--render-stop",
266
+ "--commit-start-1",
267
+ "--react-version-<filtered-version>",
268
+ "--profiler-version-1",
269
+ "--react-internal-module-start- at filtered (<anonymous>:0:0)",
270
+ "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
271
+ "--react-lane-labels-Sync,InputContinuousHydration,InputContinuous,DefaultHydration,Default,TransitionHydration,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Retry,Retry,Retry,Retry,Retry,SelectiveHydration,IdleHydration,Idle,Offscreen",
272
+ "--layout-effects-start-1",
273
+ "--schedule-state-update-1-ErrorBoundary",
274
+ "--layout-effects-stop",
275
+ "--commit-stop",
276
+ "--render-start-1",
277
+ "--component-render-start-ErrorBoundary",
278
+ "--component-render-stop",
279
+ "--render-stop",
280
+ "--commit-start-1",
281
+ "--react-version-<filtered-version>",
282
+ "--profiler-version-1",
283
+ "--react-internal-module-start- at filtered (<anonymous>:0:0)",
284
+ "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
285
+ "--react-lane-labels-Sync,InputContinuousHydration,InputContinuous,DefaultHydration,Default,TransitionHydration,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Retry,Retry,Retry,Retry,Retry,SelectiveHydration,IdleHydration,Idle,Offscreen",
286
+ "--commit-stop",
287
+ ]
288
+ `);
289
});
290
});
291
309
modernRender(<div />);
310
311
expect(clearedMarks).toMatchInlineSnapshot(`
312
- [
313
- "--schedule-render-32",
314
- ]
315
- `);
312
+ [
313
+ "--schedule-render-32",
314
+ ]
315
+ `);
316
317
clearPendingMarks();
318
319
await waitForPaint([]);
320
321
expect(clearedMarks).toMatchInlineSnapshot(`
322
- [
323
- "--render-start-32",
324
- "--render-stop",
325
- "--commit-start-32",
326
- "--react-version-<filtered-version>",
327
- "--profiler-version-1",
328
- "--react-internal-module-start- at filtered (<anonymous>:0:0)",
329
- "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
330
- "--react-lane-labels-SyncHydrationLane,Sync,InputContinuousHydration,InputContinuous,DefaultHydration,Default,TransitionHydration,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Retry,Retry,Retry,Retry,SelectiveHydration,IdleHydration,Idle,Offscreen,Deferred",
331
- "--layout-effects-start-32",
332
- "--layout-effects-stop",
333
- "--commit-stop",
334
- ]
335
- `);
322
+ [
323
+ "--render-start-32",
324
+ "--render-stop",
325
+ "--commit-start-32",
326
+ "--react-version-<filtered-version>",
327
+ "--profiler-version-1",
328
+ "--react-internal-module-start- at filtered (<anonymous>:0:0)",
329
+ "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
330
+ "--react-internal-module-start- at filtered (<anonymous>:0:0)",
331
+ "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
332
+ "--react-lane-labels-SyncHydrationLane,Sync,InputContinuousHydration,InputContinuous,DefaultHydration,Default,TransitionHydration,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Retry,Retry,Retry,Retry,SelectiveHydration,IdleHydration,Idle,Offscreen,Deferred",
333
+ "--layout-effects-start-32",
334
+ "--layout-effects-stop",
335
+ "--commit-stop",
336
+ ]
337
+ `);
338
});
339
340
it('should mark render yields', async () => {
355
await waitFor(['Foo']);
356
357
expect(clearedMarks).toMatchInlineSnapshot(`
356
- [
357
- "--schedule-render-128",
358
- "--render-start-128",
359
- "--component-render-start-Foo",
360
- "--component-render-stop",
361
- "--render-yield",
362
- ]
363
- `);
358
+ [
359
+ "--schedule-render-128",
360
+ "--render-start-128",
361
+ "--component-render-start-Foo",
362
+ "--component-render-stop",
363
+ "--render-yield",
364
+ ]
365
+ `);
366
});
367
368
it('should mark concurrent render with suspense that resolves', async () => {
382
);
383
384
expect(clearedMarks).toMatchInlineSnapshot(`
383
- [
384
- "--schedule-render-32",
385
- ]
386
- `);
385
+ [
386
+ "--schedule-render-32",
387
+ ]
388
+ `);
389
390
clearPendingMarks();
391
392
await waitForPaint([]);
393
394
expect(clearedMarks).toMatchInlineSnapshot(`
393
- [
394
- "--render-start-32",
395
- "--component-render-start-Example",
396
- "--component-render-stop",
397
- "--suspense-suspend-0-Example-mount-32-",
398
- "--render-stop",
399
- "--commit-start-32",
400
- "--react-version-<filtered-version>",
401
- "--profiler-version-1",
402
- "--react-internal-module-start- at filtered (<anonymous>:0:0)",
403
- "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
404
- "--react-lane-labels-SyncHydrationLane,Sync,InputContinuousHydration,InputContinuous,DefaultHydration,Default,TransitionHydration,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Retry,Retry,Retry,Retry,SelectiveHydration,IdleHydration,Idle,Offscreen,Deferred",
405
- "--layout-effects-start-32",
406
- "--layout-effects-stop",
407
- "--commit-stop",
408
- ]
409
- `);
395
+ [
396
+ "--render-start-32",
397
+ "--component-render-start-Example",
398
+ "--component-render-stop",
399
+ "--suspense-suspend-0-Example-mount-32-",
400
+ "--render-stop",
401
+ "--commit-start-32",
402
+ "--react-version-<filtered-version>",
403
+ "--profiler-version-1",
404
+ "--react-internal-module-start- at filtered (<anonymous>:0:0)",
405
+ "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
406
+ "--react-internal-module-start- at filtered (<anonymous>:0:0)",
407
+ "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
408
+ "--react-lane-labels-SyncHydrationLane,Sync,InputContinuousHydration,InputContinuous,DefaultHydration,Default,TransitionHydration,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Retry,Retry,Retry,Retry,SelectiveHydration,IdleHydration,Idle,Offscreen,Deferred",
409
+ "--layout-effects-start-32",
410
+ "--layout-effects-stop",
411
+ "--commit-stop",
412
+ ]
413
+ `);
414
415
clearPendingMarks();
416
439
);
440
441
expect(clearedMarks).toMatchInlineSnapshot(`
438
- [
439
- "--schedule-render-32",
440
- ]
441
- `);
442
+ [
443
+ "--schedule-render-32",
444
+ ]
445
+ `);
446
447
clearPendingMarks();
448
449
await waitForPaint([]);
450
451
expect(clearedMarks).toMatchInlineSnapshot(`
448
- [
449
- "--render-start-32",
450
- "--component-render-start-Example",
451
- "--component-render-stop",
452
- "--suspense-suspend-0-Example-mount-32-",
453
- "--render-stop",
454
- "--commit-start-32",
455
- "--react-version-<filtered-version>",
456
- "--profiler-version-1",
457
- "--react-internal-module-start- at filtered (<anonymous>:0:0)",
458
- "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
459
- "--react-lane-labels-SyncHydrationLane,Sync,InputContinuousHydration,InputContinuous,DefaultHydration,Default,TransitionHydration,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Retry,Retry,Retry,Retry,SelectiveHydration,IdleHydration,Idle,Offscreen,Deferred",
460
- "--layout-effects-start-32",
461
- "--layout-effects-stop",
462
- "--commit-stop",
463
- ]
464
- `);
452
+ [
453
+ "--render-start-32",
454
+ "--component-render-start-Example",
455
+ "--component-render-stop",
456
+ "--suspense-suspend-0-Example-mount-32-",
457
+ "--render-stop",
458
+ "--commit-start-32",
459
+ "--react-version-<filtered-version>",
460
+ "--profiler-version-1",
461
+ "--react-internal-module-start- at filtered (<anonymous>:0:0)",
462
+ "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
463
+ "--react-internal-module-start- at filtered (<anonymous>:0:0)",
464
+ "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
465
+ "--react-lane-labels-SyncHydrationLane,Sync,InputContinuousHydration,InputContinuous,DefaultHydration,Default,TransitionHydration,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Retry,Retry,Retry,Retry,SelectiveHydration,IdleHydration,Idle,Offscreen,Deferred",
466
+ "--layout-effects-start-32",
467
+ "--layout-effects-stop",
468
+ "--commit-stop",
469
+ ]
470
+ `);
471
472
clearPendingMarks();
473
496
modernRender(<Example />);
497
498
expect(clearedMarks).toMatchInlineSnapshot(`
493
- [
494
- "--schedule-render-32",
495
- ]
496
- `);
499
+ [
500
+ "--schedule-render-32",
501
+ ]
502
+ `);
503
504
clearPendingMarks();
505
506
await waitForPaint([]);
507
508
expect(clearedMarks).toMatchInlineSnapshot(`
503
- [
504
- "--render-start-32",
505
- "--component-render-start-Example",
506
- "--component-render-stop",
507
- "--render-stop",
508
- "--commit-start-32",
509
- "--react-version-<filtered-version>",
510
- "--profiler-version-1",
511
- "--react-internal-module-start- at filtered (<anonymous>:0:0)",
512
- "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
513
- "--react-lane-labels-SyncHydrationLane,Sync,InputContinuousHydration,InputContinuous,DefaultHydration,Default,TransitionHydration,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Retry,Retry,Retry,Retry,SelectiveHydration,IdleHydration,Idle,Offscreen,Deferred",
514
- "--layout-effects-start-32",
515
- "--schedule-state-update-2-Example",
516
- "--layout-effects-stop",
517
- "--render-start-2",
518
- "--component-render-start-Example",
519
- "--component-render-stop",
520
- "--render-stop",
521
- "--commit-start-2",
522
- "--react-version-<filtered-version>",
523
- "--profiler-version-1",
524
- "--react-internal-module-start- at filtered (<anonymous>:0:0)",
525
- "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
526
- "--react-lane-labels-SyncHydrationLane,Sync,InputContinuousHydration,InputContinuous,DefaultHydration,Default,TransitionHydration,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Retry,Retry,Retry,Retry,SelectiveHydration,IdleHydration,Idle,Offscreen,Deferred",
527
- "--commit-stop",
528
- "--commit-stop",
529
- ]
530
- `);
509
+ [
510
+ "--render-start-32",
511
+ "--component-render-start-Example",
512
+ "--component-render-stop",
513
+ "--render-stop",
514
+ "--commit-start-32",
515
+ "--react-version-<filtered-version>",
516
+ "--profiler-version-1",
517
+ "--react-internal-module-start- at filtered (<anonymous>:0:0)",
518
+ "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
519
+ "--react-internal-module-start- at filtered (<anonymous>:0:0)",
520
+ "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
521
+ "--react-lane-labels-SyncHydrationLane,Sync,InputContinuousHydration,InputContinuous,DefaultHydration,Default,TransitionHydration,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Retry,Retry,Retry,Retry,SelectiveHydration,IdleHydration,Idle,Offscreen,Deferred",
522
+ "--layout-effects-start-32",
523
+ "--schedule-state-update-2-Example",
524
+ "--layout-effects-stop",
525
+ "--render-start-2",
526
+ "--component-render-start-Example",
527
+ "--component-render-stop",
528
+ "--render-stop",
529
+ "--commit-start-2",
530
+ "--react-version-<filtered-version>",
531
+ "--profiler-version-1",
532
+ "--react-internal-module-start- at filtered (<anonymous>:0:0)",
533
+ "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
534
+ "--react-internal-module-start- at filtered (<anonymous>:0:0)",
535
+ "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
536
+ "--react-lane-labels-SyncHydrationLane,Sync,InputContinuousHydration,InputContinuous,DefaultHydration,Default,TransitionHydration,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Retry,Retry,Retry,Retry,SelectiveHydration,IdleHydration,Idle,Offscreen,Deferred",
537
+ "--commit-stop",
538
+ "--commit-stop",
539
+ ]
540
+ `);
541
});
542
543
it('should mark cascading class component force updates', async () => {
553
modernRender(<Example />);
554
555
expect(clearedMarks).toMatchInlineSnapshot(`
546
- [
547
- "--schedule-render-32",
548
- ]
549
- `);
556
+ [
557
+ "--schedule-render-32",
558
+ ]
559
+ `);
560
561
clearPendingMarks();
562
563
await waitForPaint([]);
564
565
expect(clearedMarks).toMatchInlineSnapshot(`
556
- [
557
- "--render-start-32",
558
- "--component-render-start-Example",
559
- "--component-render-stop",
560
- "--render-stop",
561
- "--commit-start-32",
562
- "--react-version-<filtered-version>",
563
- "--profiler-version-1",
564
- "--react-internal-module-start- at filtered (<anonymous>:0:0)",
565
- "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
566
- "--react-lane-labels-SyncHydrationLane,Sync,InputContinuousHydration,InputContinuous,DefaultHydration,Default,TransitionHydration,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Retry,Retry,Retry,Retry,SelectiveHydration,IdleHydration,Idle,Offscreen,Deferred",
567
- "--layout-effects-start-32",
568
- "--schedule-forced-update-2-Example",
569
- "--layout-effects-stop",
570
- "--render-start-2",
571
- "--component-render-start-Example",
572
- "--component-render-stop",
573
- "--render-stop",
574
- "--commit-start-2",
575
- "--react-version-<filtered-version>",
576
- "--profiler-version-1",
577
- "--react-internal-module-start- at filtered (<anonymous>:0:0)",
578
- "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
579
- "--react-lane-labels-SyncHydrationLane,Sync,InputContinuousHydration,InputContinuous,DefaultHydration,Default,TransitionHydration,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Retry,Retry,Retry,Retry,SelectiveHydration,IdleHydration,Idle,Offscreen,Deferred",
580
- "--commit-stop",
581
- "--commit-stop",
582
- ]
583
- `);
566
+ [
567
+ "--render-start-32",
568
+ "--component-render-start-Example",
569
+ "--component-render-stop",
570
+ "--render-stop",
571
+ "--commit-start-32",
572
+ "--react-version-<filtered-version>",
573
+ "--profiler-version-1",
574
+ "--react-internal-module-start- at filtered (<anonymous>:0:0)",
575
+ "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
576
+ "--react-internal-module-start- at filtered (<anonymous>:0:0)",
577
+ "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
578
+ "--react-lane-labels-SyncHydrationLane,Sync,InputContinuousHydration,InputContinuous,DefaultHydration,Default,TransitionHydration,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Retry,Retry,Retry,Retry,SelectiveHydration,IdleHydration,Idle,Offscreen,Deferred",
579
+ "--layout-effects-start-32",
580
+ "--schedule-forced-update-2-Example",
581
+ "--layout-effects-stop",
582
+ "--render-start-2",
583
+ "--component-render-start-Example",
584
+ "--component-render-stop",
585
+ "--render-stop",
586
+ "--commit-start-2",
587
+ "--react-version-<filtered-version>",
588
+ "--profiler-version-1",
589
+ "--react-internal-module-start- at filtered (<anonymous>:0:0)",
590
+ "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
591
+ "--react-internal-module-start- at filtered (<anonymous>:0:0)",
592
+ "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
593
+ "--react-lane-labels-SyncHydrationLane,Sync,InputContinuousHydration,InputContinuous,DefaultHydration,Default,TransitionHydration,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Retry,Retry,Retry,Retry,SelectiveHydration,IdleHydration,Idle,Offscreen,Deferred",
594
+ "--commit-stop",
595
+ "--commit-stop",
596
+ ]
597
+ `);
598
});
599
600
it('should mark render phase state updates for class component', async () => {
611
modernRender(<Example />);
612
613
expect(clearedMarks).toMatchInlineSnapshot(`
600
- [
601
- "--schedule-render-32",
602
- ]
603
- `);
614
+ [
615
+ "--schedule-render-32",
616
+ ]
617
+ `);
618
619
clearPendingMarks();
620
631
);
632
633
expect(clearedMarks).toMatchInlineSnapshot(`
620
- [
621
- "--render-start-32",
622
- "--component-render-start-Example",
623
- "--schedule-state-update-32-Example",
624
- "--component-render-stop",
625
- "--render-stop",
626
- "--commit-start-32",
627
- "--react-version-<filtered-version>",
628
- "--profiler-version-1",
629
- "--react-internal-module-start- at filtered (<anonymous>:0:0)",
630
- "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
631
- "--react-lane-labels-SyncHydrationLane,Sync,InputContinuousHydration,InputContinuous,DefaultHydration,Default,TransitionHydration,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Retry,Retry,Retry,Retry,SelectiveHydration,IdleHydration,Idle,Offscreen,Deferred",
632
- "--layout-effects-start-32",
633
- "--layout-effects-stop",
634
- "--commit-stop",
635
- ]
636
- `);
634
+ [
635
+ "--render-start-32",
636
+ "--component-render-start-Example",
637
+ "--schedule-state-update-32-Example",
638
+ "--component-render-stop",
639
+ "--render-stop",
640
+ "--commit-start-32",
641
+ "--react-version-<filtered-version>",
642
+ "--profiler-version-1",
643
+ "--react-internal-module-start- at filtered (<anonymous>:0:0)",
644
+ "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
645
+ "--react-internal-module-start- at filtered (<anonymous>:0:0)",
646
+ "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
647
+ "--react-lane-labels-SyncHydrationLane,Sync,InputContinuousHydration,InputContinuous,DefaultHydration,Default,TransitionHydration,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Retry,Retry,Retry,Retry,SelectiveHydration,IdleHydration,Idle,Offscreen,Deferred",
648
+ "--layout-effects-start-32",
649
+ "--layout-effects-stop",
650
+ "--commit-stop",
651
+ ]
652
+ `);
653
});
654
655
it('should mark render phase force updates for class component', async () => {
667
modernRender(<Example />);
668
669
expect(clearedMarks).toMatchInlineSnapshot(`
654
- [
655
- "--schedule-render-32",
656
- ]
657
- `);
670
+ [
671
+ "--schedule-render-32",
672
+ ]
673
+ `);
674
675
clearPendingMarks();
676
687
);
688
689
expect(clearedMarks).toMatchInlineSnapshot(`
674
- [
675
- "--render-start-32",
676
- "--component-render-start-Example",
677
- "--schedule-forced-update-32-Example",
678
- "--component-render-stop",
679
- "--render-stop",
680
- "--commit-start-32",
681
- "--react-version-<filtered-version>",
682
- "--profiler-version-1",
683
- "--react-internal-module-start- at filtered (<anonymous>:0:0)",
684
- "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
685
- "--react-lane-labels-SyncHydrationLane,Sync,InputContinuousHydration,InputContinuous,DefaultHydration,Default,TransitionHydration,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Retry,Retry,Retry,Retry,SelectiveHydration,IdleHydration,Idle,Offscreen,Deferred",
686
- "--layout-effects-start-32",
687
- "--layout-effects-stop",
688
- "--commit-stop",
689
- ]
690
- `);
690
+ [
691
+ "--render-start-32",
692
+ "--component-render-start-Example",
693
+ "--schedule-forced-update-32-Example",
694
+ "--component-render-stop",
695
+ "--render-stop",
696
+ "--commit-start-32",
697
+ "--react-version-<filtered-version>",
698
+ "--profiler-version-1",
699
+ "--react-internal-module-start- at filtered (<anonymous>:0:0)",
700
+ "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
701
+ "--react-internal-module-start- at filtered (<anonymous>:0:0)",
702
+ "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
703
+ "--react-lane-labels-SyncHydrationLane,Sync,InputContinuousHydration,InputContinuous,DefaultHydration,Default,TransitionHydration,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Retry,Retry,Retry,Retry,SelectiveHydration,IdleHydration,Idle,Offscreen,Deferred",
704
+ "--layout-effects-start-32",
705
+ "--layout-effects-stop",
706
+ "--commit-stop",
707
+ ]
708
+ `);
709
});
710
711
it('should mark cascading layout updates', async () => {
720
modernRender(<Example />);
721
722
expect(clearedMarks).toMatchInlineSnapshot(`
705
- [
706
- "--schedule-render-32",
707
- ]
708
- `);
723
+ [
724
+ "--schedule-render-32",
725
+ ]
726
+ `);
727
728
clearPendingMarks();
729
730
await waitForPaint([]);
731
732
expect(clearedMarks).toMatchInlineSnapshot(`
715
- [
716
- "--render-start-32",
717
- "--component-render-start-Example",
718
- "--component-render-stop",
719
- "--render-stop",
720
- "--commit-start-32",
721
- "--react-version-<filtered-version>",
722
- "--profiler-version-1",
723
- "--react-internal-module-start- at filtered (<anonymous>:0:0)",
724
- "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
725
- "--react-lane-labels-SyncHydrationLane,Sync,InputContinuousHydration,InputContinuous,DefaultHydration,Default,TransitionHydration,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Retry,Retry,Retry,Retry,SelectiveHydration,IdleHydration,Idle,Offscreen,Deferred",
726
- "--layout-effects-start-32",
727
- "--component-layout-effect-mount-start-Example",
728
- "--schedule-state-update-2-Example",
729
- "--component-layout-effect-mount-stop",
730
- "--layout-effects-stop",
731
- "--render-start-2",
732
- "--component-render-start-Example",
733
- "--component-render-stop",
734
- "--render-stop",
735
- "--commit-start-2",
736
- "--react-version-<filtered-version>",
737
- "--profiler-version-1",
738
- "--react-internal-module-start- at filtered (<anonymous>:0:0)",
739
- "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
740
- "--react-lane-labels-SyncHydrationLane,Sync,InputContinuousHydration,InputContinuous,DefaultHydration,Default,TransitionHydration,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Retry,Retry,Retry,Retry,SelectiveHydration,IdleHydration,Idle,Offscreen,Deferred",
741
- "--commit-stop",
742
- "--commit-stop",
743
- ]
744
- `);
733
+ [
734
+ "--render-start-32",
735
+ "--component-render-start-Example",
736
+ "--component-render-stop",
737
+ "--render-stop",
738
+ "--commit-start-32",
739
+ "--react-version-<filtered-version>",
740
+ "--profiler-version-1",
741
+ "--react-internal-module-start- at filtered (<anonymous>:0:0)",
742
+ "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
743
+ "--react-internal-module-start- at filtered (<anonymous>:0:0)",
744
+ "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
745
+ "--react-lane-labels-SyncHydrationLane,Sync,InputContinuousHydration,InputContinuous,DefaultHydration,Default,TransitionHydration,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Retry,Retry,Retry,Retry,SelectiveHydration,IdleHydration,Idle,Offscreen,Deferred",
746
+ "--layout-effects-start-32",
747
+ "--component-layout-effect-mount-start-Example",
748
+ "--schedule-state-update-2-Example",
749
+ "--component-layout-effect-mount-stop",
750
+ "--layout-effects-stop",
751
+ "--render-start-2",
752
+ "--component-render-start-Example",
753
+ "--component-render-stop",
754
+ "--render-stop",
755
+ "--commit-start-2",
756
+ "--react-version-<filtered-version>",
757
+ "--profiler-version-1",
758
+ "--react-internal-module-start- at filtered (<anonymous>:0:0)",
759
+ "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
760
+ "--react-internal-module-start- at filtered (<anonymous>:0:0)",
761
+ "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
762
+ "--react-lane-labels-SyncHydrationLane,Sync,InputContinuousHydration,InputContinuous,DefaultHydration,Default,TransitionHydration,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Retry,Retry,Retry,Retry,SelectiveHydration,IdleHydration,Idle,Offscreen,Deferred",
763
+ "--commit-stop",
764
+ "--commit-stop",
765
+ ]
766
+ `);
767
});
768
769
it('should mark cascading passive updates', async () => {
780
await waitForAll([]);
781
782
expect(clearedMarks).toMatchInlineSnapshot(`
761
- [
762
- "--schedule-render-32",
763
- "--render-start-32",
764
- "--component-render-start-Example",
765
- "--component-render-stop",
766
- "--render-stop",
767
- "--commit-start-32",
768
- "--react-version-<filtered-version>",
769
- "--profiler-version-1",
770
- "--react-internal-module-start- at filtered (<anonymous>:0:0)",
771
- "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
772
- "--react-lane-labels-SyncHydrationLane,Sync,InputContinuousHydration,InputContinuous,DefaultHydration,Default,TransitionHydration,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Retry,Retry,Retry,Retry,SelectiveHydration,IdleHydration,Idle,Offscreen,Deferred",
773
- "--layout-effects-start-32",
774
- "--layout-effects-stop",
775
- "--commit-stop",
776
- "--passive-effects-start-32",
777
- "--component-passive-effect-mount-start-Example",
778
- "--schedule-state-update-32-Example",
779
- "--component-passive-effect-mount-stop",
780
- "--passive-effects-stop",
781
- "--render-start-32",
782
- "--component-render-start-Example",
783
- "--component-render-stop",
784
- "--render-stop",
785
- "--commit-start-32",
786
- "--react-version-<filtered-version>",
787
- "--profiler-version-1",
788
- "--react-internal-module-start- at filtered (<anonymous>:0:0)",
789
- "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
790
- "--react-lane-labels-SyncHydrationLane,Sync,InputContinuousHydration,InputContinuous,DefaultHydration,Default,TransitionHydration,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Retry,Retry,Retry,Retry,SelectiveHydration,IdleHydration,Idle,Offscreen,Deferred",
791
- "--commit-stop",
792
- ]
793
- `);
783
+ [
784
+ "--schedule-render-32",
785
+ "--render-start-32",
786
+ "--component-render-start-Example",
787
+ "--component-render-stop",
788
+ "--render-stop",
789
+ "--commit-start-32",
790
+ "--react-version-<filtered-version>",
791
+ "--profiler-version-1",
792
+ "--react-internal-module-start- at filtered (<anonymous>:0:0)",
793
+ "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
794
+ "--react-internal-module-start- at filtered (<anonymous>:0:0)",
795
+ "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
796
+ "--react-lane-labels-SyncHydrationLane,Sync,InputContinuousHydration,InputContinuous,DefaultHydration,Default,TransitionHydration,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Retry,Retry,Retry,Retry,SelectiveHydration,IdleHydration,Idle,Offscreen,Deferred",
797
+ "--layout-effects-start-32",
798
+ "--layout-effects-stop",
799
+ "--commit-stop",
800
+ "--passive-effects-start-32",
801
+ "--component-passive-effect-mount-start-Example",
802
+ "--schedule-state-update-32-Example",
803
+ "--component-passive-effect-mount-stop",
804
+ "--passive-effects-stop",
805
+ "--render-start-32",
806
+ "--component-render-start-Example",
807
+ "--component-render-stop",
808
+ "--render-stop",
809
+ "--commit-start-32",
810
+ "--react-version-<filtered-version>",
811
+ "--profiler-version-1",
812
+ "--react-internal-module-start- at filtered (<anonymous>:0:0)",
813
+ "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
814
+ "--react-internal-module-start- at filtered (<anonymous>:0:0)",
815
+ "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
816
+ "--react-lane-labels-SyncHydrationLane,Sync,InputContinuousHydration,InputContinuous,DefaultHydration,Default,TransitionHydration,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Retry,Retry,Retry,Retry,SelectiveHydration,IdleHydration,Idle,Offscreen,Deferred",
817
+ "--commit-stop",
818
+ ]
819
+ `);
820
});
821
822
it('should mark render phase updates', async () => {
833
await waitForAll([]);
834
835
expect(clearedMarks).toMatchInlineSnapshot(`
810
- [
811
- "--schedule-render-32",
812
- "--render-start-32",
813
- "--component-render-start-Example",
814
- "--schedule-state-update-32-Example",
815
- "--component-render-stop",
816
- "--render-stop",
817
- "--commit-start-32",
818
- "--react-version-<filtered-version>",
819
- "--profiler-version-1",
820
- "--react-internal-module-start- at filtered (<anonymous>:0:0)",
821
- "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
822
- "--react-lane-labels-SyncHydrationLane,Sync,InputContinuousHydration,InputContinuous,DefaultHydration,Default,TransitionHydration,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Retry,Retry,Retry,Retry,SelectiveHydration,IdleHydration,Idle,Offscreen,Deferred",
823
- "--layout-effects-start-32",
824
- "--layout-effects-stop",
825
- "--commit-stop",
826
- ]
827
- `);
836
+ [
837
+ "--schedule-render-32",
838
+ "--render-start-32",
839
+ "--component-render-start-Example",
840
+ "--schedule-state-update-32-Example",
841
+ "--component-render-stop",
842
+ "--render-stop",
843
+ "--commit-start-32",
844
+ "--react-version-<filtered-version>",
845
+ "--profiler-version-1",
846
+ "--react-internal-module-start- at filtered (<anonymous>:0:0)",
847
+ "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
848
+ "--react-internal-module-start- at filtered (<anonymous>:0:0)",
849
+ "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
850
+ "--react-lane-labels-SyncHydrationLane,Sync,InputContinuousHydration,InputContinuous,DefaultHydration,Default,TransitionHydration,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Retry,Retry,Retry,Retry,SelectiveHydration,IdleHydration,Idle,Offscreen,Deferred",
851
+ "--layout-effects-start-32",
852
+ "--layout-effects-stop",
853
+ "--commit-stop",
854
+ ]
855
+ `);
856
});
857
858
it('should mark concurrent render that throws', async () => {
883
);
884
885
expect(clearedMarks).toMatchInlineSnapshot(`
858
- [
859
- "--schedule-render-32",
860
- ]
861
- `);
886
+ [
887
+ "--schedule-render-32",
888
+ ]
889
+ `);
890
891
clearPendingMarks();
892
893
await waitForPaint([]);
894
895
expect(clearedMarks).toMatchInlineSnapshot(`
868
- [
869
- "--render-start-32",
870
- "--component-render-start-ErrorBoundary",
871
- "--component-render-stop",
872
- "--component-render-start-ExampleThatThrows",
873
- "--component-render-stop",
874
- "--error-ExampleThatThrows-mount-Expected error",
875
- "--render-stop",
876
- "--render-start-32",
877
- "--component-render-start-ErrorBoundary",
878
- "--component-render-stop",
879
- "--component-render-start-ExampleThatThrows",
880
- "--component-render-stop",
881
- "--error-ExampleThatThrows-mount-Expected error",
882
- "--render-stop",
883
- "--commit-start-32",
884
- "--react-version-<filtered-version>",
885
- "--profiler-version-1",
886
- "--react-internal-module-start- at filtered (<anonymous>:0:0)",
887
- "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
888
- "--react-lane-labels-SyncHydrationLane,Sync,InputContinuousHydration,InputContinuous,DefaultHydration,Default,TransitionHydration,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Retry,Retry,Retry,Retry,SelectiveHydration,IdleHydration,Idle,Offscreen,Deferred",
889
- "--layout-effects-start-32",
890
- "--schedule-state-update-2-ErrorBoundary",
891
- "--layout-effects-stop",
892
- "--render-start-2",
893
- "--component-render-start-ErrorBoundary",
894
- "--component-render-stop",
895
- "--render-stop",
896
- "--commit-start-2",
897
- "--react-version-<filtered-version>",
898
- "--profiler-version-1",
899
- "--react-internal-module-start- at filtered (<anonymous>:0:0)",
900
- "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
901
- "--react-lane-labels-SyncHydrationLane,Sync,InputContinuousHydration,InputContinuous,DefaultHydration,Default,TransitionHydration,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Retry,Retry,Retry,Retry,SelectiveHydration,IdleHydration,Idle,Offscreen,Deferred",
902
- "--commit-stop",
903
- "--commit-stop",
904
- ]
905
- `);
896
+ [
897
+ "--render-start-32",
898
+ "--component-render-start-ErrorBoundary",
899
+ "--component-render-stop",
900
+ "--component-render-start-ExampleThatThrows",
901
+ "--component-render-stop",
902
+ "--error-ExampleThatThrows-mount-Expected error",
903
+ "--render-stop",
904
+ "--render-start-32",
905
+ "--component-render-start-ErrorBoundary",
906
+ "--component-render-stop",
907
+ "--component-render-start-ExampleThatThrows",
908
+ "--component-render-stop",
909
+ "--error-ExampleThatThrows-mount-Expected error",
910
+ "--render-stop",
911
+ "--commit-start-32",
912
+ "--react-version-<filtered-version>",
913
+ "--profiler-version-1",
914
+ "--react-internal-module-start- at filtered (<anonymous>:0:0)",
915
+ "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
916
+ "--react-internal-module-start- at filtered (<anonymous>:0:0)",
917
+ "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
918
+ "--react-lane-labels-SyncHydrationLane,Sync,InputContinuousHydration,InputContinuous,DefaultHydration,Default,TransitionHydration,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Retry,Retry,Retry,Retry,SelectiveHydration,IdleHydration,Idle,Offscreen,Deferred",
919
+ "--layout-effects-start-32",
920
+ "--schedule-state-update-2-ErrorBoundary",
921
+ "--layout-effects-stop",
922
+ "--render-start-2",
923
+ "--component-render-start-ErrorBoundary",
924
+ "--component-render-stop",
925
+ "--render-stop",
926
+ "--commit-start-2",
927
+ "--react-version-<filtered-version>",
928
+ "--profiler-version-1",
929
+ "--react-internal-module-start- at filtered (<anonymous>:0:0)",
930
+ "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
931
+ "--react-internal-module-start- at filtered (<anonymous>:0:0)",
932
+ "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
933
+ "--react-lane-labels-SyncHydrationLane,Sync,InputContinuousHydration,InputContinuous,DefaultHydration,Default,TransitionHydration,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Retry,Retry,Retry,Retry,SelectiveHydration,IdleHydration,Idle,Offscreen,Deferred",
934
+ "--commit-stop",
935
+ "--commit-stop",
936
+ ]
937
+ `);
938
});
939
940
it('should mark passive and layout effects', async () => {
982
await waitForPaint(['layout 1 mount', 'layout 2 mount']);
983
984
expect(clearedMarks).toMatchInlineSnapshot(`
953
- [
954
- "--schedule-render-32",
955
- "--render-start-32",
956
- "--component-render-start-ComponentWithEffects",
957
- "--component-render-stop",
958
- "--render-stop",
959
- "--commit-start-32",
960
- "--react-version-<filtered-version>",
961
- "--profiler-version-1",
962
- "--react-internal-module-start- at filtered (<anonymous>:0:0)",
963
- "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
964
- "--react-lane-labels-SyncHydrationLane,Sync,InputContinuousHydration,InputContinuous,DefaultHydration,Default,TransitionHydration,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Retry,Retry,Retry,Retry,SelectiveHydration,IdleHydration,Idle,Offscreen,Deferred",
965
- "--layout-effects-start-32",
966
- "--component-layout-effect-mount-start-ComponentWithEffects",
967
- "--component-layout-effect-mount-stop",
968
- "--component-layout-effect-mount-start-ComponentWithEffects",
969
- "--component-layout-effect-mount-stop",
970
- "--layout-effects-stop",
971
- "--commit-stop",
972
- ]
973
- `);
985
+ [
986
+ "--schedule-render-32",
987
+ "--render-start-32",
988
+ "--component-render-start-ComponentWithEffects",
989
+ "--component-render-stop",
990
+ "--render-stop",
991
+ "--commit-start-32",
992
+ "--react-version-<filtered-version>",
993
+ "--profiler-version-1",
994
+ "--react-internal-module-start- at filtered (<anonymous>:0:0)",
995
+ "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
996
+ "--react-internal-module-start- at filtered (<anonymous>:0:0)",
997
+ "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
998
+ "--react-lane-labels-SyncHydrationLane,Sync,InputContinuousHydration,InputContinuous,DefaultHydration,Default,TransitionHydration,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Retry,Retry,Retry,Retry,SelectiveHydration,IdleHydration,Idle,Offscreen,Deferred",
999
+ "--layout-effects-start-32",
1000
+ "--component-layout-effect-mount-start-ComponentWithEffects",
1001
+ "--component-layout-effect-mount-stop",
1002
+ "--component-layout-effect-mount-start-ComponentWithEffects",
1003
+ "--component-layout-effect-mount-stop",
1004
+ "--layout-effects-stop",
1005
+ "--commit-stop",
1006
+ ]
1007
+ `);
1008
1009
clearPendingMarks();
1010
1015
]);
1016
1017
expect(clearedMarks).toMatchInlineSnapshot(`
984
- [
985
- "--passive-effects-start-32",
986
- "--component-passive-effect-mount-start-ComponentWithEffects",
987
- "--component-passive-effect-mount-stop",
988
- "--component-passive-effect-mount-start-ComponentWithEffects",
989
- "--component-passive-effect-mount-stop",
990
- "--component-passive-effect-mount-start-ComponentWithEffects",
991
- "--component-passive-effect-mount-stop",
992
- "--passive-effects-stop",
993
- ]
994
- `);
1018
+ [
1019
+ "--passive-effects-start-32",
1020
+ "--component-passive-effect-mount-start-ComponentWithEffects",
1021
+ "--component-passive-effect-mount-stop",
1022
+ "--component-passive-effect-mount-start-ComponentWithEffects",
1023
+ "--component-passive-effect-mount-stop",
1024
+ "--component-passive-effect-mount-start-ComponentWithEffects",
1025
+ "--component-passive-effect-mount-stop",
1026
+ "--passive-effects-stop",
1027
+ ]
1028
+ `);
1029
1030
clearPendingMarks();
1031
1042
]);
1043
1044
expect(clearedMarks).toMatchInlineSnapshot(`
1011
- [
1012
- "--schedule-render-2",
1013
- "--render-start-2",
1014
- "--render-stop",
1015
- "--commit-start-2",
1016
- "--react-version-<filtered-version>",
1017
- "--profiler-version-1",
1018
- "--react-internal-module-start- at filtered (<anonymous>:0:0)",
1019
- "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
1020
- "--react-lane-labels-SyncHydrationLane,Sync,InputContinuousHydration,InputContinuous,DefaultHydration,Default,TransitionHydration,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Retry,Retry,Retry,Retry,SelectiveHydration,IdleHydration,Idle,Offscreen,Deferred",
1021
- "--component-layout-effect-unmount-start-ComponentWithEffects",
1022
- "--component-layout-effect-unmount-stop",
1023
- "--component-layout-effect-unmount-start-ComponentWithEffects",
1024
- "--component-layout-effect-unmount-stop",
1025
- "--layout-effects-start-2",
1026
- "--layout-effects-stop",
1027
- "--passive-effects-start-2",
1028
- "--component-passive-effect-unmount-start-ComponentWithEffects",
1029
- "--component-passive-effect-unmount-stop",
1030
- "--component-passive-effect-unmount-start-ComponentWithEffects",
1031
- "--component-passive-effect-unmount-stop",
1032
- "--component-passive-effect-unmount-start-ComponentWithEffects",
1033
- "--component-passive-effect-unmount-stop",
1034
- "--passive-effects-stop",
1035
- "--commit-stop",
1036
- ]
1037
- `);
1045
+ [
1046
+ "--schedule-render-2",
1047
+ "--render-start-2",
1048
+ "--render-stop",
1049
+ "--commit-start-2",
1050
+ "--react-version-<filtered-version>",
1051
+ "--profiler-version-1",
1052
+ "--react-internal-module-start- at filtered (<anonymous>:0:0)",
1053
+ "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
1054
+ "--react-internal-module-start- at filtered (<anonymous>:0:0)",
1055
+ "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
1056
+ "--react-lane-labels-SyncHydrationLane,Sync,InputContinuousHydration,InputContinuous,DefaultHydration,Default,TransitionHydration,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Retry,Retry,Retry,Retry,SelectiveHydration,IdleHydration,Idle,Offscreen,Deferred",
1057
+ "--component-layout-effect-unmount-start-ComponentWithEffects",
1058
+ "--component-layout-effect-unmount-stop",
1059
+ "--component-layout-effect-unmount-start-ComponentWithEffects",
1060
+ "--component-layout-effect-unmount-stop",
1061
+ "--layout-effects-start-2",
1062
+ "--layout-effects-stop",
1063
+ "--passive-effects-start-2",
1064
+ "--component-passive-effect-unmount-start-ComponentWithEffects",
1065
+ "--component-passive-effect-unmount-stop",
1066
+ "--component-passive-effect-unmount-start-ComponentWithEffects",
1067
+ "--component-passive-effect-unmount-stop",
1068
+ "--component-passive-effect-unmount-start-ComponentWithEffects",
1069
+ "--component-passive-effect-unmount-stop",
1070
+ "--passive-effects-stop",
1071
+ "--commit-stop",
1072
+ ]
1073
+ `);
1074
});
1075
});
1076
1084
legacyRender(<div />);
1085
1086
expect(clearedMarks).toMatchInlineSnapshot(`
1051
- [
1052
- "--schedule-render-1",
1053
- "--render-start-1",
1054
- "--render-stop",
1055
- "--commit-start-1",
1056
- "--react-version-<filtered-version>",
1057
- "--profiler-version-1",
1058
- "--react-internal-module-start- at filtered (<anonymous>:0:0)",
1059
- "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
1060
- "--react-lane-labels-Sync,InputContinuousHydration,InputContinuous,DefaultHydration,Default,TransitionHydration,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Retry,Retry,Retry,Retry,Retry,SelectiveHydration,IdleHydration,Idle,Offscreen",
1061
- "--layout-effects-start-1",
1062
- "--layout-effects-stop",
1063
- "--commit-stop",
1064
- ]
1065
- `);
1087
+ [
1088
+ "--schedule-render-1",
1089
+ "--render-start-1",
1090
+ "--render-stop",
1091
+ "--commit-start-1",
1092
+ "--react-version-<filtered-version>",
1093
+ "--profiler-version-1",
1094
+ "--react-internal-module-start- at filtered (<anonymous>:0:0)",
1095
+ "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
1096
+ "--react-lane-labels-Sync,InputContinuousHydration,InputContinuous,DefaultHydration,Default,TransitionHydration,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Retry,Retry,Retry,Retry,Retry,SelectiveHydration,IdleHydration,Idle,Offscreen",
1097
+ "--layout-effects-start-1",
1098
+ "--layout-effects-stop",
1099
+ "--commit-stop",
1100
+ ]
1101
+ `);
1102
});
1103
});
1104
1115
it('regression test DefaultLane', () => {
1116
modernRender(<div />);
1117
expect(clearedMarks).toMatchInlineSnapshot(`
1082
- [
1083
- "--schedule-render-32",
1084
- ]
1085
- `);
1118
+ [
1119
+ "--schedule-render-32",
1120
+ ]
1121
+ `);
1122
});
1123
1124
it('regression test InputDiscreteLane', async () => {
1143
await Promise.resolve();
1144
1145
expect(clearedMarks).toMatchInlineSnapshot(`
1110
- [
1111
- "--schedule-state-update-2-App",
1112
- "--render-start-2",
1113
- "--component-render-start-App",
1114
- "--component-render-stop",
1115
- "--render-stop",
1116
- "--commit-start-2",
1117
- "--react-version-<filtered-version>",
1118
- "--profiler-version-1",
1119
- "--react-internal-module-start- at filtered (<anonymous>:0:0)",
1120
- "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
1121
- "--react-lane-labels-SyncHydrationLane,Sync,InputContinuousHydration,InputContinuous,DefaultHydration,Default,TransitionHydration,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Retry,Retry,Retry,Retry,SelectiveHydration,IdleHydration,Idle,Offscreen,Deferred",
1122
- "--layout-effects-start-2",
1123
- "--layout-effects-stop",
1124
- "--commit-stop",
1125
- ]
1126
- `);
1146
+ [
1147
+ "--schedule-state-update-2-App",
1148
+ "--render-start-2",
1149
+ "--component-render-start-App",
1150
+ "--component-render-stop",
1151
+ "--render-stop",
1152
+ "--commit-start-2",
1153
+ "--react-version-<filtered-version>",
1154
+ "--profiler-version-1",
1155
+ "--react-internal-module-start- at filtered (<anonymous>:0:0)",
1156
+ "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
1157
+ "--react-internal-module-start- at filtered (<anonymous>:0:0)",
1158
+ "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
1159
+ "--react-lane-labels-SyncHydrationLane,Sync,InputContinuousHydration,InputContinuous,DefaultHydration,Default,TransitionHydration,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Retry,Retry,Retry,Retry,SelectiveHydration,IdleHydration,Idle,Offscreen,Deferred",
1160
+ "--layout-effects-start-2",
1161
+ "--layout-effects-stop",
1162
+ "--commit-stop",
1163
+ ]
1164
+ `);
1165
});
1166
1167
it('regression test InputContinuousLane', async () => {
1185
await waitForAll([]);
1186
1187
expect(clearedMarks).toMatchInlineSnapshot(`
1150
- [
1151
- "--schedule-state-update-8-App",
1152
- "--render-start-8",
1153
- "--component-render-start-App",
1154
- "--component-render-stop",
1155
- "--render-stop",
1156
- "--commit-start-8",
1157
- "--react-version-<filtered-version>",
1158
- "--profiler-version-1",
1159
- "--react-internal-module-start- at filtered (<anonymous>:0:0)",
1160
- "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
1161
- "--react-lane-labels-SyncHydrationLane,Sync,InputContinuousHydration,InputContinuous,DefaultHydration,Default,TransitionHydration,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Retry,Retry,Retry,Retry,SelectiveHydration,IdleHydration,Idle,Offscreen,Deferred",
1162
- "--layout-effects-start-8",
1163
- "--layout-effects-stop",
1164
- "--commit-stop",
1165
- ]
1166
- `);
1188
+ [
1189
+ "--schedule-state-update-8-App",
1190
+ "--render-start-8",
1191
+ "--component-render-start-App",
1192
+ "--component-render-stop",
1193
+ "--render-stop",
1194
+ "--commit-start-8",
1195
+ "--react-version-<filtered-version>",
1196
+ "--profiler-version-1",
1197
+ "--react-internal-module-start- at filtered (<anonymous>:0:0)",
1198
+ "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
1199
+ "--react-internal-module-start- at filtered (<anonymous>:0:0)",
1200
+ "--react-internal-module-stop- at filtered (<anonymous>:1:1)",
1201
+ "--react-lane-labels-SyncHydrationLane,Sync,InputContinuousHydration,InputContinuous,DefaultHydration,Default,TransitionHydration,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Retry,Retry,Retry,Retry,SelectiveHydration,IdleHydration,Idle,Offscreen,Deferred",
1202
+ "--layout-effects-start-8",
1203
+ "--layout-effects-stop",
1204
+ "--commit-stop",
1205
+ ]
1206
+ `);
1207
});
1208
});
1209
});
1269
1270
const timelineData = stopProfilingAndGetTimelineData();
1271
expect(timelineData.schedulingEvents).toMatchInlineSnapshot(`
1232
- [
1233
- {
1234
- "lanes": "0b0000000000000000000000000000001",
1235
- "timestamp": 10,
1236
- "type": "schedule-render",
1237
- "warning": null,
1238
- },
1239
- ]
1240
- `);
1272
+ [
1273
+ {
1274
+ "lanes": "0b0000000000000000000000000000001",
1275
+ "timestamp": 10,
1276
+ "type": "schedule-render",
1277
+ "warning": null,
1278
+ },
1279
+ ]
1280
+ `);
1281
});
1282
1283
// @reactVersion <= 18.2
1321
1322
const timelineData = stopProfilingAndGetTimelineData();
1323
expect(timelineData.componentMeasures).toMatchInlineSnapshot(`
1284
- [
1285
- {
1286
- "componentName": "ErrorBoundary",
1287
- "duration": 10,
1288
- "timestamp": 10,
1289
- "type": "render",
1290
- "warning": null,
1291
- },
1292
- {
1293
- "componentName": "ExampleThatThrows",
1294
- "duration": 0,
1295
- "timestamp": 20,
1296
- "type": "render",
1297
- "warning": null,
1298
- },
1299
- {
1300
- "componentName": "ErrorBoundary",
1301
- "duration": 10,
1302
- "timestamp": 20,
1303
- "type": "render",
1304
- "warning": null,
1305
- },
1306
- ]
1307
- `);
1324
+ [
1325
+ {
1326
+ "componentName": "ErrorBoundary",
1327
+ "duration": 10,
1328
+ "timestamp": 10,
1329
+ "type": "render",
1330
+ "warning": null,
1331
+ },
1332
+ {
1333
+ "componentName": "ExampleThatThrows",
1334
+ "duration": 0,
1335
+ "timestamp": 20,
1336
+ "type": "render",
1337
+ "warning": null,
1338
+ },
1339
+ {
1340
+ "componentName": "ErrorBoundary",
1341
+ "duration": 10,
1342
+ "timestamp": 20,
1343
+ "type": "render",
1344
+ "warning": null,
1345
+ },
1346
+ ]
1347
+ `);
1348
expect(timelineData.schedulingEvents).toMatchInlineSnapshot(`
1309
- [
1310
- {
1311
- "lanes": "0b0000000000000000000000000000001",
1312
- "timestamp": 10,
1313
- "type": "schedule-render",
1314
- "warning": null,
1315
- },
1316
- {
1317
- "componentName": "ErrorBoundary",
1318
- "componentStack": "
1319
- in ErrorBoundary (at **)",
1320
- "lanes": "0b0000000000000000000000000000001",
1321
- "timestamp": 20,
1322
- "type": "schedule-state-update",
1323
- "warning": null,
1324
- },
1325
- ]
1326
- `);
1349
+ [
1350
+ {
1351
+ "lanes": "0b0000000000000000000000000000001",
1352
+ "timestamp": 10,
1353
+ "type": "schedule-render",
1354
+ "warning": null,
1355
+ },
1356
+ {
1357
+ "componentName": "ErrorBoundary",
1358
+ "componentStack": "
1359
+ in ErrorBoundary (at **)",
1360
+ "lanes": "0b0000000000000000000000000000001",
1361
+ "timestamp": 20,
1362
+ "type": "schedule-state-update",
1363
+ "warning": null,
1364
+ },
1365
+ ]
1366
+ `);
1367
expect(timelineData.thrownErrors).toMatchInlineSnapshot(`
1328
- [
1329
- {
1330
- "componentName": "ExampleThatThrows",
1331
- "message": "Expected error",
1332
- "phase": "mount",
1333
- "timestamp": 20,
1334
- "type": "thrown-error",
1335
- },
1336
- ]
1337
- `);
1368
+ [
1369
+ {
1370
+ "componentName": "ExampleThatThrows",
1371
+ "message": "Expected error",
1372
+ "phase": "mount",
1373
+ "timestamp": 20,
1374
+ "type": "thrown-error",
1375
+ },
1376
+ ]
1377
+ `);
1378
});
1379
1380
// @reactVersion <= 18.2
1418
expect(timelineData.suspenseEvents).toHaveLength(1);
1419
const suspenseEvent = timelineData.suspenseEvents[0];
1420
expect(suspenseEvent).toMatchInlineSnapshot(`
1381
- {
1382
- "componentName": "Example",
1383
- "depth": 0,
1384
- "duration": 10,
1385
- "id": "0",
1386
- "phase": "mount",
1387
- "promiseName": "",
1388
- "resolution": "resolved",
1389
- "timestamp": 10,
1390
- "type": "suspense",
1391
- "warning": null,
1392
- }
1393
- `);
1421
+ {
1422
+ "componentName": "Example",
1423
+ "depth": 0,
1424
+ "duration": 10,
1425
+ "id": "0",
1426
+ "phase": "mount",
1427
+ "promiseName": "",
1428
+ "resolution": "resolved",
1429
+ "timestamp": 10,
1430
+ "type": "suspense",
1431
+ "warning": null,
1432
+ }
1433
+ `);
1434
1435
// There should be two batches of renders: Suspeneded and resolved.
1436
expect(timelineData.batchUIDToMeasuresMap.size).toBe(2);
1476
expect(timelineData.suspenseEvents).toHaveLength(1);
1477
const suspenseEvent = timelineData.suspenseEvents[0];
1478
expect(suspenseEvent).toMatchInlineSnapshot(`
1439
- {
1440
- "componentName": "Example",
1441
- "depth": 0,
1442
- "duration": 10,
1443
- "id": "0",
1444
- "phase": "mount",
1445
- "promiseName": "",
1446
- "resolution": "rejected",
1447
- "timestamp": 10,
1448
- "type": "suspense",
1449
- "warning": null,
1450
- }
1451
- `);
1479
+ {
1480
+ "componentName": "Example",
1481
+ "depth": 0,
1482
+ "duration": 10,
1483
+ "id": "0",
1484
+ "phase": "mount",
1485
+ "promiseName": "",
1486
+ "resolution": "rejected",
1487
+ "timestamp": 10,
1488
+ "type": "suspense",
1489
+ "warning": null,
1490
+ }
1491
+ `);
1492
1493
// There should be two batches of renders: Suspeneded and resolved.
1494
expect(timelineData.batchUIDToMeasuresMap.size).toBe(2);
1517
1518
const timelineData = stopProfilingAndGetTimelineData();
1519
expect(timelineData.schedulingEvents).toMatchInlineSnapshot(`
1480
- [
1481
- {
1482
- "lanes": "0b0000000000000000000000000100000",
1483
- "timestamp": 10,
1484
- "type": "schedule-render",
1485
- "warning": null,
1486
- },
1487
- ]
1488
- `);
1520
+ [
1521
+ {
1522
+ "lanes": "0b0000000000000000000000000100000",
1523
+ "timestamp": 10,
1524
+ "type": "schedule-render",
1525
+ "warning": null,
1526
+ },
1527
+ ]
1528
+ `);
1529
});
1530
1531
it('should mark concurrent render without suspends or state updates', () => {
1554
1555
const timelineData = stopProfilingAndGetTimelineData();
1556
expect(timelineData.schedulingEvents).toMatchInlineSnapshot(`
1517
- [
1518
- {
1519
- "componentName": "Example",
1520
- "componentStack": "
1521
- in Example (at **)",
1522
- "lanes": "0b0000000000000000000000010000000",
1523
- "timestamp": 10,
1524
- "type": "schedule-state-update",
1525
- "warning": null,
1526
- },
1527
- {
1528
- "componentName": "Example",
1529
- "componentStack": "
1530
- in Example (at **)",
1531
- "lanes": "0b0000000000000000000000000100000",
1532
- "timestamp": 10,
1533
- "type": "schedule-state-update",
1534
- "warning": null,
1535
- },
1536
- ]
1537
- `);
1557
+ [
1558
+ {
1559
+ "componentName": "Example",
1560
+ "componentStack": "
1561
+ in Example (at **)",
1562
+ "lanes": "0b0000000000000000000000010000000",
1563
+ "timestamp": 10,
1564
+ "type": "schedule-state-update",
1565
+ "warning": null,
1566
+ },
1567
+ {
1568
+ "componentName": "Example",
1569
+ "componentStack": "
1570
+ in Example (at **)",
1571
+ "lanes": "0b0000000000000000000000000100000",
1572
+ "timestamp": 10,
1573
+ "type": "schedule-state-update",
1574
+ "warning": null,
1575
+ },
1576
+ ]
1577
+ `);
1578
expect(timelineData.componentMeasures).toMatchInlineSnapshot(`
1539
- [
1540
- {
1541
- "componentName": "Example",
1542
- "duration": 0,
1543
- "timestamp": 10,
1544
- "type": "render",
1545
- "warning": null,
1546
- },
1547
- {
1548
- "componentName": "Example",
1549
- "duration": 10,
1550
- "timestamp": 10,
1551
- "type": "render",
1552
- "warning": null,
1553
- },
1554
- ]
1555
- `);
1579
+ [
1580
+ {
1581
+ "componentName": "Example",
1582
+ "duration": 0,
1583
+ "timestamp": 10,
1584
+ "type": "render",
1585
+ "warning": null,
1586
+ },
1587
+ {
1588
+ "componentName": "Example",
1589
+ "duration": 10,
1590
+ "timestamp": 10,
1591
+ "type": "render",
1592
+ "warning": null,
1593
+ },
1594
+ ]
1595
+ `);
1596
expect(timelineData.batchUIDToMeasuresMap.size).toBe(2);
1597
});
1598
1661
expect(timelineData.suspenseEvents).toHaveLength(1);
1662
const suspenseEvent = timelineData.suspenseEvents[0];
1663
expect(suspenseEvent).toMatchInlineSnapshot(`
1624
- {
1625
- "componentName": "Example",
1626
- "depth": 0,
1627
- "duration": 10,
1628
- "id": "0",
1629
- "phase": "mount",
1630
- "promiseName": "",
1631
- "resolution": "resolved",
1632
- "timestamp": 10,
1633
- "type": "suspense",
1634
- "warning": null,
1635
- }
1636
- `);
1664
+ {
1665
+ "componentName": "Example",
1666
+ "depth": 0,
1667
+ "duration": 10,
1668
+ "id": "0",
1669
+ "phase": "mount",
1670
+ "promiseName": "",
1671
+ "resolution": "resolved",
1672
+ "timestamp": 10,
1673
+ "type": "suspense",
1674
+ "warning": null,
1675
+ }
1676
+ `);
1677
1678
// There should be two batches of renders: Suspeneded and resolved.
1679
expect(timelineData.batchUIDToMeasuresMap.size).toBe(2);
1718
expect(timelineData.suspenseEvents).toHaveLength(1);
1719
const suspenseEvent = timelineData.suspenseEvents[0];
1720
expect(suspenseEvent).toMatchInlineSnapshot(`
1681
- {
1682
- "componentName": "Example",
1683
- "depth": 0,
1684
- "duration": 10,
1685
- "id": "0",
1686
- "phase": "mount",
1687
- "promiseName": "",
1688
- "resolution": "rejected",
1689
- "timestamp": 10,
1690
- "type": "suspense",
1691
- "warning": null,
1692
- }
1693
- `);
1721
+ {
1722
+ "componentName": "Example",
1723
+ "depth": 0,
1724
+ "duration": 10,
1725
+ "id": "0",
1726
+ "phase": "mount",
1727
+ "promiseName": "",
1728
+ "resolution": "rejected",
1729
+ "timestamp": 10,
1730
+ "type": "suspense",
1731
+ "warning": null,
1732
+ }
1733
+ `);
1734
1735
// There should be two batches of renders: Suspeneded and resolved.
1736
expect(timelineData.batchUIDToMeasuresMap.size).toBe(2);
1757
const timelineData = stopProfilingAndGetTimelineData();
1758
expect(timelineData.batchUIDToMeasuresMap.size).toBe(2);
1759
expect(timelineData.componentMeasures).toMatchInlineSnapshot(`
1720
- [
1721
- {
1722
- "componentName": "Example",
1723
- "duration": 10,
1724
- "timestamp": 10,
1725
- "type": "render",
1726
- "warning": null,
1727
- },
1728
- {
1729
- "componentName": "Example",
1730
- "duration": 10,
1731
- "timestamp": 20,
1732
- "type": "render",
1733
- "warning": null,
1734
- },
1735
- ]
1736
- `);
1760
+ [
1761
+ {
1762
+ "componentName": "Example",
1763
+ "duration": 10,
1764
+ "timestamp": 10,
1765
+ "type": "render",
1766
+ "warning": null,
1767
+ },
1768
+ {
1769
+ "componentName": "Example",
1770
+ "duration": 10,
1771
+ "timestamp": 20,
1772
+ "type": "render",
1773
+ "warning": null,
1774
+ },
1775
+ ]
1776
+ `);
1777
expect(timelineData.schedulingEvents).toMatchInlineSnapshot(`
1738
- [
1739
- {
1740
- "lanes": "0b0000000000000000000000000100000",
1741
- "timestamp": 10,
1742
- "type": "schedule-render",
1743
- "warning": null,
1744
- },
1745
- {
1746
- "componentName": "Example",
1747
- "componentStack": "
1748
- in Example (at **)",
1749
- "lanes": "0b0000000000000000000000000000010",
1750
- "timestamp": 20,
1751
- "type": "schedule-state-update",
1752
- "warning": null,
1753
- },
1754
- ]
1755
- `);
1778
+ [
1779
+ {
1780
+ "lanes": "0b0000000000000000000000000100000",
1781
+ "timestamp": 10,
1782
+ "type": "schedule-render",
1783
+ "warning": null,
1784
+ },
1785
+ {
1786
+ "componentName": "Example",
1787
+ "componentStack": "
1788
+ in Example (at **)",
1789
+ "lanes": "0b0000000000000000000000000000010",
1790
+ "timestamp": 20,
1791
+ "type": "schedule-state-update",
1792
+ "warning": null,
1793
+ },
1794
+ ]
1795
+ `);
1796
});
1797
1798
it('should mark cascading class component force updates', async () => {
1816
const timelineData = stopProfilingAndGetTimelineData();
1817
expect(timelineData.batchUIDToMeasuresMap.size).toBe(2);
1818
expect(timelineData.componentMeasures).toMatchInlineSnapshot(`
1779
- [
1780
- {
1781
- "componentName": "Example",
1782
- "duration": 10,
1783
- "timestamp": 10,
1784
- "type": "render",
1785
- "warning": null,
1786
- },
1787
- {
1788
- "componentName": "Example",
1789
- "duration": 10,
1790
- "timestamp": 20,
1791
- "type": "render",
1792
- "warning": null,
1793
- },
1794
- ]
1795
- `);
1819
+ [
1820
+ {
1821
+ "componentName": "Example",
1822
+ "duration": 10,
1823
+ "timestamp": 10,
1824
+ "type": "render",
1825
+ "warning": null,
1826
+ },
1827
+ {
1828
+ "componentName": "Example",
1829
+ "duration": 10,
1830
+ "timestamp": 20,
1831
+ "type": "render",
1832
+ "warning": null,
1833
+ },
1834
+ ]
1835
+ `);
1836
expect(timelineData.schedulingEvents).toMatchInlineSnapshot(`
1797
- [
1798
- {
1799
- "lanes": "0b0000000000000000000000000100000",
1800
- "timestamp": 10,
1801
- "type": "schedule-render",
1802
- "warning": null,
1803
- },
1804
- {
1805
- "componentName": "Example",
1806
- "lanes": "0b0000000000000000000000000000010",
1807
- "timestamp": 20,
1808
- "type": "schedule-force-update",
1809
- "warning": null,
1810
- },
1811
- ]
1812
- `);
1837
+ [
1838
+ {
1839
+ "lanes": "0b0000000000000000000000000100000",
1840
+ "timestamp": 10,
1841
+ "type": "schedule-render",
1842
+ "warning": null,
1843
+ },
1844
+ {
1845
+ "componentName": "Example",
1846
+ "lanes": "0b0000000000000000000000000000010",
1847
+ "timestamp": 20,
1848
+ "type": "schedule-force-update",
1849
+ "warning": null,
1850
+ },
1851
+ ]
1852
+ `);
1853
});
1854
1855
it('should mark render phase state updates for class component', async () => {
1884
const timelineData = stopProfilingAndGetTimelineData();
1885
expect(timelineData.batchUIDToMeasuresMap.size).toBe(2);
1886
expect(timelineData.componentMeasures).toMatchInlineSnapshot(`
1847
- [
1848
- {
1849
- "componentName": "Example",
1850
- "duration": 10,
1851
- "timestamp": 10,
1852
- "type": "render",
1853
- "warning": null,
1854
- },
1855
- {
1856
- "componentName": "Example",
1857
- "duration": 10,
1858
- "timestamp": 20,
1859
- "type": "render",
1860
- "warning": null,
1861
- },
1862
- ]
1863
- `);
1887
+ [
1888
+ {
1889
+ "componentName": "Example",
1890
+ "duration": 10,
1891
+ "timestamp": 10,
1892
+ "type": "render",
1893
+ "warning": null,
1894
+ },
1895
+ {
1896
+ "componentName": "Example",
1897
+ "duration": 10,
1898
+ "timestamp": 20,
1899
+ "type": "render",
1900
+ "warning": null,
1901
+ },
1902
+ ]
1903
+ `);
1904
expect(timelineData.schedulingEvents).toMatchInlineSnapshot(`
1865
- [
1866
- {
1867
- "lanes": "0b0000000000000000000000000100000",
1868
- "timestamp": 10,
1869
- "type": "schedule-render",
1870
- "warning": null,
1871
- },
1872
- {
1873
- "componentName": "Example",
1874
- "componentStack": "
1875
- in Example (at **)",
1876
- "lanes": "0b0000000000000000000000000100000",
1877
- "timestamp": 10,
1878
- "type": "schedule-state-update",
1879
- "warning": null,
1880
- },
1881
- ]
1882
- `);
1905
+ [
1906
+ {
1907
+ "lanes": "0b0000000000000000000000000100000",
1908
+ "timestamp": 10,
1909
+ "type": "schedule-render",
1910
+ "warning": null,
1911
+ },
1912
+ {
1913
+ "componentName": "Example",
1914
+ "componentStack": "
1915
+ in Example (at **)",
1916
+ "lanes": "0b0000000000000000000000000100000",
1917
+ "timestamp": 10,
1918
+ "type": "schedule-state-update",
1919
+ "warning": null,
1920
+ },
1921
+ ]
1922
+ `);
1923
});
1924
1925
it('should mark render phase force updates for class component', async () => {
1953
const timelineData = stopProfilingAndGetTimelineData();
1954
expect(timelineData.batchUIDToMeasuresMap.size).toBe(2);
1955
expect(timelineData.componentMeasures).toMatchInlineSnapshot(`
1916
- [
1917
- {
1918
- "componentName": "Example",
1919
- "duration": 10,
1920
- "timestamp": 10,
1921
- "type": "render",
1922
- "warning": null,
1923
- },
1924
- {
1925
- "componentName": "Example",
1926
- "duration": 10,
1927
- "timestamp": 20,
1928
- "type": "render",
1929
- "warning": null,
1930
- },
1931
- ]
1932
- `);
1956
+ [
1957
+ {
1958
+ "componentName": "Example",
1959
+ "duration": 10,
1960
+ "timestamp": 10,
1961
+ "type": "render",
1962
+ "warning": null,
1963
+ },
1964
+ {
1965
+ "componentName": "Example",
1966
+ "duration": 10,
1967
+ "timestamp": 20,
1968
+ "type": "render",
1969
+ "warning": null,
1970
+ },
1971
+ ]
1972
+ `);
1973
expect(timelineData.schedulingEvents).toMatchInlineSnapshot(`
1934
- [
1935
- {
1936
- "lanes": "0b0000000000000000000000000100000",
1937
- "timestamp": 10,
1938
- "type": "schedule-render",
1939
- "warning": null,
1940
- },
1941
- {
1942
- "componentName": "Example",
1943
- "lanes": "0b0000000000000000000000000100000",
1944
- "timestamp": 20,
1945
- "type": "schedule-force-update",
1946
- "warning": null,
1947
- },
1948
- ]
1949
- `);
1974
+ [
1975
+ {
1976
+ "lanes": "0b0000000000000000000000000100000",
1977
+ "timestamp": 10,
1978
+ "type": "schedule-render",
1979
+ "warning": null,
1980
+ },
1981
+ {
1982
+ "componentName": "Example",
1983
+ "lanes": "0b0000000000000000000000000100000",
1984
+ "timestamp": 20,
1985
+ "type": "schedule-force-update",
1986
+ "warning": null,
1987
+ },
1988
+ ]
1989
+ `);
1990
});
1991
1992
it('should mark cascading layout updates', async () => {
2008
const timelineData = stopProfilingAndGetTimelineData();
2009
expect(timelineData.batchUIDToMeasuresMap.size).toBe(2);
2010
expect(timelineData.componentMeasures).toMatchInlineSnapshot(`
1971
- [
1972
- {
1973
- "componentName": "Example",
1974
- "duration": 10,
1975
- "timestamp": 10,
1976
- "type": "render",
1977
- "warning": null,
1978
- },
1979
- {
1980
- "componentName": "Example",
1981
- "duration": 1,
1982
- "timestamp": 20,
1983
- "type": "layout-effect-mount",
1984
- "warning": null,
1985
- },
1986
- {
1987
- "componentName": "Example",
1988
- "duration": 10,
1989
- "timestamp": 21,
1990
- "type": "render",
1991
- "warning": null,
1992
- },
1993
- ]
1994
- `);
2011
+ [
2012
+ {
2013
+ "componentName": "Example",
2014
+ "duration": 10,
2015
+ "timestamp": 10,
2016
+ "type": "render",
2017
+ "warning": null,
2018
+ },
2019
+ {
2020
+ "componentName": "Example",
2021
+ "duration": 1,
2022
+ "timestamp": 20,
2023
+ "type": "layout-effect-mount",
2024
+ "warning": null,
2025
+ },
2026
+ {
2027
+ "componentName": "Example",
2028
+ "duration": 10,
2029
+ "timestamp": 21,
2030
+ "type": "render",
2031
+ "warning": null,
2032
+ },
2033
+ ]
2034
+ `);
2035
expect(timelineData.schedulingEvents).toMatchInlineSnapshot(`
1996
- [
1997
- {
1998
- "lanes": "0b0000000000000000000000000100000",
1999
- "timestamp": 10,
2000
- "type": "schedule-render",
2001
- "warning": null,
2002
- },
2003
- {
2004
- "componentName": "Example",
2005
- "componentStack": "
2006
- in Example (at **)",
2007
- "lanes": "0b0000000000000000000000000000010",
2008
- "timestamp": 21,
2009
- "type": "schedule-state-update",
2010
- "warning": null,
2011
- },
2012
- ]
2013
- `);
2036
+ [
2037
+ {
2038
+ "lanes": "0b0000000000000000000000000100000",
2039
+ "timestamp": 10,
2040
+ "type": "schedule-render",
2041
+ "warning": null,
2042
+ },
2043
+ {
2044
+ "componentName": "Example",
2045
+ "componentStack": "
2046
+ in Example (at **)",
2047
+ "lanes": "0b0000000000000000000000000000010",
2048
+ "timestamp": 21,
2049
+ "type": "schedule-state-update",
2050
+ "warning": null,
2051
+ },
2052
+ ]
2053
+ `);
2054
});
2055
2056
it('should mark cascading passive updates', async () => {
2071
const timelineData = stopProfilingAndGetTimelineData();
2072
expect(timelineData.batchUIDToMeasuresMap.size).toBe(2);
2073
expect(timelineData.componentMeasures).toMatchInlineSnapshot(`
2034
- [
2035
- {
2036
- "componentName": "Example",
2037
- "duration": 10,
2038
- "timestamp": 10,
2039
- "type": "render",
2040
- "warning": null,
2041
- },
2042
- {
2043
- "componentName": "Example",
2044
- "duration": 1,
2045
- "timestamp": 20,
2046
- "type": "passive-effect-mount",
2047
- "warning": null,
2048
- },
2049
- {
2050
- "componentName": "Example",
2051
- "duration": 10,
2052
- "timestamp": 21,
2053
- "type": "render",
2054
- "warning": null,
2055
- },
2056
- ]
2057
- `);
2074
+ [
2075
+ {
2076
+ "componentName": "Example",
2077
+ "duration": 10,
2078
+ "timestamp": 10,
2079
+ "type": "render",
2080
+ "warning": null,
2081
+ },
2082
+ {
2083
+ "componentName": "Example",
2084
+ "duration": 1,
2085
+ "timestamp": 20,
2086
+ "type": "passive-effect-mount",
2087
+ "warning": null,
2088
+ },
2089
+ {
2090
+ "componentName": "Example",
2091
+ "duration": 10,
2092
+ "timestamp": 21,
2093
+ "type": "render",
2094
+ "warning": null,
2095
+ },
2096
+ ]
2097
+ `);
2098
expect(timelineData.schedulingEvents).toMatchInlineSnapshot(`
2059
- [
2060
- {
2061
- "lanes": "0b0000000000000000000000000100000",
2062
- "timestamp": 10,
2063
- "type": "schedule-render",
2064
- "warning": null,
2065
- },
2066
- {
2067
- "componentName": "Example",
2068
- "componentStack": "
2069
- in Example (at **)",
2070
- "lanes": "0b0000000000000000000000000100000",
2071
- "timestamp": 21,
2072
- "type": "schedule-state-update",
2073
- "warning": null,
2074
- },
2075
- ]
2076
- `);
2099
+ [
2100
+ {
2101
+ "lanes": "0b0000000000000000000000000100000",
2102
+ "timestamp": 10,
2103
+ "type": "schedule-render",
2104
+ "warning": null,
2105
+ },
2106
+ {
2107
+ "componentName": "Example",
2108
+ "componentStack": "
2109
+ in Example (at **)",
2110
+ "lanes": "0b0000000000000000000000000100000",
2111
+ "timestamp": 21,
2112
+ "type": "schedule-state-update",
2113
+ "warning": null,
2114
+ },
2115
+ ]
2116
+ `);
2117
});
2118
2119
it('should mark render phase updates', async () => {
2134
// Render phase updates should be retried as part of the same batch.
2135
expect(timelineData.batchUIDToMeasuresMap.size).toBe(1);
2136
expect(timelineData.componentMeasures).toMatchInlineSnapshot(`
2097
- [
2098
- {
2099
- "componentName": "Example",
2100
- "duration": 20,
2101
- "timestamp": 10,
2102
- "type": "render",
2103
- "warning": null,
2104
- },
2105
- ]
2106
- `);
2137
+ [
2138
+ {
2139
+ "componentName": "Example",
2140
+ "duration": 20,
2141
+ "timestamp": 10,
2142
+ "type": "render",
2143
+ "warning": null,
2144
+ },
2145
+ ]
2146
+ `);
2147
expect(timelineData.schedulingEvents).toMatchInlineSnapshot(`
2108
- [
2109
- {
2110
- "lanes": "0b0000000000000000000000000100000",
2111
- "timestamp": 10,
2112
- "type": "schedule-render",
2113
- "warning": null,
2114
- },
2115
- {
2116
- "componentName": "Example",
2117
- "componentStack": "
2118
- in Example (at **)",
2119
- "lanes": "0b0000000000000000000000000100000",
2120
- "timestamp": 20,
2121
- "type": "schedule-state-update",
2122
- "warning": null,
2123
- },
2124
- ]
2125
- `);
2148
+ [
2149
+ {
2150
+ "lanes": "0b0000000000000000000000000100000",
2151
+ "timestamp": 10,
2152
+ "type": "schedule-render",
2153
+ "warning": null,
2154
+ },
2155
+ {
2156
+ "componentName": "Example",
2157
+ "componentStack": "
2158
+ in Example (at **)",
2159
+ "lanes": "0b0000000000000000000000000100000",
2160
+ "timestamp": 20,
2161
+ "type": "schedule-state-update",
2162
+ "warning": null,
2163
+ },
2164
+ ]
2165
+ `);
2166
});
2167
2168
it('should mark concurrent render that throws', async () => {
2206
2207
const timelineData = stopProfilingAndGetTimelineData();
2208
expect(timelineData.componentMeasures).toMatchInlineSnapshot(`
2169
- [
2170
- {
2171
- "componentName": "ErrorBoundary",
2172
- "duration": 10,
2173
- "timestamp": 10,
2174
- "type": "render",
2175
- "warning": null,
2176
- },
2177
- {
2178
- "componentName": "ExampleThatThrows",
2179
- "duration": 0,
2180
- "timestamp": 20,
2181
- "type": "render",
2182
- "warning": null,
2183
- },
2184
- {
2185
- "componentName": "ErrorBoundary",
2186
- "duration": 10,
2187
- "timestamp": 20,
2188
- "type": "render",
2189
- "warning": null,
2190
- },
2191
- {
2192
- "componentName": "ExampleThatThrows",
2193
- "duration": 0,
2194
- "timestamp": 30,
2195
- "type": "render",
2196
- "warning": null,
2197
- },
2198
- {
2199
- "componentName": "ErrorBoundary",
2200
- "duration": 10,
2201
- "timestamp": 30,
2202
- "type": "render",
2203
- "warning": null,
2204
- },
2205
- ]
2206
- `);
2209
+ [
2210
+ {
2211
+ "componentName": "ErrorBoundary",
2212
+ "duration": 10,
2213
+ "timestamp": 10,
2214
+ "type": "render",
2215
+ "warning": null,
2216
+ },
2217
+ {
2218
+ "componentName": "ExampleThatThrows",
2219
+ "duration": 0,
2220
+ "timestamp": 20,
2221
+ "type": "render",
2222
+ "warning": null,
2223
+ },
2224
+ {
2225
+ "componentName": "ErrorBoundary",
2226
+ "duration": 10,
2227
+ "timestamp": 20,
2228
+ "type": "render",
2229
+ "warning": null,
2230
+ },
2231
+ {
2232
+ "componentName": "ExampleThatThrows",
2233
+ "duration": 0,
2234
+ "timestamp": 30,
2235
+ "type": "render",
2236
+ "warning": null,
2237
+ },
2238
+ {
2239
+ "componentName": "ErrorBoundary",
2240
+ "duration": 10,
2241
+ "timestamp": 30,
2242
+ "type": "render",
2243
+ "warning": null,
2244
+ },
2245
+ ]
2246
+ `);
2247
expect(timelineData.schedulingEvents).toMatchInlineSnapshot(`
2208
- [
2209
- {
2210
- "lanes": "0b0000000000000000000000000100000",
2211
- "timestamp": 10,
2212
- "type": "schedule-render",
2213
- "warning": null,
2214
- },
2215
- {
2216
- "componentName": "ErrorBoundary",
2217
- "componentStack": "
2218
- in ErrorBoundary (at **)",
2219
- "lanes": "0b0000000000000000000000000000010",
2220
- "timestamp": 30,
2221
- "type": "schedule-state-update",
2222
- "warning": null,
2223
- },
2224
- ]
2225
- `);
2248
+ [
2249
+ {
2250
+ "lanes": "0b0000000000000000000000000100000",
2251
+ "timestamp": 10,
2252
+ "type": "schedule-render",
2253
+ "warning": null,
2254
+ },
2255
+ {
2256
+ "componentName": "ErrorBoundary",
2257
+ "componentStack": "
2258
+ in ErrorBoundary (at **)",
2259
+ "lanes": "0b0000000000000000000000000000010",
2260
+ "timestamp": 30,
2261
+ "type": "schedule-state-update",
2262
+ "warning": null,
2263
+ },
2264
+ ]
2265
+ `);
2266
expect(timelineData.thrownErrors).toMatchInlineSnapshot(`
2227
- [
2228
- {
2229
- "componentName": "ExampleThatThrows",
2230
- "message": "Expected error",
2231
- "phase": "mount",
2232
- "timestamp": 20,
2233
- "type": "thrown-error",
2234
- },
2235
- {
2236
- "componentName": "ExampleThatThrows",
2237
- "message": "Expected error",
2238
- "phase": "mount",
2239
- "timestamp": 30,
2240
- "type": "thrown-error",
2241
- },
2242
- ]
2243
- `);
2267
+ [
2268
+ {
2269
+ "componentName": "ExampleThatThrows",
2270
+ "message": "Expected error",
2271
+ "phase": "mount",
2272
+ "timestamp": 20,
2273
+ "type": "thrown-error",
2274
+ },
2275
+ {
2276
+ "componentName": "ExampleThatThrows",
2277
+ "message": "Expected error",
2278
+ "phase": "mount",
2279
+ "timestamp": 30,
2280
+ "type": "thrown-error",
2281
+ },
2282
+ ]
2283
+ `);
2284
});
2285
2286
it('should mark passive and layout effects', async () => {
2347
2348
const timelineData = stopProfilingAndGetTimelineData();
2349
expect(timelineData.componentMeasures).toMatchInlineSnapshot(`
2310
- [
2311
- {
2312
- "componentName": "ComponentWithEffects",
2313
- "duration": 0,
2314
- "timestamp": 10,
2315
- "type": "render",
2316
- "warning": null,
2317
- },
2318
- {
2319
- "componentName": "ComponentWithEffects",
2320
- "duration": 0,
2321
- "timestamp": 10,
2322
- "type": "layout-effect-mount",
2323
- "warning": null,
2324
- },
2325
- {
2326
- "componentName": "ComponentWithEffects",
2327
- "duration": 0,
2328
- "timestamp": 10,
2329
- "type": "layout-effect-mount",
2330
- "warning": null,
2331
- },
2332
- {
2333
- "componentName": "ComponentWithEffects",
2334
- "duration": 0,
2335
- "timestamp": 10,
2336
- "type": "passive-effect-mount",
2337
- "warning": null,
2338
- },
2339
- {
2340
- "componentName": "ComponentWithEffects",
2341
- "duration": 0,
2342
- "timestamp": 10,
2343
- "type": "passive-effect-mount",
2344
- "warning": null,
2345
- },
2346
- {
2347
- "componentName": "ComponentWithEffects",
2348
- "duration": 0,
2349
- "timestamp": 10,
2350
- "type": "passive-effect-mount",
2351
- "warning": null,
2352
- },
2353
- {
2354
- "componentName": "ComponentWithEffects",
2355
- "duration": 0,
2356
- "timestamp": 10,
2357
- "type": "layout-effect-unmount",
2358
- "warning": null,
2359
- },
2360
- {
2361
- "componentName": "ComponentWithEffects",
2362
- "duration": 0,
2363
- "timestamp": 10,
2364
- "type": "layout-effect-unmount",
2365
- "warning": null,
2366
- },
2367
- {
2368
- "componentName": "ComponentWithEffects",
2369
- "duration": 0,
2370
- "timestamp": 10,
2371
- "type": "passive-effect-unmount",
2372
- "warning": null,
2373
- },
2374
- {
2375
- "componentName": "ComponentWithEffects",
2376
- "duration": 0,
2377
- "timestamp": 10,
2378
- "type": "passive-effect-unmount",
2379
- "warning": null,
2380
- },
2381
- {
2382
- "componentName": "ComponentWithEffects",
2383
- "duration": 0,
2384
- "timestamp": 10,
2385
- "type": "passive-effect-unmount",
2386
- "warning": null,
2387
- },
2388
- ]
2389
- `);
2350
+ [
2351
+ {
2352
+ "componentName": "ComponentWithEffects",
2353
+ "duration": 0,
2354
+ "timestamp": 10,
2355
+ "type": "render",
2356
+ "warning": null,
2357
+ },
2358
+ {
2359
+ "componentName": "ComponentWithEffects",
2360
+ "duration": 0,
2361
+ "timestamp": 10,
2362
+ "type": "layout-effect-mount",
2363
+ "warning": null,
2364
+ },
2365
+ {
2366
+ "componentName": "ComponentWithEffects",
2367
+ "duration": 0,
2368
+ "timestamp": 10,
2369
+ "type": "layout-effect-mount",
2370
+ "warning": null,
2371
+ },
2372
+ {
2373
+ "componentName": "ComponentWithEffects",
2374
+ "duration": 0,
2375
+ "timestamp": 10,
2376
+ "type": "passive-effect-mount",
2377
+ "warning": null,
2378
+ },
2379
+ {
2380
+ "componentName": "ComponentWithEffects",
2381
+ "duration": 0,
2382
+ "timestamp": 10,
2383
+ "type": "passive-effect-mount",
2384
+ "warning": null,
2385
+ },
2386
+ {
2387
+ "componentName": "ComponentWithEffects",
2388
+ "duration": 0,
2389
+ "timestamp": 10,
2390
+ "type": "passive-effect-mount",
2391
+ "warning": null,
2392
+ },
2393
+ {
2394
+ "componentName": "ComponentWithEffects",
2395
+ "duration": 0,
2396
+ "timestamp": 10,
2397
+ "type": "layout-effect-unmount",
2398
+ "warning": null,
2399
+ },
2400
+ {
2401
+ "componentName": "ComponentWithEffects",
2402
+ "duration": 0,
2403
+ "timestamp": 10,
2404
+ "type": "layout-effect-unmount",
2405
+ "warning": null,
2406
+ },
2407
+ {
2408
+ "componentName": "ComponentWithEffects",
2409
+ "duration": 0,
2410
+ "timestamp": 10,
2411
+ "type": "passive-effect-unmount",
2412
+ "warning": null,
2413
+ },
2414
+ {
2415
+ "componentName": "ComponentWithEffects",
2416
+ "duration": 0,
2417
+ "timestamp": 10,
2418
+ "type": "passive-effect-unmount",
2419
+ "warning": null,
2420
+ },
2421
+ {
2422
+ "componentName": "ComponentWithEffects",
2423
+ "duration": 0,
2424
+ "timestamp": 10,
2425
+ "type": "passive-effect-unmount",
2426
+ "warning": null,
2427
+ },
2428
+ ]
2429
+ `);
2430
expect(timelineData.batchUIDToMeasuresMap).toMatchInlineSnapshot(`
2391
- Map {
2392
- 1 => [
2393
- {
2394
- "batchUID": 1,
2395
- "depth": 0,
2396
- "duration": 0,
2397
- "lanes": "0b0000000000000000000000000100000",
2398
- "timestamp": 10,
2399
- "type": "render-idle",
2400
- },
2401
- {
2402
- "batchUID": 1,
2403
- "depth": 0,
2404
- "duration": 0,
2405
- "lanes": "0b0000000000000000000000000100000",
2406
- "timestamp": 10,
2407
- "type": "render",
2408
- },
2409
- {
2410
- "batchUID": 1,
2411
- "depth": 0,
2412
- "duration": 0,
2413
- "lanes": "0b0000000000000000000000000100000",
2414
- "timestamp": 10,
2415
- "type": "commit",
2416
- },
2417
- {
2418
- "batchUID": 1,
2419
- "depth": 1,
2420
- "duration": 0,
2421
- "lanes": "0b0000000000000000000000000100000",
2422
- "timestamp": 10,
2423
- "type": "layout-effects",
2424
- },
2425
- {
2426
- "batchUID": 1,
2427
- "depth": 0,
2428
- "duration": 0,
2429
- "lanes": "0b0000000000000000000000000100000",
2430
- "timestamp": 10,
2431
- "type": "passive-effects",
2432
- },
2433
- ],
2434
- 2 => [
2435
- {
2436
- "batchUID": 2,
2437
- "depth": 0,
2438
- "duration": 0,
2439
- "lanes": "0b0000000000000000000000000000010",
2440
- "timestamp": 10,
2441
- "type": "render-idle",
2442
- },
2443
- {
2444
- "batchUID": 2,
2445
- "depth": 0,
2446
- "duration": 0,
2447
- "lanes": "0b0000000000000000000000000000010",
2448
- "timestamp": 10,
2449
- "type": "render",
2450
- },
2451
- {
2452
- "batchUID": 2,
2453
- "depth": 0,
2454
- "duration": 0,
2455
- "lanes": "0b0000000000000000000000000000010",
2456
- "timestamp": 10,
2457
- "type": "commit",
2458
- },
2459
- {
2460
- "batchUID": 2,
2461
- "depth": 1,
2462
- "duration": 0,
2463
- "lanes": "0b0000000000000000000000000000010",
2464
- "timestamp": 10,
2465
- "type": "layout-effects",
2466
- },
2467
- {
2468
- "batchUID": 2,
2469
- "depth": 1,
2470
- "duration": 0,
2471
- "lanes": "0b0000000000000000000000000000010",
2472
- "timestamp": 10,
2473
- "type": "passive-effects",
2474
- },
2475
- ],
2476
- }
2477
- `);
2431
+ Map {
2432
+ 1 => [
2433
+ {
2434
+ "batchUID": 1,
2435
+ "depth": 0,
2436
+ "duration": 0,
2437
+ "lanes": "0b0000000000000000000000000100000",
2438
+ "timestamp": 10,
2439
+ "type": "render-idle",
2440
+ },
2441
+ {
2442
+ "batchUID": 1,
2443
+ "depth": 0,
2444
+ "duration": 0,
2445
+ "lanes": "0b0000000000000000000000000100000",
2446
+ "timestamp": 10,
2447
+ "type": "render",
2448
+ },
2449
+ {
2450
+ "batchUID": 1,
2451
+ "depth": 0,
2452
+ "duration": 0,
2453
+ "lanes": "0b0000000000000000000000000100000",
2454
+ "timestamp": 10,
2455
+ "type": "commit",
2456
+ },
2457
+ {
2458
+ "batchUID": 1,
2459
+ "depth": 1,
2460
+ "duration": 0,
2461
+ "lanes": "0b0000000000000000000000000100000",
2462
+ "timestamp": 10,
2463
+ "type": "layout-effects",
2464
+ },
2465
+ {
2466
+ "batchUID": 1,
2467
+ "depth": 0,
2468
+ "duration": 0,
2469
+ "lanes": "0b0000000000000000000000000100000",
2470
+ "timestamp": 10,
2471
+ "type": "passive-effects",
2472
+ },
2473
+ ],
2474
+ 2 => [
2475
+ {
2476
+ "batchUID": 2,
2477
+ "depth": 0,
2478
+ "duration": 0,
2479
+ "lanes": "0b0000000000000000000000000000010",
2480
+ "timestamp": 10,
2481
+ "type": "render-idle",
2482
+ },
2483
+ {
2484
+ "batchUID": 2,
2485
+ "depth": 0,
2486
+ "duration": 0,
2487
+ "lanes": "0b0000000000000000000000000000010",
2488
+ "timestamp": 10,
2489
+ "type": "render",
2490
+ },
2491
+ {
2492
+ "batchUID": 2,
2493
+ "depth": 0,
2494
+ "duration": 0,
2495
+ "lanes": "0b0000000000000000000000000000010",
2496
+ "timestamp": 10,
2497
+ "type": "commit",
2498
+ },
2499
+ {
2500
+ "batchUID": 2,
2501
+ "depth": 1,
2502
+ "duration": 0,
2503
+ "lanes": "0b0000000000000000000000000000010",
2504
+ "timestamp": 10,
2505
+ "type": "layout-effects",
2506
+ },
2507
+ {
2508
+ "batchUID": 2,
2509
+ "depth": 1,
2510
+ "duration": 0,
2511
+ "lanes": "0b0000000000000000000000000000010",
2512
+ "timestamp": 10,
2513
+ "type": "passive-effects",
2514
+ },
2515
+ ],
2516
+ }
2517
+ `);
2518
});
2519
2520
it('should generate component stacks for state update', async () => {
2542
2543
const timelineData = stopProfilingAndGetTimelineData();
2544
expect(timelineData.schedulingEvents).toMatchInlineSnapshot(`
2505
- [
2506
- {
2507
- "lanes": "0b0000000000000000000000000100000",
2508
- "timestamp": 10,
2509
- "type": "schedule-render",
2510
- "warning": null,
2511
- },
2512
- {
2513
- "componentName": "Child",
2514
- "componentStack": "
2515
- in Child (at **)
2516
- in CommponentWithChildren (at **)",
2517
- "lanes": "0b0000000000000000000000000100000",
2518
- "timestamp": 10,
2519
- "type": "schedule-state-update",
2520
- "warning": null,
2521
- },
2522
- ]
2523
- `);
2545
+ [
2546
+ {
2547
+ "lanes": "0b0000000000000000000000000100000",
2548
+ "timestamp": 10,
2549
+ "type": "schedule-render",
2550
+ "warning": null,
2551
+ },
2552
+ {
2553
+ "componentName": "Child",
2554
+ "componentStack": "
2555
+ in Child (at **)
2556
+ in CommponentWithChildren (at **)",
2557
+ "lanes": "0b0000000000000000000000000100000",
2558
+ "timestamp": 10,
2559
+ "type": "schedule-state-update",
2560
+ "warning": null,
2561
+ },
2562
+ ]
2563
+ `);
2564
});
2565
});
2566
});