10
10
import EventEmitter from '../events' ;
11
11
import { inspect } from 'util' ;
12
12
import {
13
- PROFILING_FLAG_LEGACY_SUPPORT ,
13
+ PROFILING_FLAG_BASIC_SUPPORT ,
14
14
PROFILING_FLAG_TIMELINE_SUPPORT ,
15
15
TREE_OPERATION_ADD ,
16
16
TREE_OPERATION_REMOVE ,
@@ -74,8 +74,8 @@ type Config = {|
74
74
| } ;
75
75
76
76
export type Capabilities = { |
77
+ supportsBasicProfiling : boolean ,
77
78
hasOwnerMetadata : boolean ,
78
- supportsProfiling : boolean ,
79
79
supportsStrictMode : boolean ,
80
80
supportsTimeline : boolean ,
81
81
| } ;
@@ -91,8 +91,8 @@ export default class Store extends EventEmitter<{|
91
91
mutated : [ [ Array < number > , Map < number , number > ] ] ,
92
92
recordChangeDescriptions : [ ] ,
93
93
roots : [ ] ,
94
- rootSupportsProfiling : [ ] ,
95
- rootSupportsTimeline : [ ] ,
94
+ rootSupportsBasicProfiling : [ ] ,
95
+ rootSupportsTimelineProfiling : [ ] ,
96
96
supportsNativeStyleEditor : [ ] ,
97
97
supportsReloadAndProfile : [ ] ,
98
98
unsupportedBridgeProtocolDetected : [ ] ,
@@ -172,8 +172,8 @@ export default class Store extends EventEmitter<{|
172
172
_supportsTraceUpdates: boolean = false ;
173
173
174
174
// These options default to false but may be updated as roots are added and removed.
175
- _rootSupportsProfiling : boolean = false ;
176
- _rootSupportsTimeline : boolean = false ;
175
+ _rootSupportsBasicProfiling : boolean = false ;
176
+ _rootSupportsTimelineProfiling : boolean = false ;
177
177
178
178
_unsupportedBridgeProtocol: BridgeProtocol | null = null ;
179
179
_unsupportedRendererVersionDetected: boolean = false ;
@@ -410,13 +410,13 @@ export default class Store extends EventEmitter<{|
410
410
}
411
411
412
412
// At least one of the currently mounted roots support the Legacy profiler.
413
- get rootSupportsProfiling ( ) : boolean {
414
- return this . _rootSupportsProfiling ;
413
+ get rootSupportsBasicProfiling ( ) : boolean {
414
+ return this . _rootSupportsBasicProfiling ;
415
415
}
416
416
417
417
// At least one of the currently mounted roots support the Timeline profiler.
418
- get rootSupportsTimeline ( ) : boolean {
419
- return this . _rootSupportsTimeline ;
418
+ get rootSupportsTimelineProfiling ( ) : boolean {
419
+ return this . _rootSupportsTimelineProfiling ;
420
420
}
421
421
422
422
get supportsNativeInspection ( ) : boolean {
@@ -924,8 +924,8 @@ export default class Store extends EventEmitter<{|
924
924
const isStrictModeCompliant = operations [ i ] > 0 ;
925
925
i ++ ;
926
926
927
- const supportsProfiling =
928
- ( operations [ i ] & PROFILING_FLAG_LEGACY_SUPPORT ) !== 0 ;
927
+ const supportsBasicProfiling =
928
+ ( operations [ i ] & PROFILING_FLAG_BASIC_SUPPORT ) !== 0 ;
929
929
const supportsTimeline =
930
930
( operations [ i ] & PROFILING_FLAG_TIMELINE_SUPPORT ) !== 0 ;
931
931
i ++ ;
@@ -939,8 +939,8 @@ export default class Store extends EventEmitter<{|
939
939
this . _roots = this . _roots . concat ( id ) ;
940
940
this . _rootIDToRendererID . set ( id , rendererID ) ;
941
941
this . _rootIDToCapabilities . set ( id , {
942
+ supportsBasicProfiling,
942
943
hasOwnerMetadata,
943
- supportsProfiling,
944
944
supportsStrictMode,
945
945
supportsTimeline,
946
946
} ) ;
@@ -1249,34 +1249,38 @@ export default class Store extends EventEmitter<{|
1249
1249
}
1250
1250
1251
1251
if ( haveRootsChanged ) {
1252
- const prevRootSupportsProfiling = this . _rootSupportsProfiling ;
1253
- const prevRootSupportsTimeline = this . _rootSupportsTimeline ;
1252
+ const prevRootSupportsProfiling = this . _rootSupportsBasicProfiling ;
1253
+ const prevRootSupportsTimelineProfiling = this
1254
+ . _rootSupportsTimelineProfiling ;
1254
1255
1255
1256
this . _hasOwnerMetadata = false ;
1256
- this . _rootSupportsProfiling = false ;
1257
- this . _rootSupportsTimeline = false ;
1257
+ this . _rootSupportsBasicProfiling = false ;
1258
+ this . _rootSupportsTimelineProfiling = false ;
1258
1259
this . _rootIDToCapabilities . forEach (
1259
- ( { hasOwnerMetadata, supportsProfiling, supportsTimeline} ) => {
1260
+ ( { supportsBasicProfiling, hasOwnerMetadata, supportsTimeline} ) => {
1261
+ if ( supportsBasicProfiling ) {
1262
+ this . _rootSupportsBasicProfiling = true ;
1263
+ }
1260
1264
if ( hasOwnerMetadata ) {
1261
1265
this . _hasOwnerMetadata = true ;
1262
1266
}
1263
- if ( supportsProfiling ) {
1264
- this . _rootSupportsProfiling = true ;
1265
- }
1266
1267
if ( supportsTimeline ) {
1267
- this . _rootSupportsTimeline = true ;
1268
+ this . _rootSupportsTimelineProfiling = true ;
1268
1269
}
1269
1270
} ,
1270
1271
) ;
1271
1272
1272
1273
this . emit ( 'roots' ) ;
1273
1274
1274
- if ( this . _rootSupportsProfiling !== prevRootSupportsProfiling ) {
1275
- this . emit ( 'rootSupportsProfiling ' ) ;
1275
+ if ( this . _rootSupportsBasicProfiling !== prevRootSupportsProfiling ) {
1276
+ this . emit ( 'rootSupportsBasicProfiling ' ) ;
1276
1277
}
1277
1278
1278
- if ( this . _rootSupportsTimeline !== prevRootSupportsTimeline ) {
1279
- this . emit ( 'rootSupportsTimeline' ) ;
1279
+ if (
1280
+ this . _rootSupportsTimelineProfiling !==
1281
+ prevRootSupportsTimelineProfiling
1282
+ ) {
1283
+ this . emit ( 'rootSupportsTimelineProfiling' ) ;
1280
1284
}
1281
1285
}
1282
1286
0 commit comments