From 9e83e93662009b5f49f276015bbffc36ce22716b Mon Sep 17 00:00:00 2001 From: Chaiwat Ekkaewnumchai Date: Wed, 8 Jul 2020 03:05:17 -0700 Subject: [PATCH] Move Static Fields to package.json: reactdevtools Summary: Flipper reads metadata to show on the sidebar from `package.json` and static fields (`id`, `title`, and `icon`) from `FlipperPlugin` class. If there are fields declared in both file, `FlipperPlugin` class takes precedences. With Sandy (new Flipper plugin API), there is no static field available. In order to prevent unexpected scenario happening when migrating to Sandy, this codemod-ish is applied to plugins that contain static field. The static fields are merged into `package.json` to get the same result. In addition, the static fields are also removed. Reviewed By: mweststrate Differential Revision: D22411845 fbshipit-source-id: b6f043e74358a9a66d5d466a17252820d712b71c --- desktop/plugins/reactdevtools/index.tsx | 6 +----- desktop/plugins/reactdevtools/package.json | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/desktop/plugins/reactdevtools/index.tsx b/desktop/plugins/reactdevtools/index.tsx index c5bd84d80..37c225642 100644 --- a/desktop/plugins/reactdevtools/index.tsx +++ b/desktop/plugins/reactdevtools/index.tsx @@ -99,14 +99,10 @@ enum ConnectionStatus { } export default class ReactDevTools extends FlipperDevicePlugin< - { - status: string; - }, + {status: string}, any, {} > { - static id = 'React'; - static supportsDevice(device: Device) { return !device.isArchived && device.os === 'Metro'; } diff --git a/desktop/plugins/reactdevtools/package.json b/desktop/plugins/reactdevtools/package.json index cf8a3a931..93751b26f 100644 --- a/desktop/plugins/reactdevtools/package.json +++ b/desktop/plugins/reactdevtools/package.json @@ -1,7 +1,7 @@ { "$schema": "https://fbflipper.com/schemas/plugin-package/v2.json", "name": "flipper-plugin-react-devtools", - "id": "flipper-plugin-react-devtools", + "id": "React", "version": "0.49.0", "main": "dist/bundle.js", "flipperBundlerEntry": "index.tsx",