From 8e7089fb4c37ea05d199053670b831a02f5d7ec9 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: navigation 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: D22411856 fbshipit-source-id: 491d93fbe6393a7e9eded91208fdd71990402bb9 --- desktop/plugins/navigation/index.tsx | 4 ---- desktop/plugins/navigation/package.json | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/desktop/plugins/navigation/index.tsx b/desktop/plugins/navigation/index.tsx index 05fc12c6d..2fd0e1991 100644 --- a/desktop/plugins/navigation/index.tsx +++ b/desktop/plugins/navigation/index.tsx @@ -38,10 +38,6 @@ import { import React from 'react'; export default class extends FlipperPlugin { - static title = 'Navigation'; - static id = 'Navigation'; - static icon = 'directions'; - static defaultPersistedState = { navigationEvents: [], bookmarks: new Map(), diff --git a/desktop/plugins/navigation/package.json b/desktop/plugins/navigation/package.json index 22141cc89..212e1295b 100644 --- a/desktop/plugins/navigation/package.json +++ b/desktop/plugins/navigation/package.json @@ -1,7 +1,7 @@ { "$schema": "https://fbflipper.com/schemas/plugin-package/v2.json", "name": "flipper-plugin-navigation", - "id": "flipper-plugin-navigation", + "id": "Navigation", "version": "0.49.0", "main": "dist/bundle.js", "flipperBundlerEntry": "index.tsx",