Commit Graph

7442 Commits

Author SHA1 Message Date
Andrey Goncharov
1167728b98 Freeze plugin messages
Reviewed By: mweststrate

Differential Revision: D39618330

fbshipit-source-id: 7b982d2307a021e7dea71fd84ca6140998b31366
2022-09-19 05:40:33 -07:00
Andrey Goncharov
202bce31b4 Stop freezing plugin messages
Reviewed By: lblasa

Differential Revision: D39600455

fbshipit-source-id: f829d135d4feb2a8000d094e3dad17b8b9d46cd3
2022-09-18 15:00:34 -07:00
Mohamed Osman
c71d1bd512 Adding basic version of WhatsApp Status Plugin
Summary:
This is mainly an RFC version (happy to land it as a seed for a plugin that can be used to debug and/or control status) the plan is to have the following:
 - One place to track the full life-cycle of status.
 - Control and visualize playback and state.
 - Troubleshoot errors and details of a given status (e.g. media links, evets, latencies .. etc).

Differential Revision: D38123193

fbshipit-source-id: 49229d604434d575d6aaddc818064598e7ccee92
2022-09-16 17:09:40 -07:00
Flipper Bot
f09295e613 Flipper Snapshot Bump: v0.165.1-SNAPSHOT
Summary: Releasing snapshot version 0.165.1-SNAPSHOT

Reviewed By: aigoncharov

Differential Revision: D39579336

fbshipit-source-id: 09bfd12892fffe1ccd12e94bcaa0f7d135b5496a
2022-09-16 10:05:24 -07:00
Flipper Bot
4c61c53a7b Flipper Release: v0.165.0
Summary: Releasing version 0.165.0

Reviewed By: aigoncharov

Differential Revision: D39579337

fbshipit-source-id: 42c3c470718b1e5953ab07afa9a7690b33acfe3f
2022-09-16 10:05:24 -07:00
Andrey Goncharov
d81dac18b5 Work around empty file restirction
Reviewed By: nikoant

Differential Revision: D39578561

fbshipit-source-id: 3a471e7dd06a1e8cee2c7823b1d7f764110ecf80
2022-09-16 09:00:21 -07:00
Andrey Goncharov
2aa3dc9bd8 Remove reference to flipper-server bundle map
Summary: flipper-server is currently shipped unbundled and unminified

Reviewed By: nikoant

Differential Revision: D39577062

fbshipit-source-id: cd78aded878358e9f90792c695b6d1b27863f05a
2022-09-16 08:09:31 -07:00
Andrey Goncharov
7c66a83328 Add source map copying for plugins
Reviewed By: nikoant

Differential Revision: D39576201

fbshipit-source-id: cd6b11bdb0a4c89e2f84d1c4772f08acc4b86418
2022-09-16 07:22:09 -07:00
Andrey Goncharov
9fc9d6f9b5 Remove redundant exports from 'flipper'
Summary: Prevent getRenderHostInstance leaking into 'flipper' types

Reviewed By: lblasa

Differential Revision: D39574678

fbshipit-source-id: 43932d73fed8b37a2a0791a312ee3d5129a4923f
2022-09-16 06:33:18 -07:00
Andrey Goncharov
8dc5f4d3ea Remove stale build options
Summary: Now that we build all plugins at all times and it is super-fast, these options are redundant

Reviewed By: lblasa

Differential Revision: D39542723

fbshipit-source-id: 1b30ba384267ec4fd0c35b4dc14f0223ffe414c9
2022-09-15 10:02:19 -07:00
Andrey Goncharov
ab03140201 Fix list of watch folders for electron dev build
Summary: Restart electron app if we had any server-code changes

Reviewed By: lblasa

Differential Revision: D39542169

fbshipit-source-id: fb8e335f3e3fe0cf34e57a79b96e9cc8377e9fda
2022-09-15 10:02:19 -07:00
Andrey Goncharov
fab4ee8c22 Unload stale modules from electron cache
Summary: `requirePlugin` in electron uses native `require` which has a built-in cache. Without this fix a stale version of the plugin loaded.

Reviewed By: lblasa

Differential Revision: D39542121

fbshipit-source-id: e6c4b65f9ea7b816803baaae537c234914fcb3d7
2022-09-15 10:02:19 -07:00
Andrey Goncharov
6b3298a29e Reload plugins with updated sources
Reviewed By: lblasa

Differential Revision: D39540173

fbshipit-source-id: 65f5d0f0a325d6ca3ed5e1213e689490c6b650b2
2022-09-15 10:02:19 -07:00
Andrey Goncharov
d3d2e189d0 Consume changed plugins message in the UI
Summary: Relay message to the React app via postmessage. Later, we will subscribe to these messages and update the plugins

Reviewed By: lblasa

Differential Revision: D39539590

