Remove 'process' usage

Summary: Removed process, adbkit and electron usages that were still remaining. Verified changes by disabling the built-in module stubbing (will be cleaned up further later in this stack).

Reviewed By: aigoncharov

Differential Revision: D33019083

fbshipit-source-id: 8bfce31f4b5ed349cb4fd86d34c9b41b9b8b8360
This commit is contained in:
Michel Weststrate
2021-12-13 05:46:42 -08:00
committed by Facebook GitHub Bot
parent 3ef1923b29
commit ac9080abac
7 changed files with 62 additions and 52 deletions

View File

@@ -104,6 +104,7 @@ export interface RenderHost {
// given the requested icon and proposed public url of the icon, rewrite it to a local icon if needed
getLocalIconUrl?(icon: Icon, publicUrl: string): string;
unloadModule?(path: string): void;
getPercentCPUUsage?(): number;
}
export function getRenderHostInstance(): RenderHost {

View File

@@ -24,7 +24,6 @@ import {
import produce from 'immer';
import BaseDevice from '../devices/BaseDevice';
import {deconstructClientId} from 'flipper-common';
import {getCPUUsage} from 'process';
import {sideEffect} from '../utils/sideEffect';
import {getSelectionInfo} from '../utils/info';
import type {SelectionInfo} from '../utils/info';
@@ -239,7 +238,7 @@ export default (store: Store, logger: Logger) => {
sdkVersion,
isForeground: state.application.windowIsFocused,
usedJSHeapSize: (window.performance as any).memory.usedJSHeapSize,
cpuLoad: getCPUUsage().percentCPUUsage,
cpuLoad: renderHost.getPercentCPUUsage?.() ?? 0,
};
// reset dropped frames counter