Commit Graph

380 Commits

Author SHA1 Message Date
Daniel Büchele
4151c73409 add emotion �
Summary: adding `react-emotion`

Reviewed By: jknoxville

Differential Revision: D9479892

fbshipit-source-id: 0813c887f01ba0f5cd93208e4fe285d5a9dcd6b2
2018-08-23 09:42:17 -07:00
Tim Isganitis
f560f770b6 Fix iOS screen recording
Summary: It looks like the iOS simulator screen recording tool expects a SIGINT instead of a SIGKILL (the default of node's ChildProcess.kill()) to indicate it should stop recording, save the video file and die cleanly.

Reviewed By: danielbuechele

Differential Revision: D9480678

fbshipit-source-id: 5f17bd288c7622ffa3c337cef311e5e4e462218a
2018-08-23 09:12:53 -07:00
Pascal Hartig
715d12db8d Use recursive ctime to determine plugin cache expiration
Summary:
Disabling `atime` on Linux is quite common. (I don't have data to back this up,
but with my sample size of n=1, 100% fall into this bucket.) In that case,
the plugins will be cached indefinitely.

Using `ctime` on the directory doesn't really mean anything because it is
only affected by changes *to* the directory, not the files inside.

So, let's do this right and use the most recent change to any of the files
*inside* the directory instead.

Reviewed By: danielbuechele

Differential Revision: D9479491

fbshipit-source-id: 6945d7bf87defa67679cacdaf0a978d8ff1770c3
2018-08-23 04:57:29 -07:00
Daniel Büchele
624d06f2c2 remove old virtualized
Summary: Switches elements from custom virtualization to react-window, so the custom implementation is not needed anymore and therefore can be removed.

Reviewed By: jknoxville

Differential Revision: D9447723

fbshipit-source-id: 7abcc077f87fe634a0e9517908db03398848bce7
2018-08-23 04:57:29 -07:00
Daniel Büchele
7bdb21e055 adding table debouncing
Summary:
When changing the props of a table often, this might results in a lot of unnecessary rerenders. This could be mostly seen in the analytics plugin, which is sending a lot of messages in a short time.

The update of the table component is now debounced to only re-render every 150ms. This also affects searching and filtering and makes typing in the search input smoother.

Reviewed By: passy

Differential Revision: D9447722

fbshipit-source-id: 00e092e4e047e9c40e5a1ec2789644858acc18dd
2018-08-23 04:57:28 -07:00
Daniel Büchele
1891e2c869 moving tables to react-window
Summary:
Tables were using a custom virtualization, which wasn't as performant as other solutions out there. In this diff, the table component is reworked for performance.
- removes `Table` component, because it was never used standalone, `ManagedTable` is what all plugins used
- uses `react-window` for `ManagedTable`
- reworks table highlighting and arrow-navigation to work with the new virtualization
- moves actual filtering out of `ManagedTable` into `Searchable` component for a better separation of concerns.

Reviewed By: jknoxville

Differential Revision: D9447721

fbshipit-source-id: 15eb2eb55eed9f49a0cb1ccfb2d748b3672fa898
2018-08-23 04:57:28 -07:00
Pascal Hartig
33f34650df Fix plugin resolution on Linux
Summary:
Linux appears to spawn a completely separate browser process whereas MacOS either
forks or uses a thread. Either way, Linux no longer has access to the parent
process's environment variables we use to look up plugins. Using
the remote module fixes that.

In the medium term, we should convert the `plugin` module to not rely on import effects
and instead use the IPC mechanism, making the plugin resolution asynchronous:

https://electronjs.org/docs/api/web-contents#contentssendchannel-arg1-arg2-

That would also allow us to do the plugin resolution while starting up the browser window,
lowering the startup time.

Reviewed By: danielbuechele

Differential Revision: D9423628

fbshipit-source-id: 76351f267864147c4494aadaf4e16ea636952118
2018-08-23 03:13:07 -07:00
Sara Valderrama
7852a3886b Accessibility Inspector open-sourcing move and documentation
Summary: Replaces AXElementsInpector with normal inspector implementation, removes gating from external builds. Adds documentation to https://fbflipper.com/docs/layout-plugin.html.

Reviewed By: passy

Differential Revision: D9438713

fbshipit-source-id: 18616c6cbab339bf474d116cac128e1d4a5fc2be
2018-08-22 14:57:44 -07:00
Pritesh Nandgaonkar
9095b3a030 Build Sample app rather than just building the sample pods (#251)
Summary:
Currently travis just builds the pods which sample app depends on. The test case which the current setup misses it that it will fail to check if the required header files are exposed to public. The master is broken recently because a header file is not exposed publicly and sample app fails to build, whereas all the dependencies like Sonar and SonarKit build successfully. This PR updates the travis, so that it builds sample app rather than the dependent pods.
Pull Request resolved: https://github.com/facebook/flipper/pull/251

Reviewed By: jknoxville

Differential Revision: D9465234

Pulled By: priteshrnandgaonkar

fbshipit-source-id: 42ab7210d7fa5a3dc2927efee4b4dee95f15c6cd
2018-08-22 12:57:33 -07:00
Pritesh Nandgaonkar
a0bb9e6fe5 Fix broken sample app
Summary:
This diff adds FlipperStateUpdateListener in public headers, as SonarClient.h depends on it and the sample app depends on SonarClient.h.

This diff fixes the compilation error for Sample and SwiftSample

Ideally travis should have caught it. Fix for travis is coming.

Reviewed By: jknoxville

Differential Revision: D9462177

fbshipit-source-id: e3e0ec90f9083294d4a131989ec0eaee02b52791
2018-08-22 12:57:33 -07:00
Sara Valderrama
7acf0ff9af Remove sidebar extensions from accessibility inspector
Summary: Sidebar extensions are automatically added to main inspector sidebar but kept from accessibility side menu.

Reviewed By: xiphirx

Differential Revision: D9438644

fbshipit-source-id: 47a9cc630117e15be3368d78f2396f02796c998d
2018-08-22 09:58:23 -07:00
John Knox
d82fa3c2b5 Add SonarDiagnosticActivity to getting-started (#250)
Summary:
Sonar isn't yet opening this activity remotely, but it's worth getting users to add it early, so that when it does, it will work.
Pull Request resolved: https://github.com/facebook/flipper/pull/250

Reviewed By: passy

Differential Revision: D9455599

Pulled By: jknoxville

fbshipit-source-id: 252f7e7f89751b188665ece4ab9f815fd90fe500
2018-08-22 09:26:05 -07:00
John Knox
e2575239f2 Add background color to iOS diagnostic screen
Summary:
Some apps have a default background color, for example black, making the diagnostic screen fully black.
Fix this by making sure the bg is always white so the text is readable.

Reviewed By: passy

Differential Revision: D9400682

fbshipit-source-id: a45744f833cb7fe5ca7db4dcdacc09f304670032
2018-08-21 12:43:02 -07:00
Pascal Hartig
b4b5ccdcd6 Add missing native targets (#248)
Summary:
Depends on #247.

Ensure that `libextra` is included when building sonar targets. My
cleanup was a bit too aggressive.

Fixes #246
Pull Request resolved: https://github.com/facebook/flipper/pull/248

Reviewed By: jknoxville

Differential Revision: D9420724

Pulled By: passy

fbshipit-source-id: f2d0625507a4897051840c95feefc534583b080f
2018-08-21 06:14:37 -07:00
Pascal Hartig
69cd889b71 Fix Litho plugin package (#247)
Summary:
The plugin was part of the wrong package based on its directory. This
confuses Gradle and I'm frankly a bit surprised this ever built before.
Pull Request resolved: https://github.com/facebook/flipper/pull/247

Reviewed By: danielbuechele

Differential Revision: D9420595

Pulled By: passy

fbshipit-source-id: fd8e47ff242c4535b36e379df93b672eb8bb840d
2018-08-21 04:29:08 -07:00
Hilal Alsibai
1aee2cdaa3 Pass the Layout plugin's logger to the sidebar and sidebar extensions
Summary: Lets the sidebar + sidebar extensions log custom events

Reviewed By: danielbuechele

Differential Revision: D9411001

fbshipit-source-id: 37704e805eda56347cd95c155f81ad31b34bd508
2018-08-21 02:58:33 -07:00
Sara Valderrama
c428de3948 Tooltips added on hover for AX sidebar
Summary: Adds on hover descriptions for some of the more esoteric properties in the accessibility sidebar panel such as accessibility-focused and all the talkback derived properties. Also change talkback-focusable and talkback-ignored to both be talkback-focusable.

Differential Revision: D9381676

fbshipit-source-id: 55ce854da24241a7c89b0c122c4c3ebd77438dbb
2018-08-20 09:41:46 -07:00
Pascal Hartig
02cf3a90a2 Fix build caching (#242)
Summary:
See https://github.com/facebook/flipper/issues/230 for a longer
explanation.

It turns out that many of the tasks in `native.gradle` (at least
`prepareGlog` which modifies files inside the source directory, but also
others) cause the cmake cache to invalidate.

Because we run those tasks unconditionally, we need to recompile all our
C++ code even when unmodified.

I fix this by adding a manual cache key to this which simply skips all
the tasks unless an up-to-date `external_cache_revision.txt` is found.
This is a bit hacky, but the alternatives are a) convincing cmake that
these modifications are not recompile-worthy which I have no idea how to
do and which might be impossible to do `mtime` on the files touches, or
b) having fine-grained `onlyIf` rules for every task which can easily
break. This seems the most straight-forward option.

Fixes #230.
Pull Request resolved: https://github.com/facebook/flipper/pull/242

Reviewed By: jknoxville

Differential Revision: D9381340

Pulled By: passy

fbshipit-source-id: a7db55aacac4a29076c29298d6c5b97d8bc91f66
2018-08-20 07:43:47 -07:00
John Knox
d8e5e31c9a iOS: Update diagnostic screen on state update
Summary: Update the diagnostic screen whenever the sonar state changes.

Reviewed By: priteshrnandgaonkar

Differential Revision: D9218765

fbshipit-source-id: 654a35e309cb43df18bc8c8a645d469eddc1031d
2018-08-20 05:11:49 -07:00
John Knox
21888157df iOS: Add very basic diagnostic screen
Summary:
Adds an extremely barebones in-app screen for showing sonar diagnostics.
The UI is laughable, but it's wired up. Leaving proper design to a later commit.

Like in the android case, state is currently passed as a string, but will become something much more structured after this is in place.

Reviewed By: priteshrnandgaonkar

Differential Revision: D9218766

fbshipit-source-id: 4889ed79b928056a67b1e8cb8a40a9bd52e084f1
2018-08-20 05:11:49 -07:00
Pritesh Nandgaonkar
be4b45c703 Update Sample apps to refer local podspecs (#244)
Summary:
Before this PR, travis used to build sample app which used a tagged release of SonarKit and Sonar. So travis used to never check the source code in master branch. This PR, instead uses local podspecs, which refers to the local source code, and thus travis would be testing the local source code.
Solves #237
Pull Request resolved: https://github.com/facebook/flipper/pull/244

Reviewed By: passy

Differential Revision: D9394955

Pulled By: priteshrnandgaonkar

fbshipit-source-id: 7109a8baaeb8ff7e14d19ebe1d7c3bcb7e4bebd2
2018-08-20 04:11:38 -07:00
Hilal Alsibai
82c2f0c68c Minor typo
Summary: Minor typo

Reviewed By: passy

Differential Revision: D9393881

fbshipit-source-id: 252ed38f1532947a7a15b2149bd5da42d6e0e31d
2018-08-20 02:56:44 -07:00
Hilal Alsibai
dd3cb40010 Fix shared preference plugin display
Summary:
There seems to be an issue showing a ManagedTable within a Panel. The component was properly
receiving new changes etc, it just wasn't displaying due to a 0 height (I guess).

This diff fixes that + updates the layout so its not cramped.

Reviewed By: passy

Differential Revision: D9393882

fbshipit-source-id: a35f2a298106c4b2a48883822ef997e8499f1eec
2018-08-20 02:28:12 -07:00
Yuri Schimke
5eb986d598 Use UUID instead of new Random().nextInt(...) (#238)
Summary:
Minor simplification, mostly cleanup.  Arguably, better to avoid the birthday paradox e.g. collision with > a few thousand requests.

Tested via

$ ./gradlew :sample:installDebug
Pull Request resolved: https://github.com/facebook/flipper/pull/238

Reviewed By: danielbuechele

Differential Revision: D9359941

Pulled By: passy

fbshipit-source-id: d2988b58f41d84a52aca060b5c583e055b8b203a
2018-08-20 02:28:12 -07:00
Aaron Brady
e9471c7197 fix crash if SonarClient is stopped with no connection
Summary: calling SonarClient::instance()->stop() without a connection will try to deref a null client_

Reviewed By: jknoxville

Differential Revision: D9325527

fbshipit-source-id: b0a81d6eb9d1375b74cbf10466f947e8a2de3b98
2018-08-17 10:14:10 -07:00
John Knox
839a579a17 Remove MySonarPlugin from getting-started (#240)
Summary:
I think the getting-started page should be a no-nonsense quick set of steps to get you up and running so you can try out flipper.

With it referencing the non existent "MySonarPlugin", you can't just follow the steps for it to work. You'd have to either write a plugin which would take a while, or look at the sample apps on your own to see how to add a real plugin. I think it will be far more helpful just to give a working example.
Pull Request resolved: https://github.com/facebook/flipper/pull/240

Reviewed By: passy

Differential Revision: D9378196

Pulled By: jknoxville

fbshipit-source-id: 18ae4a39d09c7baa17adb7f7a71fd766e9bc8e51
2018-08-17 07:27:38 -07:00
Marco Cova
aedb9c0343 Unify Components and Sections StateContainer interface
Summary: Components and Sections has two different but equal interfaces for StateContainer. This diff create one unique StateContainer interface they can both use.

Reviewed By: passy

Differential Revision: D9359823

fbshipit-source-id: 288abefd53670d3c128b5d00b5c204f0c1ea3948
2018-08-17 02:27:32 -07:00
Oleksiy Ivanov
6924416de8 Fix for compilation error about missing virtual destructor in GCDQueue (#236)
Summary:
error: destructor called on non-final 'facebook::sonar::GCDQueue' that has virtual functions but non-virtual destructor [-Werror,-Wdelete-non-virtual-dtor]
    __data_.second().~_Tp();
Pull Request resolved: https://github.com/facebook/flipper/pull/236

Reviewed By: passy

Differential Revision: D9351946

Pulled By: priteshrnandgaonkar

fbshipit-source-id: 4718460ff587e1d5fa475a5f3bf115b1e2b5305f
2018-08-16 08:44:47 -07:00
Pascal Hartig
4e943dbb36 Limit CMake targets to build
Summary:
This doesn't solve our build caching issue (GH230) but
helps a bit with build times as we can skip building all
sorts of test targets which are otherwise included.

The sonar target is the only thing we care about here.

Reviewed By: danielbuechele

Differential Revision: D9360117

fbshipit-source-id: 13a976243b48efbe0f69e9fe47780486f9688eb8
2018-08-16 08:27:21 -07:00
Daniel Büchele
f4822143bd plugin reselection
Summary: When relaunching Flipper/refreshing it while developing, where was a case, where the App Client connected, before the device was registered in Flipper. In this case, we didn't select the previously selected plugin

Reviewed By: jknoxville

Differential Revision: D9359779

fbshipit-source-id: 9c6f8e6bf65a46dc84c9781242b23df0ed539810
2018-08-16 08:12:16 -07:00
Pascal Hartig
cded1ceead Switch to Litho snapshot releases
Summary:
This allows breaking changes in Litho to be landed.
I'm also adding some helpers to determine if Flipper itself
is currently in a release or snapshot release train.

N.B. We don't publish snapshot releases for Flipper
right now, but will in the future where this will come in
handy.

Reviewed By: jknoxville

Differential Revision: D9359035

fbshipit-source-id: d21b607eca5d57caf4cc34234f6ba3cb0d8f307d
2018-08-16 06:56:30 -07:00
Daniel Büchele
11ba553ab8 tracking for large frame drops
Summary:
`largeFrameDrops` are added to the usage tracking.
Similar to our other apps, we are considering a drop of 4 or more frames as a large frame drop. While a single frame drop might not be relevant to the user, large frame drops are a more relevant number to optimize for.

Reviewed By: passy

Differential Revision: D9358795

fbshipit-source-id: d9354695c816ba6c40676df6f3c6f3f070e28269
2018-08-16 05:12:27 -07:00
Sara Valderrama
6a746d744e Update AX sidebar properties - clarify focus vs accessibility-focus
Summary: Updated properties to be more specific about what type of focus they are describing (keyboard vs accessibility vs talkback). Also separates sidebar into 3 sections (View, Talkback, and AccessibilityNodeInfo) since this organization is clearer now that Talkback is more robust.

Reviewed By: blavalla

Differential Revision: D9338822

fbshipit-source-id: d110faa43822faa36a081832207c259cddec44f0
2018-08-15 20:49:09 -07:00
Sara Valderrama
e82808da6f Talkback properties update for AX sidebar
Summary: Talkback-description now called talkback-output to avoid confusion about content-description. Talkback-output now includes the state and role of the view as well so it is more accurate to Talkback's actual output. Talkback-hint also added as a property to show what talkback will append to the description if a user has hints turned on. This may not always be 100% accurate because talkback changes what it says based on certain events and global settings as well but is correct for most general-use cases.

Reviewed By: blavalla

Differential Revision: D9317270

fbshipit-source-id: df9b9b5ebef19f583cbf997e0cd3fac6450170bb
2018-08-15 20:49:08 -07:00
John Knox
e76a6ef529 Document SonarStep.h
Summary: It may not be immediately obvious how this works, so adding comments.

Reviewed By: passy

Differential Revision: D9333321

fbshipit-source-id: 79740b3d2a9589b3ba48c47b0068afdaf26f35a3
2018-08-15 06:12:30 -07:00
John Knox
38391ca29e Allow steps to fail with error message
Summary:
Add a method to add error messages into failed steps. This will be surfaced in the diagnostic screen, to help the user
troubleshoot.

Reviewed By: passy

Differential Revision: D9333322

fbshipit-source-id: 5f1e55c3d71b19292dbc428aaecfbd41e7a75125
2018-08-15 06:12:30 -07:00
John Knox
dfcfa9f7fa Handle socket not open error individually
Summary:
It's expected that whenever not connected to a desktop, or when the sonar desktop app isn't running, we'll get
errors connecting. Isolate these so we can treat all other exceptions properly.

Reviewed By: passy

Differential Revision: D9333323

fbshipit-source-id: c9853ca84d1a04827ebf7bae0fe87859ca6110d1
2018-08-15 06:12:29 -07:00
John Knox
292cb4107b Summarise state in diagnostic screen
Summary:
Display the summarised state of the sonar agent alongside the "log" view of it.
The log view contains every event, while the summarised view has just one entry for the latest attempt at each step.

Reviewed By: danielbuechele

Differential Revision: D9315502

fbshipit-source-id: 8767c3cce7d2765ef6ab09db5945248ddd6dcbce
2018-08-15 05:11:54 -07:00
John Knox
660da3f80e Add getStateSummary method for diagnostics
Summary:
Adds a more structured representation of state updates than a multiline string.
Also changes the string form to omit [started] records.

Reviewed By: danielbuechele

Differential Revision: D9315503

fbshipit-source-id: 55b8f9572091fd42fe852c8d26a8f2a53f76c82a
2018-08-15 05:11:54 -07:00
Anamaria Cotirlea
e51b8c0742 Add Hardware Details to CPU Info Plugin.
Summary: Added an additional field which contains hardware information regarding the chipset manufacturer and model.

Reviewed By: danielbuechele

Differential Revision: D9294547

fbshipit-source-id: 45c577475f156ee4a83140f506df161cd4ed4330
2018-08-15 02:57:18 -07:00
John Knox
a35765335e Wait for server when requesting certificate files
Summary:
NOTE: Second push of the same commit. The original was reverted because of an incompatibility with
the rsocket version used in the OSS build, which is now fixed.

[Step 2 of a protocol change between desktop app and agent]

The flipper agent periodically tries to connect.
When it doesn't have the required certs, instead of trying to connect, it requests them from the desktop.
After requesting, it just continues the loop, trying to request.

The problem with that is
a) the desktop can take longer than one cycle to generate and provide the certs, meaning the agent will make overlapping requests, causing confusion and it to take longer than necessary.
b) the desktop can take less time than a retry cycle, but the agent will still wait before trying to connect.

Fixing a) by making the agent wait for a response from the desktop before continuing attempting to reconnect.
This means on the next connection attempt, it's guaranteed that the desktop is finished processing the CSR.

b) remains unfixed for now, but can be dealt with separately.

This changes the agent to use requestResponse, instead of fireAndForget and wait for a response from Flipper before continuing.

Also added a fallback to detect old versions of Flipper/Sonar and use the oldFireAndForget method in those cases.

Reviewed By: danielbuechele

Differential Revision: D9315946

fbshipit-source-id: 8058f7d43690ba609f16a61c0a9b40991e9e83cc
2018-08-14 11:12:21 -07:00
Pritesh Nandgaonkar
3a584d0f18 Update rsocket version (#225)
Summary:
Updates rsocket to latest version
Pull Request resolved: https://github.com/facebook/flipper/pull/225

Reviewed By: jknoxville

Differential Revision: D9313576

Pulled By: priteshrnandgaonkar

fbshipit-source-id: afd55eddfa79f0f9d2a36a6f0539d823161d1bed
2018-08-14 06:01:00 -07:00
Daniel Büchele
6f2a7dcb05 clean up console
Summary: The console was pretty spammy. This fixes some issues that were logged and changes many log statements to `console.debug` which are not shown by default.

Reviewed By: passy

Differential Revision: D9303011

fbshipit-source-id: 1102f4f8814152a45f155cb43488a515c2d4eee4
2018-08-14 03:12:54 -07:00
Daniel Büchele
eb316be4e4 fixing tracking metrics
Summary:
- fixing dropped frames calculation
- fixing plugin activation time

Reviewed By: passy

Differential Revision: D9301759

fbshipit-source-id: 872e4d2edcafdbc67668f3d0b713dfbf55f068f5
2018-08-13 15:27:29 -07:00
Sara Valderrama
656044ce69 AX tree expands with main tree on search (cannot search ax tree yet)
Summary: AX tree will now stay in sync with the main tree when searching. Also allows user to completely erase search (previously had left one letter highlighted in the tree even if entire query was erased).

Reviewed By: danielbuechele

Differential Revision: D9276721

fbshipit-source-id: 5272bb9cf3400ad3eb9d16bf438b0e5d4b551c6a
2018-08-13 13:28:10 -07:00
Pascal Hartig
00847365ef Android v0.6.17
Summary: Published new android artifacts.

Reviewed By: danielbuechele

Differential Revision: D9295871

fbshipit-source-id: 7809d947622138192b3b931c6739570c11d050a8
2018-08-13 12:11:42 -07:00
Aaron Brady
b552dc6f52 Make WindowsDevice for Sonar
Summary:
This diff adds the ability for a windows desktop app to be a selectable device for Sonar.

just to over-communicate what I'm thinking regarding the logging: windows system logs don't have a lot of valuable information in my experience, and there is a ton of garbage, but there is probably a way to tap into that if we want.

however, I was thinking that redirecting stderr/stdout from every connected process would be useful. i.e. OVRServer could register a log plugin and it would write to the device's log output. not sure if this would be better than just having a logger plugin. This is probably a pretty naive question and this probably isn't the place to have this conversation...but here we are :)

Reviewed By: jknoxville

Differential Revision: D8861986

fbshipit-source-id: f6ccba28729692ae4566dd24302268ad54d437eb
2018-08-13 11:29:59 -07:00
Aaron Brady
1a7ef4fc85 Generalize client OS filtering by device and move logic to Device class itself
Summary: Adding support for a WindowsDevice (in following diff) that relies on this behavior, also seems reasonable that the logic for what client os' a device supports should be in the device class.

Reviewed By: jknoxville

Differential Revision: D8861698

fbshipit-source-id: 2907f616baa04eb71a9e4ef3b6704980acbafaf5
2018-08-13 11:29:59 -07:00
Pascal Hartig
f400fcb99d Back out "[litho] Unify Components and Sections StateContainer interface"
Summary: Original commit changeset: fac09e914a17

Reviewed By: marco-cova

Differential Revision: D9295577

fbshipit-source-id: 6f79e6b9139b448726a6c3e049c8b3496f8e95b5
2018-08-13 06:56:36 -07:00
Pascal Hartig
8b3251a047 Make Travis output less verbose
Summary:
The results on the website are completely useless right now
due to wget and unzip spam.

Reviewed By: danielbuechele

Differential Revision: D9294858

fbshipit-source-id: 921979e19ff744a58da170d3dd15663fa2475275
2018-08-13 06:30:18 -07:00