Skip to content

Commit 6047f9c

Browse files
authored
[0.76][Fix] Restore Metro log forwarding, change notice to signal future removal (#46815)
1 parent 531657b commit 6047f9c

2 files changed

Lines changed: 11 additions & 6 deletions

File tree

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,13 @@ if (__DEV__) {
4242
if (!Platform.isTesting) {
4343
const HMRClient = require('../Utilities/HMRClient');
4444

45+
// [0.76 only] When under React Native DevTools, log "JavaScript logs will
46+
// be removed from Metro..." warning, and continue to forward logs.
4547
if (global.__FUSEBOX_HAS_FULL_CONSOLE_SUPPORT__) {
4648
HMRClient.unstable_notifyFuseboxConsoleEnabled();
47-
} else if (console._isPolyfilled) {
49+
}
50+
51+
if (console._isPolyfilled) {
4852
// We assume full control over the console and send JavaScript logs to Metro.
4953
[
5054
'trace',

packages/react-native/Libraries/Utilities/HMRClient.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,12 @@ const HMRClient: HMRClientNativeInterface = {
153153
level: 'info',
154154
data: [
155155
'\n' +
156-
'\x1b[7m' +
157-
' \x1b[1mJavaScript logs have moved!\x1b[22m They will now appear in the debugger console. ' +
158-
'Tip: Type \x1b[1mj\x1b[22m in the terminal to open the debugger (requires Google Chrome ' +
159-
'or Microsoft Edge).' +
160-
'\x1b[27m' +
156+
'\u001B[7m' +
157+
' \u001B[1m💡 JavaScript logs will be removed from Metro in React ' +
158+
'Native 0.77!\u001B[22m Please use React Native DevTools as your ' +
159+
'default tool. Tip: Type \u001B[1mj\u001B[22m in the terminal to ' +
160+
'open (requires Google Chrome or Microsoft Edge).' +
161+
'\u001B[27m' +
161162
'\n',
162163
],
163164
}),

0 commit comments

Comments
 (0)