fbshipit-source-id: c6742e45330e71b63c135c0267e6e9c5817fc9ff
2022-09-15 10:02:19 -07:00
Andrey Goncharov
c69d102ca1 Track plugin changes and notify frontend
Summary: Watch source plugin folders and notify frontend that any of them changed. In subsequent diffs, we will start reloading plugins that changed.

Reviewed By: lblasa

Differential Revision: D39539443

fbshipit-source-id: 726916c0bce336a2c0179558526bcb1b74e35b93
2022-09-15 10:02:19 -07:00
Andrey Goncharov
3639feef61 Watch and rebuild plugins
Summary: Now, once we build all plugins before we start Flipper, we need to rebuild some of them when they change. Previously, it was handled by Metro when we included plugins int he bundle, but we no longer include them in the bundle.

Reviewed By: lblasa

Differential Revision: D39510213

fbshipit-source-id: a352d78946f844a25d9127ac09c26e43e6739ca9
2022-09-15 10:02:19 -07:00
Andrey Goncharov
9dda947371 Fix flipper server prod build
Summary: Make flipper-server link local flipper-* deps for intern prod build. Update flipper-* deps versions for public builds so `npx` pulls them from npm

Reviewed By: lblasa

Differential Revision: D39497944

fbshipit-source-id: ca2674a4ac8f5b6c3efa9546b631f2526bf48f8e
2022-09-15 10:02:19 -07:00
Andrey Goncharov
ed93dfe978 Refine prod and dev deps
Summary: Move flipper local deps to prod deps, so yarn installs them later when we build a bundle

Reviewed By: lblasa

Differential Revision: D39475545

fbshipit-source-id: 5b61d15b45ee315c3b35d8e6836c114b90503b1a
2022-09-15 10:02:19 -07:00
Andrey Goncharov
a411fc6720 Remove stale babel transforms
Reviewed By: lblasa

Differential Revision: D39467843

fbshipit-source-id: e2659995913144d4ba1a51e5670d4405e1354314
2022-09-15 10:02:19 -07:00
Andrey Goncharov
094c5bdfdd Provide external modules to plugins
Summary: esbuild references external modules via `require`. We wrap `require` to point the references to built-in modules to global variables

Reviewed By: lblasa

Differential Revision: D39311893

fbshipit-source-id: a99480161c082f4095d78c22271f114532f32c16
2022-09-15 10:02:19 -07:00
Andrey Goncharov
650ff4bcfb Remove plugin bundling
Summary: Remove the notion of bundled plugins

Reviewed By: lblasa

Differential Revision: D39308888

fbshipit-source-id: aa88ddbf2801ad1da95f89e4c761259b697b0d66
2022-09-15 10:02:19 -07:00
Andrey Goncharov
f835e07c46 Build all plugins before start
Summary: prepareDefaultPlugins builds all plugins now. We no longer need extra helpers

Reviewed By: lblasa

Differential Revision: D39308098

fbshipit-source-id: 4f12a0bdbc2afd2b306565fff3494daa630e1a20
2022-09-15 10:02:19 -07:00
Andrey Goncharov
642a3ebf81 Remove default plugin entrypoints for hot-reloading
Summary: As we stopped bundling plugins in D39276249, we no longer need the entry points for the bundled plugins (these entry points are always going to be empty)

Reviewed By: lblasa

Differential Revision: D39307565

fbshipit-source-id: 43751fe31c8bd962677c226b27cfe52093d3f2d4
2022-09-15 10:02:19 -07:00
Andrey Goncharov
94df830dfb Migrate plugin bundling to esbuild
Summary: With esbuild bundling all plugins takes a couple of seconds instead of 3-5 minutes with metro. As a result, we can stop including plugins into Flipper's bundle for development and always bundle them separately. It reduces complexity of our build pipeline and makes the dev build work more like our prod build. It also allows us to stop bundling flipper-server code and just compile it instead.

Reviewed By: lblasa

Differential Revision: D39262048

fbshipit-source-id: c4da0f2ea2807015d98e0d070349c39b2118e189
2022-09-15 10:02:19 -07:00
Andrey Goncharov
819cb4342c Promote using ESM instead CJS with createTablePlugin
Summary: Mixing CJS and ESM confuses esbuild

Reviewed By: lawrencelomax

Differential Revision: D39467716

fbshipit-source-id: 84273eb8c1c7e45a16da979d0fbd0a7f7df8828b
2022-09-15 10:02:19 -07:00
Andrey Goncharov
62bb4df8d7 Remove direct eval from react devtools
Reviewed By: lblasa

Differential Revision: D39467192

fbshipit-source-id: 925678b17c9a454298aa141eb19e1ae6aa9c369f
2022-09-15 10:02:19 -07:00
Andrey Goncharov
f463520522 Decapitate "network" plugin
Reviewed By: lawrencelomax

Differential Revision: D39466980

