Commit Graph

146 Commits

Author SHA1 Message Date
Pascal Hartig
540776f172 Add Travis link to readme (#141)
Summary:
![](https://media1.giphy.com/media/vntyBKuV7FwZO/giphy.gif)
Pull Request resolved: https://github.com/facebook/Sonar/pull/141

Reviewed By: jknoxville

Differential Revision: D8766655

Pulled By: passy

fbshipit-source-id: 04026f06d248880e5373806769613e9226aa712f
2018-07-09 07:19:22 -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
Hilal Alsibai
56cfe6600d Add Shared Preferences plugin docs
Summary: Moar docz

Reviewed By: danielbuechele

Differential Revision: D8752565

fbshipit-source-id: d7e4392e00dc06b0ffbebce491d5244b4b31a34d
2018-07-09 02:48:37 -07:00
Sam Goldman
51741a2741 Update Sonar from 0.69.0 to 0.70.0
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
2018-07-06 16:04:19 -07:00
Conor O'Donnell
d45bc14cce Keep strong reference to OnSharedPreferenceChangeListener (#131)
Summary:
A strong reference to the listener should be kept when calling `registerOnSharedPreferenceChangeListener`, otherwise the listener can get garbage-collected and stop working.

Mentioned in the Android SDK docs [here](https://developer.android.com/reference/android/content/SharedPreferences.html#registerOnSharedPreferenceChangeListener(android.content.SharedPreferences.OnSharedPreferenceChangeListener)):

> Caution: The preference manager does not currently store a strong reference to the listener. You must store a strong reference to the listener, or it will be susceptible to garbage collection. We recommend you keep a reference to the listener in the instance data of an object that will exist as long as you need the listener.
Closes https://github.com/facebook/Sonar/pull/131

Differential Revision: D8751484

Pulled By: xiphirx

fbshipit-source-id: e46715d637c89491770c266fc22c27db41beb042
2018-07-06 13:03:44 -07:00
Hilal Alsibai
3af57b1ad9 Fix minor typo in alt text for network plugin image
Summary: Typo

Reviewed By: danielbuechele

Differential Revision: D8751861

fbshipit-source-id: 26e89222a6e745dac4f114d62ad1fa6faebbecd6
2018-07-06 12:49:55 -07:00
Daniel Büchele
809136fc29 fix plugin state initialization
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
2018-07-06 03:17:54 -07:00
Sara Valderrama
d8cf48d750 Two-tree view up and running, separately interactive/editable
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
2018-07-05 16:19:29 -07:00
Sara Valderrama
917376db6d basic layout edits
Summary: Include toggle button, trees/sidebar not separately interactive

Reviewed By: danielbuechele

Differential Revision: D8680613

fbshipit-source-id: 3bc52b66881abc56ea5cc0955f8237509d039fc4
2018-07-05 16:19:28 -07:00
Pritesh Nandgaonkar
3833f061e2 Android travis
Summary: Closes https://github.com/facebook/Sonar/pull/136

Reviewed By: danielbuechele

Differential Revision: D8735101

Pulled By: priteshrnandgaonkar

fbshipit-source-id: 648756cf67f07abb6e0c80b677fa01bf5c5085b7
2018-07-05 10:18:18 -07:00
Edoardo Tognoni
53753801b0 Open source the Sandbox plugin
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
2018-07-05 09:19:37 -07:00
Daniel Büchele
03a8e696a9 Screenshot in titlebar
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
2018-07-05 07:32:31 -07:00
John Knox
de353a7ed0 Add RecurringError class for errors that should only be logged once per session
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
2018-07-05 07:17:41 -07:00
Daniel Büchele
0ddeb076bb Update notifications
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
2018-07-05 04:47:20 -07:00
Hilal Alsibai
2a46f93eab Fix install for Windows (#138)
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
2018-07-05 03:32:30 -07:00
Pritesh Nandgaonkar
49c533ed35 Travis badge (#135)
Summary:
Adds travis badge
Closes https://github.com/facebook/Sonar/pull/135

Reviewed By: danielbuechele

Differential Revision: D8732766

Pulled By: priteshrnandgaonkar

fbshipit-source-id: 51ba49b0382f9bef88f297d061e30c862b751cd1
2018-07-04 11:33:36 -07:00
Pascal Hartig
020a771125 Clean up Folly CMakeLists (#127)
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
2018-07-04 11:33:36 -07:00
Pascal Hartig
c4696303fc v0.0.10 (#129)
Summary:
New release including x86_64 binaries.

Depends on #128.
Closes #111.
Closes https://github.com/facebook/Sonar/pull/129

Reviewed By: danielbuechele

Differential Revision: D8723869

Pulled By: priteshrnandgaonkar

fbshipit-source-id: f52ce3eaf28e3f18f7099d17647c1650d3fa7c58
2018-07-04 10:17:52 -07:00
Pascal Hartig
3dcf7722bb Add support for x86_64 builds (#128)
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
2018-07-04 10:17:52 -07:00
Pascal Hartig
ce33859d2d v0.0.9 (#126)
Summary:
Bump version.

Depends on #125.
Closes https://github.com/facebook/Sonar/pull/126

Reviewed By: danielbuechele

Differential Revision: D8731964

Pulled By: priteshrnandgaonkar

fbshipit-source-id: cac1100208435c2830a572d8a2a318f4c87516ec
2018-07-04 10:17:52 -07:00
Pritesh Nandgaonkar
c3286b7f85 Update iOS travis to make it pass (#133)
Summary:
It updates the `xcodebuild` command with the sdk argument
Closes https://github.com/facebook/Sonar/pull/133

Reviewed By: danielbuechele

Differential Revision: D8732525

Pulled By: priteshrnandgaonkar

fbshipit-source-id: 3aafa44cf00f49e507246ec25329a58749025cb4
2018-07-04 09:32:48 -07:00
Daniel Buchele
5163f8b9a3 fbshipit-source-id: c71048dfea2a03cf83650b55aa9d1e463251920c 2018-07-04 07:19:44 -07:00
Hilal Alsibai
e6fa377d75 Add extension support to InspectorSonarPlugin
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
2018-07-03 16:33:42 -07:00
Hilal Alsibai
44f561a683 Add ability to dynamically extend the layout inspector sidebar
Summary: This adds the ability to extend the layout inspector's sidebar via SidebarExtensions

Reviewed By: sjkirby

Differential Revision: D8677332

fbshipit-source-id: 1880d5d2185306290a278e8a48e965ad94b98cc0
2018-07-03 16:33:42 -07:00
santosh
f0bf61881e Typo : Need "must" instead of "much" word in Device Communication doc page
Summary: Closes https://github.com/facebook/Sonar/pull/124

Differential Revision: D8727053

Pulled By: passy

fbshipit-source-id: 3609e70af254e2aee7e9e9400ebf631c6198a382
2018-07-03 13:35:10 -07:00
Pascal Hartig
69711642c9 Build against vanilla OpenSSL 1.1.0h (#125)
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
2018-07-03 13:18:53 -07:00
Daniel Büchele
bcc47bfe0c add missing flow interfaces
Summary: adding missing flow interfaces, fixes flow error

Reviewed By: priteshrnandgaonkar

Differential Revision: D8639038

fbshipit-source-id: 509ebcc86ea64a01dcea4968a39ed0ea51fdec93
2018-07-03 10:05:00 -07:00
Daniel Büchele
0d5c98341a allow tilde in pluginPaths
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
2018-07-03 10:05:00 -07:00
Hilal Alsibai
c6eb0d6b1a Integrate shared preferences plugin in sample Android app
Summary: Adds the shared preferences plugin to the sample Android app

Reviewed By: sjkirby

Differential Revision: D8661572

fbshipit-source-id: 490a19938b9dd1c87f9200027d3395d719013d21
2018-07-02 11:05:14 -07:00
Hilal Alsibai
ceb16db812 Make the shared preferences plugin more flexible
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
2018-07-02 11:05:14 -07:00
Hilal Alsibai
55930db6a6 Open source desktop shared preferences plugin
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
2018-07-02 11:05:14 -07:00
Marc Terns
9ad693ca05 CocoaPods Private Repo support (#107)
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
2018-07-02 08:33:07 -07:00
Pascal Hartig
e11a587426 Update getting started reference (#118)
Summary:
Mention latest published version `0.0.8`.
Closes https://github.com/facebook/Sonar/pull/118

Reviewed By: priteshrnandgaonkar

Differential Revision: D8694476

Pulled By: passy

fbshipit-source-id: 7fc536dde44313eff09a64611d4c942d4f52fa1f
2018-07-02 02:33:19 -07:00
Pascal Hartig
cc3a784538 v0.0.8
Summary: Bump the Android version to 0.0.8.

Reviewed By: priteshrnandgaonkar

Differential Revision: D8694509

fbshipit-source-id: fec7a0cfcde7dfd12ba2ad13f68da6e1e6e55254
2018-07-02 02:33:18 -07:00
Pascal Hartig
0515ddb76e Setup fbjni sub-project for maven (#119)
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
2018-07-02 01:19:35 -07:00
Pascal Hartig
167792e7d8 Remove NDK build from fbjni sub-project (#116)
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
2018-06-29 06:47:31 -07:00
John Knox
f8c79b55dc Back out "[sonar] Stop using folly Future::delayedUnsafe()"
Summary: Original commit changeset: 51ab3224b93e

Reviewed By: priteshrnandgaonkar

Differential Revision: D8676855

fbshipit-source-id: 38282f642d8497ce7715017127368445132454fa
2018-06-28 04:32:32 -07:00
Pascal Hartig
fc184812f6 Update Litho dependencies (#112)
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
2018-06-27 08:17:46 -07:00
Pascal Hartig
1060542f64 Add note about current android release issues
Summary: Per title

Reviewed By: danielbuechele

Differential Revision: D8659337

fbshipit-source-id: 3415dfa34b7a4918e9df2abd7f226f62eb63c4d7
2018-06-27 08:04:11 -07:00
Daniel Ruf
85a0e1d24f chore: add Node.js 10
Summary: Closes https://github.com/facebook/Sonar/pull/100

Differential Revision: D8618047

Pulled By: danielbuechele

fbshipit-source-id: 12215bcbd12a9afef88de3d4979931481ff2e7d9
2018-06-27 04:17:23 -07:00
Peter van der Zee
7246e8404b Upgrade Prettier to 1.13.6 on fbsource
Reviewed By: zertosh

Differential Revision: D8638504

fbshipit-source-id: c6991b2e884e14868ddc1d9047a78191219d673f
2018-06-27 03:33:24 -07:00
John Knox
266af3e274 Display message when "Operation Not Permitted" bug is seen
Summary:
On certain samsung devices, the 'run-as' command, inside adb shell doesn't work.
We don't yet have a workaround for this, otherwise potentially upgrading to android 8.
Distinguish these errors (log them so we'll see how often it happens), and tell the user why it's not working.

Reviewed By: danielbuechele

Differential Revision: D8638728

fbshipit-source-id: f4764120cc27187330a3f236636292a5e63e8ec9
2018-06-26 13:02:17 -07:00
Pascal Hartig
46df0b25a0 Set up Maven packaging and Bintray upload (#104)
Summary:
This make use of the the setup we have at Litho, which should make
it easier to keep them in sync.

It creates proper source jars, AARs (without bundling in unwanted
transitive deps) and POMs.
Closes https://github.com/facebook/Sonar/pull/104

Reviewed By: priteshrnandgaonkar

Differential Revision: D8638912

Pulled By: passy

fbshipit-source-id: ff4921c0683e9b6f859085b542ceae840a7e8291
2018-06-26 08:18:23 -07:00
Pritesh Nandgaonkar
110ff1c353 Package prebuilt libraries in android target (#105)
Summary:
package prebuilt libraries in `:android` rather than in sample app
Closes https://github.com/facebook/Sonar/pull/105

Reviewed By: passy

Differential Revision: D8639064

Pulled By: priteshrnandgaonkar

fbshipit-source-id: 4da20b046e2e55f0f605f91bf8809a4efd6848d9
2018-06-26 07:32:46 -07:00
Daniel Büchele
5edb8bd770 clean up dynamic plugin loading
Summary:
There are 3 sources where plugins can be loaded from:
* `src/plugins`
* `src/fb/plugins`
* any path specified in `~/.sonar/config.json`

Plugins found in the first two directories are bundled with the app when building.

Reviewed By: jknoxville

Differential Revision: D8636061

fbshipit-source-id: 2064090d43d11695ffd99df195e5b594559fe087
2018-06-26 07:17:39 -07:00
John Knox
70e11e8269 Stop using folly Future::delayedUnsafe()
Summary:
delayedUnsafe() is unsafe because it disregards the executor you have specified, and uses the default one.
Depending on the context, this can sometimes be an InlineExecutor, and since some of the scheduled jobs, schedule instances of themselves, this can cause infinite recursion to occur.
Fixing this by using the safe variant of delayed, and also using a new instance of IOExecutor.
We need a new Executor for the Sonar loop, because if we use the same worker thread as is provided to RSocket, we get deadlock when we wait for rsocket to connect.

Reviewed By: danielbuechele

Differential Revision: D8617679

fbshipit-source-id: 51ab3224b93e774596a8799338e7391e2eb956cb
2018-06-25 16:03:18 -07:00
John Knox
361a4cca76 Fix Logger issue in OSS build (#102)
Summary:
We've replaced the global console.* methods with those in the Logger.
The OSS Logger uses a different implementation to the internal fb one, and it still calls back to console.*, causing a stack overflow.
Fix it by removing the console calls from Logger.js.
Logging to the original console methods is done by the Proxy in App.js.

Fixes #101
Closes https://github.com/facebook/Sonar/pull/102

Reviewed By: priteshrnandgaonkar

Differential Revision: D8617042

Pulled By: jknoxville

fbshipit-source-id: 055bf0e1a2fba8ad5312c88fa97a44389eb52390
2018-06-25 14:05:03 -07:00
Pritesh Nandgaonkar
64a61a37d4 Fix Broken sample app (#103)
Summary:
With this fix the entire android setup builds with gradle . To try out the sample app, run `./gradlew :sample:installDebug`
Closes https://github.com/facebook/Sonar/pull/103

Reviewed By: danielbuechele

Differential Revision: D8618622

Pulled By: priteshrnandgaonkar

fbshipit-source-id: 62a038f95c37cbadf48636a58ca222c8162e256e
2018-06-25 11:33: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