Skip to content

Commit 41bd80b

Browse files
huntiefacebook-github-bot
authored andcommitted
Remove --version spawn from debugger shell preparation
Summary: Addresses an issue where on macOS, we briefly flashed the RNDT app icon in the Dock. (This has been raised to us recently by Expo.) **More info** The `unstable_prepareDebuggerShell` health check was spawning the Electron binary with `--version` after a successful `dotslash fetch`. Invoking the native binary causes the app icon flash. - I couldn't find an Electron-side way to eliminate this (e.g. headless). - DotSlash already performs mandatory verification of every fetched artifact. The additional `--version` spawn was therefore redundant/overkill. Changelog: [General][Fixed] - React Native DevTools will no longer briefly flash in the system dock/taskbar when starting Metro Differential Revision: D104061238
1 parent 71a0d5d commit 41bd80b

2 files changed

Lines changed: 2 additions & 19 deletions

File tree

packages/debugger-shell/src/node/index.flow.js

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,7 @@
88
* @format
99
*/
1010

11-
import {
12-
prepareDebuggerShellFromDotSlashFile,
13-
spawnAndGetStderr,
14-
} from './private/LaunchUtils';
11+
import {prepareDebuggerShellFromDotSlashFile} from './private/LaunchUtils';
1512

1613
const {spawn} = require('cross-spawn');
1714
const debug = require('debug')('Metro:DebuggerShell');
@@ -174,20 +171,6 @@ async function unstable_prepareDebuggerShell({
174171
throw new Error(`Unknown flavor: ${flavor}`);
175172
}
176173

177-
const [binaryPath, baseArgs] = getShellBinaryAndArgs(
178-
flavor,
179-
prebuiltBinaryPath,
180-
);
181-
const {code, stderr} = await spawnAndGetStderr(binaryPath, [
182-
...baseArgs,
183-
'--version',
184-
]);
185-
if (code !== 0) {
186-
return {
187-
code: 'unexpected_error',
188-
verboseInfo: stderr,
189-
};
190-
}
191174
return {code: 'success'};
192175
} catch (e) {
193176
return {

packages/debugger-shell/src/node/private/LaunchUtils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,4 +95,4 @@ async function prepareDebuggerShellFromDotSlashFile(
9595
};
9696
}
9797

98-
export {spawnAndGetStderr, prepareDebuggerShellFromDotSlashFile};
98+
export {prepareDebuggerShellFromDotSlashFile};

0 commit comments

Comments
 (0)