@@ -138,16 +138,6 @@ export default class Store extends EventEmitter<{
138138 // Should the React Native style editor panel be shown?
139139 _isNativeStyleEditorSupported : boolean = false ;
140140
141- // Can the backend use the Storage API (e.g. localStorage)?
142- // If not, features like reload-and-profile will not work correctly and must be disabled.
143- _isBackendStorageAPISupported : boolean = false ;
144-
145- // Can DevTools use sync XHR requests?
146- // If not, features like reload-and-profile will not work correctly and must be disabled.
147- // This current limitation applies only to web extension builds
148- // and will need to be reconsidered in the future if we add support for reload to React Native.
149- _isSynchronousXHRSupported : boolean = false ;
150-
151141 _nativeStyleEditorValidAttributes : $ReadOnlyArray < string > | null = null ;
152142
153143 // Older backends don't support an explicit bridge protocol,
@@ -178,10 +168,12 @@ export default class Store extends EventEmitter<{
178168 // These options may be initially set by a configuration option when constructing the Store.
179169 _supportsInspectMatchingDOMElement : boolean = false ;
180170 _supportsClickToInspect : boolean = false ;
181- _supportsReloadAndProfile : boolean = false ;
182171 _supportsTimeline : boolean = false ;
183172 _supportsTraceUpdates : boolean = false ;
184173
174+ _isReloadAndProfileFrontendSupported : boolean = false ;
175+ _isReloadAndProfileBackendSupported : boolean = false ;
176+
185177 // These options default to false but may be updated as roots are added and removed.
186178 _rootSupportsBasicProfiling : boolean = false ;
187179 _rootSupportsTimelineProfiling : boolean = false ;
@@ -233,7 +225,7 @@ export default class Store extends EventEmitter<{
233225 this . _supportsClickToInspect = true ;
234226 }
235227 if ( supportsReloadAndProfile ) {
236- this . _supportsReloadAndProfile = true ;
228+ this . _isReloadAndProfileFrontendSupported = true ;
237229 }
238230 if ( supportsTimeline ) {
239231 this . _supportsTimeline = true ;
@@ -254,17 +246,13 @@ export default class Store extends EventEmitter<{
254246 ) ;
255247 bridge . addListener ( 'shutdown' , this . onBridgeShutdown ) ;
256248 bridge . addListener (
257- 'isBackendStorageAPISupported ' ,
258- this . onBackendStorageAPISupported ,
249+ 'isReloadAndProfileSupportedByBackend ' ,
250+ this . onBackendReloadAndProfileSupported ,
259251 ) ;
260252 bridge . addListener (
261253 'isNativeStyleEditorSupported' ,
262254 this . onBridgeNativeStyleEditorSupported ,
263255 ) ;
264- bridge . addListener (
265- 'isSynchronousXHRSupported' ,
266- this . onBridgeSynchronousXHRSupported ,
267- ) ;
268256 bridge . addListener (
269257 'unsupportedRendererVersion' ,
270258 this . onBridgeUnsupportedRendererVersion ,
@@ -452,13 +440,9 @@ export default class Store extends EventEmitter<{
452440 }
453441
454442 get supportsReloadAndProfile ( ) : boolean {
455- // Does the DevTools shell support reloading and eagerly injecting the renderer interface?
456- // And if so, can the backend use the localStorage API and sync XHR?
457- // All of these are currently required for the reload-and-profile feature to work.
458443 return (
459- this . _supportsReloadAndProfile &&
460- this . _isBackendStorageAPISupported &&
461- this . _isSynchronousXHRSupported
444+ this . _isReloadAndProfileFrontendSupported &&
445+ this . _isReloadAndProfileBackendSupported
462446 ) ;
463447 }
464448
@@ -1407,17 +1391,13 @@ export default class Store extends EventEmitter<{
14071391 ) ;
14081392 bridge . removeListener ( 'shutdown' , this . onBridgeShutdown ) ;
14091393 bridge . removeListener (
1410- 'isBackendStorageAPISupported ' ,
1411- this . onBackendStorageAPISupported ,
1394+ 'isReloadAndProfileSupportedByBackend ' ,
1395+ this . onBackendReloadAndProfileSupported ,
14121396 ) ;
14131397 bridge . removeListener (
14141398 'isNativeStyleEditorSupported' ,
14151399 this . onBridgeNativeStyleEditorSupported ,
14161400 ) ;
1417- bridge . removeListener (
1418- 'isSynchronousXHRSupported' ,
1419- this . onBridgeSynchronousXHRSupported ,
1420- ) ;
14211401 bridge . removeListener (
14221402 'unsupportedRendererVersion' ,
14231403 this . onBridgeUnsupportedRendererVersion ,
@@ -1432,18 +1412,10 @@ export default class Store extends EventEmitter<{
14321412 }
14331413 } ;
14341414
1435- onBackendStorageAPISupported: (
1436- isBackendStorageAPISupported : boolean ,
1437- ) => void = isBackendStorageAPISupported => {
1438- this . _isBackendStorageAPISupported = isBackendStorageAPISupported ;
1439-
1440- this . emit ( 'supportsReloadAndProfile' ) ;
1441- } ;
1442-
1443- onBridgeSynchronousXHRSupported: (
1444- isSynchronousXHRSupported : boolean ,
1445- ) => void = isSynchronousXHRSupported => {
1446- this . _isSynchronousXHRSupported = isSynchronousXHRSupported ;
1415+ onBackendReloadAndProfileSupported: (
1416+ isReloadAndProfileSupported : boolean ,
1417+ ) => void = isReloadAndProfileSupported => {
1418+ this . _isReloadAndProfileBackendSupported = isReloadAndProfileSupported ;
14471419
14481420 this . emit ( 'supportsReloadAndProfile' ) ;
14491421 } ;
0 commit comments