Differentiate Flipper in logging from standalone app
Summary: This commit makes it so when we load DevTools from within Flipper we log it as a Flipper load and not a regular standalone app load. Note that the logging only applies internally. Reviewed By: bvaughn Differential Revision: D32884616 fbshipit-source-id: 90d0962bac9c1abdde36a70fd361251d7e607b57
This commit is contained in:
committed by
Facebook GitHub Bot
parent
f9547e024e
commit
4a93224151
@@ -237,7 +237,9 @@ export function devicePlugin(client: DevicePluginClient) {
|
|||||||
// TODO: since devToolsInstance is an instance, we are probably leaking memory here
|
// TODO: since devToolsInstance is an instance, we are probably leaking memory here
|
||||||
setStatus(ConnectionStatus.Initializing, status);
|
setStatus(ConnectionStatus.Initializing, status);
|
||||||
})
|
})
|
||||||
.startServer(DEV_TOOLS_PORT) as any;
|
.startServer(DEV_TOOLS_PORT, 'localhost', undefined, {
|
||||||
|
surface: 'flipper',
|
||||||
|
});
|
||||||
setStatus(ConnectionStatus.Initializing, 'Waiting for device...');
|
setStatus(ConnectionStatus.Initializing, 'Waiting for device...');
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('Failed to initalize React DevTools' + e);
|
console.error('Failed to initalize React DevTools' + e);
|
||||||
|
|||||||
@@ -7,10 +7,24 @@
|
|||||||
* @format
|
* @format
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
type ServerOptions = {
|
||||||
|
key?: string;
|
||||||
|
cert?: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
type LoggerOptions = {
|
||||||
|
surface?: string;
|
||||||
|
};
|
||||||
|
|
||||||
declare module 'react-devtools-core/standalone' {
|
declare module 'react-devtools-core/standalone' {
|
||||||
interface DevTools {
|
interface DevTools {
|
||||||
setContentDOMNode(node: HTMLElement): this;
|
setContentDOMNode(node: HTMLElement): this;
|
||||||
startServer(port: number): this;
|
startServer(
|
||||||
|
port?: number,
|
||||||
|
host?: string,
|
||||||
|
httpsOptions?: ServerOptions,
|
||||||
|
loggerOptions?: LoggerOptions,
|
||||||
|
): {close: () => void};
|
||||||
setStatusListener(listener: (message: string) => void): this;
|
setStatusListener(listener: (message: string) => void): this;
|
||||||
}
|
}
|
||||||
const DevTools: DevTools;
|
const DevTools: DevTools;
|
||||||
|
|||||||
Reference in New Issue
Block a user