Rename global variable with Metro server for Fantom (#53202)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/53202

Changelog: [internal]

Just a minor refactor to follow the convention of prefixing Fantom-related globals and environment variables.

Reviewed By: rshest

Differential Revision: D79804007

fbshipit-source-id: 0c9a57c1b08ae18ae03cd66d1a6ef9690e0dea42
This commit is contained in:
Rubén Norte
2025-08-12 05:41:11 -07:00
committed by Facebook GitHub Bot
parent 6fb0072f01
commit e0b22e1ebf
2 changed files with 5 additions and 4 deletions
@@ -50,7 +50,7 @@ async function startMetroServer() {
});
// $FlowExpectedError[prop-missing]
globalThis.__METRO_SERVER__ = server;
globalThis.__FANTOM_METRO_SERVER__ = server;
}
async function findAvailablePort(): Promise<number> {
@@ -12,11 +12,12 @@ import type {RunServerResult} from 'metro';
type MetroServer = $NonMaybeType<RunServerResult?.['httpServer']>;
declare var __METRO_SERVER__: ?RunServerResult;
declare var __FANTOM_METRO_SERVER__: ?RunServerResult;
function getMetroServer(): ?MetroServer {
return typeof __METRO_SERVER__ !== 'undefined' && __METRO_SERVER__ != null
? __METRO_SERVER__.httpServer
return typeof __FANTOM_METRO_SERVER__ !== 'undefined' &&
__FANTOM_METRO_SERVER__ != null
? __FANTOM_METRO_SERVER__.httpServer
: null;
}