Commit Graph

20 Commits

Author SHA1 Message Date
Lorenzo Blasa
7f2a0c94f9 Deprecate Layout plugin
Summary: ^

Reviewed By: aigoncharov

Differential Revision: D44417781

fbshipit-source-id: 7ffb369d88771901c9ffca2bbe8ecbd571373a77
2023-03-27 07:32:23 -07:00
Lorenzo Blasa
7cc8e3732c Advertise UI Debugger for iOS
Summary:
^

If the connected device was not an Android device, we were not showing the notification. This change removes that check to also advertise on iOS.

Reviewed By: mweststrate

Differential Revision: D42989975

fbshipit-source-id: eac8d588be789dcab281a746395a4fb7a88df790
2023-02-03 04:01:23 -08:00
Lorenzo Blasa
f007da93d3 Show the banner only once per day
Summary: ^

Reviewed By: jknoxville

Differential Revision: D42499338

fbshipit-source-id: 85c1edc676d00a1e442c5490575f8a14465d5a4f
2023-01-13 07:36:20 -08:00
Lorenzo Blasa
29e0794ff4 Fix advertisement bug
Summary: Falsely advertising UIDebugger for iOS devices.

Reviewed By: LukeDefeo

Differential Revision: D41732451

fbshipit-source-id: 0377da0090c4c7f4d56d8a31a2af35b403b69b8f
2022-12-05 06:17:52 -08:00
Lorenzo Blasa
7f5592a68b Suggest ui-debugger from layout
Summary: Increase awareness of ui-debugger by displaying a notification.

Reviewed By: LukeDefeo

Differential Revision: D41530681

fbshipit-source-id: bf0aaeb8bb5fdc88e2425371fb04155cec739ba4
2022-11-28 02:40:38 -08:00
Lorenzo Blasa
c871b221fd Add catch handlers to client calls
Summary:
Client calls return a promise. Not dealing with the error causes promise unhandled rejection errors.

This change adds a catch block and logs the error instead.

Reviewed By: antonk52

Differential Revision: D37955029

fbshipit-source-id: 50cac5a5339961d16868ab2102d3c77790e6943c
2022-07-19 04:05:12 -07:00
Andrey Goncharov
fd380a4c1e Use BaseDevice from flipper-frontend-core in flipper-ui-core
Summary: Use BasDevice definition from flipper-frontend-core in flipper-ui-core and remove the redundant definition from flipper-ui-core

Reviewed By: lblasa

Differential Revision: D37234785

fbshipit-source-id: 6e768090a197c1d2c49cb1cd573acea12fb65d24
2022-06-20 12:18:40 -07:00
Andrey Goncharov
ef5fa275a3 Use AbstractClient from flipper-frontend-core in fliper-ui-core
Summary: This stack attempts to start using flipper-frontend-core from flipper-ui-core. Currently, flipper-frontend-core contains lots of copy-pasted code from flipper-ui-core.

Reviewed By: lblasa

Differential Revision: D37139198

fbshipit-source-id: 042db7492c550e10ea72c32fd15001c141bf53f9
2022-06-20 12:18:40 -07:00
Lorenzo Blasa
cfdb363ab4 UI preview of selected element
Summary:
This is a prototype for view preview within Flipper.
If enabled, a preview of the selected element is rendered in the attribute inspector.

Changelog: Add view preview/snapshot for the Layout plugin on Android.

Reviewed By: mweststrate

Differential Revision: D35009246

fbshipit-source-id: a442ff7f57093f463016811f0f451b52f579b448
2022-03-28 06:51:53 -07:00
Lorenzo Blasa
aed7e7e6f2 UI preview of selected element
Summary:
This is a prototype for view preview within Flipper for iOS (Android next).

If enabled, a preview of the selected element is rendered in the attribute inspector.

Changelog: Add view preview/snapshot for the Layout plugin on iOS.

Reviewed By: antonk52

Differential Revision: D34990372

fbshipit-source-id: 1984514fbf59041ad236008a8db10569c5fc5f94
2022-03-28 05:17:23 -07:00
Andres Suarez
79023ee190 Update copyright headers from Facebook to Meta
Reviewed By: bhamodi

Differential Revision: D33331422

fbshipit-source-id: 016e8dcc0c0c7f1fc353a348b54fda0d5e2ddc01
2021-12-27 14:31:45 -08:00
Michel Weststrate
d48f22b8dc Factor out GK fetch logic
Summary:
Removed loadGKs and loadDistilleryGKs from the `flipper` API, as it leaked implementation details of GK that didn't work well with decapitation later in this diff, and refactored it to using `getFlipperLib().GK`.

After that discovered that those APIs are actuallly only used by nt-shared's performGKcheck, which was already removed from all usages in D27736036, so just removed the code altogether. But left loading distillery GKs in place, since that is good infra structure to provide anyway(?), although we don't have active use cases atm

Reviewed By: jknoxville

Differential Revision: D32529600

