Commit Graph

1288 Commits

Author SHA1 Message Date
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
Pritesh Nandgaonkar
5964f1621e Open source Import/Export feature to open source
Summary: Exposes Import/Export feature to open source. This diff also makes sure that, "Shareable Link" option doesn't show up, as it is specific to fb's infrastructure.

Reviewed By: passy

Differential Revision: D14526634

fbshipit-source-id: 3aeb97c91bc00a9c5f01c74c34a5690ec3b5739d
2019-03-20 06:59:28 -07:00
Pritesh Nandgaonkar
fd9b581162 Documentation for sharing flipper data
Summary: Added documentation for the Flipper's Import/Export feature

Reviewed By: passy

Differential Revision: D14539133

fbshipit-source-id: 66f85c46edd4ca644d2bbcd6e47dd9c88aa3618c
2019-03-20 06:59:28 -07:00
Kevin Lin
deef14d3a2 Rename CKComponentDataSourceAttachController to CKComponentAttachController
Summary:
`CKComponentDataSourceAttachContrlller` doesn't have to be tied with datasource. It's totally legit to use it in hosting view as well.
Renaming it to `CKComponentAttachController` and move it to `Core` folder.

Reviewed By: priteshrnandgaonkar

Differential Revision: D14526150

fbshipit-source-id: f48a8d27a3bfa5170e22a397fe1b32e806bc3c55
2019-03-20 06:09:22 -07:00
Pascal Hartig
3b53aff55c Add --file option
Summary:
Positional arguments with yargs are a mess, so I'm adding a `--file` instead.
This can then be used to pass parameters on through the launcher.

Reviewed By: danielbuechele

Differential Revision: D14525320

