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: 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 adds the ability to extend the layout inspector's sidebar via SidebarExtensions
Reviewed By: sjkirby
Differential Revision: D8677332
fbshipit-source-id: 1880d5d2185306290a278e8a48e965ad94b98cc0
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:
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
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
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
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
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
Summary:
At the moment, in sonar we have an error reporter and a Logger.
ErrorReporter can be encapsulated into Logger, so users don't have to decide between logging and reporting errors.
Reviewed By: danielbuechele
Differential Revision: D8531902
fbshipit-source-id: 3986f51ea163ac939f3baffd4db3ab968f2a0762
Summary: maliciously named Android emulators could execute arbitrary commands. This checks makes sure the emulator name only has valid characters and puts them in quotes to prevent executing other commands.
Reviewed By: jknoxville
Differential Revision: D8489024
fbshipit-source-id: d91011ceaa8abf0ac53a308089cbdd0b0db03b54
Summary:
Remove old version number check. `AutoUpdateVersion` is used instead for macOS, we currently do not support auto-updates on other platforms.
This also removes the leaked Intern Graph secret.
Reviewed By: emilsjolander
Differential Revision: D8488849
fbshipit-source-id: 0853e8f868137972f718847c49038304525e1e06
Summary:
Common Name extraction by regex was failing on LibreSSL.
Now using RFC2253 to unamiguously format distinguished name subject strings.
Reviewed By: emilsjolander
Differential Revision: D8452825
fbshipit-source-id: a18d4162a7aed3b5bd8c2996ff3832877dac90db