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

@@ -42,12 +42,14 @@
"xdg-basedir": "^4.0.0"
},
"devDependencies": {
"@types/archiver": "^5.1.1",
"@types/invariant": "^2.2.35",
"@types/memorystream": "^0.3.0",
"@types/node": "^15.12.5",
"@types/rimraf": "^3.0.2",
"@types/rsocket-core": "^0.0.7",
"@types/rsocket-tcp-server": "^0.0.2",
"@types/split2": "^3.2.1",
"@types/tmp": "^0.2.2",
"@types/ws": "^7.4.7",
"@types/which": "^2.0.1",

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;

View File

@@ -9,5 +9,10 @@
"lib": ["DOM", "ES2019"],
"types": ["jest"]
},
"exclude": ["**/node_modules/", "**/lib/", "**/dist/"]
"exclude": [
"**/node_modules/",
"**/lib/",
"**/dist/",
"flipper-server/static/**"
]
}

View File

@@ -3315,7 +3315,7 @@ archiver-utils@^2.1.0:
normalize-path "^3.0.0"
readable-stream "^2.0.0"
archiver@^5.0.2, archiver@^5.3.0:
archiver@^5.3.0:
version "5.3.0"
resolved "https://registry.yarnpkg.com/archiver/-/archiver-5.3.0.tgz#dd3e097624481741df626267564f7dd8640a45ba"
integrity sha512-iUw+oDwK0fgNpvveEsdQ0Ase6IIKztBJU2U0E9MzszMfmVVUyv1QJhS2ITW9ZCqx8dktAxVAjWWkKehuZE8OPg==
@@ -4656,11 +4656,6 @@ crc32-stream@^4.0.1:
crc-32 "^1.2.0"
readable-stream "^3.4.0"
crc32@^0.2.2:
version "0.2.2"
resolved "https://registry.yarnpkg.com/crc32/-/crc32-0.2.2.tgz#7ad220d6ffdcd119f9fc127a7772cacea390a4ba"
integrity sha1-etIg1v/c0Rn5/BJ6d3LKzqOQpLo=
crc@^3.8.0:
version "3.8.0"
resolved "https://registry.yarnpkg.com/crc/-/crc-3.8.0.tgz#ad60269c2c856f8c299e2c4cc0de4556914056c6"
@@ -5337,11 +5332,6 @@ envinfo@^7.8.1:
resolved "https://registry.yarnpkg.com/envinfo/-/envinfo-7.8.1.tgz#06377e3e5f4d379fea7ac592d5ad8927e0c4d475"
integrity sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw==
err-code@^2.0.2:
version "2.0.3"
resolved "https://registry.yarnpkg.com/err-code/-/err-code-2.0.3.tgz#23c2f3b756ffdfc608d30e27c9a941024807e7f9"
integrity sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==
errno@^0.1.1:
version "0.1.7"
resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.7.tgz#4684d71779ad39af177e3f007996f7c67c852618"
@@ -5868,13 +5858,6 @@ expand-brackets@^2.1.4:
snapdragon "^0.8.1"
to-regex "^3.0.1"
expand-tilde@^2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/expand-tilde/-/expand-tilde-2.0.2.tgz#97e801aa052df02454de46b02bf621642cdc8502"
integrity sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=
dependencies:
homedir-polyfill "^1.0.1"
expect@^26.6.2:
version "26.6.2"
resolved "https://registry.yarnpkg.com/expect/-/expect-26.6.2.tgz#c6b996bf26bf3fe18b67b2d0f51fc981ba934417"
@@ -6634,13 +6617,6 @@ hoist-non-react-statics@^3.3.0, hoist-non-react-statics@^3.3.1, hoist-non-react-
dependencies:
react-is "^16.7.0"
homedir-polyfill@^1.0.1:
version "1.0.3"
resolved "https://registry.yarnpkg.com/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz#743298cef4e5af3e194161fbadcc2151d3a058e8"
integrity sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==
dependencies:
parse-passwd "^1.0.0"
hosted-git-info@^2.1.4:
version "2.8.9"
resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.9.tgz#dffc0bf9a21c02209090f2aa69429e1414daf3f9"
@@ -9483,11 +9459,6 @@ parse-node-version@^1.0.1:
resolved "https://registry.yarnpkg.com/parse-node-version/-/parse-node-version-1.0.1.tgz#e2b5dbede00e7fa9bc363607f53327e8b073189b"
integrity sha512-3YHlOa/JgH6Mnpr05jP9eDG254US9ek25LyIxZlDItp2iJtwyaXQb57lBYLdT3MowkUFYEV2XXNAYIPlESvJlA==
parse-passwd@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/parse-passwd/-/parse-passwd-1.0.0.tgz#6d5b934a456993b23d37f40a382d6f1666a8e5c6"
integrity sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=
parse5@6.0.1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/parse5/-/parse5-6.0.1.tgz#e1a1c085c569b3dc08321184f19a39cc27f7c30b"
@@ -9736,14 +9707,6 @@ promise-polyfill@^8.1.3:
resolved "https://registry.yarnpkg.com/promise-polyfill/-/promise-polyfill-8.1.3.tgz#8c99b3cf53f3a91c68226ffde7bde81d7f904116"
integrity sha512-MG5r82wBzh7pSKDRa9y+vllNHz3e3d4CNj1PQE4BQYxLme0gKYYBm9YENq+UkEikyZ0XbiGWxYlVw3Rl9O/U8g==
promise-retry@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/promise-retry/-/promise-retry-2.0.1.tgz#ff747a13620ab57ba688f5fc67855410c370da22"
integrity sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==
dependencies:
err-code "^2.0.2"
retry "^0.12.0"
promise@^7.1.1:
version "7.3.1"
resolved "https://registry.yarnpkg.com/promise/-/promise-7.3.1.tgz#064b72602b18f90f29192b8b1bc418ffd1ebd3bf"
@@ -10777,11 +10740,6 @@ ret@~0.1.10:
resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc"
integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==
retry@^0.12.0:
version "0.12.0"
resolved "https://registry.yarnpkg.com/retry/-/retry-0.12.0.tgz#1b42a6266a21f07421d1b0b54b7dc167b01c013b"
integrity sha1-G0KmJmoh8HQh0bC1S33BZ7AcATs=
reusify@^1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76"