Commit Graph

103 Commits

Author SHA1 Message Date
Lorenzo Blasa
1f63a25027 idb kill
Summary: Introduce a new command to allow killing idb

Reviewed By: lawrencelomax

Differential Revision: D47911709

fbshipit-source-id: 970f1147a177bbcca0bdfa9e9ba970cdc8a914a3
2023-07-31 03:55:58 -07:00
Lorenzo Blasa
1f53c167ab Dedicated connectivity troubleshoot notification
Summary:
There's a generic notification server event.

This change introduces a new notification server event dedicated for connection troubleshoot.

The difference is, this notification will have a button to troubleshoot the issue. Additionally, in the future, we may even be able to add a payload so that we can troubleshoot the exact problem.

Reviewed By: antonk52

Differential Revision: D47873697

fbshipit-source-id: 28843a08836d0054909f6b9ab7a88b14b8a1b868
2023-07-28 10:25:17 -07:00
Lorenzo Blasa
60b3ff99ce Troubleshoot FlipperServer support
Summary: Add neessary types and events to troubleshoot connectivity.

Reviewed By: antonk52

Differential Revision: D47293373

fbshipit-source-id: 9ffbe07e5c71ba0d8ab1c58cd322eaab22141f12
2023-07-10 05:52:07 -07:00
Lorenzo Blasa
e052c27f27 Remove ClientCsrQuery
Summary: Already have SecureClientQuery. No need to have this as a type as it's not used or needed anywhere.

Reviewed By: antonk52

Differential Revision: D47210345

fbshipit-source-id: d9f3026a0e2a0b5dd2e87f16dba34a388dacd75f
2023-07-04 09:01:26 -07:00
Lorenzo Blasa
4a0ad8c1c3 SecureClientQuery moved to flipper-common
Summary: It should've been there with ClientQuery.

Reviewed By: antonk52

Differential Revision: D47210314

fbshipit-source-id: 869496918648f20b616c1a612296fff55597af77
2023-07-04 09:01:26 -07:00
Lorenzo Blasa
2f9e633fad Medium refactoring
Summary:
Simplifies medium usage. Clients report this value as an integer. Internally, we transform this integer as type (a set of valid strings).

Instead of transform this value in different places, do it once when the client query is received.

Reviewed By: antonk52

Differential Revision: D46358024

fbshipit-source-id: ecd2b6c6ccbe7c38787a89d4e2f81930c7b91864
2023-06-02 03:59:15 -07:00
Andrey Goncharov
5ca9107d0c Expose SKIP_TOKEN_VERIFICATION to frontend
Summary: It is hard to pass auth token to Jest E2E tests.

Reviewed By: lblasa

Differential Revision: D46279204

