Move flipper-server client to flipper-frontend-core
Summary: ^ Reviewed By: aigoncharov Differential Revision: D36410944 fbshipit-source-id: 2adb5904cd0f5f15d08be22c611d6774e7533f94
This commit is contained in:
committed by
Facebook GitHub Bot
parent
ce83f2c01b
commit
bfcdb82b43
@@ -15,6 +15,7 @@
|
||||
"devDependencies": {
|
||||
"eventemitter3": "^4.0.7",
|
||||
"flipper-common": "0.0.0",
|
||||
"flipper-frontend-core": "0.0.0",
|
||||
"flipper-ui-core": "0.0.0",
|
||||
"invariant": "^2.2.4",
|
||||
"metro-runtime": "^0.70.2",
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
import {getLogger, Logger, setLoggerInstance} from 'flipper-common';
|
||||
import {initializeRenderHost} from './initializeRenderHost';
|
||||
import {createFlipperServer} from './flipperServerConnection';
|
||||
import {createFlipperServer, FlipperServerState} from 'flipper-frontend-core';
|
||||
|
||||
document.getElementById('root')!.innerText = 'flipper-ui-browser started';
|
||||
|
||||
@@ -27,7 +27,21 @@ async function start() {
|
||||
const logger = createDelegatedLogger();
|
||||
setLoggerInstance(logger);
|
||||
|
||||
const flipperServer = await createFlipperServer();
|
||||
const flipperServer = await createFlipperServer(
|
||||
(state: FlipperServerState) => {
|
||||
switch (state) {
|
||||
case FlipperServerState.CONNECTING:
|
||||
window.flipperShowError?.('Connecting to flipper-server...');
|
||||
break;
|
||||
case FlipperServerState.CONNECTED:
|
||||
window?.flipperHideError?.();
|
||||
break;
|
||||
case FlipperServerState.DISCONNECTED:
|
||||
window?.flipperShowError?.('Lost connection to flipper-server');
|
||||
break;
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
await flipperServer.connect();
|
||||
const flipperServerConfig = await flipperServer.exec('get-config');
|
||||
|
||||
@@ -10,6 +10,9 @@
|
||||
{
|
||||
"path": "../flipper-common"
|
||||
},
|
||||
{
|
||||
"path": "../flipper-frontend-core"
|
||||
},
|
||||
{
|
||||
"path": "../flipper-ui-core"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user