138
// Should the React Native style editor panel be shown?
139
_isNativeStyleEditorSupported: boolean = false;
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
-
141
_nativeStyleEditorValidAttributes: $ReadOnlyArray<string> | null = null;
142
143
// Older backends don't support an explicit bridge protocol,
168
// These options may be initially set by a configuration option when constructing the Store.
169
_supportsInspectMatchingDOMElement: boolean = false;
170
_supportsClickToInspect: boolean = false;
181
- _supportsReloadAndProfile: boolean = false;
171
_supportsTimeline: boolean = false;
172
_supportsTraceUpdates: boolean = false;
173
174
+ _isReloadAndProfileFrontendSupported: boolean = false;
175
+ _isReloadAndProfileBackendSupported: boolean = false;
176
+
177
// These options default to false but may be updated as roots are added and removed.
178
_rootSupportsBasicProfiling: boolean = false;
179
_rootSupportsTimelineProfiling: boolean = false;
226
this._supportsClickToInspect = true;
227
}
228
if (supportsReloadAndProfile) {
237
- this._supportsReloadAndProfile = true;
229
+ this._isReloadAndProfileFrontendSupported = true;
230
}
231
if (supportsTimeline) {
232
this._supportsTimeline = true;
247
);
248
bridge.addListener('shutdown', this.onBridgeShutdown);
249
bridge.addListener(
258
- 'isBackendStorageAPISupported',
259
- this.onBackendStorageAPISupported,
250
+ 'isReloadAndProfileSupportedByBackend',
251
+ this.onBackendReloadAndProfileSupported,
252
);
253
bridge.addListener(
254
'isNativeStyleEditorSupported',
255
this.onBridgeNativeStyleEditorSupported,
256
);
265
- bridge.addListener(
266
- 'isSynchronousXHRSupported',
267
- this.onBridgeSynchronousXHRSupported,
268
- );
257
bridge.addListener(
258
'unsupportedRendererVersion',
259
this.onBridgeUnsupportedRendererVersion,
457
}
458
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.
460
return (
476
- this._supportsReloadAndProfile &&
477
- this._isBackendStorageAPISupported &&
478
- this._isSynchronousXHRSupported
461
+ this._isReloadAndProfileFrontendSupported &&
462
+ this._isReloadAndProfileBackendSupported
463
);
464
}
465
1417
);
1418
bridge.removeListener('shutdown', this.onBridgeShutdown);
1419
bridge.removeListener(
1436
- 'isBackendStorageAPISupported',
1437
- this.onBackendStorageAPISupported,
1420
+ 'isReloadAndProfileSupportedByBackend',
1421
+ this.onBackendReloadAndProfileSupported,
1422
);
1423
bridge.removeListener(
1424
'isNativeStyleEditorSupported',
1425
this.onBridgeNativeStyleEditorSupported,
1426
);
1443
- bridge.removeListener(
1444
- 'isSynchronousXHRSupported',
1445
- this.onBridgeSynchronousXHRSupported,
1446
- );
1427
bridge.removeListener(
1428
'unsupportedRendererVersion',
1429
this.onBridgeUnsupportedRendererVersion,
1438
}
1439
};
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;
1445
1446
this.emit('supportsReloadAndProfile');
1447
};