Commit Graph

2355 Commits

Author SHA1 Message Date
Pascal Hartig
9d390d0864 Dep bump for /desktop
Summary: Combining dependabot bumps.

Reviewed By: nikoant

Differential Revision: D34682717

fbshipit-source-id: 09975ed9f258d2f5bed6871e15643c38a07e0459
2022-03-08 03:02:11 -08:00
Pascal Hartig
a5529d789d Don't raise EADDRINUSE as error on startup
Summary:
There will likely be more so I added a place for inspecting
these messages to the top.

Reviewed By: antonk52

Differential Revision: D34681084

fbshipit-source-id: ad32145d44dba08b813d8a2ddc63d500a0c360d8
2022-03-07 09:09:52 -08:00
Anton Nikolaev
37ff34390a Enable Marketplace for Flipper (#3491)
Summary:
This is PR on top of: https://github.com/facebook/flipper/pull/3473

It adds an option to Settings to allow distribution of marketplace plugins.

Also includes a simple fetch function to retrieve data from external API/server.

## Changelog

Allow marketplace plugins

Pull Request resolved: https://github.com/facebook/flipper/pull/3491

Test Plan:
1. Enable marketplace
2. Provide custom marketplace server (it will serve the list of internal plugins with downloadURL)
3. Test if can see Available plugins and can download/remove the plugin
4. If new update for the plugin, it should also allow auto update

Reviewed By: antonk52

Differential Revision: D34586339

Pulled By: nikoant

fbshipit-source-id: c887982aa0f0f9abd3b5360f22e8692a2445d345
2022-03-07 02:49:49 -08:00
Andres Orozco Gonzalez
5b6000b424 add localhost specification for IPV6 without square brackets
Summary: Socket.io-client sends the host as ::1 instead of [::1] when using IPV6 to communicate with Flipper, that is the reason the communication was always being refused.

Reviewed By: mweststrate

Differential Revision: D34679825

fbshipit-source-id: b7431ad23f743276c11619d7cdb5c83594dee43a
2022-03-07 02:40:11 -08:00
Andrey Goncharov
6c74f2dd18 Set device features on device initialization
Summary:
1. Identify if device supports screenshots/screen recording when it is created.
2. Disable screen recording/screenshot buttons when they are not supported

Reviewed By: passy

Differential Revision: D34611133

fbshipit-source-id: 82ad2d67e4af482d9becf7995187667b5d99bc36
2022-03-04 02:00:23 -08:00
Pascal Hartig
7c1251075f Dep bump for /desktop
Summary:
Combining a bunch of dependabot PRs.

N.B. I had to manually clean up the `yarn.lock` a few times because some dependencies resolved to multiple version numbers, catching tsc off-guard.
allow-large-files

Reviewed By: nikoant

Differential Revision: D34579180

fbshipit-source-id: a4848e1010ff240d9b0e721d3878585e7b4bd078
2022-03-03 04:11:52 -08:00
Andres Orozco Gonzalez
5b5ce92519 Add support to binding both IPv6 and IPv4 ports
Summary: Add support for binding the same port in flipper in both the IPv6 and IPv4 interfaces

Reviewed By: mweststrate

Differential Revision: D34591022

fbshipit-source-id: e28239c24425885ee442d93b84bb38902d521a0c
2022-03-03 00:31:08 -08:00
Adam Fiksen
7222437beb Add plumbing icon to flipper
Summary: Adds a reference to plumbing icon for plugins to use

Reviewed By: svaithia

Differential Revision: D34467457

fbshipit-source-id: 21d95f663309224742f4f93ac584998e1a470f28
2022-03-02 14:59:50 -08:00
Andrey Goncharov
5068c8273b Add deprecation notice notification
Summary: Add deprecation notice device icon and notification

Reviewed By: lblasa

Differential Revision: D34582475

fbshipit-source-id: 90fde15caf1925b42f50fbfc77dece88c82833cf
2022-03-02 09:18:15 -08:00
Flipper Bot
f2e60ab6cb Flipper Release: v0.137.0
Summary: Releasing version 0.137.0

Reviewed By: passy

Differential Revision: D34577711

fbshipit-source-id: fc0ceb7676d1f7a8f5d1e271d78b489c61919bf6
2022-03-02 07:41:24 -08:00
Andrey Goncharov
8ee788239b Update version number for default plugins
Summary: Prior to this fix, plugins were copied with verion 0.0.0 which forced them to be updated with "newer" versions from marketplace

Reviewed By: nikoant

Differential Revision: D34457087

fbshipit-source-id: a3242578c570447f8ecf9c62bcaa69e5d9688c42
2022-02-28 03:50:34 -08:00
Andrey Goncharov
b82cdfb664 Fix starting dev Flipper without bundled plugins
Summary: --no-embedded-plugins does not seem to exist. Replaced with --no-bundled-plugins which removes plugins from defaultPlugins/idex.tsx (as in prod).

Reviewed By: antonk52

Differential Revision: D34445364

fbshipit-source-id: e52c2e327bf43a3f682b6d9e18315e6ecadad5d8
2022-02-28 03:50:34 -08:00
Andrey Goncharov
3ec5b56263 Polyfill fetch
Summary: Provide server add-on writers with a well-known fetch API

Reviewed By: mweststrate

Differential Revision: D34447630

fbshipit-source-id: 70386940c12f9e53aa97b3530a7edf1d40b5f2e2
2022-02-28 03:50:34 -08:00
Andrey Goncharov
aec05533d7 Expose a subset of flipper-plugin to flipper server
Summary: Flipper plugins rely on 'flipper-plugin' package being accessible from 'global'. Expose a subset (without UI stuff) of flipper-plugin to server add-ons

Reviewed By: mweststrate

Differential Revision: D34400811

fbshipit-source-id: e0079ddfa67e66c1b24ab02d7682917ddfc84aaf
2022-02-28 03:50:34 -08:00
Andrey Goncharov
9449f61adb Add server add-on babel transform
Reviewed By: antonk52

Differential Revision: D34393126

fbshipit-source-id: d910392d9ac7e7a44e2e9ede690a6bed77f018c7
2022-02-28 03:50:34 -08:00
Andrey Goncharov
01a5f3da90 Add generics to server add-on connection
Reviewed By: mweststrate

Differential Revision: D34307356

fbshipit-source-id: 27e61355a85995368ebb197c42d58f4145473567
2022-02-28 03:50:34 -08:00
Andrey Goncharov
673bb9135e Allow Node APIs for server add-ons
Reviewed By: antonk52

Differential Revision: D34386916

fbshipit-source-id: b2484dff15b0a1b0d08f8b0b2e17916d037570c8
2022-02-28 03:50:34 -08:00
Andrey Goncharov
dcfc84cce6 Add onServerAddOnStart and onServerAddOnStop plugin hooks
Reviewed By: mweststrate

Differential Revision: D34378231

fbshipit-source-id: e086eebcf94c01da76bfe8b88c6528bd21d89968
2022-02-28 03:50:34 -08:00
Andrey Goncharov
9e4ac0aaa9 Add unit tests for PluginManager
Reviewed By: mweststrate

Differential Revision: D34307076

fbshipit-source-id: 7cb6c808bea10d15627958e8fabc02b4563183d4
2022-02-28 03:50:34 -08:00
Andrey Goncharov
d96cf8127f Add unit tests for ServerAddOn
Reviewed By: mweststrate

Differential Revision: D34303780

fbshipit-source-id: 03a4570a6e891d979b87caca14f51068d74df877
2022-02-28 03:50:34 -08:00
Andrey Goncharov
81d0057a8d Fix potential race conditions for starting/stopping server add-ons
Reviewed By: mweststrate

Differential Revision: D34301593

fbshipit-source-id: 2950de8a8567318cd3e87eff176657df5ba8fd1b
2022-02-28 03:50:34 -08:00
Andrey Goncharov
bdbf79e3e1 Limit events and methods in server contact to strings only
Reviewed By: antonk52

Differential Revision: D34300854

fbshipit-source-id: 79cd3e3da9bb5dbac75243ac90118f32e12d8177
2022-02-28 03:50:34 -08:00
Andrey Goncharov
8b94186783 Load installed server add-ons
Reviewed By: nikoant

Differential Revision: D34300475

fbshipit-source-id: 6bb6c0ab811e28806a0924b3487931bdb0dd2c59
2022-02-28 03:50:34 -08:00
Andrey Goncharov
b4b9c0ab28 Implement receiving messages from add-on on the client
Reviewed By: mweststrate

Differential Revision: D34249101

fbshipit-source-id: 07297b84ed8640e3b41599726ba613b6b4e2b62e
2022-02-28 03:50:34 -08:00
Andrey Goncharov
4067f5bd88 Implement sending messages from desktop to add-on
Reviewed By: antonk52

Differential Revision: D34239803

fbshipit-source-id: 1a18d522ba877ade3d0703fbb374c15b596241d7
2022-02-28 03:50:34 -08:00
Andrey Goncharov
2ce037d96b Load bundled server add-ons
Reviewed By: antonk52

Differential Revision: D34238883

fbshipit-source-id: 01b4b1c1c0a63cbfb639e903f6a77307ae370330
2022-02-28 03:50:34 -08:00
Andrey Goncharov
b655efc78e Migrate to default exports for server add-ons
Reviewed By: antonk52

Differential Revision: D34201906

fbshipit-source-id: 3ee2bf831d5a1f5c6c9252acce1b1731462871f1
2022-02-28 03:50:34 -08:00
Andrey Goncharov
5cdb7c952e Update build scripts to support bundling server add-ons
Summary: Summary

Reviewed By: nikoant

Differential Revision: D34170565

fbshipit-source-id: be9904809bf33e85536a4c6ead0e753ef05209ff
2022-02-28 03:50:34 -08:00
Andrey Goncharov
47dd675dc8 Update schema
Reviewed By: mweststrate

Differential Revision: D34169727

fbshipit-source-id: 4df1eeb17ff3894e60b7b857a571524dba7de085
2022-02-28 03:50:34 -08:00
Andrey Goncharov
04eab80c98 Move server add-on interfaces to flipper-common
Reviewed By: antonk52

Differential Revision: D34169419

fbshipit-source-id: 69fcc8da7d98f59818fbb5b486a488f19830cd81
2022-02-28 03:50:34 -08:00
Andrey Goncharov
b9294645d3 Limit methods server add on can access
Reviewed By: mweststrate

Differential Revision: D34076174

fbshipit-source-id: e51a1b08dab54de6b7dc82ca59ec18a10f81ddd7
2022-02-28 03:50:34 -08:00
Andrey Goncharov
b80755721c Draft communication with server add-ons from the client side
Reviewed By: nikoant

Differential Revision: D34075379

fbshipit-source-id: 09f575f5cced866ad7b9290d7739ce60f38edeee
2022-02-28 03:50:34 -08:00
Andrey Goncharov
db976d5113 Implement sending messages from a server add-on
Reviewed By: mweststrate

Differential Revision: D34074383

fbshipit-source-id: de85e7a22dc9bb780163fc5b522708e8bc976df3
2022-02-28 03:50:34 -08:00
Andrey Goncharov
842b2c810a Implement sending messages to server add-on
Reviewed By: mweststrate

Differential Revision: D34073403

fbshipit-source-id: eacd73811b436f2b5c4255a83d8eb09367a96a67
2022-02-28 03:50:34 -08:00
Andrey Goncharov
12151e4a71 Extend Flipper commands to support server add-on messaging
Reviewed By: mweststrate

Differential Revision: D34046466

fbshipit-source-id: 9acc172c1805ec724b8709999bacf9e899c39e6b
2022-02-28 03:50:34 -08:00
Andrey Goncharov
3b390b74ff Track client connections and autostop server add-ons when all clients leave
Reviewed By: mweststrate

Differential Revision: D34045584

fbshipit-source-id: 1ad0cfffb9d304f0359c973d76d6956f7e932f72
2022-02-28 03:50:34 -08:00
Andrey Goncharov
9113006851 Make Client initialize server add-ons
Reviewed By: mweststrate

Differential Revision: D34044353

fbshipit-source-id: 99bcb1559787b2a904bdd796233666a7a4783ea4
2022-02-28 03:50:34 -08:00
Andrey Goncharov
a60865f0be Intergrate ServerAddOn with PluginManager
Reviewed By: lblasa

Differential Revision: D34042338

fbshipit-source-id: 2ae3992738e647075f19c4dba0ebfb01e6c12b8f
2022-02-28 03:50:34 -08:00
Andrey Goncharov
016299b374 Add server-side ServerAddOn entity
Reviewed By: lblasa

Differential Revision: D33982373

fbshipit-source-id: a07589e515fe82d3735402cc26d1258e1d212931
2022-02-28 03:50:34 -08:00
Andrey Goncharov
fc20abf392 Add Flipper server command definitions
Reviewed By: lblasa

Differential Revision: D33980529

fbshipit-source-id: b64f48134d4816d3502c70d15beff90a044490a4
2022-02-28 03:50:34 -08:00
Jong Hyun Park
035ba5613c Add neighbouring lines feature to Flipper Logs plugin
Summary:
Adding a feature to Flipper's Logs plugin where:
1) you search for something,
2) click on a line among the filtered search results,
3) press control,
4) get taken back to unfiltered list of all messages, centered on your selected line

