Skip to content

Commit 53b7f0e

Browse files
hoxyqfacebook-github-bot
authored andcommitted
upgrade React Native on a new RDT backend (#46669)
Summary: Pull Request resolved: #46669 # Changelog: [Internal] In React DevTools 6.0.0, settings manager is [no longer used](facebook/react#30986), because the host of the Backend is responsible for settings persistance. Also, `installHook()` call was removed from the top level of the JavaScript module and now we need to call `initialize()` explicitly. The logic for persisting settings will be added in one of the next diffs at the top. Reviewed By: huntie Differential Revision: D62967059 fbshipit-source-id: 5022546aab02540f38c8d2e2f2e7dfeb82863f3f
1 parent 6173d6c commit 53b7f0e

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

packages/react-native/Libraries/Core/setUpReactDevTools.js

+9-6
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,22 @@ import type {Domain} from '../../src/private/fusebox/setUpFuseboxReactDevToolsDi
1515
if (__DEV__) {
1616
// Register dispatcher on global, which can be used later by Chrome DevTools frontend
1717
require('../../src/private/fusebox/setUpFuseboxReactDevToolsDispatcher');
18+
const {
19+
initialize,
20+
connectToDevTools,
21+
connectWithCustomMessagingProtocol,
22+
} = require('react-devtools-core');
1823

1924
// Install hook before React is loaded.
20-
const reactDevTools = require('react-devtools-core');
25+
initialize();
26+
2127
// This should be defined in DEV, otherwise error is expected.
2228
const fuseboxReactDevToolsDispatcher =
2329
global.__FUSEBOX_REACT_DEVTOOLS_DISPATCHER__;
2430
const reactDevToolsFuseboxGlobalBindingName =
2531
fuseboxReactDevToolsDispatcher.BINDING_NAME;
2632

2733
const ReactNativeStyleAttributes = require('../Components/View/ReactNativeStyleAttributes');
28-
const devToolsSettingsManager = require('../DevToolsSettings/DevToolsSettingsManager');
2934
const resolveRNStyle = require('../StyleSheet/flattenStyle');
3035

3136
let disconnect = null;
@@ -37,7 +42,7 @@ if (__DEV__) {
3742
}
3843

3944
function connectToReactDevToolsInFusebox(domain: Domain) {
40-
disconnect = reactDevTools.connectWithCustomMessagingProtocol({
45+
disconnect = connectWithCustomMessagingProtocol({
4146
onSubscribe: listener => {
4247
domain.onMessage.addEventListener(listener);
4348
},
@@ -47,7 +52,6 @@ if (__DEV__) {
4752
onMessage: (event, payload) => {
4853
domain.sendMessage({event, payload});
4954
},
50-
settingsManager: devToolsSettingsManager,
5155
nativeStyleEditorValidAttributes: Object.keys(ReactNativeStyleAttributes),
5256
resolveRNStyle,
5357
});
@@ -101,14 +105,13 @@ if (__DEV__) {
101105
isWebSocketOpen = true;
102106
});
103107

104-
reactDevTools.connectToDevTools({
108+
connectToDevTools({
105109
isAppActive,
106110
resolveRNStyle,
107111
nativeStyleEditorValidAttributes: Object.keys(
108112
ReactNativeStyleAttributes,
109113
),
110114
websocket: ws,
111-
devToolsSettingsManager,
112115
});
113116
}
114117
}

0 commit comments

Comments
 (0)