Commit Graph

359 Commits

Author SHA1 Message Date
Anton Nikolaev
eeded4e32f Install plugins to pending directory first to enable installing new versions of existing plugins
Summary:
Install plugins to pending directory first to enable installing new versions of existing plugins. On startup Flipper moves all the plugins from pending directory into installed plugins directory.

Auto-update, after downloading a plugin package, will also extract it to "pending", so after restart update will automatically be applied.

Reviewed By: mweststrate

Differential Revision: D21929713

fbshipit-source-id: 141b106415e941156ae598cf810ab3bed8c76ced
2020-06-09 04:58:36 -07:00
Michel Weststrate
eff378defa Avoid JSON.stingify during render
Summary:
See previous diffs, same change as with analytics, don't stringify when creating the rows, but rather provide a closure to do that lazily, which reduces CPU (and mem) usage.

Note that this implicitly assumes the captures variables are immutable, as otherwise the semantics would change. But than again, if those variables are changed in the future, copyText will reflect their latest rather than initial state, which is better anyway.

Reviewed By: nikoant

Differential Revision: D21931748

fbshipit-source-id: 62325dd25953bab3a4e2e9a0d5dea3b3a7787bae
2020-06-09 03:00:23 -07:00
Michel Weststrate
3033fb035c Evaluate copyText lazily
Summary:
`copyText` is generated when building rows for table, and is typically filled by JSON stringifying the incoming data. That is a pretty expensive process that could be done lazily. As shown in later diffs, this reduces the generation of rows for tables from ~18ms to ~3ms, which makes rendering a lot smoother.

(n.b. fixing the code duplication in the managedtables is part of the component lib plan)

Reviewed By: passy

Differential Revision: D21929660

fbshipit-source-id: 67cc69945e2bb28a6462a9d9ab765e33ced89378
2020-06-09 03:00:23 -07:00
Michel Weststrate
2375dd02c3 Fixed bug where message could get lost if plugin was selected
Summary:
If the analytics plugin was in the foreground, and messages arrived in quick succession, some messages would not be processed.

Although the code was tested, there were not enough assertions to make sure the loop was correct. coverage !== correctness {emoji:1f605}

This fixes T68101450

Changelog: Fixed regression where analytics messages where lost

Reviewed By: jknoxville

Differential Revision: D21929679

fbshipit-source-id: c9fe2b18a249e40085d99914a809abf14fa7cf8f
2020-06-08 11:57:20 -07:00
Michel Weststrate
0007ef4b27 Disable sourcemaps for emotion to fix chrome Profiler freeze
Summary:
When trying to profile the Electron app, since recently the profiler hangs when trying to start the initializer. Found the following weird message in the console and googled the problem :-P

{F239554230}

Reviewed By: jknoxville

Differential Revision: D21929677

fbshipit-source-id: 7a9f150ebc8df30fa2890c9dbb79c8c144a5feae
2020-06-08 11:57:19 -07:00
Anton Nikolaev
db3f04a2d7 Use the single type representing plugins
Summary: Use interface PluginDetails everywhere where plugins are handled and removed PluginDefinition type which was effectively a subset of PluginDetails

Reviewed By: mweststrate

Differential Revision: D21927456

fbshipit-source-id: 434ebeef955b922cc11757e78fbba8dec05f1060
2020-06-08 08:57:07 -07:00
Anton Nikolaev
9324bef8cc Moved plugin installation utilities to "plugin-lib" module
Summary: Moved plugin installation utilities to "plugin-lib" module. There are no functional changes in this diff, just refactoring so that plugin installation utils can be re-used by different modules.

Reviewed By: passy

Differential Revision: D21927387

fbshipit-source-id: 340516a544f7cfdcc15d94660dcb74a012054531
2020-06-08 08:57:06 -07:00
Michel Weststrate
b94e426261 Make iOS device detection faster
Summary:
I noticed that Android device detection is _much_ faster than iOS, so I tried to optimize it a bit

1. Removed a test run on `instruments -s`. That command is really slow (easily 5 secs), and the check has become redundant since Doctor already does a similar check
2. When querying for devices, it tries to fetch emulated and physical devices in parallel, but only processes the results after both have finished. However, finding simulators is almost instant, while querying the physical devices takes ~5 seconds ore more. So in this diff we process the found devices till in parallel, rather than waiting until both have arrived