fbshipit-source-id: f04ebed85b6eb9e3c82e76736695d41e7bafb301
2019-03-20 05:30:59 -07:00
JianyingLi
2564bce5a0 Fix DataInspector Component diff some problems. (#397)
Summary:
1. In `diffMetadataExtractor` function, when the `data` or `diff` is `null`, it diff view does not display correctly.

```jsx

<Panel floating={false} heading={'Test'}>
  <ManagedDataInspector
    diff={{
      auth: null
    }}
    data={{
      auth: {
        user: {
          name: 'JianyingLi'
        }
      }
    }}
    expandRoot={true}
  />
</Panel>
```

Before:
![2561552808023_ pic](https://user-images.githubusercontent.com/3889523/54486986-db383b80-48ca-11e9-9869-a008f72f4324.jpg)

After:
![2551552807969_ pic](https://user-images.githubusercontent.com/3889523/54486992-ea1eee00-48ca-11e9-90b0-7fd043f1c2bd.jpg)

2. Status `added`(green) and `removed`(red) should be the opposite

```jsx
<ManagedDataInspector
  diff={{
    user: {
      name: 'Leo'
    }
  }}
  data={{
    user: {
      name: 'JianyingLi'
    }
  }}
  expandRoot={true}
/>
```

Before:
![2591552808195_ pic](https://user-images.githubusercontent.com/3889523/54487019-35390100-48cb-11e9-8c20-1526aeae52a1.jpg)

After:
![2581552808145_ pic](https://user-images.githubusercontent.com/3889523/54487022-3c600f00-48cb-11e9-9ea9-75a8c8490c22.jpg)
Pull Request resolved: https://github.com/facebook/flipper/pull/397

Reviewed By: danielbuechele

Differential Revision: D14505757

Pulled By: passy

fbshipit-source-id: 35ca1bf8721468fdde13f3a9ede75cb72a59caea
2019-03-19 17:04:15 -07:00
Pascal Hartig
04cebe6e29 Upgrade to yargs 13
Summary: Want to use something that's not in 11.

Reviewed By: jknoxville

Differential Revision: D14524126

fbshipit-source-id: b0f038f32adccf91a394346da9335aa3cfc8e942
2019-03-19 12:28:33 -07:00
Pritesh Nandgaonkar
574ae7a3e8 Improve CrashReporter UI for the latest crash
Summary: I have updated the UI of the crash reporter. It doesn't show the multiple crashes now. I will work on that in other diff. This diff just updates the current UI that shows the latest crash, as per the [design](https://our.intern.facebook.com/intern/px/p/pJ11/)

Reviewed By: danielbuechele

Differential Revision: D14399400

fbshipit-source-id: f6f28c2c6d386f4cd99a257922993ef355b1059b
2019-03-19 08:18:13 -07:00
Daniel Büchele
8b91ec68a7 Catch error on export
Summary:
`exportStore` throws, when no device is connected. The error wasn't catched and `process.exit();` never called. The result is that the CLI couldn't be interrupted as long as `exportStore` thorws (e.g. no device connected).

Catching this error now.

Reviewed By: passy

Differential Revision: D14520754

fbshipit-source-id: 97b245c4de53e58bac8066a1b15874d873bf2841
2019-03-19 07:23:29 -07:00
Daniel Büchele
a54b02b583 release v2
Summary:
- Moving the new layout plugin from `layout2` to `layout`.
- updating dependencies
- removed beta toolbar

Reviewed By: passy

Differential Revision: D14519490

fbshipit-source-id: d184767e767e1717368f66e2bda2af318b7e63c9
2019-03-19 06:47:06 -07:00
Daniel Büchele
f9ec0cd326 fix colorpicker in panel. Fixes #396
Summary: Overflow on panels was clipped. Setting overflow visible to make it visible.

Reviewed By: passy

Differential Revision: D14519402

fbshipit-source-id: 264f99e3ac20986365c8f69564c4633818dd4a94
2019-03-19 04:17:40 -07:00
Pascal Hartig
7c185ea771 Add activity for connectivity test
Summary:
This is quite hacky, but allows us to test that a plugin connects, sends some actions and
then shuts down the app which we can use in a headless test.

Reviewed By: jknoxville

Differential Revision: D14482381

fbshipit-source-id: deafa8fa7e6d5a5ca1bb006e9d150b62295105af
2019-03-18 07:34:44 -07:00
Daniel Büchele
f30ff068a7 Show offline devices in dropdown
Summary:
This diff aims to make the selected device a little clearer, the button now shows different icons depending on the selected devices: physical, emulators and archived devices.

The dropdown now is grouped in these sections, depending on their availability:
- Connected Devices
- Running Emulators
- Imported Devices
- Launch Android emulators
- Open File...

"Open File..." allows to import a file the same way as File -> Open File...

Reviewed By: jknoxville

Differential Revision: D14460789

fbshipit-source-id: 8d6edff0d90d5e02e4ef5976af5680ab8eaf77b4
2019-03-15 11:30:38 -07:00
Pritesh Nandgaonkar
51139500f4 Add revision information in the exported file
Summary: Adds revision information which is used to build the flipper app. for more context follow the [discussion](https://fb.workplace.com/groups/1489943347777350/permalink/2046366362135043/)

Reviewed By: danielbuechele

Differential Revision: D14458169

fbshipit-source-id: 71860f1e78c042f76d0e220dd3be96f2adaf609e
2019-03-15 09:57:12 -07:00
Pritesh Nandgaonkar
e184af7f2a fix the parsing error
Summary:
The headless version used to use `JSON.stringify` to serialize the output of `serializeStore` which basically transformed the store to a specific format which is serializable.  But we have written the custom serialize function which cateres to the non serializable object types. Headless didn't use it, so thats why it exported Flipper trace in an unrecognizable format for the flipper.

I have also renamed `serializeStore` to `prepareToSerializeStore` so that the confusion doesn't occur in future. I have used an `exportStore` function in headless which exports the store to the `Promise<String>`

Reviewed By: jknoxville

Differential Revision: D14480096

fbshipit-source-id: f312d7637aa082d96c3bc1dfd00eefb19182e97f
2019-03-15 09:49:31 -07:00
Pascal Hartig
2813b584f6 Flipper Bump: v0.18.1-SNAPSHOT
Summary: Reenable snapshots.

Reviewed By: jknoxville

Differential Revision: D14477604

fbshipit-source-id: a71d49f2228b8f91b22ac5f8f1afc0444b77b32b
2019-03-15 08:51:09 -07:00
Pascal Hartig
c7633cb585 Flipper Release: v0.18.0
Summary:
= Highlights

This is a bit of a boring release, to be frank. Most of the stuff happened behind the scenes, but a lot of preparation for interesting stuff happened behind the scenes, so stay tuned!

= Fixes

- Upgraded to Electron 4.0.8 (e0127b8438)
- Fixes to node expansion in the layout inspector.
- Connectivity improvements.

See https://github.com/facebook/flipper/compare/v0.17.1...v0.18.0 for reference.

Reviewed By: jknoxville

Differential Revision: D14477605

fbshipit-source-id: 0d927ba08fa5fab9d95c76ec763f5b9dd5bc104d
2019-03-15 08:51:09 -07:00
Pascal Hartig
3141b954bf Run prettier fix
Summary: Should also fix the build.

Reviewed By: jknoxville

Differential Revision: D14477777

fbshipit-source-id: 01fcfb2321c9b7a12acdf079473d91b6805d4dda
2019-03-15 05:13:30 -07:00
Pascal Hartig
b354a82066 Bump Litho back to stable
Summary: Unblocking the release.

Reviewed By: muraziz

Differential Revision: D14477571

fbshipit-source-id: 06674e5c714f67f71f541c36b866ad3b403c960e
2019-03-15 03:50:13 -07:00
Pascal Hartig
69dd6e4fc1 Add non-interactive mode to sample app
Summary:
This can be used in integration tests/headless to create
some data to match against.

Ideally, headless also will need some mechanism to be
told to exit, but that's a separate issue.

Reviewed By: jknoxville

Differential Revision: D14387494

fbshipit-source-id: 88d7c27e342fb0b26251e6edf12e7b922d5144c0
2019-03-14 11:16:40 -07:00
John Knox
b675d1c6b5 Add test:debug target
Summary:
To run a test with the chrome debugger attached:
* Add `debugger` statement in the code
* Open 'chrome://inspect' and then "Open dedicated DevTools for Node"
* run `yarn test:debug $TEST_FILE` where $TEST_FILE is the file containing the tests to debug

I haven't done this for test-electron and test-with-device because the debugger didn't hit the breakpoint for some reason. Shipping this because some is better than all.

Reviewed By: danielbuechele

Differential Revision: D14457843

fbshipit-source-id: 3ce7ba7a95f4623bd87b5feeae0c26a65f4b7eb8
2019-03-14 11:04:51 -07:00
Peter van der Zee
f8b86362d7 Bump Prettier to 1.16.4
Summary:
@public
This bumps Prettier to v1.16.4
Only format source files were updated.

Reviewed By: mjesun

Differential Revision: D14454893

fbshipit-source-id: 72f9872fe764a79dbf0d9fab9bebb1456b039f2f
2019-03-14 07:00:52 -07:00
Pascal Hartig
e97dddfda6 Add readCurrentRevision helper
Summary: To read the current revision written into the manifest at build-time.

Reviewed By: danielbuechele

Differential Revision: D14454983

fbshipit-source-id: adad7d85dbf410701d2f8601bfccbcfbc0f30dff
2019-03-14 04:48:01 -07:00
Daniel Büchele
aad970defd UI for sharable URLs
Summary:
Uploading the Flipper data could take some while. With the current implementation the user didn't know what was happening. This is why this diff immediately shows a sheet with a spinner, until the upload is finished.

The URL is still copied to the clipboard and a notifications is displayed. Additionally the user can copy the URL from the sheet.

Reviewed By: priteshrnandgaonkar

Differential Revision: D14441759

fbshipit-source-id: c853526a7da76e2dea5e1aaf6b6eff21e4268789
2019-03-14 04:22:15 -07:00