Commit Graph

1478 Commits

Author SHA1 Message Date
Pascal Hartig
f2986f8a2f Update README.md (#465)
Summary:
Trying to address https://github.com/facebook/flipper/issues/464.
Pull Request resolved: https://github.com/facebook/flipper/pull/465

Reviewed By: danielbuechele

Differential Revision: D15778823

Pulled By: passy

fbshipit-source-id: 5bddd7914575fe5a53b53b6a7aee11e4777d9f57
2019-06-12 04:31:10 -07:00
Pritesh Nandgaonkar
7d8db465e1 Bump Folly dependency for Android (#463)
Summary:
Pull Request resolved: https://github.com/facebook/flipper/pull/463

Was made aware [here](https://github.com/facebook/flipper/issues/461) that
we currently don't build with NDK 20 because of Folly. The above issue exists only for x86 platform and not for other platform. I have updated the folly and RSocket. Although this diff doesn't solve the issue mentioned above for x86, but it updates the dependencies to the latest version. To mitigate temporarily, I have updated the gradle to not build for x86.

Reviewed By: passy

Differential Revision: D15713205

fbshipit-source-id: 79dd5825b0b876c87a1868fde8f3353a76012267
2019-06-12 03:40:19 -07:00
John Knox
173ce43192 Add sample app layout snapshot test
Summary:
This is fairly experimental. The test passes, but I don't know how stable it will be when litho changes for example.

However, it's easy to exclude specific attributes from the hierarchy, so maybe we can iterate if it breaks at first.

It just takes a snapshot of the layout hierarchy from headless flipper, and compares it to it's known one.

To run it:
`cd headless-tests && DEVICE=emulator-5554 yarn test` while you have the sample app running on an emulator.

To update the snapshots, just add `-u` to the end of that command.

Reviewed By: danielbuechele

Differential Revision: D15715674

fbshipit-source-id: 4fe6f83b60f8003d48aceb6468d93c075e6c38b8
2019-06-12 03:29:58 -07:00
David Aurelio
c4f395dda2 Allow more alignments
Summary: Allows `flex-start` and `flex-end` as aligment values on table cells.

Reviewed By: danielbuechele

Differential Revision: D15754424

fbshipit-source-id: 67449e429e6841800cfab7728f51e2d59cb36f0f
2019-06-11 09:23:13 -07:00
Jan Rabe
8dc9e5aee2 adding PreferenceManager.getDefaultSharedPreferencesName to default (#454)
Summary:
Adding context [PreferenceManager.getDefaultSharedPreferencesName](https://developer.android.com/reference/android/preference/PreferenceManager.html#getDefaultSharedPreferences(android.content.Context)) by default.

## Changelog

Adding context default shared preference by default.
Pull Request resolved: https://github.com/facebook/flipper/pull/454

Reviewed By: jknoxville

Differential Revision: D15759223

Pulled By: passy

fbshipit-source-id: d0770444ce2ea43e2c9bfdc9969532d330f71488
2019-06-11 08:56:25 -07:00
Daniel Büchele
79414aa3e1 Bumped electron version
Summary:
We in React VR were need newer Chrome DevTools version to make our plugin work properly. Chromium version with required fixes were shipped in electron 5.0.0.

This diff bumps electron version and explicitly allows node integration (accessing require, process and other node related functions from window object in index.html), because it was disabled by default in 5.0.0.

Reviewed By: jknoxville

Differential Revision: D15693539

fbshipit-source-id: 4f71a07b2afaa489aec46940c924f4ad30ad0413
2019-06-10 10:36:25 -07:00
David Aurelio
844cabd5d3 ElementsInspector: Allow for custom row decorations.
Summary: Adds the capability to customize rows in the elements inspector via a callback.

Reviewed By: danielbuechele

Differential Revision: D15738355

fbshipit-source-id: 27b91a74535736318b7fdb9d2eb44dfa20b4d77b
2019-06-10 08:39:05 -07:00
David Aurelio
1d38078982 Remove unnecessary $FlowFixMe
Summary: No longer necessary, after flow types for `lodash.memoize` were added.

Reviewed By: jknoxville

Differential Revision: D15738356

fbshipit-source-id: 3c911e5eefee347ca69a37051fd5279c5de47873
2019-06-10 08:39:05 -07:00
Pascal Hartig
9998ad8367 Bump Kotlin to 1.3.31 (#462)
Summary:
Making sure we stay up-to-date.
Pull Request resolved: https://github.com/facebook/flipper/pull/462

Reviewed By: jknoxville

Differential Revision: D15738557

Pulled By: passy

fbshipit-source-id: 9c700fa06b1959dd05762c435d7b859670125986
2019-06-10 07:49:38 -07:00
John Knox
3fcd9c8e51 More specific idb failure logging
Summary: The "Conflict in temp dir" message was misleading when there were 0, rather than >1 file. This fixes that error message.

Reviewed By: passy

Differential Revision: D15716247

fbshipit-source-id: 572addf99f623cdcffd7602dd3935bb69a50d047
2019-06-10 04:13:19 -07:00
Pascal Hartig
10211e4fa1 Update ws dependency
Summary: Addresses security alert https://github.com/facebook/flipper/network/alert/static/yarn.lock/ws/open (WS-2017-0421).

Reviewed By: jknoxville

Differential Revision: D15695745

fbshipit-source-id: e5e24ace95ecccc8e3be65d159c285914bff10dd
2019-06-10 03:55:36 -07:00
John Knox
627ccc2fbc Longer connection wait time
Summary:
I'm seeing some failures where no client is connected when we do the export.
This increases the wait time before sending the SIGINT.

Reviewed By: passy

Differential Revision: D15716214

fbshipit-source-id: 4646ef9d1c37e491273bd9deff504675b0e4e780
2019-06-10 03:50:26 -07:00
Chenhao Xu
c225795b73 flipper CPU plugin sidebar
Summary: Add sidebar to the flipper CPU plugin. Sidebar displays detailed information about the selected CPU core

Differential Revision: D15696198

fbshipit-source-id: 47e687b4354653e6bef626cd3f27adcb219dbd28
2019-06-07 10:09:15 -07:00
David Aurelio
6792fb0bea StatusIndicator: support inline contexts.
Summary:
`StatusIndicator` works well as a flex child, but didn’t support usage in inline / text contexts.

Adding `display: inline-block` fixes that.

Reviewed By: danielbuechele

Differential Revision: D15695673

fbshipit-source-id: 30378d2292390b8d86c0a26c11571e5953b841f2
2019-06-07 08:36:12 -07:00
John Knox
4d6b39ae42 Add test suite for headless
Summary:
Adds a JS test suite for running jest tests against flipper headless binaries. Replaces the jq-based bash script.

Simple sanity test included for all expected top level keys in output JSON.

Reviewed By: passy

Differential Revision: D15625723

fbshipit-source-id: 5ec8e764bcdbb99d9070de704e76a5cd9d8e5dc6
2019-06-07 08:29:45 -07:00
Daniel Büchele
53748da75e UI improvements
Summary:
* expanding/collapsing nodes
* memoizing table rows
* adding sidebar

Reviewed By: davidaurelio

Differential Revision: D15621070

fbshipit-source-id: 9335259d3b4bc1348e917782918eb1e0f678ba17
2019-06-07 08:14:20 -07:00
Pascal Hartig
151ad849cb Re-enable leak tracker
Summary: Restore the temporarily removed leak tracker setup.

Reviewed By: jknoxville

Differential Revision: D15713663

fbshipit-source-id: c98a90ee86173dad7131bfe5b05bb3488f27ae6d
2019-06-07 06:56:14 -07:00
Rain ⁣
aa649ff48f standardize C-like MIT copyright headers throughout fbsource
Summary:
`/*` is the standard throughout open source code. For example, Firefox uses single /*: https://hg.mozilla.org/mozilla-central/file/21d22b2f541258d3d1cf96c7ba5ad73e96e616b5/gfx/ipc/CompositorWidgetVsyncObserver.cpp#l3

In addition, Rust considers `/**` to be a doc comment (similar to Javadoc) and having such a comment at the beginning of the file causes `rustc` to barf.

Note that some JavaScript tooling requires `/**`. This is OK since JavaScript files were not covered by the linter in the first place, but it would be good to have that tooling fixed too.

Reviewed By: zertosh

Differential Revision: D15640366

fbshipit-source-id: b4ed4599071516364d6109720750d6a43304c089
2019-06-06 19:40:28 -07:00
Arnaud Frugier
fa887f4f12 Add documentation for Databases Plugin
Summary: ^^

Reviewed By: jknoxville

Differential Revision: D15666190

fbshipit-source-id: 4b2f5c5544820baa4654b4e52a7e75bd275facc1
2019-06-06 11:17:19 -07:00
Pascal Hartig
afe7c8bf25 Upgrade to Fresco 1.14.2
Summary: Includes the LeakTracker interface change. Restores the temporarily deleted tracker, wires it back up. Requires Fresco 0.14.2 being released which has yet to happen.

Reviewed By: oprisnik

Differential Revision: D15655667

fbshipit-source-id: ab4361be35101efe7564dfdd7a69cba93135eb7e
2019-06-06 08:02:46 -07:00
Pascal Hartig
dc41e2d778 Temporarily remove FlipperCloseableReferenceLeakTracker
Summary:
Ugh, this is the only way we can land the API-breaking next diff. Will
be reverted straight after.

Reviewed By: oprisnik

Differential Revision: D15655666

fbshipit-source-id: c9318e348c187de4562a9a636287cfa7b523356f
2019-06-06 04:54:32 -07:00
David Aurelio
8b7f17d932 Pull out colored disc indicator
Summary:
Pulls out the local `Lamp` component from `PluginDebugge` into `StatusIndicator`.

This will allow to reuse the component in different context, to guarantee a consistent appearance of Flipper throughout.

For good measure, we make diameter and title configurable. Vertical alignment is changed from `margin-top` to `align-self`.

Reviewed By: danielbuechele

Differential Revision: D15692275

fbshipit-source-id: 438b2f5300175565dbf07d07a5d757936b4f7cfe
2019-06-06 04:09:56 -07:00
John Knox
92edb82e13 Exit cleanly after flushing stdout
Summary:
Using `process.exit()` stops the node process without waiting for the event loop to finish, so when using async i/o, which is what happens when piped, if the output is buffered, the process can terminate before it finishes flushing the buffer.

This means you only get some of the output and the JSON is malformed.

This fixes it by calling `process.exit()` inside the flushed callback.

Reviewed By: passy

Differential Revision: D15624806

fbshipit-source-id: ea540ed5a40fb1811e5b705b190da96c8e54730d
2019-06-06 01:59:08 -07:00
Pritesh Nandgaonkar
873475405a Catch the exception thrown in xcrun
Summary: Catch the exception thrown in xcrun, which will occur for linux machines and in the cases when Xcode command line toolchain is not installed.

Reviewed By: passy

Differential Revision: D15621368

fbshipit-source-id: f3044cee6f7a4b5ba927a33003f9690c1fe31586
2019-06-05 11:41:31 -07:00
Pascal Hartig
1973432f78 Add active leak tracking in Fresco
Summary:
Adds a "Track Leaks" option that will show notifications (even retroactively)
for `CloseableReferences` that were tracked.

Reviewed By: danielbuechele

Differential Revision: D15622596

fbshipit-source-id: ef610379aa96f9a5e541f741af608db30bee74e1
2019-06-05 11:34:55 -07:00
Pascal Hartig
bef1ff26bc Add test for closeable reference metrics reducer
Summary: Per title.

Reviewed By: danielbuechele

Differential Revision: D15621850

fbshipit-source-id: 3b7ab83b7ed8dbfd75990194e909f78bd22ec45b
2019-06-05 11:34:55 -07:00
Pascal Hartig
e2215b4a17 Update jest flow-typed definition
Summary: Should be better than the mock we generated before, I hope.

Reviewed By: danielbuechele

Differential Revision: D15621591

fbshipit-source-id: a153d9233f6715c4c53ccabf2b8d18ce95b37f03
2019-06-05 09:38:00 -07:00
Pritesh Nandgaonkar
ace19e5d36 Unit tests for the metrics
Summary: Added unit tests for the "WASTED_BYTES" for the fresco plugin

Reviewed By: passy

Differential Revision: D15610871

fbshipit-source-id: dc9bd84363e1ba22fc96890b74e217372188a9d0
2019-06-04 14:15:46 -07:00
Daniel Büchele
72a39cb09d notification throttling
Summary:
Notification from plugins (especially network) could be very spammy. This diff introduces a throttle, so a plugin can only send a notification every 5 seconds. If a notification is sent earlier, it is not displayed and the counter is reset to 5 seconds from now.
In the notifications panel still all notifications are dispalyed.

Reviewed By: passy

Differential Revision: D15621427

fbshipit-source-id: ea5e3b39fdd5cdedff3fd5234e752800520a423b
2019-06-04 07:55:25 -07:00
Pascal Hartig
eba84a7e08 Reorganize CLI arguments
Summary:
1. Yargs doesn't like having the same option name as the given alias and will just silently skip those (like --metrics).
2. Having multiple ways of specifying the same argument is not a good practise.

I think we've been misusing `alias` as a way to have more JavaScript-y accessors, but ignoring that yargs already
converts `my-long-argument` to `myLongArgument` without having to expose this.

We haven't rolled out a version with the previous long arguments, so we should
still be able to change this without breaking stuff.

Reviewed By: jknoxville

Differential Revision: D15620636

fbshipit-source-id: 84a8046cf06d696e947719032c4f9c34ac9c0474
2019-06-04 07:50:35 -07:00
Pascal Hartig
b55ad41d97 let to const
Summary: Unrelated to what I was going to work on, so separate diff.

Reviewed By: jknoxville

Differential Revision: D15620643

fbshipit-source-id: a555bbd54adfe44fa7d566cb9cb6d31bd75be28e
2019-06-04 07:42:05 -07:00
Pascal Hartig
6e0121686c Add metrics for closeable reference leaks
Summary: Add a metric for the raw number of leaked closeable references.

Reviewed By: priteshrnandgaonkar

Differential Revision: D15603348

fbshipit-source-id: 03379e180b5822620e8e8347bef354edb3527d19
2019-06-04 06:02:23 -07:00
Pritesh Nandgaonkar
62c112c713 Fix the FlipperArray creation of events
Summary:
The FlipperArray creation from JSONArray used to create an array of `null`'s instead of the FlipperObject, which used to crash the Flipper. Thus added a check in the flipper to not crash in the case when it receives array of nulls. Also fixed the Fresco plugin in mobile to send the proper FlipperArray.

Bug:

{F160049909}

Reviewed By: passy

Differential Revision: D15608297

fbshipit-source-id: 625e017d3bce4135ac699ee5aee8d871db378749
2019-06-04 03:39:28 -07:00
Pritesh Nandgaonkar
95fae7d4e8 Call exportState function before exporting metrics
Summary:
This diff fetches the additional data by calling the hook added in each plugins when the headless tries to export metrics directly out of the store rather than from the trace.

I added `fetchMetadata` function which will be called while exporting the state as well as exporting the metrics. We do not need to fetch metadata in the case when the metrics are exported from the given trace.

Reviewed By: passy

Differential Revision: D15560129

fbshipit-source-id: 9b14340e565ce17d1825bc2d32520d7b0c2b2219
2019-06-03 15:06:30 -07:00
Pascal Hartig
023135ad74 Reduce in metrics reducer
Summary: Actually reduce in the reducer step instead of using mutable state.

Reviewed By: jknoxville

Differential Revision: D15603095

fbshipit-source-id: f603ca548bb760db5423a4c1871d94284ece9521
2019-06-03 14:41:43 -07:00
John Knox
befaecbf7c Cleanup android client so tests exit without forcing them
Summary:
We've got some exit troubles, meaning we have to use process.exit() to stop the headless process. This isn't good because the output isn't necessarily flushed when the process forcefully exits this way.
The tests can check for this, so I've removed the forceExit flag, and fixed the case stopping them from cleanly exiting - the android adb client.

Reviewed By: passy

Differential Revision: D15602919

fbshipit-source-id: b4a9dbabf5d3c874bda6bf938e4acb7b5b7e901b
2019-06-03 10:44:08 -07:00
Pascal Hartig
74ca921861 Flow 100
Summary:
0.100! Just noticed there's a new version and it continues to work.

destruction100

Reviewed By: jknoxville

Differential Revision: D15601865

fbshipit-source-id: 2d9d8a9ffb073468df4b85ed83800bce00ee6cda
2019-06-03 09:05:17 -07:00
Pascal Hartig
a3b7b93167 Upgrade to Flow 0.98.1
Summary: This should buy us some time before Sandcastle kicks us off again. :)

Reviewed By: danielbuechele

Differential Revision: D15449604

fbshipit-source-id: 90d4e8a965d0163de32416b43d9aa24ede104db2
2019-06-03 07:07:24 -07:00
Pascal Hartig
c0aaf6037d Fix prop declaration
Summary:
There's a mismatch as we don't use the same existential qualification
in the constructor as we do for the class definition. This this
enforced more strictly in newer Flow versions.

Reviewed By: danielbuechele

Differential Revision: D15601548

fbshipit-source-id: 807ef9ba74933fbc653514a617d1008f4f65c631
2019-06-03 07:07:23 -07:00
Pascal Hartig
c5a6ed0839 Explicitly type service worker registration
Summary: Per title.

Reviewed By: danielbuechele

Differential Revision: D15601531

fbshipit-source-id: 251949faffd75cf8b59a71c3963230113b0ebb0c
2019-06-03 07:07:23 -07:00
Pascal Hartig
f81d46410b Add missing Server import
Summary: Not sure why Flow was okay with this before.

Reviewed By: danielbuechele

Differential Revision: D15601506

fbshipit-source-id: a211bb373061d1481dbc6748d4e061a980cd0278
2019-06-03 06:07:52 -07:00
Pascal Hartig
faf19452eb Send CloseableRef leaks to Flipper plugin (#455)
Summary:
Pull Request resolved: https://github.com/facebook/flipper/pull/455

Only logging to the console for now, but it's a good start.

Reviewed By: oprisnik

Differential Revision: D15535820

fbshipit-source-id: 8531ec5ef681d01b2428a1f016b2a1d9f1589a34
2019-05-31 16:58:16 -07:00
Pascal Hartig
7dc3525846 Bump fresco to 0.14.1
Summary: Required for the next diff as we make use of the new CloseableReference interface.

Reviewed By: oprisnik

Differential Revision: D15558423

fbshipit-source-id: 98ce5bf3f01a6f0e7ca568544709656c41093505
2019-05-31 15:43:45 -07:00
John Knox
0d08d2b3b0 Flipper Bump: v0.21.2-SNAPSHOT
Summary: Database plugin bug fixes.

Reviewed By: priteshrnandgaonkar

Differential Revision: D15557872

fbshipit-source-id: 2f19d34d38669e556024bd87055591a4ab1c3389
2019-05-30 14:29:12 -07:00
John Knox
69c38b3a26 Flipper Release: v0.21.1
Summary: Database plugin bug fixes

Reviewed By: priteshrnandgaonkar

Differential Revision: D15557874

fbshipit-source-id: 0776f2e983919f29268e094d7c760410c9c0197f
2019-05-30 14:29:12 -07:00
John Knox
f71d33586f Disable Databases plugin test until roboelectric is upgraded
Summary: This gradle flag is stopping the other tests from passing.

Reviewed By: quanturium

Differential Revision: D15558776

fbshipit-source-id: 54934c73271e1cbb041877fef0dfb2de21733424
2019-05-30 14:29:12 -07:00
Pritesh Nandgaonkar
b5bda8dfae Refactor the startFlipper function
Summary:
Refactors `startFlipper` function in headless flipper into three different functions.

`earlyExitActions`: Before the dispatcher is called on the store and will exit if the user arguments are one which are meant to terminate the process.
`exitActions`: This function will be called after the dispatcher is called and will exit if the user arguments are one which are meant to terminate the process.
`storeModifyngActions`: It involves business logic which updates the store based on the user arguments.

Reviewed By: passy

Differential Revision: D15556130

fbshipit-source-id: 9d1b035525e613bb2b75454fa4fd6c193993b530
2019-05-30 10:16:47 -07:00
Pritesh Nandgaonkar
bab2aaaf0e Select device in headless
Summary: Adds an argument to select a device in headless. I will refactor the function the headless function in the next diff

Reviewed By: danielbuechele

Differential Revision: D15536774

fbshipit-source-id: 2e3f01c6bc6094d925aebd20ba0bf15b17168cd1
2019-05-30 08:33:43 -07:00
Daniel Büchele
565b8995ae requestIdleCallback node fallback
Summary: requestIdleCallback does not exist in node.js. In this case, we immediately invoke the callback.

Reviewed By: priteshrnandgaonkar

Differential Revision: D15556037

fbshipit-source-id: 62cee8544fabd4528d9df17109e882fa9db6585f
2019-05-30 08:24:17 -07:00
John Knox
bec5c2b20c Remove unused lodash dependency
Summary: This is a big dep, and wasn't even used. Removing.

Reviewed By: danielbuechele

Differential Revision: D15555949

fbshipit-source-id: 31a5430819592478b01548469fdbf58637c4de22
2019-05-30 08:19:19 -07:00