mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
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:
committed by
Facebook GitHub Bot
parent
6fb0072f01
commit
e0b22e1ebf
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user