Commit Graph

5 Commits

Author SHA1 Message Date
John Knox
679ef665e2 Cleanup CPU plugin
Summary:
Addressing code review feedback from previous 3 diffs.

* Don't return draft when using immer
* Move functions out of component to module level
* Make executeShell async and simplify callsites
* Add onStopMonitor to cleanup function
* Add uniform spacing by adding Layout.Container around titles
* Disable searchbar on both tables
* Use Toolbar

Reviewed By: mweststrate

Differential Revision: D28091565

fbshipit-source-id: 533d2491e6f48a9eaaa64b1a6cf76eea2e7189a5
2021-04-29 07:41:23 -07:00
John Knox
303e42535c Finish converting CPU plugin to Sandy
Summary: Finishes off by converting the rest of the UI.

Reviewed By: mweststrate

Differential Revision: D28061468

fbshipit-source-id: 8d87d3344fe3937470e566d8c425efc97f38333c
2021-04-29 07:41:23 -07:00
John Knox
92f51485c9 Fix CPU plugin concurrency issues
Summary:
Half way through sandy conversion I ended up redoing the task scheduling in this plugin because it was sketchy and unreliable.

Previously, it was using setInterval to schedule a task every 500ms, which would query a lot of data from the device. The problem was that if these tasks took >500ms (which they did for me at least), you'd get overlapping ones, causing havoc.

Now it uses setTimeout instead, promisifies everything, and only ever schedules the next timeout when the current task has finished.

Also fixed a race condition where you could hit stop, but not actually stop the recurring tasks... and then there was no way to stop them because it was already "stopped".

Reviewed By: mweststrate

Differential Revision: D28061469

fbshipit-source-id: 2bb8aba7ddf37ba1fdbdc52c95ec258cae96f509
2021-04-29 07:41:23 -07:00
John Knox
a53f1b8f8d Convert CPU plugin to Sandy
Summary:
Starts converting the plugin by moving to new model and switching some of the UI components.

No logic changes here, it's just shifting everything over.

Reviewed By: mweststrate

Differential Revision: D28028052

fbshipit-source-id: 7444eab77d9dba49261a70887ee26b8d120e97a6
2021-04-29 07:41:23 -07:00
Anton Nikolaev
b3274a8450 Plugin folders re-structuring
Summary:
Here I'm changing plugin repository structure to allow re-using of shared packages between both public and fb-internal plugins, and to ensure that public plugins has their own yarn.lock as this will be required to implement reproducible jobs checking plugin compatibility with released flipper versions.

Please note that there are a lot of moved files in this diff, make sure to click "Expand all" to see all that actually changed (there are not much of them actually).

New proposed structure for plugin packages:
```
- root
- node_modules - modules included into Flipper: flipper, flipper-plugin, react, antd, emotion
-- plugins
 --- node_modules - modules used by both public and fb-internal plugins (shared libs will be linked here, see D27034936)
 --- public
---- node_modules - modules used by public plugins
---- pluginA
----- node_modules - modules used by plugin A exclusively
---- pluginB
----- node_modules - modules used by plugin B exclusively
 --- fb
---- node_modules - modules used by fb-internal plugins
---- pluginC
----- node_modules - modules used by plugin C exclusively
---- pluginD
----- node_modules - modules used by plugin D exclusively
```
I've moved all public plugins under dir "plugins/public" and excluded them from root yarn workspaces. Instead, they will have their own yarn workspaces config and yarn.lock and they will use flipper modules as peer dependencies.

Reviewed By: mweststrate

Differential Revision: D27034108

fbshipit-source-id: c2310e3c5bfe7526033f51b46c0ae40199fd7586
2021-04-09 05:22:00 -07:00