From 71458b97b3197d340893c13a4ceabe4407c11b1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20B=C3=BCchele?= Date: Thu, 20 Sep 2018 04:13:07 -0700 Subject: [PATCH] fixing plugin imports Summary: Plugins need to be self-contained. The can not require any dependency from Flipper's main app. This was a soft requirement before, but with the new version of metro, we now make this a hard requirement. This speeds up plugin compile times, because only the files in the plugin's folder are watched and not all of Flipper's files. Moreover, this ensures "plugins" are real plugins and can be added and removed and are not mixed with the apps core. Reviewed By: passy Differential Revision: D9940735 fbshipit-source-id: 47e120429fc3c4c985731478ffa35c3359ff78f9 --- package.json | 1 - src/index.js | 7 +++++++ src/plugins/layout/index.js | 2 +- yarn.lock | 7 ------- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index b56540926..2ba34abf1 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,6 @@ "jest": "^22.2.1", "lodash.debounce": "^4.0.8", "mkdirp": "^0.5.1", - "needle": "2.1.1", "openssl-wrapper": "^0.3.4", "prop-types": "^15.6.0", "react": "16", diff --git a/src/index.js b/src/index.js index bc59b1171..351fadd14 100644 --- a/src/index.js +++ b/src/index.js @@ -15,6 +15,13 @@ export { FlipperPlugin, FlipperDevicePlugin, } from './plugin.js'; + +export * from './fb-stubs/constants.js'; + +export { + default as SidebarExtensions, +} from './fb-stubs/LayoutInspectorSidebarExtensions.js'; + export {createTablePlugin} from './createTablePlugin.js'; export {default as DetailSidebar} from './chrome/DetailSidebar.js'; diff --git a/src/plugins/layout/index.js b/src/plugins/layout/index.js index d3160ecc6..2c37cb780 100644 --- a/src/plugins/layout/index.js +++ b/src/plugins/layout/index.js @@ -25,10 +25,10 @@ import { VerticalRule, Popover, ToggleButton, + SidebarExtensions, } from 'flipper'; import type {TrackType} from '../../fb-stubs/Logger.js'; -import SidebarExtensions from '../../fb-stubs/LayoutInspectorSidebarExtensions.js'; import debounce from 'lodash.debounce'; diff --git a/yarn.lock b/yarn.lock index 93819c552..b547c0ad3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3638,13 +3638,6 @@ natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" -needle@2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/needle/-/needle-2.1.1.tgz#f3d501d633e661d34cd9648ca6c42f782a44d071" - dependencies: - debug "^2.1.2" - iconv-lite "^0.4.4" - needle@^2.2.0: version "2.2.1" resolved "https://registry.yarnpkg.com/needle/-/needle-2.2.1.tgz#b5e325bd3aae8c2678902fa296f729455d1d3a7d"