This is to help debugging where the user may add a print statement but the error happens after it, and it's difficult to catch without a lot of scrolling.

Reviewed By: mweststrate

Differential Revision: D33446285

fbshipit-source-id: 19aa472a12de074e561dbe37b44821fc29bf5c91
2022-02-25 10:07:42 -08:00
Flipper Bot
e1746932ce Flipper Release: v0.136.0
Summary: Releasing version 0.136.0

Reviewed By: jknoxville

Differential Revision: D34414615

fbshipit-source-id: 7239b27687b1af22cf26597e0d1fca138f9f9c7f
2022-02-23 08:22:34 -08:00
Anton Nikolaev
38c81ca159 Make internal plugin distribution code publicly available (#3473)
Summary:
Pull Request resolved: https://github.com/facebook/flipper/pull/3473

This diff is the first one which addresses https://github.com/facebook/flipper/issues/3320.

In this diff we are making a part of the code used for internal Flipper plugin distribution in Meta also available publicly for re-using in other orgs.

Some explanation on how plugin installation and updates is designed now:
1) We periodically poll for plugins available for download. API for retrieving available plugins list is abstracted and will be different between public and fb versions, however all other logic is re-used.
2) In addition to "Enabled" and "Disabled" plugins in the left panel Flipper shows "Detected in App" list. Plugins in this list are those which are known compatible with the currently selected device/app, but not yet installed.
3) User can install any of "Detected in App" plugins by clicking to "Download and install" button near them in the left panel similarly to enabling plugins in "Disabled" list.
4) If we detect that for some installed plugin we have a newer version available for download - we download it silently and store on disk.
5) If the plugin for which we have new downloaded version is disabled - we update it silently without any notifications by loading new version from the disk and unloading the previous version from cache.
6) If the plugin for which we have new downloaded version is enabled then we avoid updating it automatically (because we need to reset plugin state in such case) and instead show notification on top of the plugin and ask user to reload it to apply new version. On reloading we reset the plugin state.
7) On Flipper startup we always update all plugins to their latest versions available on the disk.

