Skip to content

Commit 6f23540

Browse files
authored
cleanup[react-devtools]: remove unused supportsProfiling flag from store config (#29193)
Looks like this is unused
1 parent ea6e059 commit 6f23540

File tree

5 files changed

+5
-30
lines changed

5 files changed

+5
-30
lines changed

packages/react-devtools-extensions/src/main/getProfilingFlags.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,13 @@ function getProfilingFlags() {
99
// This avoids flashing a temporary "Profiling not supported" message in the Profiler tab,
1010
// after a user has clicked the "reload and profile" button.
1111
let isProfiling = false;
12-
let supportsProfiling = false;
1312

1413
if (localStorageGetItem(LOCAL_STORAGE_SUPPORTS_PROFILING_KEY) === 'true') {
15-
supportsProfiling = true;
1614
isProfiling = true;
1715
localStorageRemoveItem(LOCAL_STORAGE_SUPPORTS_PROFILING_KEY);
1816
}
1917

20-
return {isProfiling, supportsProfiling};
18+
return {isProfiling};
2119
}
2220

2321
export default getProfilingFlags;

packages/react-devtools-extensions/src/main/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,11 @@ function createBridge() {
8989
function createBridgeAndStore() {
9090
createBridge();
9191

92-
const {isProfiling, supportsProfiling} = getProfilingFlags();
92+
const {isProfiling} = getProfilingFlags();
9393

9494
store = new Store(bridge, {
9595
isProfiling,
9696
supportsReloadAndProfile: __IS_CHROME__ || __IS_EDGE__,
97-
supportsProfiling,
9897
// At this time, the timeline can only parse Chrome performance profiles.
9998
supportsTimeline: __IS_CHROME__,
10099
supportsTraceUpdates: true,

packages/react-devtools-fusebox/src/frontend.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,7 @@ import type {
2323
ViewElementSource,
2424
CanViewElementSource,
2525
} 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';
3227

3328
export function createBridge(wall?: Wall): FrontendBridge {
3429
if (wall != null) {

packages/react-devtools-inline/src/frontend.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,7 @@ import {
1616
import type {Wall} from 'react-devtools-shared/src/frontend/types';
1717
import type {FrontendBridge} from 'react-devtools-shared/src/bridge';
1818
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';
2520

2621
export function createStore(bridge: FrontendBridge, config?: Config): Store {
2722
return new Store(bridge, {

packages/react-devtools-shared/src/devtools/store.js

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,10 @@ const LOCAL_STORAGE_RECORD_CHANGE_DESCRIPTIONS_KEY =
6868

6969
type ErrorAndWarningTuples = Array<{id: number, index: number}>;
7070

71-
type Config = {
71+
export type Config = {
7272
checkBridgeProtocolCompatibility?: boolean,
7373
isProfiling?: boolean,
7474
supportsNativeInspection?: boolean,
75-
supportsProfiling?: boolean,
7675
supportsReloadAndProfile?: boolean,
7776
supportsTimeline?: boolean,
7877
supportsTraceUpdates?: boolean,
@@ -174,7 +173,6 @@ export default class Store extends EventEmitter<{
174173

175174
// These options may be initially set by a configuration option when constructing the Store.
176175
_supportsNativeInspection: boolean = true;
177-
_supportsProfiling: boolean = false;
178176
_supportsReloadAndProfile: boolean = false;
179177
_supportsTimeline: boolean = false;
180178
_supportsTraceUpdates: boolean = false;
@@ -214,15 +212,11 @@ export default class Store extends EventEmitter<{
214212

215213
const {
216214
supportsNativeInspection,
217-
supportsProfiling,
218215
supportsReloadAndProfile,
219216
supportsTimeline,
220217
supportsTraceUpdates,
221218
} = config;
222219
this._supportsNativeInspection = supportsNativeInspection !== false;
223-
if (supportsProfiling) {
224-
this._supportsProfiling = true;
225-
}
226220
if (supportsReloadAndProfile) {
227221
this._supportsReloadAndProfile = true;
228222
}
@@ -449,12 +443,6 @@ export default class Store extends EventEmitter<{
449443
return this._isNativeStyleEditorSupported;
450444
}
451445

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-
458446
get supportsReloadAndProfile(): boolean {
459447
// Does the DevTools shell support reloading and eagerly injecting the renderer interface?
460448
// And if so, can the backend use the localStorage API and sync XHR?

0 commit comments

Comments
 (0)