This diff reduces the time until the ios simulator + FB app is detected from 28 to 4 seconds on my machine.

Changelog: Improved the startup sequence for emulated iOS devices, so that devices and apps connect a lot faster after starting Flipper

Reviewed By: jknoxville

Differential Revision: D21907597

fbshipit-source-id: 73edf0b04c4ad8367e04557e33f4c0d9e9bcd710
2020-06-08 03:44:51 -07:00
Michel Weststrate
95d319a700 Store collapsed status of sidebar sections
Summary:
See previous diff, let's store the collapsed state of sidebar sections in local storage.

Introduced a reusable hook to take care of that.

Changelog: Device plugins are now expanded by default, and the expand / collapse state will now be remembered across restarts

Reviewed By: passy

Differential Revision: D21903394

fbshipit-source-id: a3c0231acc0aa0877522ec328eedd09cb11aedb1
2020-06-05 08:30:44 -07:00
Michel Weststrate
163cbe83e2 Expand device plugins by default
Summary: Heard several reports that expanding device plugins by default would be preferred

Differential Revision: D21881338

fbshipit-source-id: 9f7444a4282684e4e0f046cf6a6679181ec55e73
2020-06-05 08:30:44 -07:00
Anton Nikolaev
f981a772ec Plugin Marketplace: Download plugin updates in background
Summary: Download updated plugins in background. This is implemented by periodical polling of Marketplace GraphQL API (interval 5 min by default). The feature is under GK flipper_plugin_auto_update, so for now it is enabled only for me.

Reviewed By: mweststrate

Differential Revision: D21863057

fbshipit-source-id: 51d8223ad4b2a928f7571ea480c10ba2efd9935d
2020-06-04 08:31:09 -07:00
John Knox
ab84bd563a Enable physical iOS devices in open source
Summary:
The last piece of the puzzle to get this working.

Now if a user has iOS development enabled in Flipper settings, and has XCode installed, we'll run the PortForwardingMacApp processes required to interact with iOS devices.

It's not great the way it starts the processes without any error checking, but since that's the way it currently works, I'm leaving it as it is for now.

Reviewed By: mweststrate

Differential Revision: D21881041

fbshipit-source-id: 1d1fdb7e0621cff88408bb707d768bb5c6bea0cc
2020-06-04 08:15:30 -07:00
John Knox
ec6310dc3b Use configurable idb installation path
Summary:
Part of https://github.com/facebook/flipper/issues/262

Use the user-configured idb install location instead of a hardcoded one.

Reviewed By: passy

Differential Revision: D21860236

fbshipit-source-id: 5c604d7b6361e7c93ab49d8a03a437dfce880ac1
2020-06-04 03:04:50 -07:00
John Knox
17763809dd Add a setting for location of idb binary
Summary:
Part of https://github.com/facebook/flipper/issues/262

The default is the location on facebook computers, to avoid breaking it for existing users.

Reviewed By: passy

Differential Revision: D21860237

fbshipit-source-id: f4adfba0c63f7bb10751effb012dda734c455bee
2020-06-04 03:04:49 -07:00
Anton Nikolaev
91d5c6c130 Import MacOS CA when Flipper running in dev mode
Summary:
By default Node.JS has its internal certificate storage and doesn't use the system store. Because of this, it's impossible to access ondemand / devserver which are signed using some internal self-issued FB certificates. These internal certificates are automatically installed to MacOS system store on FB machines, so here we're using "mac-ca" library to load them into Node.JS when Flipper is running in dev mode.

For production version of Flipper we don't need to do this, because production certs are issued by DigiCert which is already trusted by node.js.

Reviewed By: passy

Differential Revision: D21862620

fbshipit-source-id: f7276e255fae1c208cb68af6632a303661af883e
2020-06-03 11:58:13 -07:00
generatedunixname89002005306973
23d80bf3d5 Flipper Release: v0.45.0
Summary: Releasing version 0.45.0

Reviewed By: mweststrate

Differential Revision: D21860035

fbshipit-source-id: 58af5bbc4e743024beac925eac8012e64bd76aa9
2020-06-03 08:28:54 -07:00
Anton Nikolaev
e65b355fb6 Load either installed or bundled version of plugin depending on which is newer
Summary: Load either installed or bundled version of plugin depending on which is newer.

