Commit Graph

15 Commits

Author SHA1 Message Date
John Knox
d48f93edea Add method field to persistedStateReducer
Summary:
When sending a message from the mobile side, you call something like:

`send(method: string, params: Object)`

But when receiving it in the reducer, you only get the params. Adding method so you can distinguish them.

Reviewed By: passy

Differential Revision: D10447890

fbshipit-source-id: f1fe925e82355866f86b322ecd3c72c604ae86af
2018-10-19 03:37:59 -07:00
Daniel Büchele
f973bdd455 add notification API to network plugin
Summary: Trigger notifications for all network requests having an error status code.

Reviewed By: passy

Differential Revision: D10401402

fbshipit-source-id: 8fa63cbc251457142abd71845fb6f1c735b247cc
2018-10-18 02:47:53 -07:00
Pascal Hartig
01020edbf2 Restore computeNotifications
Summary:
Restore the logic for setting and computing notifications that was
partially removed with D10300838.

Reviewed By: jknoxville

Differential Revision: D10361547

fbshipit-source-id: 4d229d5f4dbeda3139463e1c348909b9c5dba66f
2018-10-13 04:18:11 -07:00
Pritesh Nandgaonkar
396e385651 Handle empty state for background plugin
Summary: Handles the case when persisted state is undefined which will be the case when the initially selected plugin is not the one running in background

Reviewed By: danielbuechele

Differential Revision: D10269073

fbshipit-source-id: b7a17b0daa37a486cc7f456338cb97123ad813b7
2018-10-11 15:23:22 -07:00
Pritesh Nandgaonkar
5adc0d0625 make network plugin running in background
Summary: implements `persistedStateReducer` for the network plugins to merge messages into the persistedState even when the plugin is not running.

Reviewed By: danielbuechele

Differential Revision: D10256311

fbshipit-source-id: 53011a2123342825e8404b1c2c798aeb550c596d
2018-10-11 15:23:22 -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
John Knox
49e7f2dc8b Add notifications for failed network requests
Summary: Also acts as a model for using the computeNotifications api.

Reviewed By: passy

Differential Revision: D10240659

fbshipit-source-id: 610512de7484e10c9c0ed8e661913c2fe10869da
2018-10-09 08:27:06 -07:00
Daniel Büchele
df0a0da744 DetailSidebar
Summary:
- rename `SonarSidebar` to `DetailSidebar`
- rename portal id from `#sonarSidebar` to `#detailSidebar`

Reviewed By: passy

Differential Revision: D9851703

fbshipit-source-id: 2d904d17b0c6255a2ec3a79f0ada9bf621693c2e
2018-09-18 07:01:16 -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
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
Arvind Menon
c8c2cfa16f Ignore header case to determine if content is gzipped (#143)
Summary:
This PR updates the Network plugin's response parser to ignore the case of the `Content-Encoding` header in the response. This was preventing responses that are gzipped from being uncompressed. I tested this with gzipped responses through the OkHttp interceptor on Android. This could potentially address #79 as I was experiencing that issue before this change.

![sonar](https://user-images.githubusercontent.com/1328587/42414919-284b80bc-8238-11e8-8cf9-d9e9b9bea133.jpg)
Pull Request resolved: https://github.com/facebook/Sonar/pull/143

Differential Revision: D8780509

Pulled By: danielbuechele

fbshipit-source-id: 1a2d86226a8a0204ff43eb5f9394a56c04fd2d8d
2018-07-10 06:17:28 -07:00
Daniel Büchele
c239fcac01 persist network plugin state
Summary:
This saved the state of the network plugin even when switching between plugins using persistedState.
A bug in the Android implementation didn't clear the events that were already sent to the desktop.

Reviewed By: jknoxville

Differential Revision: D8752098

fbshipit-source-id: 152ec5da83958ad8124686f780d39983cbce563f
2018-07-10 02:33:51 -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
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