@samitouri / QOS-React-1 / commits / 6f23540c7d

cleanup[react-devtools]: remove unused supportsProfiling flag from store config (#29193)

Looks like this is unused

Ruslan Lesiutin committed May 28, 2024 at 11:07 UTC 6f23540c7d39d7da2091284322008dadd055c031
5 files changed +5 -30
packages/react-devtools-extensions/src/main/getProfilingFlags.js
+1 -3
@@ -9,15 +9,13 @@ function getProfilingFlags() {
9 // This avoids flashing a temporary "Profiling not supported" message in the Profiler tab,
10 // after a user has clicked the "reload and profile" button.
11 let isProfiling = false;
12 - let supportsProfiling = false;
12
13 if (localStorageGetItem(LOCAL_STORAGE_SUPPORTS_PROFILING_KEY) === 'true') {
15 - supportsProfiling = true;
14 isProfiling = true;
15 localStorageRemoveItem(LOCAL_STORAGE_SUPPORTS_PROFILING_KEY);
16 }
17
20 - return {isProfiling, supportsProfiling};
18 + return {isProfiling};
19 }
20
21 export default getProfilingFlags;
packages/react-devtools-extensions/src/main/index.js
+1 -2
@@ -89,12 +89,11 @@ function createBridge() {
89 function createBridgeAndStore() {
90 createBridge();
91
92 - const {isProfiling, supportsProfiling} = getProfilingFlags();
92 + const {isProfiling} = getProfilingFlags();
93
94 store = new Store(bridge, {
95 isProfiling,
96 supportsReloadAndProfile: __IS_CHROME__ || __IS_EDGE__,
97 - supportsProfiling,
97 // At this time, the timeline can only parse Chrome performance profiles.
98 supportsTimeline: __IS_CHROME__,
99 supportsTraceUpdates: true,
packages/react-devtools-fusebox/src/frontend.js
+1 -6
@@ -23,12 +23,7 @@ import type {
23 ViewElementSource,
24 CanViewElementSource,
25 } from 'react-devtools-shared/src/devtools/views/DevTools';
26 -
27 -type Config = {
28 - checkBridgeProtocolCompatibility?: boolean,
29 - supportsNativeInspection?: boolean,
30 - supportsProfiling?: boolean,
31 -};
26 +import type {Config} from 'react-devtools-shared/src/devtools/store';
27
28 export function createBridge(wall?: Wall): FrontendBridge {
29 if (wall != null) {
packages/react-devtools-inline/src/frontend.js
+1 -6
@@ -16,12 +16,7 @@ import {
16 import type {Wall} from 'react-devtools-shared/src/frontend/types';
17 import type {FrontendBridge} from 'react-devtools-shared/src/bridge';
18 import type {Props} from 'react-devtools-shared/src/devtools/views/DevTools';
19 -
20 -type Config = {
21 - checkBridgeProtocolCompatibility?: boolean,
22 - supportsNativeInspection?: boolean,
23 - supportsProfiling?: boolean,
24 -};
19 +import type {Config} from 'react-devtools-shared/src/devtools/store';
20
21 export function createStore(bridge: FrontendBridge, config?: Config): Store {
22 return new Store(bridge, {
packages/react-devtools-shared/src/devtools/store.js
+1 -13
@@ -68,11 +68,10 @@ const LOCAL_STORAGE_RECORD_CHANGE_DESCRIPTIONS_KEY =
68
69 type ErrorAndWarningTuples = Array<{id: number, index: number}>;
70
71 -type Config = {
71 +export type Config = {
72 checkBridgeProtocolCompatibility?: boolean,
73 isProfiling?: boolean,
74 supportsNativeInspection?: boolean,
75 - supportsProfiling?: boolean,
75 supportsReloadAndProfile?: boolean,
76 supportsTimeline?: boolean,
77 supportsTraceUpdates?: boolean,
@@ -174,7 +173,6 @@ export default class Store extends EventEmitter<{
173
174 // These options may be initially set by a configuration option when constructing the Store.
175 _supportsNativeInspection: boolean = true;
177 - _supportsProfiling: boolean = false;
176 _supportsReloadAndProfile: boolean = false;
177 _supportsTimeline: boolean = false;
178 _supportsTraceUpdates: boolean = false;
@@ -214,15 +212,11 @@ export default class Store extends EventEmitter<{
212
213 const {
214 supportsNativeInspection,
217 - supportsProfiling,
215 supportsReloadAndProfile,
216 supportsTimeline,
217 supportsTraceUpdates,
218 } = config;
219 this._supportsNativeInspection = supportsNativeInspection !== false;
223 - if (supportsProfiling) {
224 - this._supportsProfiling = true;
225 - }
220 if (supportsReloadAndProfile) {
221 this._supportsReloadAndProfile = true;
222 }
@@ -449,12 +443,6 @@ export default class Store extends EventEmitter<{
443 return this._isNativeStyleEditorSupported;
444 }
445
452 - // This build of DevTools supports the legacy profiler.
453 - // This is a static flag, controlled by the Store config.
454 - get supportsProfiling(): boolean {
455 - return this._supportsProfiling;
456 - }
457 -
446 get supportsReloadAndProfile(): boolean {
447 // Does the DevTools shell support reloading and eagerly injecting the renderer interface?
448 // And if so, can the backend use the localStorage API and sync XHR?