Reviewed By: aigoncharov

Differential Revision: D34380308

fbshipit-source-id: a94d724e42aa5ef78445af266fcd4c424226a703
2022-02-22 05:23:05 -08:00
Anton Nikolaev
5da0a83a36 Refactor recommended plugin API
Summary:
This is just refactoring in preparation to open-sourcing internal plugin distribution code to make it available for other orgs so they can distribute their internal plugins. See other diffs in the same stack.

This diff moves recommended plugins handling from `pluginMarketplace` which will be the same for fb-internal and OS versions into `pluginMarketplaceAPI` which will differ for fb-internal and OS versions. This will make it possible for other orgs to define their own "recommended" plugins which then will be automatically installed/enabled for new users.

Reviewed By: aigoncharov

Differential Revision: D34379981

fbshipit-source-id: 5c3a4efb6d0171256cf508f9005d914d7332e14f
2022-02-22 05:23:05 -08:00
Lorenzo Blasa
395708348d Remove RSocket documentation references
Summary:
^
Changelog: Remove RSocket documentation references

Reviewed By: jknoxville

Differential Revision: D34345316

fbshipit-source-id: 5b9fac8c04e325f3f02ef3713b0146b17e694c9d
2022-02-21 06:22:44 -08:00
Lorenzo Blasa
c45164ec2b Log unable to extract clientQuery as warning instead of error
Summary:
^
LogView is raising this up but I don't think there's an actionable item from our side. If a client doesn't have the right arguments on the query string then we effectively are unable to construct a valid query.

