Clean up flipper-ui-core deps

Summary: Noticed that flipper-ui-core bundled quite some unused / node based deps. No longer

Reviewed By: aigoncharov

Differential Revision: D33184489

fbshipit-source-id: a180f9b8f3eb00ffa6c91e0cca654d4b9b609692
This commit is contained in:
Michel Weststrate
2021-12-17 10:02:57 -08:00
committed by Facebook GitHub Bot
parent cea7be7fde
commit d9488f06ac
6 changed files with 16 additions and 70 deletions

View File

@@ -20,7 +20,6 @@ import {
} from 'flipper-common';
import {default as isProduction} from './utils/isProduction';
import EventEmitter from 'eventemitter3';
import invariant from 'invariant';
import {getPluginKey} from './utils/pluginKey';
import {defaultEnabledBackgroundPlugins} from './utils/pluginUtils';
@@ -378,7 +377,9 @@ export default class Client extends EventEmitter {
} else if (method === 'refreshPlugins') {
this.refreshPlugins();
} else if (method === 'execute') {
invariant(data.params, 'expected params');
if (!data.params) {
throw new Error('expected params');
}
const params: Params = data.params;
const bytes = msg.length * 2; // string lengths are measured in UTF-16 units (not characters), so 2 bytes per char
emitBytesReceived(params.api, bytes);

View File

@@ -22,7 +22,6 @@ import {theme, _Interactive, _InteractiveProps} from 'flipper-plugin';
import styled from '@emotion/styled';
import {colors} from '../colors';
import FlexRow from '../FlexRow';
import invariant from 'invariant';
import React from 'react';
const TableHeaderArrow = styled.span({
@@ -143,7 +142,9 @@ class TableHeadColumn extends PureComponent<{
// normalise number to a percentage if we were originally passed a percentage
if (isPercentage(width) && this.ref) {
const {parentElement} = this.ref;
invariant(parentElement, 'expected there to be parentElement');
if (!parentElement) {
throw new Error('expected there to be parentElement');
}
const parentWidth = parentElement.clientWidth;
const {childNodes} = parentElement;