fbshipit-source-id: ee0138c3bd014bafb416f7fa8951fb25b25b4067
2023-05-30 09:47:19 -07:00
Ranesh Saha
7a28ed1fe5 Pipe through --updater/--no-updater flag for flipper.exe (#4277)
Summary:
In our organization, Flipper is distributed in a version controlled way. As a result, we do not want users to manually update or receive prompts to update when a new version is available. There is already a `--updater` flag in the command line arguments for flipper.exe, but it isn't piped through. This change pipes it through and disables all update related UI when `--no-updater` is passed in.
## Changelog

Support --updater and --no-updater options for flipper.exe

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

Test Plan: Ran `yarn build --win` in flipper/desktop, and launched flipper.exe from flipper/dist/win-unpacked with the `--updater`, `--no-updater` and no flags and ensured the proper behavior was observed (update UI shows by default or when `--updater` is specified, and doesn't show when `--no-updater` is specified).

Reviewed By: passy

Differential Revision: D41298321

Pulled By: mweststrate

fbshipit-source-id: 5ddfede2700954f0fdd6a111b20d0836fab25565
2022-11-15 03:23:55 -08:00
Lorenzo Blasa
587f428cf8 Allow plugins to use css
Summary:
Flipper plugins fail when importing css from third-party dependencies. This diff tries to fix that.

Effectively, the plugin can import the css and export it when is bundled.

When we load the plugin, we check if there's a css file for it. If there's one, we return it and try to use it.

Reviewed By: aigoncharov

Differential Revision: D40758178

fbshipit-source-id: e53afffcc481504905d5eeb1aea1f9114ee2a86b
2022-10-27 22:50:30 -07:00
Andrey Goncharov
970c03d942 Add uploading to internal cloud storage
Summary:
Design doc: https://docs.google.com/document/d/1HLCFl46RfqG0o1mSt8SWrwf_HMfOCRg_oENioc1rkvQ/edit#

We'll use it in the subsequent diff to automatically upload a universal export

Reviewed By: passy

Differential Revision: D40585810

fbshipit-source-id: 5b409d716c2ead040865130d379d4f593cb68483
2022-10-25 05:31:48 -07:00
Andrey Goncharov
6af6652ab2 Export data for the universal export as a single zip archive
Summary:
Design doc: https://docs.google.com/document/d/1HLCFl46RfqG0o1mSt8SWrwf_HMfOCRg_oENioc1rkvQ/edit#

It is better UX not to prompt a user multiple times to save various pieces of the debug export

Reviewed By: passy

Differential Revision: D40550084

fbshipit-source-id: 51ea3acee7daf5074682219020e1e1eed2182b7d
2022-10-25 05:31:48 -07:00
Andrey Goncharov
480a3d26f0 List contents of Flipper folder on Android
Summary:
Design doc: https://docs.google.com/document/d/1HLCFl46RfqG0o1mSt8SWrwf_HMfOCRg_oENioc1rkvQ/edit#

In later diffs, we'll start fetching the actual files as well. The list of available files itself might be useful already to see what we have in our folder on the device

Reviewed By: passy

Differential Revision: D40508960

fbshipit-source-id: 96193fef3fed64d509cd3397513ae3e94438ae22
2022-10-25 05:31:48 -07:00
Andrey Goncharov
2db9bccf75 Export client logs for the active client as a part of the universal export
Summary:
Design doc: https://docs.google.com/document/d/1HLCFl46RfqG0o1mSt8SWrwf_HMfOCRg_oENioc1rkvQ/edit#

Introduce a command rto fetch debug data from the devices

Reviewed By: passy

Differential Revision: D40470838

fbshipit-source-id: 40a7ec66b1266ceff1b31b5b4f19b93765b78615
2022-10-25 05:31:48 -07:00
Andrey Goncharov
9597e672a1 Provide @emotion/css to plugins
Summary: Changelog: Provide `emotion/css` to plugins

Reviewed By: antonk52

Differential Revision: D40057817

fbshipit-source-id: 1e931eb8527d62dd4312556a6d493fdf3e17b45a
2022-10-04 05:07:36 -07:00
Andrey Goncharov
228de6c542 Add custom timeout to Device.installApp
Reviewed By: lblasa

Differential Revision: D39728545

fbshipit-source-id: be77a2e7ddac4071c9cafc88e67b793ee8c7631c
2022-09-23 10:20:53 -07:00
Ken Yee
fa9ba6f2d0 Adds a notifyAvailableUpdate flag to config.json to disable update (#3992)
Summary:
We would like to version control Flipper and some of our custom plugins that are installed on developers' systems.
Flipper by default prompts users to upgrade so they sometimes do the update and then all our custom plugins break because they were compiled for an older version.
See https://github.com/facebook/flipper/issues/3947 for feature request info.

## Changelog

Adds notifyAvailable flag to config.json to disable prompting for users that "an update is available"

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

Test Plan:
Tested by running locally.
Had to comment out the isProduction() check to confirm this it worked properly because this flag is false on dev versions.
Couldn't figure out how to manually test the handleOpenPluginDeeplink.tsx change but made a similar change there; happy to test that if you can tell me how to exercise that path.

Reviewed By: antonk52

Differential Revision: D39654481

Pulled By: antonk52

fbshipit-source-id: cef6b48d870915c48f620269c42d24b8ef1f4c29
2022-09-21 09:47:44 -07:00
Andrey Goncharov
8716761cb3 Fix require monkey-patching in electron build
Summary:
In D39311893 (094c5bdfdd) we started monkey-patching `require` to resolve global dependencies in the plugins. Apparently, patching `globalThis.require` did not work in the electron env. On my local machine it kept working because I had the experimental `flipper-server` feature enabled which embeds flipper-server into the electron build. In flipper-server we properly patch `require` via `Module.prototype.require` which affected the global require in electron.
With this fix we now properly patch require in electron via Module.prototype.require all the time

Changelog: Fix plugin loading with experimental flipper-server disabled

Reviewed By: nikoant

Differential Revision: D39633821

fbshipit-source-id: 9554f643c625620d116075ae87f573d8447850f6
2022-09-20 01:36:56 -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
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
Feiyu Wong
3ffb25e672 Update UI for enabling persisted logs feature
Summary:
This is the first diff to implement the feature for the Flipper logs plugin to have an option to persist logs in the table between crashes, disconnections, etc.

Since this is not a local change, the UI option for persistence will be located in the settings for the Flipper UI(as seen in the test plan). The setting is associated with the Redux Store `Settings` and is stored globally to be used across all plugins. So the plan is making the persistence pertain to all plugins.

Reviewed By: mweststrate

Differential Revision: D37786988

fbshipit-source-id: 7ffc6077cbca559b3401b16770eda657a6c45620
2022-07-28 13:56:34 -07:00
Lorenzo Blasa
c91c766b12 FlipperServer new plugin marketplace methods
Summary:
Expose two new methods as to be able to:
- List plugins from marketplace
- Install a plugin from marketplace

Reviewed By: passy

Differential Revision: D37749817

fbshipit-source-id: 82b78f7906c5664d5747289fa4f8eadebcde1d73
2022-07-11 07:04:55 -07:00
Lorenzo Blasa
ea958b0b15 MarketplacePluginDetails into flipper-common
Summary: ^

Reviewed By: antonk52

Differential Revision: D37715921

fbshipit-source-id: 05d35c472e847a7891fd4af1e88a3425e1d55f13
2022-07-11 02:39:49 -07:00
Lorenzo Blasa
caa04f4a44 Move User to flipper-common
Summary: Move User from reducers to flipper-common. User will now be usable by other modules.

Reviewed By: passy

Differential Revision: D37599802

fbshipit-source-id: 66412e7ed00bf27448fa2deae70f0e8e80303aba
2022-07-08 14:17:52 -07:00
Luke De Feo
6c5faf2932 Add command to install app to flipper server
Summary: There is a new flipper server command to install apps. For android it uses adb (via adb kit) For ios depending on idb availablity it will use idb or xcrun. Consumed in the next diff

Reviewed By: lblasa, aigoncharov

Differential Revision: D36936637

fbshipit-source-id: e09d34d840a9f3bf9136bcaf94fb8ca15dd27cbb
2022-07-07 07:50:14 -07:00
Andrey Goncharov
dcbc7c40bb Stream server logs to browser
Summary: Makes Flipper Logs tab functional for Flipper Browser

Reviewed By: lblasa

Differential Revision: D37459924

fbshipit-source-id: 4ebf3d47fbbf90bb367e01986b12dec782b03c34
2022-06-28 06:27:43 -07:00
Pascal Hartig
8333268654 Expose environment info
Summary: The part I'm most interested in is the `appVersion`. For non-debug builds this will allow us to check if a flipper-server version is compatible with flipperd/arc_uiqr or any other tool that builds on top of it.

Reviewed By: lblasa

Differential Revision: D37456699

fbshipit-source-id: 50eeb6da0f55e3a3552d43fa7c9ea34608090f97
2022-06-27 12:10:44 -07:00
Pascal Hartig
9a72169819 Expose is-logged-in endpoint
Summary: Make it possible to ask whether a user is logged in. This won't tackle token expiration but it's consistent with the internal API we have through the `isLoggedIn` atom.

Reviewed By: lblasa

Differential Revision: D37422274

fbshipit-source-id: 2d3a5e27f5dbbe866d5392403e690faf2f1156b2
2022-06-27 04:42:11 -07:00
Lorenzo Blasa
335dec1a08 Adds some settings to check flipper-server state
Summary:
There's one setting: to enable or disable flipper-server.

However, I've added some current running state to it. If there's a better way of doing this, please do let me know.

Reviewed By: aigoncharov

Differential Revision: D37276670

fbshipit-source-id: f6c941cf0cfe55c267b9bcb9f799934fba1e28ef
2022-06-22 05:26:11 -07:00
Lorenzo Blasa
2e9ab310bd Shutdown command
Summary:
Introduce a 'shutdown' command which effectively kills the process.

Killing the process, for flipper-server, will close down the server and active ws connections.

Reviewed By: passy

Differential Revision: D37209193

fbshipit-source-id: 83303e8209530a41ba870009603cfb383915b7a6
2022-06-21 04:46:42 -07:00
Andrey Goncharov
fec2650afb Remove redundant GK definition from flipper-common
Summary: Developers should use `getRenderHostInstance().GK(...)` instead

Reviewed By: lblasa

Differential Revision: D37034322

fbshipit-source-id: 41017f53a5256449252917a48fcd3a49a9b984c8
2022-06-09 03:34:04 -07:00
Andrey Goncharov
2b16916a85 Deprecate kaios-portal
Reviewed By: passy

Differential Revision: D36807506

fbshipit-source-id: 660f334a46dbf7847c90ce6e67f2dc974c1daf90
2022-06-07 04:00:02 -07:00
Andrey Goncharov
59761ecd50 Mark deprecated plugins in the UI
Summary:
Changelog: Add a deprecation warning for deprecated plugins.

Closes https://github.com/facebook/flipper/issues/2074

Reviewed By: lblasa, antonk52

Differential Revision: D36760209

fbshipit-source-id: 64cf799644f28aeedf88824c949738a6a766b094
2022-05-30 07:32:12 -07:00
Andrey Goncharov
4eca8d1088 Add isHeadlessBuild to EnvironmentInfo
Summary: Allows to attribute errors to flipper server or flipper electron

Reviewed By: passy

Differential Revision: D36698504

fbshipit-source-id: 6d07216fd05aa48b7c8cca5b53145916b64526eb
2022-05-27 02:37:53 -07:00
Lorenzo Blasa
6d2bc5cc9a Refactor some of the types used by FBLogger into Logger
Summary:
^

This change aims to extract some bits and pieces that are not specific to FBLogger and could be used by other Logger implementations.

Reviewed By: passy

Differential Revision: D36473286

fbshipit-source-id: 57f02d132673dbac97384da4dca51bf3e6fb8738
2022-05-24 10:23:42 -07:00
Andrey Goncharov
4f9ceb2e22 Implement subscribing to data updates for Flipper Server Companion
Summary: Allow subscribing to state updates from the plugin in headless mode

Reviewed By: passy

Differential Revision: D36516754

fbshipit-source-id: 14db51243e1d91332a7327c1792412149339f907
2022-05-23 03:38:23 -07:00
Andrey Goncharov
0f038218f8 Share uuid
Summary: Expose uuid from flipper-common as it is required in multiple packages

Reviewed By: lblasa

Differential Revision: D36441889

fbshipit-source-id: 1fa539cb437976dbefe7d5d9a52e5e098a6402a7
2022-05-18 03:13:31 -07:00
Andrey Goncharov
98dde53cda Add companion logging
Summary: Add top-level error logging to flipper-server. Use the top-level logging mechanism in flipper-companion.

Reviewed By: lblasa

Differential Revision: D36252218

fbshipit-source-id: 58d22b3b9bd51e597b5250478640f54d10277861
2022-05-10 05:13:24 -07:00
Andrey Goncharov
5a5c0ce426 Export typeUtils from flipper-common
Reviewed By: passy

Differential Revision: D36098166

fbshipit-source-id: 0f3da1d17da8ff6d08bc05abe73f9657df3bc3b8
2022-05-10 05:13:24 -07:00
Andrey Goncharov
3dd7583fdc Add device-find, client-find server commands
Reviewed By: passy

Differential Revision: D36098171

fbshipit-source-id: f0d0bbefcafc57a6413f9ffe8da271419c0d4deb
2022-05-10 05:13:24 -07:00
Andrey Goncharov
50111ef24b Add headless plugin definition
Summary: Support explicitly marking headless plugins as "headless"

Reviewed By: passy

Differential Revision: D35891387

fbshipit-source-id: 50b5acb3a7c52d7aedf32e271ebe6fc6d4fcef73
2022-05-10 05:13:24 -07:00
Andrey Goncharov
ba9a80545d Support globally installed React DevTools
Summary:
- Support loading globally installed DevTools

Background:
1. Initially, I wanted to use react-devtools-core as before. react-devtools-core standalone contains quite a few imports of node.js APIs. After [a conversation with Brian](https://fb.workplace.com/groups/react.devtools/permalink/3131548550392044), I pivoted to react-devtools-inline
2. Technical design doc of react-devtools-inline integration: https://docs.google.com/document/d/1STUSUhXzrW_KkvqSu7Ge-rxjVFF7oU3_NbwzimkO_Z4
3. We support usage of globally installed devtools. Code of react-devtools-inline is not ready to be used by the browser as is. We need to bundle it and substitute React and ReactDOM imports with the globals.
4. As we can't pre-compile what users install globally, we need to bundle global devtools on demand,
5. I tried re-using our Metro bundling pipeline initially, but gave up after fighting it for 2 days. Included, `rollup` instead.
6. Size of a `tgz` archive with a plugin is 2.1MB

allow-large-files

Reviewed By: mweststrate

Differential Revision: D34968770

fbshipit-source-id: 352299964ccc195b8677dbda47db84ffaf38737b
2022-03-31 04:01:33 -07:00
Andres Orozco Gonzalez
83133618d6 add adbkit configurations settings
Summary: Adbkit configurations settings may be neccesary when we want to run flipper-server in an IPv6 stack machine as localhost would bind to [::1] rather than 127.0.0.1 which is where the adb server usually runs

Reviewed By: mweststrate

Differential Revision: D34964851

fbshipit-source-id: 9cf70f9bdc0c40e92382b1537013439f85983f65
2022-03-23 04:24:23 -07:00
Pascal Hartig
9c5d1a32c5 Recover from malformed JSON
Summary: Following up on D34787674 (f85def32fb).

Reviewed By: aigoncharov

Differential Revision: D34930249

fbshipit-source-id: f209a638c1281957fd2b03b6fc50389bd98bc5f6
2022-03-16 16:39:23 -07:00
Lorenzo Blasa
76847bbef1 Do not emit errors when unable to extract client query
Summary:
^

Usually, when launching Chrome, this error will take place a significat amount of times. By looking at the HTTP request, it is difficult to determine the origin other than being a Chrome extension.

There's no actionable items in Flipper, so do not emit the error.

Changelog: Do not emit errors when unable to extract client query

Reviewed By: antonk52

Differential Revision: D34898603

fbshipit-source-id: fbeb2db7ec2914669192cbebc2e6b15464e31827
2022-03-16 02:26:42 -07:00
Andrey Goncharov
f85def32fb Migrate from socket.io
Reviewed By: passy

Differential Revision: D34787674

fbshipit-source-id: 63d7c166ea29d14c96f0646a045e3f6fa93472e2
2022-03-10 10:31:24 -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
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
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
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