Commit Graph

82 Commits

Author SHA1 Message Date
Daniel Büchele
5868946818 certificate provider
Summary: _typescript_

Reviewed By: passy

Differential Revision: D17096517

fbshipit-source-id: a6e69e8b9a82fe76bb1de51a3a93182f35f40b3f
2019-08-28 20:34:59 -07:00
Daniel Büchele
0ec48d4fc9 index
Summary:
This converts the index file to TypeScript which is used as an export for all plugins. Alongside, I had to fix a couple of errors in various files to make sure everything works correctly.

For plugins using flow, we define an interface which uses the type definition for FlipperPlugin and types all UI components as `any`.

Reviewed By: passy

Differential Revision: D16936890

fbshipit-source-id: dacd9a63a82b9f0bbb530b06072186874cba7b6f
2019-08-22 10:02:27 -07:00
Daniel Büchele
5f53087c7e client server
Summary: Migrating Server, Client and UninitializedClient to TypeScript

Reviewed By: passy

Differential Revision: D16687855

fbshipit-source-id: 402e4dbcd5d283d3e280d4d8b312662829457886
2019-08-08 11:00:38 -07:00
Sidharth Guglani
d0a3cb5f74 Add button to navigate to Yoga Performance Plugin from Layout Inspector
Summary:
Add button in layout inspector to navigate to yoga performance plugin for analyzing a particular component.
We send component id in payload to yoga plugin which then uses to highlight the corresponding component in yoga plugin

Reviewed By: davidaurelio

Differential Revision: D16561301

fbshipit-source-id: 950fb3ea501283fec0a3036fb2796c178014f1f5
2019-08-07 06:17:24 -07:00
Sara Valderrama
f591475f85 A few mini-fixes for the accessibility layout inspector
Summary:
- fix mutual selection of elements in ax and non-ax tree (simplifies linkedNode logic as well)
- remove unneeded extraInfo attributes (focused, nonAXwithAXchild, & hasAXNode were not/no longer being used)
- use 50/50 fixed width view for trees when both are visible

Reviewed By: jknoxville

Differential Revision: D16390355

fbshipit-source-id: bbf9ea887f8f1035df8b4b0562ddcc4de291f004
2019-08-01 22:03:26 -07:00
Roman Gorbunov
00e8f43e37 Improvement of live editing
Summary:
Live editing is now working faster.
We had an issue that it took about 5 seconds to see the view changed and 10 seconds to see tha value in the flipper, now it's done immidiately

Reviewed By: priteshrnandgaonkar

Differential Revision: D16500961

fbshipit-source-id: 742ce628a887bab06c1b883d9710c477af2508e7
2019-07-31 03:13:38 -07:00
Pascal Hartig
c588b650ae Prefer const wherever possible
Summary:
Non-final identifiers make code harder to understand.
This is particularly true for JavaScript where even the *type*
can change as a value gets reassigned later.

This enforces to use `const` whereever possible, but doesn't
"outlaw" `let`. Mixed destructuring is also still allowed.

Used `eslint --fix` to change all existing cases.

Reviewed By: jknoxville

Differential Revision: D16131329

fbshipit-source-id: 2eceaca7c603b71b36e005be5d135e1849f2518d
2019-07-10 03:28:25 -07:00
Sidharth Guglani
5a6d978536 Search with both name and id of the component in layout inspector and handle deeplinkpayload
Summary:
deepLinkPayload is passed as initialQuery to Search component and in componentDidMount we perform search if initially query is defined.

This does not handle the case if node is not present in the layout inspector tree.

Reviewed By: danielbuechele

Differential Revision: D15874343

fbshipit-source-id: c604baea16838f07e8f8bfc0f1e67c5e830dfe97
2019-06-19 09:08:10 -07:00
Daniel Büchele
1d6399c1b5 remove console from layout inspector
Summary: We removed the console already from the client side. So this causes all calls to isConsoleEnabled to fail. This diffs removes these calls.

Reviewed By: passy

Differential Revision: D15449571

fbshipit-source-id: b702a8fbc80af002e1d8b7d37d5acc664ea5be99
2019-05-24 03:29:41 -07:00
Daniel Büchele
c1bff77f50 recursively invalidate nodes
Summary: When a node invalidates, all its children need to be updated. This was the case in v1 of Layout Inspector (3141b954bf/src/plugins/layout/index.js (L684-L692)) but got lost when writing v2.

Reviewed By: passy

Differential Revision: D15469096

