Summary:
This diff introduces the logic for queueing incoming messages rather then directly processing them you are behind the `flipper_event_queue` GK.
The reason the queue processing is a bit complicated is to make the queue can be processed non-blocking, can be cancelled, and is safe to concurrency issues.
The idea here is that the queue is processed when we switch to a plugin, report it's progress, and abort the process when switching to another plugin without loosing any work.
This diff does not include
[x] updates to the UI (**SO DON"T LAND IN ISOLATION**)
[x] metrics to see the effect
The effect of the changes can be seen when profiling the application, before this change there are very regular CPU spikes (see the small yellow bar on the top):
https://pxl.cl/TQtl
These go away when the events are no longer processed
https://pxl.cl/TQtp
Reviewed By: nikoant
Differential Revision: D19095564
fbshipit-source-id: 0b8c3421acc4a4f240bf2aab5c1743132f69aa6e
Summary:
This diff will make it easier to test a plugin in a "fully loaded" Flipper state. This makes it possible to test all the wiring of flipper, rather than the individual reducers.
This is in preparation of processing the message queue async.
Reviewed By: passy
Differential Revision: D19140879
fbshipit-source-id: 5a333abe9c7a4d0c33d1d06a105cd094cb8fc19f
Summary:
This Pull request makes it possible to automatically generate regression tests for plugins. The idea here is to record all incoming states for a specific plugin, the start state of the plugin, and the enstate of the plugin.
By replaying the same events in a test, the same plugin should result in the same end state. This will make it easy to test regressions and refactorings on real life scenarios. Execution time is recorded as well.
The API's are exposed as
- `flipperStartPluginRecording()`
- `flipperStopPluginRecording()`
This process generates both a data snapshot and unit test.
Reviewed By: passy
Differential Revision: D18907455
fbshipit-source-id: 923f814f534ccfa6aa2ff2bfa2f80bee41a1c182
Summary: I **think** this is the last part of the codebase doing manipulation of strings to produce plugin keys etc.
Reviewed By: passy
Differential Revision: D18831990
fbshipit-source-id: db449d78230adbca66e78f041381a34d9b249a45
Summary: This diff makes it possible to gather stats of plugin usage, and print them from the console by issuing `window.flipperPrintPluginBackgroundStats()`.
Reviewed By: jknoxville
Differential Revision: D18811590
fbshipit-source-id: 4219923f7fd90187c7ec50a9aa68d7b817e3db8f
Summary:
Original commit changeset: ff84080d43fa
This re-adds JS client support. The original version had a small bug that inadvertantly wrapped support for Android emulators in the dropdown in a GK that was only meant to cover JS clients. This is addressed here.
Reviewed By: timur-valiev
Differential Revision: D18707485
fbshipit-source-id: ceea8e279a21111f96073f8b784e852f6313e2a4
Summary:
Original commit changeset: 56d1ca1a60ed
This broke Android support in some instances. We haven't had a chance to investigate this yet, but this should cleanly reapply, so we can figure out what happened after the release.
Reviewed By: cekkaewnumchai
Differential Revision: D18688590
fbshipit-source-id: ff84080d43fa481cc8c8c669a76aed15d0f8aa56
Summary:
### Connecting Flipper with JS apps by using electron's BrowserWindow and IPC
1. UI: there is a menu item in Devices tab which opens JS Emulator Launcher Sheet. Here we can configure URL to open and initial size of the window.
2. BrowserWindow, preloaded js: there is SupportJSClientPreload.js which initialize communication between flipper and app via electron's ipc
3. On flipper's side there is src/utils/js-client/serverUtils.tsx which contains most of JS emulator related code
4. Extracting of FlipperClientConnection: since we don't use RScocket to communicate with JS app I extracted needed methods to FlipperClientConnection (located in Client) and partly implemented them in JSClientFlipperConnection (requestResponse is just send a message now, doesn't return actual result)
Reviewed By: jknoxville
Differential Revision: D18572882
fbshipit-source-id: 56d1ca1a60ed2e51329b917021a09382cbb1ceec
Summary: This diff lands improved sidebar navigation. The old functionality to order plugins based on last-recently-used, and cropping at 5 items has been removed. Instead, items can be starred and their position will be fixed. Together with the app switcher introduced this should lead to a cleaner, stabler, and more customizable UI.
Reviewed By: jknoxville
Differential Revision: D18299401
fbshipit-source-id: 29b7eb3a4130933c637f7c81834558bf738d5bf0
Summary: Property `device` on Clients for archived device never resolve. As it gets resolved when `addConnection` is called which happens for real non-offline devices. To get around this, I have added an argument to the constructor of the Client, as for offline case we can construct the device before client and can pass it as an argument.
Reviewed By: jknoxville
Differential Revision: D17831261
fbshipit-source-id: a14fb0b65343cccac731077e983026388611d323
Summary:
- Take device id retrieved by matching CSR to the given CSR destination
- Otherwise, use the previous way
Note:
- Backward compatibility will be fixed next diff
Reviewed By: jknoxville
Differential Revision: D17346422
fbshipit-source-id: 59b2fb9849373db1ba930dde702194c5fb201678
Summary: This diff was a joy to draft.
Reviewed By: jknoxville
Differential Revision: D17344676
fbshipit-source-id: 0694d0393fa243edef61408ecfee92912fbbfa32
Summary:
This is an interesting invariant that TS caught here. We
expect `getDevice()` to always return a device but it
cannot because it's set lazily. John Knox suggested we instead
set up a promise in the constructor and resolve it instead of
overriding the stateful promise later.
Reviewed By: jknoxville
Differential Revision: D17313468
fbshipit-source-id: 8fd75f2720546abf67beead23db56216f1a5e0df
Summary:
Could use a closer look. *Shouldn't* change semantics,
but there are some assumptions baked into the code
which I don't fully grasp.
Reviewed By: jknoxville
Differential Revision: D17282310
fbshipit-source-id: af8e6bcd188bd12180a7b2eeafee7ced4f44d1aa
Summary:
* Change the way to determine recently used plugins
* Show all plugins if there are just a few hidden plugins
* Not all of plugins in client list can be showed, so checking happens when rendering
* Add action to clear the history internally (for testing) (not sure if needed)
Reviewed By: danielbuechele
Differential Revision: D16965302
fbshipit-source-id: 6efeedac8c0fad7e89a96e7fc5ba9101d3516fe7
Summary:
- Show all or show 5 LRU plugins
- Update when close/reopen app, collapse sidebar, or expand sidebar
Reviewed By: danielbuechele
Differential Revision: D16917950
fbshipit-source-id: 1e7edc86945162ea14e1cdaa89aa47d3defa4c7d
Summary:
- Add `show more` and `show less` button to expand and collapse
- The element to show depends on its usage rank from Flipper dashboard (manually copied)
Reviewed By: danielbuechele
Differential Revision: D16917952
fbshipit-source-id: fc37d5c640be33794694e302341fa08849b8f97f