Commit Graph

1211 Commits

Author SHA1 Message Date
Pascal Hartig
ad4c2092a5 Replace launcher error bar with titlebar indicator
Summary:
When starting Flipper with `--launcher-msg`, it currently shows a red error bar at the bottom. That's not ideal for various reasons including it looking kinda bad and it only supporting a single error (the last one set).

This instead adds an action that shows an indicator next to the version at the top as we had it before with the previous system.

Reviewed By: danielbuechele

Differential Revision: D14778859

fbshipit-source-id: 28591de6262e090a4e59a7f5a8cd86d7b3abf8fe
2019-04-05 06:47:14 -07:00
John Knox
c6baeff5ed Create DEV_ENVIRONMENT.md (#409)
Summary:
Adding a recommended workflow for those that don't have a good setup after conversation in https://github.com/facebook/flipper/pull/227

Just a starting point but I think it's better than nothing.
Pull Request resolved: https://github.com/facebook/flipper/pull/409

Reviewed By: danielbuechele

Differential Revision: D14798121

Pulled By: jknoxville

fbshipit-source-id: 721a4bc07720709d1c7cc9f2fa7db69984f4c37e
2019-04-05 06:30:39 -07:00
Arthur Kushka
861c5077f1 Extended ConnectionMock functionality
Summary: Its helpful to store all history of sent messages for testing purposes.

Reviewed By: jknoxville

Differential Revision: D14797191

fbshipit-source-id: 0e58166cb4ab79852165f2107b2f6bcd259f1096
2019-04-05 05:40:44 -07:00
Pascal Hartig
684ecd8a39 Don't retrieve info object twice
Summary: Some unnecessary syscalls in the way we actually use this at the moment.

Reviewed By: danielbuechele

Differential Revision: D14750875

fbshipit-source-id: 5959ed0845398b29698ab58f7359869fa3657fdc
2019-04-04 09:54:23 -07:00
Pritesh Nandgaonkar
2655d9b0ef Fix the reason getting truncated
Summary:
The reason was getting truncated, even though it had space to show the message. Look at the screenshot

BUG:

{F155254538}

Reviewed By: jknoxville

Differential Revision: D14775792

fbshipit-source-id: d18a458150c272c0c4e22cda9ea6459f96a70ea3
2019-04-04 08:17:38 -07:00
Daniel Büchele
294d5b110f rename keytar Windows native module
Summary:
`process.platform` is used to require the native-module for keytar. On Windows this returns `win32` (No matter if 64bit or 32bit system). The native module was named `keytar-win.node`. This diff renames it to `keytar-win32.node`.

This is the code that requires the module from `user.js`:

```
keytar = global.electronRequire(
    path.join(
      isProduction() ? remote.app.getAppPath() : process.cwd(),
      'native-modules',
      `keytar-${process.platform}.node`,
    ),
  );
```

Reviewed By: priteshrnandgaonkar

Differential Revision: D14771646

fbshipit-source-id: cd48d25cb5921e07e472eb46636fa2599c8ff721
2019-04-04 04:51:11 -07:00
Pritesh Nandgaonkar
e19d6a723e Fix open log bug
Summary:
For the native crash, the crash log is logged as seperate messages. So crash reporter plugin merges them together and fires one notification. The merrging logic is timer based, so if multiple crash log message is posted in 50ms, it will be combined in one notification.

For the above case, the "Open in Logs" functionality was broken, as we used to compare the entire callstack in one entry rather than in the multiple rows. This diff fixes this issue.

Bug:

{F155167144}

Reviewed By: jknoxville

Differential Revision: D14748956

fbshipit-source-id: d24db6d47fa3cd633a9002ac77f37c267ca4924f
2019-04-04 04:39:48 -07:00
Pritesh Nandgaonkar
830c8067e4 Timeout promise while exporting flipper plugin
Summary:
Added a promiseTimeout util so that we limit the time taken to export flipper plugin. I had received a feedback from the user stating that that the loader for the export stays for ages and never finishes. So this diff adds a timeout to the promise which is returned by `exportPersistedState` function. This function is currently implemented just by Layout inspector to fetch the entire view hierarchy. I suspect the the former mentioned bug may be due to the unresponsive client.

This diff also shows the plugin and the client information for which `exportPersistedState` timed out. Also this will hopefully solve the problem surfaced recently stating that the bug report gets stuck, the reason for which I suspect would be the same as the above mentioned reason, because we export flipper data when we create a bug report.

Reviewed By: danielbuechele

Differential Revision: D14712633

fbshipit-source-id: 35f8cfa722ec3b7ff94ebda943d618834ac3207d
2019-04-04 04:20:15 -07:00
Dustin Bluck
825ecb8e23 SharedPreferencesPlugin -- Look for all shared pref files
Summary: Searches for all shared pref files instead of only the package name by default

Reviewed By: xiphirx

Differential Revision: D14763787

fbshipit-source-id: a3b7dfe8db078ac4f55e236b1516ed2de668f8d2
2019-04-03 18:16:05 -07:00
Pascal Hartig
8e9643e8a1 Bump Gradle to 5.3.1 (#403)
Summary:
Just going through some of our third-party deps and making sure that
we're not trailing too far behind.
Pull Request resolved: https://github.com/facebook/flipper/pull/403

Reviewed By: danielbuechele

Differential Revision: D14665266

Pulled By: passy

fbshipit-source-id: 61e730c4d850a1c0a9475de287d9791061e85e4b
2019-04-02 04:26:14 -07:00
Pritesh Nandgaonkar
45999a5292 Share sheet for the file export
Summary:
This diff shows an export sheet when one exports the Flipper data in a file. It also shows if any error happens.
Look at the video in test case.

Reviewed By: danielbuechele

Differential Revision: D14624194

fbshipit-source-id: dea0179a83e626e49593e5dde1d5ff128048db02
2019-04-01 08:53:37 -07:00
Pritesh Nandgaonkar
2dacea8541 Published Flipper-PeerTalk dependency on Cocoapods (#395)
Summary:
I have published the new tag of Peertalk on my [fork](https://github.com/priteshrnandgaonkar/peertalk) and published a [Flipper-PeerTalk](80e4cd9a05/Specs/d/6/6/Flipper-PeerTalk/0.0.4/Flipper-PeerTalk.podspec.json) pod on cocoapods. There was no reply on the [request](https://github.com/rsms/peertalk/issues/48) to publish the new version of the peertalk on their repository and it was blocking us to publish Flipper and FlipperKit pods to Cocoapods. For more context follow the issue #132. With this PR we would have all our dependencies on cocoapods and thus we can now publish Flipper and FlipperKit pods on the cocoapods master repository.

I have also added the Flipper-PeerTalk podspec file for future updates.
Pull Request resolved: https://github.com/facebook/flipper/pull/395

Reviewed By: passy

Differential Revision: D14642440

Pulled By: priteshrnandgaonkar

fbshipit-source-id: 7847c19cddea358ffb62d2c6f16fc06d1afa1ea1
2019-04-01 08:49:16 -07:00
Pritesh Nandgaonkar
8a19a859f2 Update Componentkit, Yoga, YogaKit
Summary: Fixed the broken master for flipper iOS  oss

Reviewed By: jknoxville

Differential Revision: D14686908

fbshipit-source-id: abdcacf279449f83c98d1635c65ff8759ee17926
2019-04-01 06:59:59 -07:00
Pritesh Nandgaonkar
d044ae991f Fix the broken iOS OSS job
Summary:
Fixes the iOS OSS job which was failing. The root cause of the problem is as follows:

- RSocket was referring the master branch of rsocket/rsocket-cpp, fixed it by forking it and making its own release, unfortunately they don't make a release.
- Folly referred to the January's release. The current master branch of RSocket doesn't build with the latest release of the Folly, [this commit](b51dc569eb) is responsible for the breakage. Thus I made a Rsocket release, right before this [commit](b51dc569eb), so that it builds.Although, the current master branch of Folly builds with the current master branch of rsocket, but we will have to wait on Folly team to make a release. Once they do that I will update bit RSocket and Folly releases.

Reviewed By: jknoxville

Differential Revision: D14668686

fbshipit-source-id: 6b0362632c26355a69a3f33a031b71c88e7dd45b
2019-03-29 05:31:16 -07:00
Andrey Mishanin
a0e0b434ee Removed UIView (CKComponentAttachController)
Summary: Remove ObjC categories so we can strip dead code

Reviewed By: kfirapps

Differential Revision: D14665041

fbshipit-source-id: 243dee61a5b7cfd854191bfb5fa3a570b4ac1a4b
2019-03-28 09:23:41 -07:00
Pascal Hartig
dde68356eb Upgrade Babel
Summary:
Just minor version bumps so this doesn't have any noticeable effects.
Doing some cleanups after danielbuechele pointed out that it's important
for us to stay close to the upstream releases in the last team meeting.

Reviewed By: jknoxville

Differential Revision: D14665264

fbshipit-source-id: 91efb0663693823f394284457550716f22c40938
2019-03-28 08:36:13 -07:00
JianyingLi
1e97d7683f iOS Devices are not yet supported Displayed only when iOS physical device is selected
Summary: Pull Request resolved: https://github.com/facebook/flipper/pull/400

Reviewed By: jknoxville

Differential Revision: D14663825

Pulled By: passy

fbshipit-source-id: 6942668e63bb98ef2e0fa299b4b7dcf9ca6af3c6
2019-03-28 08:36:13 -07:00
Pascal Hartig
6ba28232ce Flipper Bump: v0.19.1-SNAPSHOT
Summary: Reenable snapshots.

Reviewed By: priteshrnandgaonkar

Differential Revision: D14665280

fbshipit-source-id: 3d89cb2d51ceaf6fc612eb1008eb8201a5af4554
2019-03-28 08:29:51 -07:00
Pascal Hartig
9ff6cfa9a4 Flipper Release: v0.19.0
Summary:
== Highlights

- **Layout 2.0**: We have a new layout inspector that was rewritten from the ground to address all sorts of small bugs that like nodes not expanding that should all be gone now.
- **New Crash Reporter**: Flipper will now detect crashes on your device and give you easy access to them through a device plugin that you can find next to logs. Learn more at https://fbflipper.com/docs/crash-reporter-plugin.html.
- **Import/Export**: You can now import and export Flipper sessions as data to share them with others. Learn more at https://fbflipper.com/docs/share-flipper-data.html.

== Fixes

- Improved error reporting for what was previously summarised under "RecurringError". (bf9be74ad2)
- Fixed an issue where the color picker could get cut off. (f9ec0cd326) (https://github.com/facebook/flipper/issues/396)

Full list: https://github.com/facebook/flipper/compare/v0.18.0...v0.19.0

Reviewed By: priteshrnandgaonkar

Differential Revision: D14665281

fbshipit-source-id: 78ed042d38642356180f25455d0d17a03ed59c6b
2019-03-28 08:29:51 -07:00
Pascal Hartig
b20d0a4c8b Add headless option to dump on disconnect
Summary:
This adds an optional exit strategy that reacts to the client disconnecting rather than a `SIGINT` which can be used for integration tests.

`MiddlewareAPI` is a subset of `Store` and required to work here.

Annoyingly, it's not quite clear to me why this does not work as part of an event loop cycle and requires a `setTimeout`. This doesn't have any negative effects and works in the same way that the SIGINT interruption works, but it's a bit of an eyesore.

Reviewed By: danielbuechele

Differential Revision: D14622111

fbshipit-source-id: e2caca056e478428d977565dc9bc09eefca4230c
2019-03-28 06:53:57 -07:00
John Knox
ddd06971f1 NativePlugins: Implement sidebar sections in java
Summary:
Changes sidebar from just a bucket of json, to be a list of SidebarSections.
Currently implemented sections are Json, and Toolbar.

Reviewed By: passy

Differential Revision: D14620095

fbshipit-source-id: 6ba57f6f1ad954373c0bbb79570d779787e5d4db
2019-03-28 06:45:39 -07:00
John Knox
ff6988ddaf Java side of NativePlugins
Summary:
Adds abstract classes NativePlugin and TableNativePlugin.

Extend NativePlugin to implement a new NativePlugin type/template.

TableNativePlugin is an example of that. Extend TableNativePlugin to add a particular instance of a table plugin. See the stacked diff for an example of that (newsfeed inspector).

I think I'm going to change the NativePlugin implementation so it uses composition instead of inheriting from FlipperPlugin, so that the concrete subclasses don't get access to the FlipperPlugin primitive methods like onConnect etc. But I don't mind shipping this as is and changing it separately.

Reviewed By: passy

Differential Revision: D14505912

fbshipit-source-id: 0534147112aaf4c5a41d2d3e08de855767b2a010
2019-03-28 06:45:38 -07:00
John Knox
f6f00611d5 NativePlugins: Handle sidebar sections
Summary:
Adds ability to send sidebar sections from the mobile app.
Currently implemented sections are json blob, and toolbar (row of buttons).

Note that I have not tested the toolbar with more than one button. I'm currently implementing features as needed so this should be considered alpha support at the moment.

Reviewed By: passy

Differential Revision: D14642879

fbshipit-source-id: 84876935337741422242285dc48da79af3a1d5ee
2019-03-28 06:45:38 -07:00
Pritesh Nandgaonkar
d9354fa484 Update Documentation
Summary: Updated documentation and screenshot for the new revamped UI

Reviewed By: passy

Differential Revision: D14643273

fbshipit-source-id: b05e19bcf42d00ce61a7cf61f93cbcd1d1f07a20
2019-03-28 04:37:54 -07:00
JianyingLi
06e2379a78 Add contentType application/hal+json support
Summary: Pull Request resolved: https://github.com/facebook/flipper/pull/402

Differential Revision: D14663823

Pulled By: passy

fbshipit-source-id: 873a286f7d2e73c5cee4b9586adeadffa0292e43
2019-03-28 03:55:31 -07:00
Pascal Hartig
0b72c6082f Set up text filter to allow for correct emoji display
Reviewed By: jknoxville

Differential Revision: D14640808

fbshipit-source-id: 9ecdb15f32143f5615d5763b9da79c581698acc5
2019-03-28 03:12:50 -07:00
Pascal Hartig
56d597985d Bump Android plugin
Summary: Latest Android Studio is complaining otherwise.

Reviewed By: jknoxville

Differential Revision: D14639287

fbshipit-source-id: 81814e10d7de5f293295892c9c6dd19ebf525ed7
2019-03-27 13:48:54 -07:00
Pascal Hartig
d08a123ae4 Fix test
Summary: Add an ability to inspect errors reported through `ErrorReportingRunnable`.

Reviewed By: jknoxville

Differential Revision: D14640270

fbshipit-source-id: a5a79d647e20d5d46c85aac2a814c77abbc624b7
2019-03-27 10:12:04 -07:00
Vlad Albulescu
4d0b1d2fc3 remove unused constructor arg from MainThreadFlipperReceiver
Summary: Argument became unused in a previous diff.

Reviewed By: jknoxville

Differential Revision: D14642264

fbshipit-source-id: 99bc78a9cff8322e8bed337f201a4748039a0332
2019-03-27 09:50:54 -07:00
Pritesh Nandgaonkar
153c75cfa9 Remove crashreporter GK
Summary: Remove the GK

Reviewed By: jknoxville

Differential Revision: D14596572

fbshipit-source-id: 09ef9359ce37c674ac7e1741b7d550716fca5156
2019-03-27 08:45:42 -07:00
Pritesh Nandgaonkar
9dbbae91d2 Provide the capability to copy crash name and reason
Summary: This diff allows user to copy crash name and crash reason in the clipboard

Reviewed By: jknoxville

Differential Revision: D14594212

fbshipit-source-id: 88a99af70e0e1aa5950e144a9072a8d96d7d3fc3
2019-03-27 08:45:42 -07:00
Pritesh Nandgaonkar
c422829beb Limit the message length in the notification
Summary:
Before this diff the notification fired for crash reporter had the entire callstack as its message, which is actually not required and it also makes a UI not good.

This diff just limits the message length

BUG:

{F154537911}

Reviewed By: passy

Differential Revision: D14594189

fbshipit-source-id: 663710e3e80be4367d0cc2a532fd4aa312cc0c1e
2019-03-27 08:45:41 -07:00
Vlad Albulescu
de46240272 explicitly report errors in MainThreadFlipperReceiver
Summary: Use responder rather than allowing exception to propagate.

Reviewed By: jknoxville

Differential Revision: D14538883

fbshipit-source-id: 2774a2adfcee356e1853fa3bf3c01aa113181262
2019-03-27 08:05:14 -07:00
Pascal Hartig
b2d1506f15 Fix SDK app crash
Summary:
I'm not sure why this was made an AssertionError in the first place
as this cannot be caught by a catch branch that only takes Exception-subclasses.

Given that this is expected behaviour in some cases, using an Error here
is rather dangerous.

This does not fix the underlying issue of the attached task, but fixes
the undesired crashing behaviour of the app.

Reviewed By: priteshrnandgaonkar

Differential Revision: D14598611

fbshipit-source-id: b024b35f07e16755d9a4ab2f4a1f75b10d1353fb
2019-03-27 07:49:01 -07:00
Pascal Hartig
12700b8643 Remove test copy
Summary: Umm, not sure why this is still around. Looks like an `hg mv` gone wrong.

Reviewed By: jknoxville

Differential Revision: D14639300

fbshipit-source-id: 511116808c4e8ae684fc21454853a482a2c36122
2019-03-27 07:49:01 -07:00
Alex Dickson
99b0bf516e Make FlipperUtils parameters final
Summary: This diff makes the params final.

Reviewed By: jknoxville

Differential Revision: D14641443

fbshipit-source-id: 5c003bd09144a8d8dd848c04599388ace4baef4d
2019-03-27 07:44:16 -07:00
Daniel Büchele
880327b61d sign in
Reviewed By: passy

Differential Revision: D14598657

fbshipit-source-id: 3ee6ee5ec7323616ac200243747e0b44b1ce65d4
2019-03-27 04:21:23 -07:00
Daniel Büchele
1c904b219c copy Nuclide token
Summary:
* We are now using `flipper.oAuthToken` to store our token in the keychain
* If there is no Flipper token, we copy the Nuclide token (once)
* If the user signs out of Flipper, only the flipper token is removed from the keychain, not the nuclide token
* the Nuclide token is not copied anymore

Reviewed By: passy

Differential Revision: D14598658

fbshipit-source-id: ab0646b35575bd4b2e433d62bb98635f6d127fd2
2019-03-27 04:21:22 -07:00
Pascal Hartig
fd6cab2a7b Launcher cycle detection
Summary:
Flipper Electron delegates to the Launcher if it is found right on startup to fetch the most recent/compatible version of Flipper. The Launcher then opens the downloaded app with a `--no-launcher` option to avoid bouncing back and forth between the Electron app and the Launcher.

This depends on the argument processing working unchanged. In the past this has been somewhat difficult to guarantee as this doesn't happen in one place and dev/prod builds have handled arguments different due to Electron weirdness (requiring a `--` passed in, for instance).

If anything here goes wrong, we end up in a very nasty scenario where the launcher and the Electron app rapidly open and close, making it nearly impossible for users to escape that vicious cycle. `pkill -f Flipper` being the best option, if you can focus a terminal for long enough.

In order to avoid this from ever happening in the future, this introduces a quick check for the last startup is written with a timestamp and if this is less than 5s in the past, we will skip delegating to the Launcher altogether, keeping the current instance running.

Reviewed By: jknoxville

Differential Revision: D14598136

fbshipit-source-id: b3335ce7ec7dc3e5e014d459db31df4c8a774fc6
2019-03-25 11:36:19 -07:00
Pascal Hartig
ec42fd62ac Wire up --file/--url on Flipper startup
Summary:
When passing --file or --url explicitly on startup, they should
be used in the same way that event handlers are used.

Reviewed By: jknoxville

Differential Revision: D14598688

fbshipit-source-id: 07179227da3b6c754a4d3a9e15342474e39d72b7
2019-03-25 11:31:24 -07:00
Pritesh Nandgaonkar
dd3f0fdfeb Parse Date from the crash and fix the date mismatch in the UI
Summary:
This diff parses the `Date` from the crash log, so that the `Date` shown on the UI matches with the actual crash log
Bug:

{F154301489}

Added test too

Reviewed By: danielbuechele

Differential Revision: D14563053

fbshipit-source-id: b9dc7de11d7f17d6c7aa2afe5106b8f85c0a535c
2019-03-25 04:53:40 -07:00
Pritesh Nandgaonkar
0adc2ef52e Multiple crash support
Summary: This diff adds support to show multiple crashes in the crash reporter plugin. You can also select crashes from the list of the dropdown.

Reviewed By: danielbuechele

Differential Revision: D14513401

fbshipit-source-id: 621d32c5971519e5046daec76ec2f9b32ba4d8ce
2019-03-25 04:53:40 -07:00
Pascal Hartig
759329bbc3 Pass URL and file arguments to launcher
Summary:
Changes where we delegate to the launcher to a later point so we can successfully intercept file open events and custom URI events.

There's more information in Phase 1 in this paragraph of the doc: https://fb.quip.com/tpqnAbxnJw1w#UNZACAnVVGs

Reviewed By: danielbuechele

Differential Revision: D14563585

fbshipit-source-id: a8757a6072386e56102f15b0668456369a44aad7
2019-03-22 12:18:10 -07:00
Pascal Hartig
939cc531e2 Fix revision bundling
Summary:
This fixes headless not terminating due to the `package.json` not being readable.
I instead write this to the `global` object in the same way that the version is
set.

Reviewed By: jknoxville

Differential Revision: D14579316

fbshipit-source-id: 238afe912366c423552305e120088f4abac4c20b
2019-03-22 10:41:01 -07:00
John Knox
57a24769e8 JS side of Native Plugins
Summary:
Native plugins are plugins that can be written in mobile code alone (java/objc), provided they conform to a template, currently table is the only implemented template.

This adds support to flipper for handling them.

Reviewed By: danielbuechele

Differential Revision: D14502188

fbshipit-source-id: a96be9b06de1cecf7977c4ef2fd05b168f7f1330
2019-03-22 07:07:31 -07:00
John Knox
ba0cdf641d Fix error bar displaying
Summary: The error was getting wiped accidentally if register device didn't have any error. In practice, meaning that the "flipper already running" message only flickered on the screen and then disappeared.

Reviewed By: passy

Differential Revision: D14576768

fbshipit-source-id: 1c7443f8f25ffa6a56f8d4994f3fef53bbb02c6d
2019-03-22 06:52:05 -07:00
John Knox
bf9be74ad2 Remove RecurringError type
Summary:
This was originally introduced so we could squash multiple instances of the same error at the client side and only report one instance of them.
Now we've moved to doing the aggregation server side, which is more powerful, so this is no longer necessary. We've also seen a case of these Error objects appearing opaque making it hard to see the underlying problem, so removing it entirely.

Reviewed By: passy

Differential Revision: D14576715

fbshipit-source-id: b285dcb5249e209f9008a14ac6a2f226f3aa82d7
2019-03-22 06:52:05 -07:00
Pascal Hartig
daf8cfea2a Remove unneeded flow fixme
Summary: Per title.

Reviewed By: jknoxville

Differential Revision: D14561355

fbshipit-source-id: 45681a754ff91d90057d48ba9f567770a87bc3c6
2019-03-21 08:38:25 -07:00
Mihaela Ogrezeanu
2d357a2ced Show state data in flipper Sections inspector
Summary:
as title; refactored getStateData for components so we can reuse
Depends on D14386744

Reviewed By: passy

Differential Revision: D14386910

fbshipit-source-id: 088605b920fd5b489d007e5daa69f4cd53fc3072
2019-03-20 09:13:21 -07:00
Mihaela Ogrezeanu
5195bfc0e4 Show Section props in flipper
Summary:
as title.
Refactored the getPropsData from DebugComponentDescriptor and extracted it to separate class so we can use it for SectionComponentDescriptor as well.
Will follow up with adding state info

Reviewed By: passy

Differential Revision: D14386744

fbshipit-source-id: c6b9887aa9d0c8d2333e7e64fa0954e56b505e51
2019-03-20 09:13:21 -07:00