Commit Graph

32 Commits

Author SHA1 Message Date
Pascal Hartig
09a93cd9e6 Upgrading flow and fixing lint errors
Summary:
Upgrading to flow 0.91, fixing a bunch of `$FloxFixMe`s that were introduced by upgrading to 0.86.
Also fixing some linting issues.

Reviewed By: priteshrnandgaonkar

Differential Revision: D13900794

fbshipit-source-id: 5d0a1b62371f3b5d34b909bae0876583acb6f977
2019-02-01 06:51:01 -08:00
Daniel Büchele
cc0615c7d9 Sort plugins by name
Summary: Sort plugins in sidebar by name (or ID as fallback).

Reviewed By: passy

Differential Revision: D13621422

fbshipit-source-id: dd264bde64409a2cd81caa0b41af81bf614f9e62
2019-01-10 03:50:51 -08:00
Daniel Büchele
422ab99d29 no client/device
Summary:
Plugin debugger is now supporting 3 different scenarios:
- no devices connected
- device connected, but no app for the selected device is connected
- apps are connected

Added button to the sidebar to open plugin debugger.

Reviewed By: passy

Differential Revision: D13608749

fbshipit-source-id: d5ba04882590dace78e4ef0b17799d5a394dc3c4
2019-01-09 10:05:26 -08:00
Daniel Büchele
6ffc027051 read infos from package.json
Summary:
Adding the properties from a plugin's `package.json` as static properties to the class.
The name from `package.json` is used as it's `id`.

This allows us in the future to add meta information about a plugin to it's package.json and still use the data inside the app.

Reviewed By: priteshrnandgaonkar

Differential Revision: D13417288