All our clients do this correctly, but there may be instances that either a browser or another process is 'trying' to connect to Flipper even if unintentionally. This behaviour I've observed in the past.

Changelog: Log 'Unable to extract the client query from the request URL' as warning

Reviewed By: passy

Differential Revision: D34340068

fbshipit-source-id: f5fc36a9803a83d6662b6383589bc0aa99774798
2022-02-18 05:50:07 -08:00
Pascal Hartig
3945675ca0 Remove dynamic data from error
Summary:
Dynamic information means we can't deduplicate on the backend.
Logging the serial as a warning instead.

In general, I'm not convinced this is a good error to begin with
as it seems expected that devices can disappear on disconnect
but getting a better count should help to make that decision.

Reviewed By: aigoncharov

Differential Revision: D34247723

fbshipit-source-id: ace3c32d2370433dcca2debbea3a2c5d7a2ecb57
2022-02-16 07:59:45 -08:00
Andrey Goncharov
277e18133b Fix NPM publishing
Reviewed By: cekkaewnumchai

Differential Revision: D34272179

fbshipit-source-id: d270847996b180029b28d22afe5d03e2d74252a7
2022-02-16 07:59:45 -08:00
Andres Orozco Gonzalez
b2dae4da81 Add support to load settings from options (flag) and default to specific options
Summary: This change gives priority to a user option settingsString to set up the flipper-server configuration and load them from a json string. Also giving the user the chance to avoid flipper-server looking at the launcher config files in the computer

Reviewed By: mweststrate

Differential Revision: D34210110

fbshipit-source-id: 9e852b79da106b5140c59116fd7d0c0f3155e620
2022-02-16 06:23:45 -08:00
Flipper Bot
4e1ad10440 Flipper Release: v0.135.0
Summary: Releasing version 0.135.0

Reviewed By: aigoncharov

Differential Revision: D34269502

fbshipit-source-id: fe99fb7959778c97052045450ca5fce26a348043
2022-02-16 05:52:58 -08:00