@@ -29,30 +29,30 @@ describe('Timeline profiler', () => {
29
29
clearedMarks = [ ] ;
30
30
marks = [ ] ;
31
31
32
- // Remove file-system specific bits of information from the module range marks.
33
- function filterModuleRanges ( markName ) {
32
+ // Remove file-system specific bits or version-specific bits of information from the module range marks.
33
+ function filterMarkData ( markName ) {
34
34
if ( markName . startsWith ( '--react-internal-module-start' ) ) {
35
35
return `${ markName . substr ( 0 , 29 ) } -<filtered-file-system-path>` ;
36
36
} else if ( markName . startsWith ( '--react-internal-module-stop' ) ) {
37
37
return `${ markName . substr ( 0 , 28 ) } -<filtered-file-system-path>` ;
38
+ } else if ( markName . startsWith ( '--react-version' ) ) {
39
+ return `${ markName . substr ( 0 , 15 ) } -<filtered-version>` ;
40
+ } else {
41
+ return markName ;
38
42
}
39
43
}
40
44
41
45
// This is not a true polyfill, but it gives us enough to capture marks.
42
46
// Reference: https://developer.mozilla.org/en-US/docs/Web/API/User_Timing_API
43
47
return {
44
48
clearMarks ( markName ) {
45
- if ( markName . startsWith ( '--react-internal-module' ) ) {
46
- markName = filterModuleRanges ( markName ) ;
47
- }
49
+ markName = filterMarkData ( markName ) ;
48
50
49
51
clearedMarks . push ( markName ) ;
50
52
marks = marks . filter ( mark => mark !== markName ) ;
51
53
} ,
52
54
mark ( markName , markOptions ) {
53
- if ( markName . startsWith ( '--react-internal-module' ) ) {
54
- markName = filterModuleRanges ( markName ) ;
55
- }
55
+ markName = filterMarkData ( markName ) ;
56
56
57
57
if ( featureDetectionMarkName === null ) {
58
58
featureDetectionMarkName = markName ;
@@ -127,7 +127,7 @@ describe('Timeline profiler', () => {
127
127
"--render-start-1",
128
128
"--render-stop",
129
129
"--commit-start-1",
130
- "--react-version-17.0.3 ",
130
+ "--react-version-<filtered-version> ",
131
131
"--profiler-version-1",
132
132
"--react-internal-module-start-<filtered-file-system-path>",
133
133
"--react-internal-module-stop-<filtered-file-system-path>",
@@ -157,7 +157,7 @@ describe('Timeline profiler', () => {
157
157
"--render-start-16",
158
158
"--render-stop",
159
159
"--commit-start-16",
160
- "--react-version-17.0.3 ",
160
+ "--react-version-<filtered-version> ",
161
161
"--profiler-version-1",
162
162
"--react-internal-module-start-<filtered-file-system-path>",
163
163
"--react-internal-module-stop-<filtered-file-system-path>",
@@ -219,7 +219,7 @@ describe('Timeline profiler', () => {
219
219
"--suspense-suspend-0-Example-mount-1-",
220
220
"--render-stop",
221
221
"--commit-start-1",
222
- "--react-version-17.0.3 ",
222
+ "--react-version-<filtered-version> ",
223
223
"--profiler-version-1",
224
224
"--react-internal-module-start-<filtered-file-system-path>",
225
225
"--react-internal-module-stop-<filtered-file-system-path>",
@@ -261,7 +261,7 @@ describe('Timeline profiler', () => {
261
261
"--suspense-suspend-0-Example-mount-1-",
262
262
"--render-stop",
263
263
"--commit-start-1",
264
- "--react-version-17.0.3 ",
264
+ "--react-version-<filtered-version> ",
265
265
"--profiler-version-1",
266
266
"--react-internal-module-start-<filtered-file-system-path>",
267
267
"--react-internal-module-stop-<filtered-file-system-path>",
@@ -308,7 +308,7 @@ describe('Timeline profiler', () => {
308
308
"--suspense-suspend-0-Example-mount-16-",
309
309
"--render-stop",
310
310
"--commit-start-16",
311
- "--react-version-17.0.3 ",
311
+ "--react-version-<filtered-version> ",
312
312
"--profiler-version-1",
313
313
"--react-internal-module-start-<filtered-file-system-path>",
314
314
"--react-internal-module-stop-<filtered-file-system-path>",
@@ -359,7 +359,7 @@ describe('Timeline profiler', () => {
359
359
"--suspense-suspend-0-Example-mount-16-",
360
360
"--render-stop",
361
361
"--commit-start-16",
362
- "--react-version-17.0.3 ",
362
+ "--react-version-<filtered-version> ",
363
363
"--profiler-version-1",
364
364
"--react-internal-module-start-<filtered-file-system-path>",
365
365
"--react-internal-module-stop-<filtered-file-system-path>",
@@ -410,7 +410,7 @@ describe('Timeline profiler', () => {
410
410
"--component-render-stop",
411
411
"--render-stop",
412
412
"--commit-start-16",
413
- "--react-version-17.0.3 ",
413
+ "--react-version-<filtered-version> ",
414
414
"--profiler-version-1",
415
415
"--react-internal-module-start-<filtered-file-system-path>",
416
416
"--react-internal-module-stop-<filtered-file-system-path>",
@@ -423,7 +423,7 @@ describe('Timeline profiler', () => {
423
423
"--component-render-stop",
424
424
"--render-stop",
425
425
"--commit-start-1",
426
- "--react-version-17.0.3 ",
426
+ "--react-version-<filtered-version> ",
427
427
"--profiler-version-1",
428
428
"--react-internal-module-start-<filtered-file-system-path>",
429
429
"--react-internal-module-stop-<filtered-file-system-path>",
@@ -463,7 +463,7 @@ describe('Timeline profiler', () => {
463
463
"--component-render-stop",
464
464
"--render-stop",
465
465
"--commit-start-16",
466
- "--react-version-17.0.3 ",
466
+ "--react-version-<filtered-version> ",
467
467
"--profiler-version-1",
468
468
"--react-internal-module-start-<filtered-file-system-path>",
469
469
"--react-internal-module-stop-<filtered-file-system-path>",
@@ -476,7 +476,7 @@ describe('Timeline profiler', () => {
476
476
"--component-render-stop",
477
477
"--render-stop",
478
478
"--commit-start-1",
479
- "--react-version-17.0.3 ",
479
+ "--react-version-<filtered-version> ",
480
480
"--profiler-version-1",
481
481
"--react-internal-module-start-<filtered-file-system-path>",
482
482
"--react-internal-module-stop-<filtered-file-system-path>",
@@ -528,7 +528,7 @@ describe('Timeline profiler', () => {
528
528
"--component-render-stop",
529
529
"--render-stop",
530
530
"--commit-start-16",
531
- "--react-version-17.0.3 ",
531
+ "--react-version-<filtered-version> ",
532
532
"--profiler-version-1",
533
533
"--react-internal-module-start-<filtered-file-system-path>",
534
534
"--react-internal-module-stop-<filtered-file-system-path>",
@@ -581,7 +581,7 @@ describe('Timeline profiler', () => {
581
581
"--component-render-stop",
582
582
"--render-stop",
583
583
"--commit-start-16",
584
- "--react-version-17.0.3 ",
584
+ "--react-version-<filtered-version> ",
585
585
"--profiler-version-1",
586
586
"--react-internal-module-start-<filtered-file-system-path>",
587
587
"--react-internal-module-stop-<filtered-file-system-path>",
@@ -621,7 +621,7 @@ describe('Timeline profiler', () => {
621
621
"--component-render-stop",
622
622
"--render-stop",
623
623
"--commit-start-16",
624
- "--react-version-17.0.3 ",
624
+ "--react-version-<filtered-version> ",
625
625
"--profiler-version-1",
626
626
"--react-internal-module-start-<filtered-file-system-path>",
627
627
"--react-internal-module-stop-<filtered-file-system-path>",
@@ -636,7 +636,7 @@ describe('Timeline profiler', () => {
636
636
"--component-render-stop",
637
637
"--render-stop",
638
638
"--commit-start-1",
639
- "--react-version-17.0.3 ",
639
+ "--react-version-<filtered-version> ",
640
640
"--profiler-version-1",
641
641
"--react-internal-module-start-<filtered-file-system-path>",
642
642
"--react-internal-module-stop-<filtered-file-system-path>",
@@ -670,7 +670,7 @@ describe('Timeline profiler', () => {
670
670
"--component-render-stop",
671
671
"--render-stop",
672
672
"--commit-start-16",
673
- "--react-version-17.0.3 ",
673
+ "--react-version-<filtered-version> ",
674
674
"--profiler-version-1",
675
675
"--react-internal-module-start-<filtered-file-system-path>",
676
676
"--react-internal-module-stop-<filtered-file-system-path>",
@@ -688,7 +688,7 @@ describe('Timeline profiler', () => {
688
688
"--component-render-stop",
689
689
"--render-stop",
690
690
"--commit-start-16",
691
- "--react-version-17.0.3 ",
691
+ "--react-version-<filtered-version> ",
692
692
"--profiler-version-1",
693
693
"--react-internal-module-start-<filtered-file-system-path>",
694
694
"--react-internal-module-stop-<filtered-file-system-path>",
@@ -720,7 +720,7 @@ describe('Timeline profiler', () => {
720
720
"--component-render-stop",
721
721
"--render-stop",
722
722
"--commit-start-16",
723
- "--react-version-17.0.3 ",
723
+ "--react-version-<filtered-version> ",
724
724
"--profiler-version-1",
725
725
"--react-internal-module-start-<filtered-file-system-path>",
726
726
"--react-internal-module-stop-<filtered-file-system-path>",
@@ -770,7 +770,7 @@ describe('Timeline profiler', () => {
770
770
"--error-ExampleThatThrows-mount-Expected error",
771
771
"--render-stop",
772
772
"--commit-start-1",
773
- "--react-version-17.0.3 ",
773
+ "--react-version-<filtered-version> ",
774
774
"--profiler-version-1",
775
775
"--react-internal-module-start-<filtered-file-system-path>",
776
776
"--react-internal-module-stop-<filtered-file-system-path>",
@@ -784,7 +784,7 @@ describe('Timeline profiler', () => {
784
784
"--component-render-stop",
785
785
"--render-stop",
786
786
"--commit-start-1",
787
- "--react-version-17.0.3 ",
787
+ "--react-version-<filtered-version> ",
788
788
"--profiler-version-1",
789
789
"--react-internal-module-start-<filtered-file-system-path>",
790
790
"--react-internal-module-stop-<filtered-file-system-path>",
@@ -850,7 +850,7 @@ describe('Timeline profiler', () => {
850
850
"--error-ExampleThatThrows-mount-Expected error",
851
851
"--render-stop",
852
852
"--commit-start-16",
853
- "--react-version-17.0.3 ",
853
+ "--react-version-<filtered-version> ",
854
854
"--profiler-version-1",
855
855
"--react-internal-module-start-<filtered-file-system-path>",
856
856
"--react-internal-module-stop-<filtered-file-system-path>",
@@ -863,7 +863,7 @@ describe('Timeline profiler', () => {
863
863
"--component-render-stop",
864
864
"--render-stop",
865
865
"--commit-start-1",
866
- "--react-version-17.0.3 ",
866
+ "--react-version-<filtered-version> ",
867
867
"--profiler-version-1",
868
868
"--react-internal-module-start-<filtered-file-system-path>",
869
869
"--react-internal-module-stop-<filtered-file-system-path>",
@@ -929,7 +929,7 @@ describe('Timeline profiler', () => {
929
929
"--component-render-stop",
930
930
"--render-stop",
931
931
"--commit-start-16",
932
- "--react-version-17.0.3 ",
932
+ "--react-version-<filtered-version> ",
933
933
"--profiler-version-1",
934
934
"--react-internal-module-start-<filtered-file-system-path>",
935
935
"--react-internal-module-stop-<filtered-file-system-path>",
@@ -985,7 +985,7 @@ describe('Timeline profiler', () => {
985
985
"--render-start-1",
986
986
"--render-stop",
987
987
"--commit-start-1",
988
- "--react-version-17.0.3 ",
988
+ "--react-version-<filtered-version> ",
989
989
"--profiler-version-1",
990
990
"--react-internal-module-start-<filtered-file-system-path>",
991
991
"--react-internal-module-stop-<filtered-file-system-path>",
@@ -1019,7 +1019,7 @@ describe('Timeline profiler', () => {
1019
1019
"--render-start-1",
1020
1020
"--render-stop",
1021
1021
"--commit-start-1",
1022
- "--react-version-17.0.3 ",
1022
+ "--react-version-<filtered-version> ",
1023
1023
"--profiler-version-1",
1024
1024
"--react-internal-module-start-<filtered-file-system-path>",
1025
1025
"--react-internal-module-stop-<filtered-file-system-path>",
@@ -1069,7 +1069,7 @@ describe('Timeline profiler', () => {
1069
1069
"--component-render-stop",
1070
1070
"--render-stop",
1071
1071
"--commit-start-1",
1072
- "--react-version-17.0.3 ",
1072
+ "--react-version-<filtered-version> ",
1073
1073
"--profiler-version-1",
1074
1074
"--react-internal-module-start-<filtered-file-system-path>",
1075
1075
"--react-internal-module-stop-<filtered-file-system-path>",
@@ -1109,7 +1109,7 @@ describe('Timeline profiler', () => {
1109
1109
"--component-render-stop",
1110
1110
"--render-stop",
1111
1111
"--commit-start-4",
1112
- "--react-version-17.0.3 ",
1112
+ "--react-version-<filtered-version> ",
1113
1113
"--profiler-version-1",
1114
1114
"--react-internal-module-start-<filtered-file-system-path>",
1115
1115
"--react-internal-module-stop-<filtered-file-system-path>",
0 commit comments