Skip to content
This repository was archived by the owner on Nov 22, 2024. It is now read-only.

Commit 9e83e93

Browse files
Chaiwat Ekkaewnumchaifacebook-github-bot
Chaiwat Ekkaewnumchai
authored andcommitted
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
1 parent 8e7089f commit 9e83e93

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

desktop/plugins/reactdevtools/index.tsx

+1-5
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,10 @@ enum ConnectionStatus {
9999
}
100100

101101
export default class ReactDevTools extends FlipperDevicePlugin<
102-
{
103-
status: string;
104-
},
102+
{status: string},
105103
any,
106104
{}
107105
> {
108-
static id = 'React';
109-
110106
static supportsDevice(device: Device) {
111107
return !device.isArchived && device.os === 'Metro';
112108
}

desktop/plugins/reactdevtools/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://fbflipper.com/schemas/plugin-package/v2.json",
33
"name": "flipper-plugin-react-devtools",
4-
"id": "flipper-plugin-react-devtools",
4+
"id": "React",
55
"version": "0.49.0",
66
"main": "dist/bundle.js",
77
"flipperBundlerEntry": "index.tsx",

0 commit comments

Comments
 (0)