fbshipit-source-id: 9ef5368387ccbce6e5c71de28c24f5790906cee9
2019-05-24 03:09:53 -07:00
Daniel Büchele
d6ccf74c37 focus from context menu
Summary: Add option to focus a view from the context menu.

Reviewed By: passy

Differential Revision: D15294182

fbshipit-source-id: f03db136e8365833beee3b4883d2114e98a280bd
2019-05-10 06:19:28 -07:00
Daniel Büchele
ffea42e57f show/update focused element
Summary: This was already implemented in the old versin of layout inspector and got lost during the refactoring. When using talkback, the focused view is highlighted in green in the a11y inspector.

Reviewed By: passy

Differential Revision: D15294025

fbshipit-source-id: 92cc015e4bc726515e433b7b96f924246916972d
2019-05-10 06:19:28 -07:00
Zhang Qichuan
ffc6a5fe18 Fix issue 408 (#411)
Summary:
Fix https://github.com/facebook/flipper/issues/408
Pull Request resolved: https://github.com/facebook/flipper/pull/411

Reviewed By: danielbuechele

Differential Revision: D14802001

Pulled By: jknoxville

fbshipit-source-id: 5ce435c0c941a715f799c75a8e09dbf4983e9789
2019-04-11 04:38:52 -07:00
Daniel Büchele
1d3559c759 Remove beta bar from layout plugin
Summary: I though I already did this, when releasing it. Apparently not.

Reviewed By: jknoxville

Differential Revision: D14854810

fbshipit-source-id: 4da61866925e06a415bfaed0f48e5434e769ec39
2019-04-10 10:33:41 -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
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
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
Pritesh Nandgaonkar
f2627dbc8b Hide target and alignment mode for archived device
Summary: As per title. Target mode and Alignment mode doesn't make sense for archived devices.

Reviewed By: danielbuechele

Differential Revision: D14407780

fbshipit-source-id: cf6f56456674ad8fec422d6f84d58c6d5b211c25
2019-03-12 07:08:24 -07:00
Pritesh Nandgaonkar
145addf1c9 Fix search for accessibility view
Summary:
Bug: On search, the accessibility views didn't used to expand.Look at the following video to understand the bug

{F153135892}

Reviewed By: danielbuechele

Differential Revision: D14407511

fbshipit-source-id: 011bf31b5bd10f5a7dad3d5d30703ec3bdeaf9c1
2019-03-12 07:08:24 -07:00
Pritesh Nandgaonkar
1c8fffa20b Enable import all the nodes for android
Summary: Enables Import and Export for all the nodes for android. Also search and Accessibility feature works

Reviewed By: danielbuechele

Differential Revision: D14406016

fbshipit-source-id: 8976db66d1ca91e98c52983a31ea584764bde0f6
2019-03-12 07:08:24 -07:00
Pritesh Nandgaonkar
b65581262a Enable search on layout2 for archived devices
Summary:
Enables search on the imported layout data. The way search is implemented is that the Flipper app asks for the search results from the mobile clients. Since mobile client will not exist in the archived case, the search won't work. To solve this problem I added a proxy client which will get all the messages fired by the Layout Inspector and it will accordingly revert back with the responses. In the case of search, it will give back the search result tree for a particular query.

Also added extensive tests for the proxy client

Reviewed By: danielbuechele

Differential Revision: D14281856

fbshipit-source-id: 651436084ebacd57f86e4fe9bb2036e7f666880c
2019-03-08 10:19:14 -08:00
Pritesh Nandgaonkar
04d2880b25 Bug fix when the selectedPlugin is Layout, and trace is imported
Summary:
Fixes a bug which happened when the selected plugin was layout and the flipper trace was imported. While importing the trace in the mentioned scenario, the redux store didn't used to get updated in the first render but got updated in the second render. Due to which the persisted state passed in the props was undefined. Look at the attached video to understand the bug.

BUG:

{F152642401}

Reviewed By: passy

Differential Revision: D14343465

fbshipit-source-id: 59110fd6ee5839f2e3944792e1c288d2388d3340
2019-03-06 09:30:23 -08:00
Daniel Büchele
7d39c33fc4 get children on invalidation
Summary: When a node was invalidated, not only the node itself needs to be refetched, but also its children.

Reviewed By: jknoxville

Differential Revision: D14280318

fbshipit-source-id: a262a2c95347dc9bf72f83b6a9eba9d3f9badb5a
2019-03-04 02:06:05 -08:00
Pritesh Nandgaonkar
af317eed2b Export and import all the nodes
Summary:
This diff does the following

- Support to export the entire view hierarchy for iOS
- Android is not supported yet
- This diff adds a call `getAllNodes` to the client side of iOS, which returns the entire view hierarchy
- Currently the search doesn't work on the imported layout plugin data. Also the imported layout plugin data doesn't expand the way it does when component is mounted, reason being the client passed to the plugin is not functional for the archived case

I will work on fixing the last points in the next diffs stacked on the current one.

For Android:
- Currently the export function will export whatever is currently displayed on the Flipper app, not the entire view hierarchy

Support for Android will also come up in later diffs.

Reviewed By: jknoxville

Differential Revision: D14209157

fbshipit-source-id: 3ad3e39edfd994913dc19cc239bfbbe011a9757c
2019-02-28 09:40:50 -08:00
Daniel Büchele
b8cb95ab0c toolbar
Summary: When there wasn't enough space for the text toolbar, the text was wrapped into multiple lines. Now it's truncated.

Reviewed By: jknoxville

Differential Revision: D14209813

fbshipit-source-id: 1971cd791daf345639993ed0632d718374a5f91b
2019-02-26 02:37:17 -08:00
Daniel Büchele
2e8394cb36 fix search
Summary: Layout search was throwing errors before, now it's working. The problem was, the event object used in the `setTimeout`-callback was released, before the timeout fired and therefore was null.

Reviewed By: jknoxville

Differential Revision: D14209811

fbshipit-source-id: 2465241c376d3e709155830e796aa3b991cbd7de
2019-02-26 02:37:17 -08:00
Daniel Büchele
0d0da3df24 sidebar
Summary: Before, the a11y inspector was in a sidebar. This changes the actual view hierarchy to be in a sidebar on the left side. This doesn't make an actual difference for the user, but helps to fix the scrolling issues in D14209815

Reviewed By: jknoxville

Differential Revision: D14209812

fbshipit-source-id: 414e8fd34c889cdce2dd3776727dd4a3a59efeb5
2019-02-26 02:37:17 -08:00
Daniel Büchele
5f5a38f1fe element expanding
Summary:
Previously nodes were always marked as expanded, when they were loaded. In some cases this caused a node to be marked as expanded, but its children not being loaded.

This changes the behaviour to only mark a node as expanded, once its children are loaded.

Reviewed By: jknoxville

Differential Revision: D14209814

fbshipit-source-id: f825d6a066373be932e42b9612a1bf78877b12aa
2019-02-26 02:37:17 -08:00
John Knox
f12144be38 Fix CRASH: undefined undefined bug
Summary:
Display "crashes" as plugin errors when they don't include the expected crash attributes.

Plugins can respond to a `call()` with success or error. If error, then they can provide an arbitrary json object.
These errors go through the same code as crash reports for the crash reporter plugin, but they don't necessarily contain the expected attributes.

When they don't display them as a plugin error, and stringify the whole object.

It would be better to distinguish these properly and highlight that they aren't crashes, in the crash reporter, but that's a bigger task. This stops them being shown as "undefined undefined".

Reviewed By: xiphirx

Differential Revision: D14207907

fbshipit-source-id: 8ba357fbe681a40cd671510a187073e4cbfa2184
2019-02-25 09:33:01 -08:00
Daniel Büchele
9bf41f7bb7 add GK
Summary:
Users passing the GK `flipper_layout_inspector_new` will see then new layout inspector instead of the old one.

Hopefully users won't realize that they are on the new Layout Inspector. To make them aware of it, I added a bar on the bottom linking to the support group that is used for the GK.

Reviewed By: jknoxville

Differential Revision: D14100392

fbshipit-source-id: 78d561a3ab8ac035e5b439799c395901be086b1b
2019-02-18 05:17:52 -08:00
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
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
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
Daniel Büchele
500007ccca use perf_hooks
Summary:
We were using `window.performance` to measure performance. This was because the equivalent node.js API `perf_hooks` wasn't available in the electron version we were using back then.
However, `perf_hooks` has landed in electron meanwhile, so I am moving to this API, as it works for the headless version and jest tests, too.

This allows us to delete the babel transform that was used for node-based tests, where the browser API was replaced with the node API

Reviewed By: jknoxville

Differential Revision: D13860133

fbshipit-source-id: cf1395004fac046dd55751ff465af494173b2cbf
2019-01-29 09:32:05 -08:00
Daniel Büchele
1fc73ad2fb update plugin's package.json
Summary:
For all plugins:
- move static fields `title`, `id` and `icon` to `package.json`
- adds "bugs" field for all plugins containing links to support groups/oncalls.

Reviewed By: priteshrnandgaonkar

Differential Revision: D13417286

fbshipit-source-id: 7b341176915f3ed7b473b95c1d879f21d7d634ef
2018-12-18 10:36:35 -08:00
Brett Lavalla
4954d018d0 Add litho accessibility rendering to Flipper accessibility mode
Summary: This is a re-do of D9720987.  Now that the Litho version has been bumped to 20 in D12838684, this diff can land safely.

Reviewed By: danielbuechele

Differential Revision: D12969979

fbshipit-source-id: b12d14e3b292d8cd110967f84f770f3725a800de
2018-11-10 00:05:44 -08:00
Hilal Alsibai
21a18d3e53 Pass real client to sidebar extension factory functions
Summary: This allows sidebar extensions to have more information as to whether they should be enabled or not

Reviewed By: danielbuechele

Differential Revision: D12930405

fbshipit-source-id: 649d3f01da1c535f7d60b7b525b012a888ea78e0
2018-11-06 11:30:35 -08:00
Pascal Hartig
0a6dbfcf3e Bump flow version
Reviewed By: priteshrnandgaonkar

Differential Revision: D12839991

fbshipit-source-id: 1dcca0a0bc682bf24430c7313d4af14b87cfc44d
2018-10-30 17:04:50 -07:00
Pritesh Nandgaonkar
2ee2dfacfe Back out "[DO NOT LAND until Litho open source version includes rerenderForAccessibility] add litho accessibility rendering to Flipper accessibility mode [2/2]"
Summary: Original commit changeset: 000a7413fcbe

Reviewed By: passy

Differential Revision: D12821473

fbshipit-source-id: 5fa369cc48f074414b04e4786d5bd634158598a6
2018-10-29 06:20:47 -07:00
Brett Lavalla
21c0b3ad0e add litho accessibility rendering to Flipper accessibility mode [2/2]
Summary: Completes D9667222 to allow force rendering of accessibility in litho when an accessibility service is not actually running.

Reviewed By: ikenwoo

Differential Revision: D9720987

fbshipit-source-id: 000a7413fcbe775a525ca3aca64443c3669cdf9e
2018-10-27 23:35:50 -07:00
Daniel Büchele
086ab0188b rename fill attribute
Summary:
We were using `fill={true}` as an attribute to make flexbox containers fill the entire available space.

However, `fill` is an HTML attribute (see: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/fill) This caused warnings printed to the console.

This diff renames the attribute to `grow` with is also more in line with the Flexbox terminology.

Reviewed By: priteshrnandgaonkar

Differential Revision: D10488389

fbshipit-source-id: ed8553c6203cdf6df94d26c731164ecec4c9fbd2
2018-10-22 09:54:59 -07:00
Daniel Büchele
71458b97b3 fixing plugin imports
Summary:
Plugins need to be self-contained. The can not require any dependency from Flipper's main app. This was a soft requirement before, but with the new version of metro, we now make this a hard requirement.

This speeds up plugin compile times, because only the files in the plugin's folder are watched and not all of Flipper's files. Moreover, this ensures "plugins" are real plugins and can be added and removed and are not mixed with the apps core.

Reviewed By: passy

Differential Revision: D9940735

fbshipit-source-id: 47e120429fc3c4c985731478ffa35c3359ff78f9
2018-09-20 04:27:48 -07:00
Daniel Büchele
df0a0da744 DetailSidebar
Summary:
- rename `SonarSidebar` to `DetailSidebar`
- rename portal id from `#sonarSidebar` to `#detailSidebar`

Reviewed By: passy

Differential Revision: D9851703

fbshipit-source-id: 2d904d17b0c6255a2ec3a79f0ada9bf621693c2e
2018-09-18 07:01:16 -07:00
Daniel Büchele
3bea3c88e6 flipper-plugin-*
Summary: rename plugin packages from `sonar-plugin-*` to `flipper-plugin-*`.

Reviewed By: passy

Differential Revision: D9851211

fbshipit-source-id: bdac568ede0a4a9308138a6c3d60728bb6195a72
2018-09-18 07:01:16 -07:00
Daniel Büchele
66e77075be Rename package to 'flipper'
Summary:
- rename package `'sonar'` > `'flipper'`
- rename package `'sonar-static'` > `'flipper-static'`
- rename package export from `window.Sonar` to `window.Flipper`

Reviewed By: passy

Differential Revision: D9851181

fbshipit-source-id: 34d4447c3b287496b3d20ddb54471ce777ec74e1
2018-09-18 07:01:16 -07:00