fbshipit-source-id: b880690a2b334fd063f2d06923743d67b79e7b08
2022-09-15 10:02:19 -07:00
Andrey Goncharov
cb610ec751 Decapitate "navigation" plugin
Reviewed By: lawrencelomax

Differential Revision: D39465305

fbshipit-source-id: e7c4d22e0f2acfbf71a08821c90b6f26af628af2
2022-09-15 10:02:19 -07:00
Andrey Goncharov
a888e6affa Simplify bundled plugin setup
Summary: Stop bundling plugins into Flipper Server bundles. In later diffs, we will start building all plugins even in dev mode which removes the need to bundle them.

Reviewed By: lblasa

Differential Revision: D39276249

fbshipit-source-id: 091405cfcf58aa7e1bd2b382da40f8d9841ae6b1
2022-09-15 10:02:19 -07:00
Andrey Goncharov
a67a4e5d0f Remove babel transforms for flipper-server
Summary: Flipper server itself requires no babel transforms. We applied extra transforms only for the bundled plugins. However, we pack and ship all plugins in the /static folder. They are always available on the FS. Therefore we could stop bundling any plugins into flipper-server's source code.

Reviewed By: lblasa

Differential Revision: D38910251

fbshipit-source-id: b3e9fe5ae2ab69ce5579b01b6793ebf7e88baf66
2022-09-15 10:02:19 -07:00
Andrey Goncharov
218cb6abf2 Fix server bundling order
Summary: prepareDefaultPlugins and prepareHeadlessPlugins should come before compileServerMain to bundle plugins

Reviewed By: passy

Differential Revision: D38862132

fbshipit-source-id: 952a2f6d4f857f4faacfc952bebb4e59afcbc5b0
2022-09-15 10:02:19 -07:00
Andrey Goncharov
97b8b8a1c4 Split flipper-plugin package
Summary:
flipper-server-companion depends on flipper-plugin. flipper-plugin includes dependencies that run only in a browser. Splitting flipper-plugin into core and browser packages helps to avoid including browser-only dependencies into flipper-server bundle.
As a result, bundle size could be cut in half. Subsequently, RSS usage drops as there is twice as less code to process for V8.

Note: it currently breaks external flipper-data-source package. It will be restored in subsequent diffs

Reviewed By: lblasa

Differential Revision: D38658285

fbshipit-source-id: 751b11fa9f3a2d938ce166687b8310ba8b059dee
2022-09-15 10:02:19 -07:00
Luke De Feo
2090120cda Descriptor clean up
Summary:
1. The base class descriptor was removed, this was given that we have chained descriptor there is no need for this anymore
2. The Base interface node descriptor no longer has a mutable list based api. You simply return a list. The mutable list based api was specifically to allow chaining and this quirk is isoltated to the chained descriptor
3. AbstractChainedDescriptor and ChainedDescriptor were merged

Reviewed By: lblasa

Differential Revision: D39496073

fbshipit-source-id: fb3ec629ec3b27f587bdbd0b323624a4bc4ebea3
2022-09-14 05:07:51 -07:00
Luke De Feo
f5a5e1b19d Split Tree Observer into multiple files
Summary: Tree observer had multiple components, now their usage is clearer they are moved to separate files

Reviewed By: lblasa

Differential Revision: D39469078

fbshipit-source-id: 4d4c03aff229fd2cc0eace216144b37694637691
2022-09-13 11:05:42 -07:00
Luke De Feo
868ae9e36a Added dialogs to sample app
Summary: This is to allow us to test dialogs from the UI debugger

Reviewed By: lblasa

Differential Revision: D39468653

fbshipit-source-id: 59c759a794c42b85bc288d60e1b2c6a71e32bb3d
2022-09-13 11:05:42 -07:00
Luke De Feo
721b9cd4da Fix logging
Summary: typing uidebugger into ADB will hit both the log tag and any thing else such as package name. Turned Enum warning down to verbose reduce load on main thread

Reviewed By: lblasa

Differential Revision: D39466932

fbshipit-source-id: 0106a042a92755cf644c0e66683e7e5993e924e1
2022-09-13 11:05:42 -07:00
Luke De Feo
f06f63306e Restore root view tracking
Summary: We use the root view resolver to detect when roots have been added. We currently have some race conditions where the activity stack managed by application ref doesnt include the first activity

Reviewed By: lblasa

Differential Revision: D39466929

fbshipit-source-id: fff4f830dea337d96dd9a9956a20a080fff2e965
2022-09-13 11:05:42 -07:00
Luke De Feo
4341cbdf3d Factor out common traversal code in observers
Summary: Each observer was doing a similar job of traversing, and setting up child observers and its easy to not clean up child observers in some cases. This provides a helper utility for the common use case

Reviewed By: lblasa

Differential Revision: D39466930

