Summary:
This PR includes documentation for using the `SonarOkhttpInterceptor` for applications using the `OkHttp` network stack. The docs were modelled on the [Stetho docs](http://facebook.github.io/stetho/#enable-network-inspection)
Fixes#22.
Pull Request resolved: https://github.com/facebook/Sonar/pull/144
Differential Revision: D8780506
Pulled By: danielbuechele
fbshipit-source-id: fb2ddd4356b421c3baf0a80a410dd579ebc1bd8d
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
Summary:
Two pros are passed into every plugin to persist state:
- `this.props.persistedState` which is the object of the persisted state
- `this.props.setPersistedState` which can be used to modify the persisted state
The state itself is stored in redux and therefore persisted when switching plugins.
The lifecycle hooks used a HOC are now implemented by the `ref`-function, which makes the code a little cleaner.
Reviewed By: jknoxville
Differential Revision: D8752097
fbshipit-source-id: d4f081f149cd840a29f1132bde91d72d3fba67ed
Summary:
One design goal of sonar is to never cause the host app to crash or hang.
For this reason, we do all heavy work in a background thread.
If we detect that it's not running in it's own thread, just return so we don't hold up the caller.
Reviewed By: danielbuechele
Differential Revision: D8767288
fbshipit-source-id: e146cc2cfe5c3e62d12f527ff79f24c74873d4ff
Summary:
Having another attempt at removing this. It's unsafe because it in some cases executes the .then() task in the timekeeper thread, rather than the executor the original future is using.
When that default executor is an InlineExecutor, for example, you can get stack overflow.
I tried to remove this use before, but having the same thread used for both the sonar client itself and rsocket, meant that they entered a deadlock trying to connect.
Now that I've separated those jobs into separate threads, they can execute independently.
Reviewed By: danielbuechele
Differential Revision: D8748356
fbshipit-source-id: a1029ece2c7006ad7642cbf8aa59e692c76b19b2
Summary:
We currently give sonar one event base from java / obj-c code to use for scheduling tasks.
This causes a problem, because we schedule reconnect tasks on the event base, and then these tasks interact with rsocket which schedules it's own tasks.
The problem is that we're passing rsocket the same event base. So the reconnect code executes and blocks waiting for rsocket to connect.
But rsocket can never connect because it never executes because that thread is blocked, so we get deadlock.
Fixing it by giving both processes their own event base / thread.
Reviewed By: danielbuechele
Differential Revision: D8748354
fbshipit-source-id: aa00766059f66fadfecb1970492bbb7107bbbfe4
Summary:
We currently give sonar one event base from java / obj-c code to use for scheduling tasks.
This causes a problem, because we schedule reconnect tasks on the event base, and then these tasks interact with rsocket which schedules it's own tasks.
The problem is that we're passing rsocket the same event base. So the reconnect code executes and blocks waiting for rsocket to connect.
But rsocket can never connect because it never executes because that thread is blocked, so we get deadlock.
Fixing it by giving both processes their own event base / thread.
Reviewed By: danielbuechele
Differential Revision: D8748355
fbshipit-source-id: b0ad2172087f0103180677438f427c831db7f42c
Summary:
We currently give sonar one event base from java / obj-c code to use for scheduling tasks.
This causes a problem, because we schedule reconnect tasks on the event base, and then these tasks interact with rsocket which schedules it's own tasks.
The problem is that we're passing rsocket the same event base. So the reconnect code executes and blocks waiting for rsocket to connect.
But rsocket can never connect because it never executes because that thread is blocked, so we get deadlock.
This is the first step which just changes the interface to pass two event bases.
The consumers will be changed to pass in different threads next.
Reviewed By: danielbuechele
Differential Revision: D8748350
fbshipit-source-id: 481d6f23644f28fd0f1c786252605287019c999c
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
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
Summary:
All the new errors were missing annotation errors. I fixed as many as I could
by adding annotations. For the rest I added a $FlowFixMe suppression type.
Reviewed By: nmote
Differential Revision: D8756267
fbshipit-source-id: a69b6e21525b9b12e582ff18dcb1eeea584abb2a
Summary: Many plugins initialized their state in the init function. Due to changes in how plugins are rendered, the init-function might be called after the initial render and therefore the state being undefined at the first render. This moves the state initialization into a instance variable to ensure they are created before the first render.
Reviewed By: jknoxville
Differential Revision: D8746242
fbshipit-source-id: 04af039da2dc00c14a2d8ac42b72559ce789ef57
Summary: Added duplicate view tree (will be replaced with accessibility node tree eventually). Can toggle ax mode on and off and interact with each tree individually to view/change properties.
Reviewed By: danielbuechele
Differential Revision: D8717557
fbshipit-source-id: 1109ccafd49b6958ee7a70c2e8851ed8351516ae
Summary: This diff is mainly moving diffs around to open source the Sandbox plugin. I created the MD file writing some docs. The rest is just making our own FB implementation work
Reviewed By: danielbuechele
Differential Revision: D8731839
fbshipit-source-id: 27ac67223c6de9d1be406ab8c06b71b82d5407bc
Summary: Now, that we always have one device selected, we can put the buttons for screenshot and screen capture to Sonar's titlebar. This diff also adds support for iOS devices.
Reviewed By: jknoxville
Differential Revision: D8732632
fbshipit-source-id: 56271fbba7b4a2c10c2742c5c457dbb4c3c16777
Summary:
Some errors such as UI errors should be logged whenever they occur, but some, such as those that occur when a device keeps trying to connect but can't, should not be.
This adds the class and replaces the top recurring errors with it.
Reviewed By: danielbuechele
Differential Revision: D8639448
fbshipit-source-id: f001aa1e90eae6d26a8dbfcd3175b51fc486eae9
Summary: Instead of showing a modal alert, we are now showing a notification, when an update is available. Clicking the notification will restart Sonar and install the plugin. Otherwise, the update will be installed on the next start of Sonar.
Reviewed By: jknoxville, priteshrnandgaonkar
Differential Revision: D8732743
fbshipit-source-id: b9e73a0d5b0866ab79b1e17274c501eac2ef41cc
Summary:
This lets `yarn` work properly on Windows. Tested in a Cygwin environment. I also added a note about yarn compatibility to the readme.
Closes https://github.com/facebook/Sonar/pull/138
Reviewed By: danielbuechele
Differential Revision: D8734197
Pulled By: xiphirx
fbshipit-source-id: 19be8bb0653a2b0381224b065df0cac579d72c3b
Summary:
Remove left over from local testing.
Closes https://github.com/facebook/Sonar/pull/127
Reviewed By: danielbuechele
Differential Revision: D8723789
Pulled By: passy
fbshipit-source-id: f08203a441c35860dd5257a0ec147d1bf9c3da60
Summary:
Add the required compiler flag for Folly when building x86_64.
I'll prepare a new release for this shortly.
Depends on #126
Closes https://github.com/facebook/Sonar/pull/128
Reviewed By: danielbuechele
Differential Revision: D8731955
Pulled By: priteshrnandgaonkar
fbshipit-source-id: 9511811b0b51205989a5200ad9d0d8689ca684cb
Summary:
This mirrors the extension support added to the desktop plugin and allows people to dynamically
add extension commands
Reviewed By: danielbuechele
Differential Revision: D8691167
fbshipit-source-id: 60136b960f8bbdfa42b2077d1f5f7b391fc44443
Summary: This adds the ability to extend the layout inspector's sidebar via SidebarExtensions
Reviewed By: sjkirby
Differential Revision: D8677332
fbshipit-source-id: 1880d5d2185306290a278e8a48e965ad94b98cc0
Summary:
This uses OpenSSL 1.1.0h to build and link against. The `.so`s are
precompiled and hand-patched from [this
repository](https://github.com/passy/android-database-sqlcipher). The
patching was necessary to fix the `SONAME` and corresponding `NEEDED`
flags to *not* contain a `.1.1` version suffix as Gradle will refuse to
bundle those.
We basically only use the headers for the remaining part.
The precompiled version contains ABI support for `arm64-v8a`, `armeabi`,
`armeabi-v7a`, `x86` and most importantly `x86_64`. HOWEVER, `x86_64` is
still excluded for now because folly fails to compile due to a missing
compiler flag:
```
error: needs target feature pclmul
```
This should be easily fixable by ensuring that `-mpclmul` is added to
the CFLAGS if we're compiling for an `x86_64` target in the
`CMakeLists.txt` for Folly.
Closes#113.
Closes https://github.com/facebook/Sonar/pull/125
Reviewed By: priteshrnandgaonkar
Differential Revision: D8723636
Pulled By: passy
fbshipit-source-id: 41c61047d2793ebaef5793a3c937c4d628471d6a
Summary: `~` is not supported by node's `fs` functions. So we are replacing it manually.
Reviewed By: priteshrnandgaonkar
Differential Revision: D8658889
fbshipit-source-id: 36c9885a00a7e07e54ab416d6fda3b29bbda73b6
Summary:
You don't necessarily need / have your shared preferences defined in a file that is your package
name. This adds the ability to pass in the name + mode you need to read the correct shared
preferences file.
Reviewed By: sjkirby
Differential Revision: D8661573
fbshipit-source-id: 49e57b0371228eca7fc4f06e8ba65ff8cc059b11
Summary: The Android plugin has already been open sourced. This seemed to have fallen through the cracks.
Reviewed By: danielbuechele
Differential Revision: D8661536
fbshipit-source-id: eefbf224230f055db7ab5b5a0e04c192d3309132
Summary:
This PR brings us one step closer for publishing SonarKit.podspec to the public Cocoapods master repository. This solves [#93](https://github.com/facebook/Sonar/issues/93).
- [X] `SonarKit.podspec` now lints by passing the `--sources` flag and the `--use-libraries` flag. `pod spec lint SonarKit.podspec --sources=https://github.com/facebook/Sonar,master --allow-warnings --use-libraries` Same for `pod repo push`.
- [X] `SonarKit.podspec` is now also published to the CocoaPods Private repo. What does this mean? It means that we no longer need to manually define all of `SonarKit` dependencies in the Podfile. It only takes `SonarKit` consumers to add this line `source 'https://github.com/facebook/Sonar.git'` on top of any Podfile, and `SonarKit` will be installed by just defining it with `pod SonarKit`.
- [X] We are publishing a Cocoapods Private Repo in the meantime we don't have all of our dependencies updated and published to the CocoaPods master repo. The CocoaPods Private Repo contains updated dependency podspecs that will need to be published to the CocoaPods master repo in the near future. That will be the next action item in order to have SonarKit.podspec published as well.
- [X] Sample App Podfile has been refactored, much simpler and cleaner.
- [X] SonarKit Framework project now pulls its dependencies from the cocoapods master repository and the temporary private repository instead of the local podspecs. I am able to compile the SonarKit framework project now, before I was unable to.
- [X] Local third party podspec dependencies have been removed.
emilsjolander priteshrnandgaonkar noahsark769 feel free to contribute or expose any concerns.
Closes https://github.com/facebook/Sonar/pull/107
Reviewed By: danielbuechele
Differential Revision: D8694271
Pulled By: priteshrnandgaonkar
fbshipit-source-id: dcccf70d917cad1e27606a29c0b921883bf9a76f
Summary: Bump the Android version to 0.0.8.
Reviewed By: priteshrnandgaonkar
Differential Revision: D8694509
fbshipit-source-id: fec7a0cfcde7dfd12ba2ad13f68da6e1e6e55254
Summary:
Set up our fbjni sub-project to be published to Maven Central.
This removes a bunch of abiFilters that we no longer make use of, too.
Closes https://github.com/facebook/Sonar/pull/119
Reviewed By: priteshrnandgaonkar
Differential Revision: D8694537
Pulled By: passy
fbshipit-source-id: de246fbda99c02856fbc7806b78df2114cb82acb
Summary:
We're already building this as dependency via CMake of sonar itself and
bundle the resulting `.so` files in there.
This project only contains the java files so we can ship them as
separate JAR.
Importantly, this avoids having to use `pickFirst` as we bundle multiple
incompatible `.so` files in both AARs.
Closes https://github.com/facebook/Sonar/pull/116
Reviewed By: priteshrnandgaonkar
Differential Revision: D8691119
Pulled By: passy
fbshipit-source-id: 82303d6c2b5d7e12dcd8f49300090ce8e4570e47
Summary:
There's been a new stable release and we no longer need to depend on the
snapshot releases.
Closes https://github.com/facebook/Sonar/pull/112
Reviewed By: danielbuechele
Differential Revision: D8659035
Pulled By: passy
fbshipit-source-id: 83763e521ffd53e031664e3b1d2714df769d1557