From d71297a1ea709c2c6b19d292a8df76c8180fe3ae Mon Sep 17 00:00:00 2001 From: Michel Weststrate Date: Thu, 19 Nov 2020 08:58:18 -0800 Subject: [PATCH] Expose styled and produce Summary: To control bundle size and the amount of different versions used, we want plugins to use emotion's styled and immer's produce from flipper-plugin, rather than bringing their own Reviewed By: passy Differential Revision: D25087286 fbshipit-source-id: d2cc8b2cb1a17c520d05d99048cd94338984a913 --- desktop/flipper-plugin/src/__tests__/api.node.tsx | 3 +++ desktop/flipper-plugin/src/index.ts | 4 ++++ desktop/plugins/seamammals/src/index.tsx | 3 ++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/desktop/flipper-plugin/src/__tests__/api.node.tsx b/desktop/flipper-plugin/src/__tests__/api.node.tsx index 68258640c..eb91341d7 100644 --- a/desktop/flipper-plugin/src/__tests__/api.node.tsx +++ b/desktop/flipper-plugin/src/__tests__/api.node.tsx @@ -31,7 +31,9 @@ test('Correct top level API exposed', () => { "TestUtils", "batch", "createState", + "produce", "renderReactRoot", + "styled", "theme", "usePlugin", "useValue", @@ -47,6 +49,7 @@ test('Correct top level API exposed', () => { "DeviceLogListener", "DevicePluginClient", "DeviceType", + "Draft", "FlipperLib", "LogLevel", "MenuEntry", diff --git a/desktop/flipper-plugin/src/index.ts b/desktop/flipper-plugin/src/index.ts index 6b617602f..a340eb3ae 100644 --- a/desktop/flipper-plugin/src/index.ts +++ b/desktop/flipper-plugin/src/index.ts @@ -7,6 +7,10 @@ * @format */ +export {produce, Draft} from 'immer'; +import styledImport from '@emotion/styled'; +export const styled = styledImport; + import './plugin/PluginBase'; import * as TestUtilites from './test-utils/test-utils'; diff --git a/desktop/plugins/seamammals/src/index.tsx b/desktop/plugins/seamammals/src/index.tsx index 56fd703c1..89ed7bb0f 100644 --- a/desktop/plugins/seamammals/src/index.tsx +++ b/desktop/plugins/seamammals/src/index.tsx @@ -16,8 +16,9 @@ import { createState, useValue, theme, + styled, } from 'flipper-plugin'; -import {ManagedDataInspector, DetailSidebar, styled} from 'flipper'; +import {ManagedDataInspector, DetailSidebar} from 'flipper'; type Row = { id: number;