fbshipit-source-id: e74ae5c3709297b73c020cd148a0485ac9fc0f8f
2022-09-13 11:05:42 -07:00
Luke De Feo
a0ee774159 Fix active child
Summary: The active child was only being passed for the native scan full traversal, Now we have it for the partial traversal also

Reviewed By: lblasa

Differential Revision: D39466933

fbshipit-source-id: a0e281e4f9a21bf2edd12f18ecdb68a29ead3476
2022-09-13 11:05:42 -07:00
Luke De Feo
0562178739 Basic Litho support
Summary: Added an initial litho Tree observer and descriptors, its quiet naive and will be improved in a future diff

Reviewed By: lblasa

Differential Revision: D39466931

fbshipit-source-id: 66a462882af2e585b9719ee2f61595449f99c5e5
2022-09-13 11:05:42 -07:00
Luke De Feo
24ec43eb92 Add observer type to Perf event
Summary: While looking at the event stream it is useful to know which observer type fired it

Reviewed By: lblasa

Differential Revision: D39430756

fbshipit-source-id: bc52f085a5497692f8076b12a9c015cc33a19d1e
2022-09-13 11:05:42 -07:00
Flipper Bot
03121ca8b3 Flipper Snapshot Bump: v0.164.1-SNAPSHOT
Summary: Releasing snapshot version 0.164.1-SNAPSHOT

Reviewed By: aigoncharov

Differential Revision: D39431773

fbshipit-source-id: 51cf82f1110906979861e35188d2d9b4cd87a02d
2022-09-12 09:11:16 -07:00
Flipper Bot
a941652a43 Flipper Release: v0.164.0
Summary: Releasing version 0.164.0

Reviewed By: aigoncharov

Differential Revision: D39431774

fbshipit-source-id: 17c616386d00460e7b65cc88403bb6dbbc882853
2022-09-12 09:11:16 -07:00
Lorenzo Blasa
d999f68f62 Remove warnings
Summary: Addresses a few warnings raised

Reviewed By: LukeDefeo

Differential Revision: D39430004

fbshipit-source-id: 877698e8515f08a5cb38b414689615c1b6e4b6cc
2022-09-12 08:17:39 -07:00
Andrey Goncharov
69812d543e Do not disconnect dummy devices
Summary: Do not remove dummy devices as they are created during WWW cert exchange and are not picked up by IDB

Reviewed By: lblasa

Differential Revision: D39430458

fbshipit-source-id: 249efda23f324522ae2ae3a0ee4f198ab701d22d
2022-09-12 07:37:21 -07:00
Lorenzo Blasa
ed40e16ac9 Addresses a few issues with the Stetho fragment utilities
Summary:
There is a bug in the code to get fragments from the activity.

A boolean, result from the comparison, was added to the list instead of the actual fragments.

Reviewed By: LukeDefeo

Differential Revision: D39348019

fbshipit-source-id: 669f304055f15f59b40352d86f25d768d92df76e
2022-09-12 04:20:01 -07:00
Luke De Feo
4436128d07 Descriptor clean up
Summary:
Now that we have the tree observer we can make descriptors completely about describing an object. To that end we have removed init method and made them all object to indicate to future readers their singleton nature.

onGetActive child was made open instead of abstract to avoid needed to override in all subclasses

Reviewed By: lblasa

Differential Revision: D39387935

fbshipit-source-id: 802b8afdd9aa639daecf10d774ca5b960ee48003
2022-09-12 03:48:43 -07:00
Luke De Feo
9a270cdc7a Tree observer
Summary:
Added concept of a tree observer which is responsible for listening to the changes for a portion of the UI tree. This structure nests so Tree observers can hold child tree observers which emit events on a different cadence. This structure should allow us to incorporate different UI frameworks down the road as well as native android views.

We push the tree updates from the tree observers onto a channel and setup a coroutine to consume this channel, serialize and send down the wire.

Reviewed By: lblasa

Differential Revision: D39276681

fbshipit-source-id: a4bc23b3578a8a10b57dd11fe88b273e1ce09ad8
2022-09-12 03:48:43 -07:00
Luke De Feo
c76c993ce4 Introduced concept of active child
Summary: A node can have an active child, if present we assume all others are inactive and we don't traverse them. This means the activities not on top and view pager views not active will not be scanned. Additionally on the desktop we are automatically collapsing these views. The net result is a lot less work done on the main thread

Reviewed By: lblasa

Differential Revision: D39310126

fbshipit-source-id: ebd0c69d46f2d42fe42e678c8327fcdc73d08385
2022-09-12 03:48:43 -07:00
Andrey Goncharov
a9fe381076 Add more detailed errors for assertConnected
Differential Revision: D39383946

fbshipit-source-id: e11a29c77c5abe7f3fee5e979c596efd31ef4ec2
2022-09-09 06:30:04 -07:00