Skip to content

Commit fd6e130

Browse files
authored
Default native inspections config false (#29784)
## Summary To make the config `supportsNativeInspection` explicit, set it to default to `false` and only allow it in the extension. ## How did you test this change? When disabled on **React DevTools extension** <img width="419" alt="Screenshot 2024-06-06 at 17 34 02" src="https://github.com/facebook/react/assets/5188459/0052b645-2214-475c-8b41-4f9207ca3343"> When enabled on **React DevTools extension** (the chosen config) <img width="425" alt="Screenshot 2024-06-06 at 17 34 53" src="https://github.com/facebook/react/assets/5188459/df34ec8e-2039-4984-86c8-74feaf89bbdd"> When enabled on **React DevTools in Fusebox** <img width="1170" alt="Screenshot 2024-06-06 at 17 29 24" src="https://github.com/facebook/react/assets/5188459/ae52274b-583d-463c-8482-2323d502f4c0"> When disabled on **React DevTools in Fusebox** (the chosen config) <img width="1453" alt="Screenshot 2024-06-06 at 17 30 31" src="https://github.com/facebook/react/assets/5188459/cba5b51b-c973-412d-8ad0-382a4f9bf115"> When enabled on **React DevTools Inline** <img width="915" alt="Screenshot 2024-06-06 at 17 24 20" src="https://github.com/facebook/react/assets/5188459/f0d61d99-2b75-4a87-a19e-db431be697e3"> When disabled on **React DevTools Inline** (the chosen config) <img width="844" alt="Screenshot 2024-06-06 at 17 19 39" src="https://github.com/facebook/react/assets/5188459/d3bcc8a7-535d-4656-844d-f9f89bb2b248"> When enabled on **React DevTools standalone** <img width="1227" alt="Screenshot 2024-06-06 at 17 23 16" src="https://github.com/facebook/react/assets/5188459/174fbae6-1412-4539-bbe6-e1d0e8baa7d5"> When disabled on **React DevTools standalone** (the chosen config) <img width="844" alt="Screenshot 2024-06-06 at 17 19 39" src="https://github.com/facebook/react/assets/5188459/00c46907-e3a6-4766-a1b4-dd088cac2157">
1 parent 99da76f commit fd6e130

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

packages/react-devtools-core/src/standalone.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,6 @@ function initialize(socket: WebSocket) {
279279
// $FlowFixMe[incompatible-call] found when upgrading Flow
280280
store = new Store(bridge, {
281281
checkBridgeProtocolCompatibility: true,
282-
supportsNativeInspection: false,
283282
supportsTraceUpdates: true,
284283
});
285284

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ function createBridgeAndStore() {
9797
// At this time, the timeline can only parse Chrome performance profiles.
9898
supportsTimeline: __IS_CHROME__,
9999
supportsTraceUpdates: true,
100+
supportsNativeInspection: true,
100101
});
101102

102103
if (!isProfiling) {

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ export function createStore(bridge: FrontendBridge, config?: Config): Store {
3737
return new Store(bridge, {
3838
checkBridgeProtocolCompatibility: true,
3939
supportsTraceUpdates: true,
40-
supportsNativeInspection: false,
4140
...config,
4241
});
4342
}

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ export function createStore(bridge: FrontendBridge, config?: Config): Store {
2323
checkBridgeProtocolCompatibility: true,
2424
supportsTraceUpdates: true,
2525
supportsTimeline: true,
26-
supportsNativeInspection: false,
2726
...config,
2827
});
2928
}

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ export default class Store extends EventEmitter<{
172172
_rootIDToRendererID: Map<number, number> = new Map();
173173

174174
// These options may be initially set by a configuration option when constructing the Store.
175-
_supportsNativeInspection: boolean = true;
175+
_supportsNativeInspection: boolean = false;
176176
_supportsReloadAndProfile: boolean = false;
177177
_supportsTimeline: boolean = false;
178178
_supportsTraceUpdates: boolean = false;
@@ -216,7 +216,9 @@ export default class Store extends EventEmitter<{
216216
supportsTimeline,
217217
supportsTraceUpdates,
218218
} = config;
219-
this._supportsNativeInspection = supportsNativeInspection !== false;
219+
if (supportsNativeInspection) {
220+
this._supportsNativeInspection = true;
221+
}
220222
if (supportsReloadAndProfile) {
221223
this._supportsReloadAndProfile = true;
222224
}

0 commit comments

Comments
 (0)