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
Summary: Restart electron app if we had any server-code changes
Reviewed By: lblasa
Differential Revision: D39542169
fbshipit-source-id: fb8e335f3e3fe0cf34e57a79b96e9cc8377e9fda
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
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
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
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
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
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
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
Summary: prepareDefaultPlugins builds all plugins now. We no longer need extra helpers
Reviewed By: lblasa
Differential Revision: D39308098
fbshipit-source-id: 4f12a0bdbc2afd2b306565fff3494daa630e1a20
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
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
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
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
Summary: prepareDefaultPlugins and prepareHeadlessPlugins should come before compileServerMain to bundle plugins
Reviewed By: passy
Differential Revision: D38862132
fbshipit-source-id: 952a2f6d4f857f4faacfc952bebb4e59afcbc5b0
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
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
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
Summary: This is to allow us to test dialogs from the UI debugger
Reviewed By: lblasa
Differential Revision: D39468653
fbshipit-source-id: 59c759a794c42b85bc288d60e1b2c6a71e32bb3d
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
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
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
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
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
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
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
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
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
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
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
Summary:
This diff has been automatically generated by the inpage editor.
If you want to update this diff, go through the preview link that would be attached to the test plan.
Please ensure you are editing the same page that was used to create this diff.
Reviewed By: antonk52
Differential Revision: D39345371
fbshipit-source-id: c6d42685d3ecf2d898094c3a688f7c754f318963
Summary:
BREAKING CHANGE: it won't work with react-native CLI 4.2.2 as it will search for an xcode project
Fixes https://github.com/facebook/flipper/issues/3859
## Changelog
fix: dependency.platforms.ios.project is not allowed on RN 0.69
Pull Request resolved: https://github.com/facebook/flipper/pull/3860
Test Plan:
I don't know how to test my branch directly, but I did a simple change that can easily be tested with this method:
Start a fresh `react-native` 0.69 project:
```
npx react-native init flipperBugTest
```
Then install `react-native-flipper` package:
```
yarn add -D react-native-flipper
```
Navigate to `flipperBugTest/node_modules/react-native-flipper` and delete `react-native.config.js` file.
And start `react-native` metro:
```
react-native start
```
Reviewed By: antonk52
Differential Revision: D39345618
Pulled By: lblasa
fbshipit-source-id: 2cc74e2dd7100aab693c8e66f01d5b4ced402dd3
Summary:
Resolves https://github.com/facebook/flipper/issues/3819
This PR fixes Flipper's plugin installation, so that scoped plugins (with `/` in the name) can be successfully installed (+removed).
In more detail, Flipper's function [`installPluginFromNpm()`](69bac4a3d6/desktop/plugin-lib/src/pluginInstaller.tsx (L99-L114)) relies on the `live-plugin-manager` package to handle the NPM package to a temporary directory.
Before this patch, Flipper would assume the name of the directory (incorrectly). This patch simply uses the directory as provided by `live-plugin-manager`'s result.
If we use `shopify/flipper-plugin-react-native-performance` as a concrete example after this patch:
- `installPluginFromNpm()` is called to install `shopify/flipper-plugin-react-native-performance`
- `plugManNoDep.install()` installs the plugin to `/path/to/tmp/shopify/flipper-plugin-react-native-performance`
- note: before this patch, it would have been assumed to be installed to: `/path/to/tmp/shopify__flipper-plugin-react-native-performance` which does not exist
- `installPluginFromTempDir()` is called to install the package to `~/.flipper/installed-plugins/shopify__flipper-plugin-react-native-performance/{version}` (where `{version}` is the current version, i.e. `1.0.0`)
Once the plugin is in `~/.flipper/installed-plugins/`, the escaping is correctly applied consistently by Flipper, and there are no further issues managing/using the plugin.
## Changelog
Fixed errors when installing scoped NPM plugins
Pull Request resolved: https://github.com/facebook/flipper/pull/3825
Test Plan:
Ideally we'd have some unit tests, but mocking out the NPM fetching in `live-plugin-manager` seems like a bunch of work. If you have some shortcuts, let me know, because this would be useful to test across platforms.
But in the meantime, we can easily manually test this.
### Reproduce the failure
First, let's reproduce the failure:
- run Flipper 0.150.0 (or `yarn start` on master, etc)
- open plugin marketplace, attempt to install scoped plugins
- installation will fail (with ⚠️ icon)
<img width="1541" alt="Screen Shot 2022-06-20 at 1 18 21 pm" src="https://user-images.githubusercontent.com/33126/174590735-ed25d192-a661-4333-af08-e494678b9fbb.png">
- logs will show a failure to read `package.json`
<img width="1175" alt="Screen Shot 2022-06-20 at 1 18 39 pm" src="https://user-images.githubusercontent.com/33126/174590824-339ba7ef-dcde-42b6-90ac-b99424845c3e.png">
### Demonstrate success
- run Flipper from this branch (via `yarn start`)
- open plugin marketplace, attempt to install scoped plugins
- installation will succeed, with notification to restart Flipper
<img width="1541" alt="image" src="https://user-images.githubusercontent.com/33126/174591112-880f55bf-0439-457c-a199-4bab0b3f193f.png">
- (package can also be successfully used/upgraded/uninstalled)
Reviewed By: lawrencelomax
Differential Revision: D39345564
Pulled By: lblasa
fbshipit-source-id: 729d70a29c7941e59ac03bb21061fc1d2bc8d998