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
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
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
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
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
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
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
Summary: Makes a crash reporter plugin as a device plugin
Reviewed By: passy
Differential Revision: D13203954
fbshipit-source-id: 02ef2aff05d5a240eaff588f9b515d3d610fc182
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
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
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
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
Summary: This way we can mock it during tests.
Reviewed By: jknoxville
Differential Revision: D9788349
fbshipit-source-id: 55b2a61186e6294a8098db7add50fd8bbac7a680
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
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