@@ -138,16 +138,6 @@ export default class Store extends EventEmitter<{
138
138
// Should the React Native style editor panel be shown?
139
139
_isNativeStyleEditorSupported : boolean = false ;
140
140
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
-
151
141
_nativeStyleEditorValidAttributes : $ReadOnlyArray < string > | null = null ;
152
142
153
143
// Older backends don't support an explicit bridge protocol,
@@ -178,10 +168,12 @@ export default class Store extends EventEmitter<{
178
168
// These options may be initially set by a configuration option when constructing the Store.
179
169
_supportsInspectMatchingDOMElement : boolean = false ;
180
170
_supportsClickToInspect : boolean = false ;
181
- _supportsReloadAndProfile : boolean = false ;
182
171
_supportsTimeline : boolean = false ;
183
172
_supportsTraceUpdates : boolean = false ;
184
173
174
+ _isReloadAndProfileFrontendSupported : boolean = false ;
175
+ _isReloadAndProfileBackendSupported : boolean = false ;
176
+
185
177
// These options default to false but may be updated as roots are added and removed.
186
178
_rootSupportsBasicProfiling : boolean = false ;
187
179
_rootSupportsTimelineProfiling : boolean = false ;
@@ -234,7 +226,7 @@ export default class Store extends EventEmitter<{
234
226
this . _supportsClickToInspect = true ;
235
227
}
236
228
if ( supportsReloadAndProfile ) {
237
- this . _supportsReloadAndProfile = true ;
229
+ this . _isReloadAndProfileFrontendSupported = true ;
238
230
}
239
231
if ( supportsTimeline ) {
240
232
this . _supportsTimeline = true ;
@@ -255,17 +247,13 @@ export default class Store extends EventEmitter<{
255
247
) ;
256
248
bridge . addListener ( 'shutdown' , this . onBridgeShutdown ) ;
257
249
bridge . addListener (
258
- 'isBackendStorageAPISupported ' ,
259
- this . onBackendStorageAPISupported ,
250
+ 'isReloadAndProfileSupportedByBackend ' ,
251
+ this . onBackendReloadAndProfileSupported ,
260
252
) ;
261
253
bridge . addListener (
262
254
'isNativeStyleEditorSupported' ,
263
255
this . onBridgeNativeStyleEditorSupported ,
264
256
) ;
265
- bridge . addListener (
266
- 'isSynchronousXHRSupported' ,
267
- this . onBridgeSynchronousXHRSupported ,
268
- ) ;
269
257
bridge . addListener (
270
258
'unsupportedRendererVersion' ,
271
259
this . onBridgeUnsupportedRendererVersion ,
@@ -469,13 +457,9 @@ export default class Store extends EventEmitter<{
469
457
}
470
458
471
459
get supportsReloadAndProfile ( ) : boolean {
472
- // Does the DevTools shell support reloading and eagerly injecting the renderer interface?
473
- // And if so, can the backend use the localStorage API and sync XHR?
474
- // All of these are currently required for the reload-and-profile feature to work.
475
460
return (
476
- this . _supportsReloadAndProfile &&
477
- this . _isBackendStorageAPISupported &&
478
- this . _isSynchronousXHRSupported
461
+ this . _isReloadAndProfileFrontendSupported &&
462
+ this . _isReloadAndProfileBackendSupported
479
463
) ;
480
464
}
481
465
@@ -1433,17 +1417,13 @@ export default class Store extends EventEmitter<{
1433
1417
) ;
1434
1418
bridge . removeListener ( 'shutdown' , this . onBridgeShutdown ) ;
1435
1419
bridge . removeListener (
1436
- 'isBackendStorageAPISupported ' ,
1437
- this . onBackendStorageAPISupported ,
1420
+ 'isReloadAndProfileSupportedByBackend ' ,
1421
+ this . onBackendReloadAndProfileSupported ,
1438
1422
) ;
1439
1423
bridge . removeListener (
1440
1424
'isNativeStyleEditorSupported' ,
1441
1425
this . onBridgeNativeStyleEditorSupported ,
1442
1426
) ;
1443
- bridge . removeListener (
1444
- 'isSynchronousXHRSupported' ,
1445
- this . onBridgeSynchronousXHRSupported ,
1446
- ) ;
1447
1427
bridge . removeListener (
1448
1428
'unsupportedRendererVersion' ,
1449
1429
this . onBridgeUnsupportedRendererVersion ,
@@ -1458,18 +1438,10 @@ export default class Store extends EventEmitter<{
1458
1438
}
1459
1439
} ;
1460
1440
1461
- onBackendStorageAPISupported: (
1462
- isBackendStorageAPISupported : boolean ,
1463
- ) => void = isBackendStorageAPISupported => {
1464
- this . _isBackendStorageAPISupported = isBackendStorageAPISupported ;
1465
-
1466
- this . emit ( 'supportsReloadAndProfile' ) ;
1467
- } ;
1468
-
1469
- onBridgeSynchronousXHRSupported: (
1470
- isSynchronousXHRSupported : boolean ,
1471
- ) => void = isSynchronousXHRSupported => {
1472
- this . _isSynchronousXHRSupported = isSynchronousXHRSupported ;
1441
+ onBackendReloadAndProfileSupported: (
1442
+ isReloadAndProfileSupported : boolean ,
1443
+ ) => void = isReloadAndProfileSupported => {
1444
+ this . _isReloadAndProfileBackendSupported = isReloadAndProfileSupported ;
1473
1445
1474
1446
this . emit ( 'supportsReloadAndProfile' ) ;
1475
1447
} ;
0 commit comments