Reviewed By: mweststrate

Differential Revision: D21858965

fbshipit-source-id: aa46eafe0b5137134fadad827749672441f2c9e5
2020-06-03 07:42:12 -07:00
Michel Weststrate
e31ddbc648 Debounce receiving messages
Summary:
See previous diff.

Achieves the same optimization as in the mentioned diff, but this time by only debouncing the messages as they arrive over the socket, and not the state updates caused by Redux directly. This means that plugin rendering won't be debounced anymore until we address this more fundamentally.

With this change there is a double level buffering:

1. A buffer that stores all incoming messages (that are not replies to requests)
2. A buffer that stores messages we are interested in in the plugin queue, unless the plugin is active (this we already had).

This still fixes the issue that too chatty plugins cause to many updates foreground plugin (the problem we tried to fix originally), without debouncing plugin rendering if it is needed to update for any other reason.

Another nice benefit is that previously every received message would trigger a store update in Redux which would cause all connected components to evaluate their subscriptions (and then bail out in the typical case). Now we will only update the redux store every 200 ms.

Changelog: Foreground plugins will burn less CPU when they're very chatty

Reviewed By: jknoxville

Differential Revision: D21858849

fbshipit-source-id: c72352e569a8a803bbedffb71b17b11fcefee043
2020-06-03 06:54:15 -07:00
Michel Weststrate
d70b620fae Disable render debouncing
Summary:
This change kinda reverts D21690494, which broke the layout plugin.

The layout plugin broken because it's implementation assumes that if `this.props.setPersisted` state is called, those changes are immediately reflected in `this.props.persistedState`. For that to work it means that a render needs to be triggered immediately and synchronously by React.

