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
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
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
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
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
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
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
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
Summary: Add option to focus a view from the context menu.
Reviewed By: passy
Differential Revision: D15294182
fbshipit-source-id: f03db136e8365833beee3b4883d2114e98a280bd
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
Summary: I though I already did this, when releasing it. Apparently not.
Reviewed By: jknoxville
Differential Revision: D14854810
fbshipit-source-id: 4da61866925e06a415bfaed0f48e5434e769ec39
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
Summary: Should also fix the build.
Reviewed By: jknoxville
Differential Revision: D14477777
fbshipit-source-id: 01fcfb2321c9b7a12acdf079473d91b6805d4dda
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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