1010import EventEmitter from '../events' ;
1111import { inspect } from 'util' ;
1212import {
13- PROFILING_FLAG_LEGACY_SUPPORT ,
13+ PROFILING_FLAG_BASIC_SUPPORT ,
1414 PROFILING_FLAG_TIMELINE_SUPPORT ,
1515 TREE_OPERATION_ADD ,
1616 TREE_OPERATION_REMOVE ,
@@ -74,8 +74,8 @@ type Config = {|
7474| } ;
7575
7676export type Capabilities = { |
77+ supportsBasicProfiling : boolean ,
7778 hasOwnerMetadata : boolean ,
78- supportsProfiling : boolean ,
7979 supportsStrictMode : boolean ,
8080 supportsTimeline : boolean ,
8181| } ;
@@ -91,8 +91,8 @@ export default class Store extends EventEmitter<{|
9191 mutated : [ [ Array < number > , Map < number , number > ] ] ,
9292 recordChangeDescriptions : [ ] ,
9393 roots : [ ] ,
94- rootSupportsProfiling : [ ] ,
95- rootSupportsTimeline : [ ] ,
94+ rootSupportsBasicProfiling : [ ] ,
95+ rootSupportsTimelineProfiling : [ ] ,
9696 supportsNativeStyleEditor : [ ] ,
9797 supportsReloadAndProfile : [ ] ,
9898 unsupportedBridgeProtocolDetected : [ ] ,
@@ -172,8 +172,8 @@ export default class Store extends EventEmitter<{|
172172 _supportsTraceUpdates: boolean = false ;
173173
174174 // 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 ;
177177
178178 _unsupportedBridgeProtocol: BridgeProtocol | null = null ;
179179 _unsupportedRendererVersionDetected: boolean = false ;
@@ -410,13 +410,13 @@ export default class Store extends EventEmitter<{|
410410 }
411411
412412 // 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 ;
415415 }
416416
417417 // 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 ;
420420 }
421421
422422 get supportsNativeInspection ( ) : boolean {
@@ -924,8 +924,8 @@ export default class Store extends EventEmitter<{|
924924 const isStrictModeCompliant = operations [ i ] > 0 ;
925925 i ++ ;
926926
927- const supportsProfiling =
928- ( operations [ i ] & PROFILING_FLAG_LEGACY_SUPPORT ) !== 0 ;
927+ const supportsBasicProfiling =
928+ ( operations [ i ] & PROFILING_FLAG_BASIC_SUPPORT ) !== 0 ;
929929 const supportsTimeline =
930930 ( operations [ i ] & PROFILING_FLAG_TIMELINE_SUPPORT ) !== 0 ;
931931 i ++ ;
@@ -939,8 +939,8 @@ export default class Store extends EventEmitter<{|
939939 this . _roots = this . _roots . concat ( id ) ;
940940 this . _rootIDToRendererID . set ( id , rendererID ) ;
941941 this . _rootIDToCapabilities . set ( id , {
942+ supportsBasicProfiling,
942943 hasOwnerMetadata,
943- supportsProfiling,
944944 supportsStrictMode,
945945 supportsTimeline,
946946 } ) ;
@@ -1249,34 +1249,38 @@ export default class Store extends EventEmitter<{|
12491249 }
12501250
12511251 if ( haveRootsChanged ) {
1252- const prevRootSupportsProfiling = this . _rootSupportsProfiling ;
1253- const prevRootSupportsTimeline = this . _rootSupportsTimeline ;
1252+ const prevRootSupportsProfiling = this . _rootSupportsBasicProfiling ;
1253+ const prevRootSupportsTimelineProfiling = this
1254+ . _rootSupportsTimelineProfiling ;
12541255
12551256 this . _hasOwnerMetadata = false ;
1256- this . _rootSupportsProfiling = false ;
1257- this . _rootSupportsTimeline = false ;
1257+ this . _rootSupportsBasicProfiling = false ;
1258+ this . _rootSupportsTimelineProfiling = false ;
12581259 this . _rootIDToCapabilities . forEach (
1259- ( { hasOwnerMetadata, supportsProfiling, supportsTimeline} ) => {
1260+ ( { supportsBasicProfiling, hasOwnerMetadata, supportsTimeline} ) => {
1261+ if ( supportsBasicProfiling ) {
1262+ this . _rootSupportsBasicProfiling = true ;
1263+ }
12601264 if ( hasOwnerMetadata ) {
12611265 this . _hasOwnerMetadata = true ;
12621266 }
1263- if ( supportsProfiling ) {
1264- this . _rootSupportsProfiling = true ;
1265- }
12661267 if ( supportsTimeline ) {
1267- this . _rootSupportsTimeline = true ;
1268+ this . _rootSupportsTimelineProfiling = true ;
12681269 }
12691270 } ,
12701271 ) ;
12711272
12721273 this . emit ( 'roots' ) ;
12731274
1274- if ( this . _rootSupportsProfiling !== prevRootSupportsProfiling ) {
1275- this . emit ( 'rootSupportsProfiling ' ) ;
1275+ if ( this . _rootSupportsBasicProfiling !== prevRootSupportsProfiling ) {
1276+ this . emit ( 'rootSupportsBasicProfiling ' ) ;
12761277 }
12771278
1278- if ( this . _rootSupportsTimeline !== prevRootSupportsTimeline ) {
1279- this . emit ( 'rootSupportsTimeline' ) ;
1279+ if (
1280+ this . _rootSupportsTimelineProfiling !==
1281+ prevRootSupportsTimelineProfiling
1282+ ) {
1283+ this . emit ( 'rootSupportsTimelineProfiling' ) ;
12801284 }
12811285 }
12821286
0 commit comments