Remove TCP option as it will be the only option

Summary: UDS will be removed. The first step would be to remove the TCP optionality.

Reviewed By: passy

Differential Revision: D48264741

fbshipit-source-id: ca9e1b68be61e99240e95bcd4f26f2db63a64005
This commit is contained in:
Lorenzo Blasa
2023-08-11 08:19:51 -07:00
committed by Facebook GitHub Bot
parent bdc2d5f6eb
commit 47b718d104
4 changed files with 12 additions and 49 deletions

View File

@@ -74,12 +74,6 @@ const argv = yargs
type: 'boolean', type: 'boolean',
default: true, default: true,
}, },
tcp: {
describe:
'Open a TCP port (--no-tcp can be specified as to use unix-domain-socket exclusively)',
type: 'boolean',
default: true,
},
replace: { replace: {
describe: 'Replaces any running instance, if any.', describe: 'Replaces any running instance, if any.',
type: 'boolean', type: 'boolean',
@@ -214,7 +208,7 @@ async function start() {
staticPath, staticPath,
entry: `index.web${argv.bundler ? '.dev' : ''}.html`, entry: `index.web${argv.bundler ? '.dev' : ''}.html`,
port: argv.port, port: argv.port,
tcp: argv.tcp, tcp: true,
}); });
const t4 = performance.now(); const t4 = performance.now();
@@ -308,10 +302,6 @@ async function start() {
} }
async function launch() { async function launch() {
if (!argv.tcp) {
return;
}
let token: string | undefined; let token: string | undefined;
if (await hasAuthToken()) { if (await hasAuthToken()) {
token = await getAuthToken(); token = await getAuthToken();

View File

@@ -90,11 +90,6 @@ const argv = yargs
type: 'boolean', type: 'boolean',
default: false, default: false,
}, },
tcp: {
describe: 'Enable TCP connections on flipper-server.',
type: 'boolean',
default: true,
},
'rebuild-plugins': { 'rebuild-plugins': {
describe: describe:
'Enables rebuilding of default plugins on Flipper build. Only make sense in conjunction with "--no-bundled-plugins". Enabled by default, but if disabled using "--no-plugin-rebuild", then plugins are just released as is without rebuilding. This can save some time if you know plugin bundles are already up-to-date.', 'Enables rebuilding of default plugins on Flipper build. Only make sense in conjunction with "--no-bundled-plugins". Enabled by default, but if disabled using "--no-plugin-rebuild", then plugins are just released as is without rebuilding. This can save some time if you know plugin bundles are already up-to-date.',
@@ -356,29 +351,17 @@ async function runPostBuildAction(archive: string, dir: string) {
// didn't change // didn't change
console.log(`⚙️ Installing flipper-server.tgz using npx`); console.log(`⚙️ Installing flipper-server.tgz using npx`);
await fs.remove(path.join(homedir(), '.npm', '_npx')); await fs.remove(path.join(homedir(), '.npm', '_npx'));
await spawn( await spawn('npx', [archive, argv.open ? '--open' : '--no-open'], {
'npx', stdio: 'inherit',
[ shell: true,
archive, });
argv.open ? '--open' : '--no-open',
argv.tcp ? '--tcp' : '--no-tcp',
],
{
stdio: 'inherit',
shell: true,
},
);
} else if (argv.start) { } else if (argv.start) {
console.log(`⚙️ Starting flipper-server from build dir`); console.log(`⚙️ Starting flipper-server from build dir`);
await spawn( await spawn('./server.js', [argv.open ? '--open' : '--no-open'], {
'./server.js', cwd: dir,
[argv.open ? '--open' : '--no-open', argv.tcp ? '--tcp' : '--no-tcp'], stdio: 'inherit',
{ shell: true,
cwd: dir, });
stdio: 'inherit',
shell: true,
},
);
} }
} }

View File

@@ -384,11 +384,7 @@ export function sleep(ms: number) {
let proc: child.ChildProcess | undefined; let proc: child.ChildProcess | undefined;
export async function launchServer( export async function launchServer(startBundler: boolean, open: boolean) {
startBundler: boolean,
open: boolean,
tcp: boolean,
) {
if (proc) { if (proc) {
console.log('⚙️ Killing old flipper-server...'); console.log('⚙️ Killing old flipper-server...');
proc.kill(9); proc.kill(9);
@@ -401,7 +397,6 @@ export async function launchServer(
`../flipper-server/server.js`, `../flipper-server/server.js`,
startBundler ? `--bundler` : `--no-bundler`, startBundler ? `--bundler` : `--no-bundler`,
open ? `--open` : `--no-open`, open ? `--open` : `--no-open`,
tcp ? `--tcp` : `--no-tcp`,
], ],
{ {
cwd: serverDir, cwd: serverDir,

View File

@@ -44,11 +44,6 @@ const argv = yargs
'[FB-internal only] Will force using public sources only, to be able to iterate quickly on the public version. If sources are checked out from GitHub this is already the default. Setting env var "FLIPPER_FORCE_PUBLIC_BUILD" is equivalent.', '[FB-internal only] Will force using public sources only, to be able to iterate quickly on the public version. If sources are checked out from GitHub this is already the default. Setting env var "FLIPPER_FORCE_PUBLIC_BUILD" is equivalent.',
type: 'boolean', type: 'boolean',
}, },
tcp: {
describe: 'Enable TCP connections on flipper-server.',
type: 'boolean',
default: true,
},
channel: { channel: {
description: 'Release channel for the build', description: 'Release channel for the build',
choices: ['stable', 'insiders'], choices: ['stable', 'insiders'],
@@ -108,7 +103,7 @@ async function copyStaticResources() {
async function restartServer() { async function restartServer() {
try { try {
await compileServerMain(true); await compileServerMain(true);
await launchServer(true, ++startCount === 1, argv.tcp); // only open on the first time await launchServer(true, ++startCount === 1); // only open on the first time
} catch (e) { } catch (e) {
console.error( console.error(
chalk.red( chalk.red(