fbshipit-source-id: 3d0a62d4cb0115153cce1aaee677b9680fefebf4
2018-12-18 08:37:28 -08:00
John Knox
3057c0a6e7 Show indicator when client setup fails (#339)
Summary:
At the moment, when a client is failing to connect, you effectively get an infinite spinner, as it keeps retrying.

This keeps the spinner while it's retrying, but in between, shows a failure icon.

This isn't perfect. It's still shown under possibly the wrong device, but that already happens anyway, this just adds an extra icon.
Pull Request resolved: https://github.com/facebook/flipper/pull/339

Reviewed By: priteshrnandgaonkar

Differential Revision: D13319635

Pulled By: jknoxville

fbshipit-source-id: e16177ecc7058b779fb17b61e20fcbac8ccf0c29
2018-12-04 07:10:51 -08:00
Daniel Büchele
133788380e prevent unnecessary rerenders
Summary:
Updates of the redux store caused rerendering of UI components, even without the acutal UI changing. This diff ensures the UI is only updated, when

The PluginContainer received all plugin states and selected the pluginState of the active plugin to pass it down to the plugin. However, this caused a rerender everytime a pluginState changed (even if the plugin was in the background).

This diff moves the selection of the active plugin to the `connect`-function and only passes the state of the active plugin into the container. This makes sure the plugin rerenders only if it's own state changes.

The main sidebar displays the number of notifications. Therefore, it was passed the array of notifications. However, this array is regenerated, everytime a new notification **might** be triggered.

Now, the number of notifications is calculated in the `connect`-method and only the number itself is passed into the component. This makes sure the sidebar is only rerendered, when the actual number of notifications changes.

Reviewed By: passy

Differential Revision: D13276096

fbshipit-source-id: bf1e6c4a186f7a1cf7f7427cd3523b5b71eb003a
2018-11-30 09:39:28 -08:00
Pritesh Nandgaonkar
fd022e3c73 Improvise UI of crash reporter plugin
Summary:
- New improved UI
- Instead of sending the callstack as a string from android, now sending it as an array
- Deeplink to Logs support just for android. In iOS crash is not automatically logged in Logs plugin, atleast thats what happens in sample app

Reviewed By: jknoxville

Differential Revision: D13216477

fbshipit-source-id: d8b77549c83572d0442e431ce88a8f01f42c9565
2018-11-30 05:28:46 -08:00
Panagiotis Vekris
e380fa7a08 Flow v0.86.0 in xplat/sonar
Summary: allow-large-files

Reviewed By: gabelevi, dsainati1

Differential Revision: D13105210

fbshipit-source-id: 462af926206a10618a725531f2e62da9f3291fc0
2018-11-19 12:14:51 -08:00
Panagiotis Vekris
b2b27b774e Back out "Flow v0.86.0 in xplat/sonar"
Summary: Original commit changeset: f0122c8c6d60

Reviewed By: avielg

Differential Revision: D13083312

fbshipit-source-id: 4b77fda5221feff5c721bb8a509b1350d60046d5
2018-11-15 08:24:00 -08:00
Daniel Büchele
7747a0714d plugin redux
Summary:
Plugins were loaded in `/plugins/index.js` which was loaded once at launch of the app. This moves the list of available plugins to redux. This way, plugins can be dynamically added. The redux store keeps to Maps of plugins (devicePlugins and clientPlugins) with their ID as key:

```
  devicePlugins: Map<string, Class<FlipperDevicePlugin<>>>,
  clientPlugins: Map<string, Class<FlipperPlugin<>>>,
```

On launch of the app, all plugins bundled with the app and the one found in `pluginsPath` are dynamically added.

This changes now allows to add new plugins at any time. All components that need to know which plugins are available (e.g. the sidebar) are connected to the redux store. This way, they will automatically update, whenever a new plugin is added.

- add `plugins` to the redux store to keep the list of available plugins
- add a plugins dispatcher, responsible for loading the plugins on launch
- connecting all React components that imported `plugins/index.js` before to the redux store to get the plugins from there.
- moved the updating of the MenuBar to the plugins dispatcher as it needs to update whenever a new plugin is added.

Reviewed By: jknoxville, passy

Differential Revision: D12449236

fbshipit-source-id: 6ef3e243e2c80443614b901ccbfde485fcb4301c
2018-11-15 07:30:05 -08:00
John Knox
ff3977da77 Show connecting spinner
Summary:
First step in visualising the connection setup process.
Just a spinner while cert exchange is happening, so it doesn't look like nothing is happening.

Reviewed By: passy

Differential Revision: D13062514

fbshipit-source-id: a0692821025f42f4fe4af86faf059d4719008f25
2018-11-15 04:36:40 -08:00
Panagiotis Vekris
6362188563 Flow v0.86.0 in xplat/sonar
Summary: allow-large-files

Reviewed By: zertosh

Differential Revision: D13067587

fbshipit-source-id: f0122c8c6d602750289121d2ab2fdb09cbb033bc
2018-11-14 15:39:25 -08:00
Daniel Büchele
f1c6ebfbd5 disable GK
Summary: Adding a GK to be able to disable notifications remotely.

Reviewed By: passy

Differential Revision: D10467036

fbshipit-source-id: ee555bd73cb5c58d1113e28fe88fe605480865cf
2018-10-19 10:53:13 -07:00
Daniel Büchele
22e3017cdc move NotificationHub from plugins to main folder
Summary: As all device plugins are now moved to the plugins folder, this was the last thing in this folder. I am moving it out and putting it next to the core UI parts of the app.

Reviewed By: jknoxville

Differential Revision: D10337838

fbshipit-source-id: 6fa699c28e5df8a53719179fbb760f2a140bafc4
2018-10-15 02:59:37 -07:00
Alex Langenfeld
f3d2e0983e support user defined device plugins
Summary:
* move CPU and Logs plugin to plugins directory, set up package.json for them
* adjust plugins/index.js to expose device and client plugins in the same place, adding two new exports

Reviewed By: danielbuechele

Differential Revision: D10247606

fbshipit-source-id: 347bf8b3f9629987ad29d1d2ed025e0c88b9c967
2018-10-10 18:43:21 -07:00
Alex Langenfeld
7527636a38 change device plugin support check
Summary: Invert the way device plugin <-> device support works with the long term goal of supporting user defined device plugins

Reviewed By: danielbuechele

Differential Revision: D10240765

fbshipit-source-id: 9e886518a2fbfd263c79daa4b805c088ab38ab87
2018-10-10 18:43:21 -07:00
Daniel Büchele
78252b2ef2 adding UI
Summary:
- Adds the Flipper notifications UI from the hackweek
- The notifications plugin is hidden behind a GK `flipper_notifications`
- Plugins currently can not dispatch any notifications

Reviewed By: jknoxville, passy

Differential Revision: D10300838

fbshipit-source-id: 2a3a823f09fee3370ce725b506b162e57751c382
2018-10-10 10:41:09 -07:00
Daniel Büchele
66e77075be Rename package to 'flipper'
Summary:
- rename package `'sonar'` > `'flipper'`
- rename package `'sonar-static'` > `'flipper-static'`
- rename package export from `window.Sonar` to `window.Flipper`

Reviewed By: passy

Differential Revision: D9851181

fbshipit-source-id: 34d4447c3b287496b3d20ddb54471ce777ec74e1
2018-09-18 07:01:16 -07:00
Daniel Büchele
2e2924c979 SonarPlugin > FlipperPlugin
Summary:
Renaming:
- `SonarPlugin` > `FlipperPlugin`
- `SonarBasePlugin` > `FlipperBasePlugin`
- `SonarDevicePlugin` > `FlipperDevicePlugin`

Reviewed By: passy

Differential Revision: D9851075

fbshipit-source-id: d59df6952a42eb493c86c38895216c9985f1e14b
2018-09-18 07:01:16 -07:00
John Knox
0f08b04571 Filter displayed plugins by selected device
Summary: Now that android devices know their own serial, we can filter plugins by the selected device.

Reviewed By: passy

Differential Revision: D9481461

fbshipit-source-id: 4a53eea1e61caa09c3d63ca0076fbc1b6dceb99f
2018-08-31 08:12:57 -07:00
Daniel Büchele
726966fdc0 convert to emotion
Summary:
My benchmarks have shown react-emotion to be faster than the current implementation of `styled`. For this reason, I am converting all styling to [emotion](https://emotion.sh).

Benchmark results:
{F136839093}

The syntax is very similar between the two libraries. The main difference is that emotion only allows a single function for the whole style attribute, whereas the old implementation had functions for every style-attirbute.

Before:
```
{
  color: props => props.color,
  fontSize: props => props.size,
}
```

After:
```
props => ({
  color: props.color,
  fontSize: props.size,
})
```

Reviewed By: jknoxville

Differential Revision: D9479893

fbshipit-source-id: 2c39e4618f7e52ceacb67bbec8ae26114025723f
2018-08-23 09:42:18 -07:00
Aaron Brady
1a7ef4fc85 Generalize client OS filtering by device and move logic to Device class itself
Summary: Adding support for a WindowsDevice (in following diff) that relies on this behavior, also seems reasonable that the logic for what client os' a device supports should be in the device class.

Reviewed By: jknoxville

Differential Revision: D8861698

fbshipit-source-id: 2907f616baa04eb71a9e4ef3b6704980acbafaf5
2018-08-13 11:29:59 -07:00
Daniel Büchele
aace545ba6 move WelcomeScreen
Summary: The sidebar is now shown, even if no device is connected. This prevents the jumping layout when Flipper launches, but still has not connected to devices.

Reviewed By: passy

Differential Revision: D9263892

fbshipit-source-id: d5b96a8619393ee4002863a83d9024f00c6cb396
2018-08-10 08:57:09 -07:00
Daniel Büchele
764ad440cb Make sidebar scrollable
Summary: Sidebar is now scrollable, when showing too many plugins.

Reviewed By: jknoxville

Differential Revision: D9179312

fbshipit-source-id: bfcd4655a0fbbe91424b88378db3713e68e2cb7f
2018-08-06 06:27:18 -07:00
Daniel Büchele
1f977f4844 Store use selected plugin after reconnect
Summary:
Deselect plugin when app disconnects, but store the information that the users had the app selected. When the app conencts again, restore the user's selection.
This also stores the device seleced by the user and reselects the device if it connects.

Reviewed By: xiphirx

Differential Revision: D8833948

fbshipit-source-id: ad3ef54681550ae674bdd4e695d677aea5c14588
2018-07-31 07:58:33 -07:00
Daniel Büchele
9f95698492 disable auto publish
Summary: electro-builder automatically publishes when it detects builds on TravisCI. This disables this behaviour, as we want to manually publish releases.

Reviewed By: jknoxville

Differential Revision: D8783066

fbshipit-source-id: d8723c87b879b3ef7ee02585997a13cb55095e65
2018-07-11 08:03:57 -07:00
Daniel Büchele
7ed154c510 selected device
Summary: The redux store keeps a list of devices. For the active device, it stored the index in that list. This diff now stores a reference to the active device instead of the index in that array. This changes makes it easier to get the reference to the active device in a component.

Reviewed By: jknoxville

Differential Revision: D8767514

fbshipit-source-id: c740cf98d6039223ce8d5a47bcd277989fe70bc3
2018-07-09 07:19:23 -07:00
Daniel Büchele
a24655e7bd only show apps from selected OS
Summary:
The sidebar always showed all apps, because we don't know on which device an app is running. This filters the sidebar to only show Android apps, when an Android device is selected and only show iOS apps when an iOS device is selected.
Still, we can't filter when where are more simulators with the same OS.

Reviewed By: jknoxville

Differential Revision: D8766007

fbshipit-source-id: dcf0db41b2c2c5dcaa2d1700343b1dd45d3d53b0
2018-07-09 05:32:38 -07:00
Daniel Buchele
5163f8b9a3 fbshipit-source-id: c71048dfea2a03cf83650b55aa9d1e463251920c 2018-07-04 07:19:44 -07:00
Daniel Büchele
cbab597236 show only one device in sidbar
Summary:
Refactors the plugin architecture of Sonar:
- Before plugin rendering had it's own implementation of the react lifecycle. This means the `render`-function was not called by react, but rather by the application it self. In this diff, the render method is now called from react, which enables better debugging and allows react to do optimizations.
- Business logic for querying emulators is moved away from the view components into its own dispatcher
- All plugin handling is moved from `App.js` to `PluginContainer`.
- The sidebar only shows one selected device. This allows us to add the screenshot feature as part of the Sonar main app and not a plugin.
- This also fixes the inconsistency between the devices button and the sidebar

Reviewed By: jknoxville

Differential Revision: D8186933

fbshipit-source-id: 46404443025bcf18d6eeba0679e098d5440822d5
2018-06-25 10:04:00 -07:00
Daniel Büchele
0c2f4d7cff split Client/Server
Summary: The `Client` and `Server` code was in one file, which was messy. This splits it into two separate files.

Reviewed By: emilsjolander

Differential Revision: D8186932

fbshipit-source-id: faa79d7dccd867d69ccd1bccd43a2cf85314b1b3
2018-06-25 10:04:00 -07:00
Daniel Büchele
fbbf8cf16b Initial commit 🎉
fbshipit-source-id: b6fc29740c6875d2e78953b8a7123890a67930f2
Co-authored-by: Sebastian McKenzie <sebmck@fb.com>
Co-authored-by: John Knox <jknox@fb.com>
Co-authored-by: Emil Sjölander <emilsj@fb.com>
Co-authored-by: Pritesh Nandgaonkar <prit91@fb.com>
2018-06-01 11:03:58 +01:00