@@ -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 ;
@@ -233,7 +225,7 @@ export default class Store extends EventEmitter<{
233
225
this . _supportsClickToInspect = true ;
234
226
}
235
227
if ( supportsReloadAndProfile ) {
236
- this . _supportsReloadAndProfile = true ;
228
+ this . _isReloadAndProfileFrontendSupported = true ;
237
229
}
238
230
if ( supportsTimeline ) {
239
231
this . _supportsTimeline = true ;
@@ -254,17 +246,13 @@ export default class Store extends EventEmitter<{
254
246
) ;
255
247
bridge . addListener ( 'shutdown' , this . onBridgeShutdown ) ;
256
248
bridge . addListener (
257
- 'isBackendStorageAPISupported ' ,
258
- this . onBackendStorageAPISupported ,
249
+ 'isReloadAndProfileSupportedByBackend ' ,
250
+ this . onBackendReloadAndProfileSupported ,
259
251
) ;
260
252
bridge . addListener (
261
253
'isNativeStyleEditorSupported' ,
262
254
this . onBridgeNativeStyleEditorSupported ,
263
255
) ;
264
- bridge . addListener (
265
- 'isSynchronousXHRSupported' ,
266
- this . onBridgeSynchronousXHRSupported ,
267
- ) ;
268
256
bridge . addListener (
269
257
'unsupportedRendererVersion' ,
270
258
this . onBridgeUnsupportedRendererVersion ,
@@ -452,13 +440,9 @@ export default class Store extends EventEmitter<{
452
440
}
453
441
454
442
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.
458
443
return (
459
- this . _supportsReloadAndProfile &&
460
- this . _isBackendStorageAPISupported &&
461
- this . _isSynchronousXHRSupported
444
+ this . _isReloadAndProfileFrontendSupported &&
445
+ this . _isReloadAndProfileBackendSupported
462
446
) ;
463
447
}
464
448
@@ -1407,17 +1391,13 @@ export default class Store extends EventEmitter<{
1407
1391
) ;
1408
1392
bridge . removeListener ( 'shutdown' , this . onBridgeShutdown ) ;
1409
1393
bridge . removeListener (
1410
- 'isBackendStorageAPISupported ' ,
1411
- this . onBackendStorageAPISupported ,
1394
+ 'isReloadAndProfileSupportedByBackend ' ,
1395
+ this . onBackendReloadAndProfileSupported ,
1412
1396
) ;
1413
1397
bridge . removeListener (
1414
1398
'isNativeStyleEditorSupported' ,
1415
1399
this . onBridgeNativeStyleEditorSupported ,
1416
1400
) ;
1417
- bridge . removeListener (
1418
- 'isSynchronousXHRSupported' ,
1419
- this . onBridgeSynchronousXHRSupported ,
1420
- ) ;
1421
1401
bridge . removeListener (
1422
1402
'unsupportedRendererVersion' ,
1423
1403
this . onBridgeUnsupportedRendererVersion ,
@@ -1432,18 +1412,10 @@ export default class Store extends EventEmitter<{
1432
1412
}
1433
1413
} ;
1434
1414
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 ;
1447
1419
1448
1420
this . emit ( 'supportsReloadAndProfile' ) ;
1449
1421
} ;
0 commit comments