Commit Graph

19 Commits

Author SHA1 Message Date
Daniel Büchele
99ea11b8e6 createPaste
Reviewed By: jknoxville

Differential Revision: D14224400

fbshipit-source-id: 9a9a8578de00d276d65a7928964eae619f5bc41f
2019-02-28 07:28:25 -08:00
Daniel Büchele
c21875e168 refactoring
Summary:
This is refactoring the layout inspector. The old layout inspector was a single file with more than 1200 LOC which was really hard to debug and extend. This aims for splitting it up into smaller, easier to maintain components.

This version of the layout inspector only shows the view hierarchy for the regular view tree and the a11y tree. Additional features are added in stacked diffs.

Reviewed By: jknoxville

Differential Revision: D14100536

fbshipit-source-id: ca5e22dbb6ed9e34ce208a2a699ebfeb083904ad
2019-02-18 05:17:52 -08:00
Pritesh Nandgaonkar
f12226ac00 Just trigger for fatal logs and error logs with tag AndroidRuntime
Summary: This diff updates the check which triggers crash notifications. We got a user feedback that crash reporter used to report non fatal crash too and it used to annoy users with bombardment of crash notifications.

Reviewed By: passy

Differential Revision: D13878272

fbshipit-source-id: 75446f08f806e8f28a6f68953c0a001fd18a7dc0
2019-01-30 06:50:16 -08:00
Pritesh Nandgaonkar
978b14c3d3 Append and show errors which are caused due to jni/native crashes
Summary:
Before this diff, the crash reporteer plugin for android just used to show messages which were error and had tag as "AndroidRuntime". This diff fixes this and instead accepts multiple different tags which might be related to crashes.

The issue with triggering the notification for all kind of messages would be that, the user might get many. For the jni errors, the stack trace of it are shown as multiple entry instead of one entry in logcat. So to combine all the stack trace into one callstack message, this diff adds a timer of 10ms and combines the messages which occur in that timespan and then trigger the notification.

Reviewed By: danielbuechele

Differential Revision: D13772505

fbshipit-source-id: fec6f5a7f9f46948c9f9dc5b2a7b92690913c8aa
2019-01-25 09:52:43 -08:00
Pritesh Nandgaonkar
3b9253680f Refactor the type of os from String to an closest enum kind of thing
Summary: This diff updates the type of os in Store from string to a custom enum kind of type.

Reviewed By: passy

Differential Revision: D13622598

fbshipit-source-id: c57a1f2eedbe9e88d43c681c2fa6ca72b93e8808
2019-01-10 09:55:47 -08:00
Pritesh Nandgaonkar
0048fc6e4a Crash reporter plugin
Summary: This diff adds a static function `onRegisterDevice` which is being called whenever an  device gets registered. This callback is used to add loglisterner for android. I even moved the logic of iOS from `onRegisterPlugin` to this callback. The reason for not adding android log listener in `onRegisterPlugin` was that there were cases when baseDevice was not yet registered before calling `onRegisterPlugin`. For android, I want the instance of `BaseDevice` so that I can add logListener on it.

Reviewed By: danielbuechele

Differential Revision: D13563282

fbshipit-source-id: b5be40f3dbc808bdaeabae28423c563cf2345a22
2019-01-09 10:42:55 -08:00
Pritesh Nandgaonkar
9d4bb45dbc Refactor CrashReporter plugin
Summary: This diff refactors CrashReporter Plugin. The business logic of crash reporter plugin was placed in the `iOSDevice.js` as it gets the hook to the initialisation of iOSDevice. This diff moves the business logic to the Crash Reporter plugin files under the plugins folder. To get the hook, so that we can add our watcher, I have added a static function over `FlipperBasePlugin`, which if exists, will be called once `REGISTER_PLUGIN` event is dispatched

Reviewed By: danielbuechele

Differential Revision: D13529035

fbshipit-source-id: 28216b273b4032727859107d8a6751c6465af9ac
2018-12-21 07:03:21 -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
Pritesh Nandgaonkar
14431e6b76 Make crash reporter plugin device only
Summary: Makes a crash reporter plugin as a device plugin

Reviewed By: passy

Differential Revision: D13203954

fbshipit-source-id: 02ef2aff05d5a240eaff588f9b515d3d610fc182
2018-11-29 06:59:16 -08:00
Daniel Büchele
a455520ecb adding jest test setup
Summary:
Adds a test runner for jest test and adds three simple test cases:
- render the app
- start a server
- client connecting to the app

Test can be run using `yarn test`.

To make the test runner work, some changes needed to be made:
- remove the export of `init()` from `'flipper'`, because it was a cyclic dependency
- updating Button.js to the new ref-API

Reviewed By: jknoxville

Differential Revision: D10027078

fbshipit-source-id: 49107b0dd4dec666b92ecd841422fe7e6b3a7756
2018-09-28 06:42:08 -07:00
Daniel Büchele
71458b97b3 fixing plugin imports
Summary:
Plugins need to be self-contained. The can not require any dependency from Flipper's main app. This was a soft requirement before, but with the new version of metro, we now make this a hard requirement.

This speeds up plugin compile times, because only the files in the plugin's folder are watched and not all of Flipper's files. Moreover, this ensures "plugins" are real plugins and can be added and removed and are not mixed with the apps core.

Reviewed By: passy

Differential Revision: D9940735

fbshipit-source-id: 47e120429fc3c4c985731478ffa35c3359ff78f9
2018-09-20 04:27:48 -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
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
Pascal Hartig
175ba7f331 Remove import-sideffect call to init()
Summary:
Back out "Back out "[flipper] Export init function""
Original commit changeset: 93b916d472b7

The import side effect seems to cause some issues with shadowing,
so let's pull this all the way to the top and call this from HTML
as Sonar.init().

Reviewed By: danielbuechele

Differential Revision: D9849869

fbshipit-source-id: b62772ecddc59eab00251ebf19816f470d76ba82
2018-09-17 08:59:34 -07:00
Pascal Hartig
c93ab83bd9 Back out "[flipper] Export init function"
Summary:
This seems to break initialization. I'm not quite sure why, but
inside the exported function, nothing else from the file appears
to be visible.

Original commit changeset: 55b2a61186e6

Reviewed By: danielbuechele

Differential Revision: D9849812

fbshipit-source-id: d88973721da82040e1f29669acade6c883619ce8
2018-09-17 06:14:32 -07:00
Pascal Hartig
fc653d8057 Export init function
Summary: This way we can mock it during tests.

Reviewed By: jknoxville

Differential Revision: D9788349

fbshipit-source-id: 55b2a61186e6294a8098db7add50fd8bbac7a680
2018-09-13 08:58:03 -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
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