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

@@ -16,31 +16,20 @@
"@emotion/styled": "^11.6.0",
"@tanishiking/aho-corasick": "^0.0.1",
"antd": "4.16.8",
"archiver": "^5.0.2",
"async-mutex": "^0.3.2",
"axios": "^0.22.0",
"cbuffer": "^2.2.0",
"console-feed": "^3.2.2",
"crc32": "^0.2.2",
"deep-equal": "^2.0.5",
"eventemitter3": "^4.0.7",
"expand-tilde": "^2.0.2",
"flipper-client-sdk": "^0.0.3",
"flipper-common": "0.0.0",
"flipper-plugin": "0.0.0",
"flipper-ui-core": "0.0.0",
"fs-extra": "^10.0.0",
"hotkeys-js": "^3.8.7",
"immer": "^9.0.6",
"invariant": "^2.2.2",
"js-base64": "^3.7.2",
"lodash": "^4.17.21",
"lodash.memoize": "^4.1.2",
"openssl-wrapper": "^0.3.4",
"p-filter": "^2.1.0",
"p-map": "^4.0.0",
"promise-retry": "^2.0.1",
"promisify-child-process": "^4.1.0",
"react": "17.0.2",
"react-async": "^10.0.0",
"react-debounce-render": "^7.0.0",
@@ -52,33 +41,23 @@
"react-test-renderer": "^17.0.1",
"react-virtualized-auto-sizer": "^1.0.6",
"react-window": "^1.8.6",
"recursive-readdir": "^2.2.2",
"redux": "^4.1.2",
"redux-persist": "^6.0.0",
"reselect": "^4.1.5",
"semver": "^7.3.5",
"tmp": "^0.2.1",
"uuid": "^8.3.2",
"which": "^2.0.1",
"ws": "^7.5.6"
},
"optionalDependencies": {
"7zip-bin-mac": "^1.0.1"
"uuid": "^8.3.2"
},
"devDependencies": {
"@testing-library/dom": "^8.11.1",
"@testing-library/react": "^12.1.2",
"@types/archiver": "^5.1.1",
"@types/deep-equal": "^1.0.1",
"@types/lodash.memoize": "^4.1.6",
"@types/react-test-renderer": "^17.0.1",
"@types/react-virtualized-auto-sizer": "^1.0.1",
"@types/react-window": "^1.8.5",
"@types/redux-mock-store": "^1.0.3",
"@types/split2": "^3.2.1",
"@types/uuid": "^8.3.1",
"flipper-test-utils": "0.0.0",
"mock-fs": "^5.1.2",
"redux-mock-store": "^1.0.1"
},
"scripts": {

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;