Skip to content

Commit e6ff429

Browse files
vzaidmanfacebook-github-bot
authored andcommitted
move default React Native DevTools launching params downstream (facebook#54528)
Summary: Changelog: [Internal] Currently, `DefaultBrowserLauncher.js` holds arguments configuring how the debugger shell is launched. Instead, move some of them downstream, and make `DefaultBrowserLauncher.js` use the defaults. Differential Revision: D86772692
1 parent 2b92283 commit e6ff429

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

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

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ async function unstable_spawnDebuggerShellWithArgs(
2929
args: string[],
3030
{
3131
mode = 'detached',
32-
flavor = 'prebuilt',
32+
flavor = process.env.RNDT_DEV === '1' ? 'dev' : 'prebuilt',
3333
prebuiltBinaryPath,
3434
}: $ReadOnly<{
3535
// In 'syncAndExit' mode, the current process will block until the spawned process exits, and then it will exit
@@ -38,7 +38,7 @@ async function unstable_spawnDebuggerShellWithArgs(
3838
// continue to run normally.
3939
mode?: 'syncThenExit' | 'detached',
4040
flavor?: DebuggerShellFlavor,
41-
prebuiltBinaryPath?: string,
41+
prebuiltBinaryPath?: ?string,
4242
}> = {},
4343
): Promise<void> {
4444
const [binaryPath, baseArgs] = getShellBinaryAndArgs(
@@ -119,10 +119,13 @@ export type DebuggerShellPreparationResult = $ReadOnly<{
119119
* instantly when the user tries to open it (and conversely, the user is
120120
* informed ASAP if it is not ready to use).
121121
*/
122-
async function unstable_prepareDebuggerShell(
123-
flavor: DebuggerShellFlavor,
124-
{prebuiltBinaryPath}: {prebuiltBinaryPath?: string} = {},
125-
): Promise<DebuggerShellPreparationResult> {
122+
async function unstable_prepareDebuggerShell({
123+
prebuiltBinaryPath,
124+
flavor = process.env.RNDT_DEV === '1' ? 'dev' : 'prebuilt',
125+
}: {
126+
prebuiltBinaryPath?: ?string,
127+
flavor?: DebuggerShellFlavor,
128+
} = {}): Promise<DebuggerShellPreparationResult> {
126129
try {
127130
switch (flavor) {
128131
case 'prebuilt':

packages/dev-middleware/src/utils/DefaultBrowserLauncher.js

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -73,19 +73,16 @@ const DefaultBrowserLauncher = {
7373
url: string,
7474
windowKey: string,
7575
): Promise<void> {
76-
return await unstable_spawnDebuggerShellWithArgs(
77-
['--frontendUrl=' + url, '--windowKey=' + windowKey],
78-
{
79-
mode: 'detached',
80-
flavor: process.env.RNDT_DEV === '1' ? 'dev' : 'prebuilt',
81-
},
82-
);
76+
return await unstable_spawnDebuggerShellWithArgs([
77+
'--frontendUrl=' + url,
78+
'--windowKey=' + windowKey,
79+
]);
8380
},
8481

85-
async unstable_prepareFuseboxShell(): Promise<DebuggerShellPreparationResult> {
86-
return await unstable_prepareDebuggerShell(
87-
process.env.RNDT_DEV === '1' ? 'dev' : 'prebuilt',
88-
);
82+
async unstable_prepareFuseboxShell(
83+
prebuiltBinaryPath?: ?string,
84+
): Promise<DebuggerShellPreparationResult> {
85+
return await unstable_prepareDebuggerShell();
8986
},
9087
};
9188

0 commit comments

Comments
 (0)