fbshipit-source-id: a03fb14ada21018d329eea78a59f1b20610b2fd3
2021-12-08 04:30:54 -08:00
Michel Weststrate
8764da7c0b Add error handling to Layout.setHighlighted
Summary: Fixed error generated by monitoring, by adding a proper .catch

Reviewed By: lblasa

Differential Revision: D32278523

fbshipit-source-id: dd14f81d708893a1505ef902e0dc03fee433487b
2021-11-09 05:48:36 -08:00
Michel Weststrate
b8236f1b3a Don't leave rejection unhandled if node fetching fails
Summary: Fix potentially unhandled promise rejection in Layout inspector. Not really reproducible, and probably originating from old Flipper versions (no trace is available either), since we have a lot of connection check in place. Just in case still handled the exception, for example if something goes wrong on client side

Reviewed By: passy

Differential Revision: D31267465

fbshipit-source-id: d1b384db7bb010af8d2aa12ae29110f343fb14af
2021-09-30 01:40:22 -07:00
Pascal Hartig
47099cfd31 Fix Flipper lints #16
Summary: Larger list of fixes. Adding another package to the flipper export is a bit nasty but it unblocks us for now and centralises `remote` access which seems like a win for FAAS.

Reviewed By: mweststrate

Differential Revision: D30785421

fbshipit-source-id: 931297e8566b5d8a213b69ae87d0cda7648b3ed4
2021-09-08 08:44:19 -07:00
Michel Weststrate
b9250e7795 Make screen dimension reflection fast
Summary:
After loading a layout plugin snapshot, I noticed the plugin feels really sluggish. I noticed that getDimensions, which recursively walks the full tree, is triggered on every rendering, although the state it introduces is only required when opening a screenshot visualizer. So Moved the function invocation to there.

Also did some first steps on supporting iOS; the visualizer will no show a preview of iOS as well. I'll leave implementing the highlights to a volunteer :)

Reviewed By: passy

Differential Revision: D29262697

fbshipit-source-id: b13b19b013eeeb98abb66fb648a193c69688a7e3
2021-06-22 04:10:53 -07:00
Michel Weststrate
806dd63f68 Add wrapper support for import / export states
Summary: Make sure custom export handlers of classic plugins wrapped in Sandy are respected

Reviewed By: passy

Differential Revision: D29233604

fbshipit-source-id: 7bab33af3422e0b59697438577906ce8580a28ad
2021-06-21 08:37:20 -07:00
Pascal Hartig
69c7876be9 Enforce react/jsx-boolean-value
Summary: yarn fix results.

Reviewed By: nikoant

Differential Revision: D28329714

fbshipit-source-id: 564aa24bcdb4bc6cdea67dfad10a077a9c817a2d
2021-05-11 10:14:05 -07:00
Michel Weststrate
5db2ef1275 Perf fixes
Summary:
This diff fixes some more perf bottlenecks in the layout inspector (see the diffs earlier in the stack for the total picture). Mostly:

1. Pass down stable refs from the root for callbacks and configuration
2. Remove the deep-equality check in the sidebar section rendering, which has a pretty significant constant overhead, especially if the selection didn't change
3. If the selection changes, the correct semantics is to reset the sidebar rather than trying to reconcile the elements. (A consequence of this is that Panel collapse state isn't preserved atm after changing selection, will address that in a later diff)

This reduces average render time for sidebar from ~20 to ~2 ms.

Reviewed By: priteshrnandgaonkar

Differential Revision: D27677353

fbshipit-source-id: ba183b7e3d778c0b3c8e7ca0d51535ce99a097ca
2021-04-15 07:48:33 -07:00
Anton Nikolaev
b3274a8450 Plugin folders re-structuring
Summary:
Here I'm changing plugin repository structure to allow re-using of shared packages between both public and fb-internal plugins, and to ensure that public plugins has their own yarn.lock as this will be required to implement reproducible jobs checking plugin compatibility with released flipper versions.

Please note that there are a lot of moved files in this diff, make sure to click "Expand all" to see all that actually changed (there are not much of them actually).

New proposed structure for plugin packages:
```
- root
- node_modules - modules included into Flipper: flipper, flipper-plugin, react, antd, emotion
-- plugins
 --- node_modules - modules used by both public and fb-internal plugins (shared libs will be linked here, see D27034936)
 --- public
---- node_modules - modules used by public plugins
---- pluginA
----- node_modules - modules used by plugin A exclusively
---- pluginB
----- node_modules - modules used by plugin B exclusively
 --- fb
---- node_modules - modules used by fb-internal plugins
---- pluginC
----- node_modules - modules used by plugin C exclusively
---- pluginD
----- node_modules - modules used by plugin D exclusively
```
I've moved all public plugins under dir "plugins/public" and excluded them from root yarn workspaces. Instead, they will have their own yarn workspaces config and yarn.lock and they will use flipper modules as peer dependencies.

Reviewed By: mweststrate

Differential Revision: D27034108

fbshipit-source-id: c2310e3c5bfe7526033f51b46c0ae40199fd7586
2021-04-09 05:22:00 -07:00