Commit Graph

1123 Commits

Author SHA1 Message Date
Daniel Büchele
a8a1869bc8 adding Searchbar
Summary: Adding the searchbar to layout inspector. Most of it's functionality is taken from the existing implementation.

Reviewed By: jknoxville

Differential Revision: D14100533

fbshipit-source-id: 6c3a49658d53c676489886b2599bef425f8f20d3
2019-02-18 05:17:52 -08:00
Daniel Büchele
649688db2a Sidebar
Summary:
This is mostly only moving the Sidebar from the old LayoutInspctor to a separate file. The old file was part of the UI component, however, it was super specific to the layout inspector, so I felt it makes sense moving it there.

Here is a diff between the new `src/plugins/layout/layout2/InspectorSidebar.js` and `src/ui/components/elements-inspector/sidebar.js`: P60951781

The old file is still kept around, as long as the old and new layout inspector are run side by side.

Reviewed By: passy

Differential Revision: D14100537

fbshipit-source-id: b5a6fbae9866732800bb9b2b8fb1b996b9861db6
2019-02-18 05:17:52 -08:00
Daniel Büchele
4f425b05b4 Alignment mode
Summary: Adding a toggle to enable/disable alignment mode

Reviewed By: jknoxville

Differential Revision: D14100534

fbshipit-source-id: e3a49f1f31112ca2c99c2246a12c4f34be1ec61a
2019-02-18 05:17:52 -08:00
Daniel Büchele
53f3f2d40f Target mode
Summary: Adding a toggle to enable/disable target mode

Reviewed By: jknoxville

Differential Revision: D14100535

fbshipit-source-id: 9251f2d2f9d3013650421be62719ad5fb254e804
2019-02-18 05:17:52 -08:00
Daniel Büchele
c21875e168 refactoring
Summary:
This is refactoring the layout inspector. The old layout inspector was a single file with more than 1200 LOC which was really hard to debug and extend. This aims for splitting it up into smaller, easier to maintain components.

This version of the layout inspector only shows the view hierarchy for the regular view tree and the a11y tree. Additional features are added in stacked diffs.

Reviewed By: jknoxville

Differential Revision: D14100536

fbshipit-source-id: ca5e22dbb6ed9e34ce208a2a699ebfeb083904ad
2019-02-18 05:17:52 -08:00
Daniel Büchele
b70a18cef2 ToolbarIcon component
Summary: Adding a ToolbarIcon component that displays an icon in the toolbar that can be toggled on and off. This is used in subsequent diffs.

Reviewed By: passy

Differential Revision: D14100393

fbshipit-source-id: d814b52cf77585c4e8d090e11399e005713efb5e
2019-02-18 05:17:51 -08:00
Jonathan Kim
13bdfedeb1 Codemod rest of xplat// -> fbsource//xplat
Differential Revision: D14057661