That is a troublesome assumption (React doesn't actually guarantee this) and very likely to break in the future if implementation details change in React or Redux. However, since this is an assumption here, probably more plugins rely on that behavior, so this diff reverts that change. I'll add it the the component library plan to fundamentally address this.

The next diff will re-introduce debouncing, just at a different code point.

Reviewed By: jknoxville

Differential Revision: D21840282

fbshipit-source-id: af69dbded80aa73dfd6558d7cb0268ea0b1c504a
2020-06-03 06:54:14 -07:00
Anton Nikolaev
776d4098b9 Show plugin version in Plugin Manager list
Summary: Added plugin version property + showing it in Plugin Manager

Reviewed By: passy

Differential Revision: D21839544

fbshipit-source-id: 89daed813cffb066b3b584f6df97d6674ca6be08
2020-06-02 09:49:45 -07:00
Chaiwat Ekkaewnumchai
2bbd260f9f Unit Test for TypeBasedValueRenderer
Summary: per title

Reviewed By: mweststrate

Differential Revision: D21820854

fbshipit-source-id: 3035d58e9afe6d1cdc8fd90b910ff845f6d13085
2020-06-02 08:19:43 -07:00
Pritesh Nandgaonkar
965a36ee52 Fix the broken deeplink of support form
Summary:
I just noticed that the deeplink of the support form didn't select the right group. It got broken after the recent design change of the support form. This diff fixes that issue.

I have also added unit tests.

Reviewed By: passy

Differential Revision: D21817153

fbshipit-source-id: 06298b3b60cfc1bd77bea6c1f902b983474808dc
2020-06-02 04:47:37 -07:00
Chaiwat Ekkaewnumchai
df480bd57a Change Value Used in DB Plugin
Summary:
- Add value for null type to use `.value` easier
- Add value to string by directly converting to string if possible; otherwise null

Reviewed By: jknoxville

Differential Revision: D21788242

fbshipit-source-id: f3a9f995de6b4cb1b304981c8adaaba70105c988
2020-06-02 01:47:04 -07:00
John Knox
5723553fba Open-source idb interaction code
Summary:
I've outlined the tasks required to get iOS device support working for open source users [here](https://github.com/facebook/flipper/issues/262).

This is the first step. It publishes the same code we use internally to GitHub, but in a state where it is only "available" for non-public builds. This will not change any behavior, but means that together with the community, we can start adapting it to suit everyone, and then eventually flip "available" to true for everyone.

Reviewed By: passy

Differential Revision: D21740193

fbshipit-source-id: 586c79ad850f67da330c10a007605ff25a187544
2020-05-29 06:04:39 -07:00
generatedunixname89002005306973
b18760823d Flipper Release: v0.44.1
Summary: Releasing version 0.44.1

Reviewed By: passy

Differential Revision: D21767292

fbshipit-source-id: 94276959d0421fa687cc24f9553a0951b398ea56
2020-05-29 05:02:23 -07:00
Pritesh Nandgaonkar
a8f749b2e8 Update the UX of the mobilebuild download
Summary:
Update the UX of the mobilebuild download. When one clicks download one can see the the installation in progress in the main screen. Once its downloaded, you can open the finder pointed to the folder of download.

I didn't write the test for InstallSection as I was not able to test it through react-testing library. Seems like the data gets added to the document little late and not instantly.

Next work:
- Search in sidebar
- Persist downloaded app data for a session
- Show download data in the form of progress bar.

Reviewed By: mweststrate

Differential Revision: D21709229

fbshipit-source-id: e67db68ff16155230becf86c913dc6b1ec9d482c
2020-05-28 11:24:57 -07:00
Michel Weststrate
828385e246 Enable babel transformer for emotion
Summary: This diff enables the babel transformer for emotion. It is supposed to be a bit faster, but the most interesting thing is that it will show component names inside the dom tree, which, at least for me, will be a huge performance booster is it will make it much easier to find out to which component style changes need to be applied

Reviewed By: nikoant

Differential Revision: D21722021

fbshipit-source-id: cab1278046b1aa7f8b875c016d43dfafdbaa0a2d
2020-05-28 10:14:05 -07:00
Michel Weststrate
54162d480c Enable react hooks linting
Summary:
Enabled linting rules that help to signal making errors with effect dependencies and such.

Fixed all errors, left any warnings generated by the hooks untouched

Reviewed By: nikoant

Differential Revision: D21721497

fbshipit-source-id: 9548453443fa7b663dc4d4289132f388c6697283
2020-05-28 10:14:05 -07:00
Pascal Hartig
9d88469063 Fix public version check (#1203)
Summary:
Relied too much on TSC and not enough on my brain.

![image](https://user-images.githubusercontent.com/9906/83158023-2f0ff880-a0fc-11ea-8f1b-bff89ec7934a.png)
Pull Request resolved: https://github.com/facebook/flipper/pull/1203

Test Plan:
![Screenshot 2020-05-28 15 51 49](https://user-images.githubusercontent.com/9906/83158051-38996080-a0fc-11ea-8e59-9bb6cd88d832.png)

Endpoint is getting hit on startup now for public builds.

Reviewed By: mweststrate

Differential Revision: D21764325

Pulled By: passy

fbshipit-source-id: 771c4e430717f4eae5eab36f279ca3eff9e9bcf7
2020-05-28 09:04:54 -07:00
Chaiwat Ekkaewnumchai
dec5045fca Fix Unwanted Highlight in ManagedTable
Summary: Previously, rows got highlighted after switching between data for `ManagedTable` even though `highlightableRows` was set to false. This diff forces the highlighting not to happen when the value is set to false

Reviewed By: mweststrate

Differential Revision: D21720266

fbshipit-source-id: 534944fe03ad1561bc2109468ae6c4c5f3fc947d
2020-05-26 05:50:12 -07:00
Timur Valiev
2283bbd313 vscode integration helper
Summary: VSCode integration helpers to call extensions

Reviewed By: passy

Differential Revision: D21641284

fbshipit-source-id: dd978520ea541dbd6a96b8398ce28744a0fc97ad
2020-05-26 05:03:05 -07:00
Michel Weststrate
0da766f27b Make sure inefficient or chatty plugins don't churn too much CPU
Summary:
While profiling the high CPU load of the Analytics plugin, I noticed that most of the time is spend in rendering React. This makes sense as the component sends data very frequently, although it is definitely less efficient than it could be.

As shown in the following profile picture, it is clear that all the cpu churns up due to the amounts of re-renderings caused (every new incoming messages causes the plugin to analyse and process all it's data).

With background plugins, we already made sure that non-active plugins don't eat up all the CPU in React components if they process data inefficiently. Before:

{F238020503}

This change debounces how often we give new state to plugins, so that multiple updates get collapsed if the load becomes to high. After (note that not every 'emit' causes in an expensive render anymore, but that the rendering is now in a separate stack, the only remaining renderer is the debouncer component). After:

{F238020481}

Render stack happens now after a bunch of emits:
{F238021694}

This drops ~130% cpu to 70% cpu in the case of the analytics plugin, see below

Reviewed By: passy

Differential Revision: D21690494

fbshipit-source-id: 299c49c95f20af01e6ee3110b0c39478b3135c43
2020-05-26 04:50:52 -07:00
Chaiwat Ekkaewnumchai
8d8ed5e2ed Add Unit Test to ToolbarIcon
Summary: per title

Reviewed By: mweststrate

Differential Revision: D21663253

fbshipit-source-id: de1eff5a3500473082973a27d0b72479407cbebe
2020-05-25 10:40:39 -07:00
generatedunixname89002005306973
b538cead7a Flipper Release: v0.44.0
Summary: Releasing version 0.44.0

Reviewed By: passy

Differential Revision: D21686080

fbshipit-source-id: 83a8d997e99361e3fcc4472d484d3759f73ed964
2020-05-21 11:31:56 -07:00
Chaiwat Ekkaewnumchai
27dd08e546 Add Tooltip to ToolbarIcon in Layout Plugin
Summary: Trying to add tooltip to some components to promote tooltip itself and make it clearer what they do

Reviewed By: mweststrate

Differential Revision: D21649207

fbshipit-source-id: 4763ae9a99d687e6624c07bb636c5f4e869cafc9
2020-05-21 07:56:46 -07:00
Chaiwat Ekkaewnumchai
b8a989214d Change Tooltip Position
Summary: Change some offset to make it point more direct to an element

Reviewed By: mweststrate

Differential Revision: D21649206

fbshipit-source-id: 64b4a3851e713baa6095d819a16cd207bebdf46f
2020-05-21 07:56:46 -07:00
Pascal Hartig
3723e08b50 Make message drops a warning
Reviewed By: jknoxville

Differential Revision: D21684530

fbshipit-source-id: f918c39562eaf6c5fd61af76e68d3e4cfe561a90
2020-05-21 04:24:06 -07:00
Michel Weststrate
ed2bcea906 Fix horizontal scrolling issue
Summary: Fixed a layout issue in the list items of GraphQL, background style / line didn't tend to continue when scrolling, because flexbox doesn't grow all lines similarly. Tables do.

Reviewed By: jonathoma

Differential Revision: D21662000

fbshipit-source-id: 767d2d7ffd7e5dacf2c49aa67babbb47a331282c
2020-05-21 03:36:35 -07:00
Michel Weststrate
cdd0026e83 fix issue where row backgrounds are not continued when scrolling horizontally
Summary:
We used flexbox to layout rows in the element inspector. The problem with that is that flexbox cannot nicely grow all its childrens to the largest one. Although we could still see contents thanks to the `overflow: visible` hack, this means that the backgrounds didn't continue when scrolling.

In contrast, tables do grow their children width :)

Also fixed an issue where the AX details tree wasn't scrollable

Reviewed By: cekkaewnumchai

Differential Revision: D21661766

fbshipit-source-id: 6b1d16c7aded8beebdd8a50f3e8ab0d9b8633e02
2020-05-21 03:36:35 -07:00
Michel Weststrate
b0ab9b9b98 Fix Height for Main Layout Inspector
Summary:
in Layout plugin, scrollbars where often not visible, for example to see the vertical scrollbar, one had to scroll to the horizontal end first.

Also introduced the `Scrollable` component to simplify this in the feature and separate the concepts of rendering something large and making it scrollable.

This diff cleans up the layout structure and fixes the problem

changelog: Fixed several minor layout issues in the Layout plugin

Reviewed By: cekkaewnumchai

Differential Revision: D21283157

fbshipit-source-id: 81849151475165796c65001616f038a9d6cbdfb2
2020-05-21 03:36:34 -07:00
Pritesh Nandgaonkar
22dfc33da0 Fetch recommended and all builds types in Sidebar
Summary:
This diff updates the sidebar to show the recommended and all build types.

Also there is error handling in place along with tests. Right now the download happens by opening browser and the build gets downloaded in the download folder. But later in the diffs I will improve this flow to do that in the Flipper with a UX showing status updates.

Reviewed By: mweststrate

Differential Revision: D21556383

fbshipit-source-id: 6de9a00fe416c22cae7bacf91828a2221644eac7
2020-05-20 08:14:25 -07:00
Chaiwat Ekkaewnumchai
a5cd79ea8b Export FileSelector
Summary: FileSelector was added in D19743998, but it was not exported to be used by other. This diff exports it so that developers can use.

Reviewed By: mweststrate

Differential Revision: D21653870

fbshipit-source-id: 062247fa7a14c7ddf87c927205880a695598928d
2020-05-20 06:58:37 -07:00
Michel Weststrate
55b6b021f1 Fix QPL layout regeression
Summary:
Fixed the layout usage in QPL, the `horizontal` was correct, but the elements where swapped (the table was supposed to take all remaining size, and sidebar it's needed space, rather than the reverse).

Made this more explicit in the Layout component, by splitting it up in `Layout.(Top|Left|Right|Bottom)`, so that one has to make an explicit choice here, making it less error prone.

Reviewed By: passy

Differential Revision: D21572438

fbshipit-source-id: 29aa3462a3c96d048825be3157730e26182cb2fa
2020-05-19 11:51:21 -07:00
Chaiwat Ekkaewnumchai
11b233b516 Allow Long Text to Be Shown in The Sidebar
Summary:
This allows long text to be seen on the sidebar in database plugin. Also, remove weird padding in the sidebar and separate sidebar component to a new file

Refactoring is in the next diff

Reviewed By: mweststrate

Differential Revision: D21550672

fbshipit-source-id: 3e80be16783719e18392fe3d8f8068caf9283f8f
2020-05-19 09:12:56 -07:00
generatedunixname89002005306973
4e618198cb Flipper Release: v0.43.0
Summary: Releasing version 0.43.0

Reviewed By: cekkaewnumchai

Differential Revision: D21639652

fbshipit-source-id: 5a775f6361283b2e9b2540b054afad497dab2a22
2020-05-19 08:00:52 -07:00
Chaiwat Ekkaewnumchai
8fa03789d1 Add Coverage Test for MultipleSelectorSection
Summary:
To comply with recent agreement, coverage test for MultipleSelectorSection is added.

Also, add undefined check in `elements.tsx` found while adding the test

Reviewed By: mweststrate

Differential Revision: D21554782

fbshipit-source-id: 7cd868bf16f6105d6f523048f29bdaa052837f45
2020-05-15 12:49:28 -07:00
Pascal Hartig
a65b6025c1 Report failures on snapshot taking
Summary: Suggested in D21571294.

Reviewed By: jknoxville

Differential Revision: D21594146

fbshipit-source-id: 1dcc310343788aecced724282d74e0cf08688220
2020-05-15 07:09:53 -07:00
Rick Hanlon
e23acc6f04 Switch flipper-out-of-contents-container to absolute position
Summary:
This diff updated the `flipper-out-of-contents` container to render with absolute position, which allows it to cover up all of the content in the plugin. This fixes an issue where content that exists in the plugin can be broken.

For example, the banner in the next diff would look like this:

{F237034745}

Reviewed By: mweststrate

Differential Revision: D21556849

fbshipit-source-id: 95ec4aac24ac995bd1c558123ef5da6087a40d0a
2020-05-15 05:19:01 -07:00
Pascal Hartig
d6844faebb Restore open behavior on screenshot capture
Summary: The effect of opening the screenshot after capturing was removed in D19765926.

Reviewed By: mweststrate

Differential Revision: D21571294

fbshipit-source-id: f3308d80e066cc01786c17323e4ff5f97c092de9
2020-05-15 04:54:24 -07:00
Pascal Hartig
7492e781d3 Change LowPassFilter invariant use
Summary:
Ugh, lockdown brain. This was supposed to be included in the test I added before
to get to 100% coverage. Well, it's here now.

Reviewed By: mweststrate

Differential Revision: D21550904

fbshipit-source-id: 044a11d38e211c6f57cce220adc8c42241a2043a
2020-05-15 04:43:56 -07:00