fbshipit-source-id: 7780ec117cbe5deb8cf9211b228b186bf97e1b1f
2019-02-16 23:59:40 -08:00
Pascal Hartig
ab6ebf665e Bump android gradle plugin (#372)
Summary:
Pull Request resolved: https://github.com/facebook/flipper/pull/372

Some prep for AndroidX upgrade.

Reviewed By: danielbuechele

Differential Revision: D14101014

fbshipit-source-id: 15571528340ea149be77985b3d194d832f253597
2019-02-15 08:54:10 -08:00
Daniel Büchele
c6752110cf watch recursive
Summary: Plugin files in subfolders were not watched. Adding recursive flag to reload plugins, even when there are changes in any of the plugin's subdirectories.

Reviewed By: jknoxville

Differential Revision: D14100394

fbshipit-source-id: 2a0b5e35df4bbbfe6cf8a0fafd5271222d99a46c
2019-02-15 06:31:31 -08:00
John Knox
d5dc3f9c2a Add timestamp columns to network inspector
Summary: Adds requestTimestamp, and responseTimestamp which is hidden by default.

Reviewed By: passy

Differential Revision: D14088403

fbshipit-source-id: c451a428d8068c5bfce199cda5502361c12d1667
2019-02-15 04:57:38 -08:00
John Knox
ee54a54ff2 Clean up log statement
Summary: Looks like a left over debug log

Reviewed By: danielbuechele

Differential Revision: D14086508

fbshipit-source-id: 6bf3ef40746d8d248ed38071107cae00ba3040f9
2019-02-15 04:32:43 -08:00
John Knox
d95e81b17d Deprecate client.send()
Summary:
Adds a warning when not in production and client.send() is used.

We could just delete it but there may be open source users of the API.

Reviewed By: passy

Differential Revision: D14085002

fbshipit-source-id: 39f965b59540bd5b7059ec8d6b1c274146699d2d
2019-02-14 09:55:50 -08:00
John Knox
2a938c5b81 Change all plugin uses of client.send to client.call
Summary: client.send will be deprecated because it doesn't allow handling or detection of errors.

Reviewed By: passy

Differential Revision: D14084786

fbshipit-source-id: 7ebe4a7f3f8536c705e1c9302f38db0a34d99dc4
2019-02-14 09:55:50 -08:00
John Knox
8eb790b8b5 Fix Litho container props in layout inspector
Summary: The layout inspector isn't showing props for litho views. This fixes that.

Reviewed By: passy

Differential Revision: D14052057

fbshipit-source-id: fa6fe14785bc1588db6624c1319aedf88d843763
2019-02-14 09:30:41 -08:00
John Knox
e33e2d4d06 Unify Logger interface usage
Summary:
Unified all imports of Logger. Some were called LogManager before.
Now the fb-stub and the fb variants use the same interface.
Constructor of Logger is no longer exposed so it can't be initialized twice, unless in the case you're explicitly using the fb variant, which has extra functionality.

Reviewed By: danielbuechele

Differential Revision: D14083929

fbshipit-source-id: 9b61a06e1264d5f142b5a9188465c99deaf18193
2019-02-14 09:23:41 -08:00
John Knox
8ff4c4f56d Remove duplicate Logger in headless/index.js
Summary:
init() was being misused. This returns a Logger instance, so there's no need to create one as well.
This was a problem because different arguments were being passed to each (isHeadless in this case).

Reviewed By: passy

Differential Revision: D14083320

fbshipit-source-id: b0001a2b3cdd914609d54382575e3b0fa4b5f077
2019-02-14 09:23:41 -08:00
Pritesh Nandgaonkar
b9db2411cf Add archived device type
Summary:
This diff adds archived device type. This diff solves the following two problems.

- The Plugin which are device plugins and are device plugins will not show up. Look at the video, where the CPU plugin was showed, even though the imported file didn't have any information.
- An icon of 📦 will make much clearer which one is archived device and which isn't

Reviewed By: passy

Differential Revision: D14066399

fbshipit-source-id: 59b740d7fe9532e665d6b1ec6ad0124fb63ac45d
2019-02-14 06:34:02 -08:00
John Knox
9b6db1f482 Respond on exceptions thrown when on main thread
Summary: Changes FlipperPerformBlockOnMainThread to take a responder, and respond with an error if an exception is caught.

Reviewed By: passy

Differential Revision: D14066982

fbshipit-source-id: 70135bf58171684bcd013c66d9deec366aed36f5
2019-02-14 06:24:38 -08:00
Pascal Hartig
c0b5f10693 Add --launcher-msg option to pass to desktop app
Summary:
Allows the launcher to provide messages to the user. Currently, in the form
of the red notification bar at the bottom. This is just meant as a temporary measure
during the alpha to have some clearly noticeable way of getting the user's attention.

I consider removing this a blocker for the release as this mechanism is not well
suited for this in many ways.

The current use case for this is providing a warning if a cached version is used
instead of the requested one, e.g. "Could not fetch requested Flipper version 'deadbeef', using cached version instead."

Reviewed By: jknoxville, priteshrnandgaonkar

Differential Revision: D14073687

fbshipit-source-id: 85630347027063103315eeb1286731fe2478e261
2019-02-14 06:02:44 -08:00
John Knox
3caa0da887 Use call instead of send
Summary: Going to deprecate send, so changing these to call so the plugins can respond to errors.

Reviewed By: passy

Differential Revision: D14066981

fbshipit-source-id: 440563f1bf1a1a145fcfd0e6f36af63bf27836ed
2019-02-14 05:18:19 -08:00
Pritesh Nandgaonkar
9a8e30681b Handle the case of Logs not being present
Summary:
- handles the case when log is not present
- solved the cpu plugin error
- now `fileversion` is the flipper version

Reviewed By: jknoxville, danielbuechele

Differential Revision: D14065882

fbshipit-source-id: f88414bbb3d766f8ab6e0ec00943b59738918a0e
2019-02-14 04:53:56 -08:00
Pascal Hartig
a41d8eb4f8 Delegate to launcher app on startup
Summary:
For the production version, if the Launcher is installed and no `--no-launcher` (note the double-negation) is supplied, then
let the launcher start the app instead.

The launcher will pass the `--no-launcher` option back to prevent this from looping.

Reviewed By: jknoxville

Differential Revision: D14066620

fbshipit-source-id: 27d305efac36005e5e1082076829f10ef14aba0d
2019-02-14 02:33:06 -08:00
Pascal Hartig
2b9e3c54c6 Set up --no-launcher flag
Summary: For future use to disable launcher loops.

Reviewed By: jknoxville

Differential Revision: D13979653

fbshipit-source-id: db56f7d71d7a4d1322cb36622313dbad4307396d
2019-02-14 02:33:06 -08:00
Nathan Schneider
39cb25ade9 Update communicating.md (#370)
Summary:
FIxed a grammatical issue in line 32.
Pull Request resolved: https://github.com/facebook/flipper/pull/370

Reviewed By: passy

Differential Revision: D14064608

Pulled By: priteshrnandgaonkar

fbshipit-source-id: 87fc04ff56227211a43db9919ccec00380e77bc8
2019-02-13 08:08:16 -08:00
Nathan Schneider
a0d33a99e5 Updated crash-reporter-plugin.md (#371)
Summary:
Fixed a spelling error in line 6.
Pull Request resolved: https://github.com/facebook/flipper/pull/371

Reviewed By: passy

Differential Revision: D14064606

Pulled By: priteshrnandgaonkar

fbshipit-source-id: 51535362477712500c3138d1e7a688cdda8e3793
2019-02-13 07:51:49 -08:00
John Knox
ff076d9dcd FlipperResponder: no response = success
Summary:
If an exception is thrown from the plugin, FlipperClient.cpp will catch it and respond with an error response.
If the object goes out of scope with no response being returned, then return a success response in the destructor.

Reviewed By: passy

Differential Revision: D14024259

fbshipit-source-id: 52e419dd23fc3882e8b92b593e8c1e1ea90e2b26
2019-02-13 05:13:42 -08:00
Edward Pastuszenski
dfbd12cd63 Expose FlipperArray construction from JSON
Summary: Enables `FlipperArray`s to be constructed from `JSONObject`s or JSON `String`s, as `FlipperObject`s can be.

Reviewed By: jknoxville

Differential Revision: D13996135

fbshipit-source-id: d8a445d907799cd51dcdb3ba832dfe6fddb7171e
2019-02-12 13:20:49 -08:00
Pritesh Nandgaonkar
059ac83fcf Do not import already imported data
Summary: Before this diff, if one imported same file twice, it duplicated app data.This diff fixes that. When one tries to import the already imported file then this diff will select that flipper files device in the UI.

Reviewed By: jknoxville

Differential Revision: D14045145

fbshipit-source-id: f17c83486ffcdb0e2a57c70b1589e34567811d01
2019-02-12 08:37:14 -08:00
John Knox
c912dcaf48 Add isHeadless attribute to scribe messages
Summary:
So we can distinguish between humans and the machines.

We can redirect the traffic to different tables based on this attribute if necessary.

Reviewed By: danielbuechele

Differential Revision: D14025004

fbshipit-source-id: c3a24b5f8a30f24445eaee67843b78ddabfc9d51
2019-02-12 08:29:20 -08:00
Pritesh Nandgaonkar
029377a849 Change the export file extension type
Summary: This diff imports and exports data in a `.flipper` file extension. This diff also adds the support to open flipper app by double clicking on the `.flipper` file.

Reviewed By: danielbuechele

Differential Revision: D14042846

fbshipit-source-id: 17e6b55bf2796d9abdf985411fce799600f7792b
2019-02-12 06:48:06 -08:00
Mihaela Ogrezeanu
73b816de16 Click to focus in hierarchy
Summary:
as title; this shouldn't change how focus worked before on views, but accounts for the new Section nodes
Depends on D13900789

Reviewed By: astreet

Differential Revision: D13900846

fbshipit-source-id: 093016c17b5c1351108dbd9c884bf99a1b4d49cb
2019-02-12 06:30:46 -08:00
Mihaela Ogrezeanu
8855687963 Highlight section
Summary:
as title, highlight a section when hovering over it
Depends on D13900729

Reviewed By: astreet

Differential Revision: D13900789

fbshipit-source-id: 552554f5ecf9a9dd3edf4724581b7dee6a8a855d
2019-02-12 06:30:46 -08:00
Mihaela Ogrezeanu
ec98c857c2 Enable section descriptors in Flipper from configDepends on D13803338/
Summary: as title

Reviewed By: passy

Differential Revision: D13803412

fbshipit-source-id: a9d511ca7d5466eb9b1f82f93b6c48879f0aa02e
2019-02-12 06:30:46 -08:00
Mihaela Ogrezeanu
e86a5166ad Add descriptors to view a Section as a child of LithoRecyclerView
Summary:
This doesn't add new behaviour. It adds NodeDescriptor implementations for rendering Section nodes inside Litho flipper inspector.
We'll consider LithoRecyclerView as the point where we can detect a section hierarchy, and it will (for now) have as a child a DebugSection which is the root of the SectionHierarchy.
Depends on D13802978

Reviewed By: astreet

Differential Revision: D13803272

fbshipit-source-id: a5367d97315349770201a29f5d5bd05baec0405e
2019-02-12 06:30:46 -08:00
Daniel Büchele
825bfffd21 create one headless file for all platforms
Summary: We are distributing a single package via fbpkg containing the headless version linux and macOS. This changes the build process to only create a single zip-file containing these binaries.

Reviewed By: passy

Differential Revision: D14042031

fbshipit-source-id: 88992f17501353a70bc21799c6bd2957576268a3
2019-02-12 06:18:56 -08:00
Pritesh Nandgaonkar
c28ef62f07 Import and export Logs
Summary: This diff adds import and export support for the logs plugin

Reviewed By: danielbuechele

Differential Revision: D13958713

fbshipit-source-id: a072de025f0b959302175ef0ccaf763ca41377e9
2019-02-12 02:47:55 -08:00
Pritesh Nandgaonkar
e5151b9994 Add salt to the exported device serial id
Summary:
This diff solves the following bug.

When the user imports the exported flipper data for the device which is currently running, there was a bug. A duplicate device with the same serial got created after importing the file. Due to the same `device_id`, the plugins of the exported device got imported in the already running device(which has the same device id).

To solve this problem, I have prefixed the exported `device_id` with a random string, so that the exported device is unique across the device list in the Flipper app.

Look at the vide to understand the bug

Also updated the test case accordingly

Reviewed By: danielbuechele

Differential Revision: D13973180

fbshipit-source-id: df6ee00987e81923914855cea4d76e2bd7167358
2019-02-12 02:47:55 -08:00
John Knox
2335cfb312 Fix formatting in PortForwarding readme
Summary: Pull Request resolved: https://github.com/facebook/flipper/pull/369

Differential Revision: D14031906

Pulled By: passy

fbshipit-source-id: 6da0ab7da30f7505b5265033f732a00cf9f397a4
2019-02-11 15:21:25 -08:00
John Knox
fe0eeafd98 Fix issue with responses from de-inited plugins
Summary:
Now that flipper is using rsocket requestResponse, the SDK is responding with an error when the connection for this plugin has been torn down.

To avoid flipper interpreting these as bad, keep track of which plugins are inited, and only worry about responses from these.

Reviewed By: danielbuechele

Differential Revision: D13973745

fbshipit-source-id: d4e6916f89b3b562e5dcf23c4fe5b5cb384a6ec4
2019-02-11 14:06:56 -08:00
John Knox
ce5f739d81 Add sdkVersion to ping events
Summary: So we can see usage of old sdks.

Reviewed By: passy

Differential Revision: D14022623

fbshipit-source-id: 22f0681cbf4374e2cf3256e1049d154789e1959e
2019-02-11 14:06:56 -08:00
John Knox
92271d1454 Use rsocket requestResponse in desktop app
Summary:
Changes the desktop app to use requestResponse for communicating with the sdk, when the sdk is on a version that can handle it.
If it's an old sdk version, just use fire and forget. We can delete this code after a while, but keeping it for now to smooth things over during migration.

This should be fully backwards compatible both ways.

Reviewed By: passy

Differential Revision: D13971354

fbshipit-source-id: 60e18dda5c253c81ab7e62ca1aae4f4bc423f7e2
2019-02-11 14:06:56 -08:00
John Knox
0413bbd458 Add sdk_version param when connecting to flipper
Summary:
Every time an app connects to flipper, it will include its version.

With this information, the desktop app will be able to know how to communicate with it (or even whether it still can - and show an error message if not).

Reviewed By: passy

Differential Revision: D14008785

fbshipit-source-id: ac4dfd52da4bc6a2b90ec09a8e619086b7cd4a59
2019-02-11 14:06:56 -08:00
John Knox
5da8f35ee3 Don't use private access in FlipperRSocketResponder
Summary:
Changing FlipperRSocketResponder to only use public parts of FlipperConnectionManagerImpl.

This means we can test it by injecting a FCM mock, and it can use its public interface.

Reviewed By: passy

Differential Revision: D14000078

fbshipit-source-id: c0431a888b0ca041807631c81b99fb8b947274d6
2019-02-11 14:06:56 -08:00
John Knox
c48c1a728a Extract Responder class out of FlipperConnectionManagerImpl
Summary:
For one thing, this file is too big so it's good to split it up.

Also, having this responder defined in the .cpp file makes it hard to test. Extracting it for testability.

Reviewed By: passy

Differential Revision: D14000079

fbshipit-source-id: 8da4e0e325f48c0ada8efc7cd6fffcb3440c6e26
2019-02-11 14:06:56 -08:00
John Knox
4a3de26a88 Add requestResponse handler for incoming calls
Summary:
Flipper exposes a call() api to plugins which lets them call their sdk component, and it returns a promise with the response.
Currently this is done by sending a fireAndForget request, noting the id of the request, and then receiving fireAndForget requests and matching up the ids to give the result back to the right plugin promise.

Instead, it will be simpler to use rsocket requestResponse, instead of fireAndForget, which is for this exact use case. This diff adds a requestResponse handler to the SDK, so that it can deal with such requests and respond accordingly, while preserving the current functionality if it receives a fireAndForget.

So this part is backwards compatible and should be safe to land in isolation.

A later diff will change the desktop app to use requestResponse, which may not be backwards compatible, so that will have to be deployed more carefully.

Reviewed By: passy

Differential Revision: D13974049

fbshipit-source-id: b371d94a86b1f186375161ed8f2242a462ce418f
2019-02-11 14:06:55 -08:00
Mitch Ware
8f6138a41c Explicitly specify serial filename to openssl (#227)
Summary:
Manually add `serial.srl` as the `CAserial` param to `openssl`. This
fixes a permissions issue when generating certificates, which fixes some
of the issues explained in #101.
Pull Request resolved: https://github.com/facebook/flipper/pull/227

Reviewed By: passy

Differential Revision: D9316089

Pulled By: jknoxville

fbshipit-source-id: dd15e2f2f318d3a1217c6b4ffd0bb7e25b56d560
2019-02-11 04:58:46 -08:00
Daniel Büchele
c98047bbcf support DEVICE_SET_PATH env var
Summary: support for DEVICE_SET_PATH as used by 1W

Reviewed By: passy

Differential Revision: D14007285

fbshipit-source-id: 79f40355020c67efcb439f470af2fc35ec7fea7e
2019-02-11 02:57:19 -08:00
Daniel Büchele
6431d374c2 get adb config from env vars
Summary:
REact adb config from env vars:
- `ADB_SERVER_SOCKET`
- `ANDROID_ADB_SERVER_PORT`

Reviewed By: lawrencelomax

Differential Revision: D14002603

fbshipit-source-id: e30fa4354ab15048d4350654979fd0b6f394cd89
2019-02-11 02:51:25 -08:00
Patrick Shyu
3c35d6d4cf rename FBMacros.h to FBDefines.h (unrevert)
Summary:
Another smaller diff was responsible for breaking the build... D14019510 would have been the fix, which is integrated into this diff anyway.

 ---
Renaming FBMacros.h to FBDefines.h for more standard naming (similar to say UIKit/UIKit.h or Foundation/Foundation.h).

```
Tools/fastmod/fastmod --accept-all '\bFBMacros.h' FBDefines.h ../xplat
```

drop-conflicts
bypass-lint
allow-large-files

Reviewed By: dinhviethoa

Differential Revision: D14019529

fbshipit-source-id: 940490a5ec72ccdeb819598f488dc22eae454a26
2019-02-10 09:36:40 -08:00
Hoa Dinh
5cc1bb74c3 Revert D14011897: rename FBMacros.h to FBDefines.h
Differential Revision:
D14011897

Original commit changeset: f1dd7e686eef

fbshipit-source-id: ccf548ec2f82c7a1e6c2a0df5d6fd8f9dc9e1538
2019-02-09 23:23:24 -08:00