Summary:
Implementation taken from:
https://www.internalfb.com/code/fbsource/[85c1fe5afee7]/xplat/sonar/desktop/flipper-ui-core/src/fb/pluginMarketplaceAPI.tsx
As with the previous diff, the marketplace API for flipper-server-core accesses the existing config in a different way and depends on FlipperServer, instead of User, to execute intern request as to obtain marketplace plugins.
Reviewed By: passy
Differential Revision: D37749775
fbshipit-source-id: 968ea3f7a412893f032e5a7a50ecf17c298e18ff
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
Summary: We no longer need to Tail the logs as we stream the logs over WebSockets (see D37459924 (dcbc7c40bb))
Reviewed By: lblasa
Differential Revision: D37550482
fbshipit-source-id: 92a87f2ba1ecec140bbbb9e71df107341765ad46
Summary:
Provide an option to enable/disable TCP connections on flipper-server.
The only change at this stage is that Flipper Desktop will use UDS to connect to flipper-server.
Reviewed By: passy
Differential Revision: D37519656
fbshipit-source-id: 3d02084666fde532ec76134edf8cf6a231060a48
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
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
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
Summary:
This change attaches our event handlers as soon as the ws is created.
As a consequence, we need to wait until the server has created any necessary instances required to process incoming requests.
To achieve this, I created a type called `Lazy`.
This type wraps around a value and a promise to that value. Callers can check if the value is set. If not, callers can wait for it.
Ultimately, the value can be set outside of the promise itself.
Reviewed By: passy
Differential Revision: D37284939
fbshipit-source-id: 17dec548d7155a3d65440c9584cec07cbb826c37
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
Summary: On exit, close the servers explicitly.
Reviewed By: lawrencelomax
Differential Revision: D37206986
fbshipit-source-id: 7f4313cce1db18e1fb1320993a58c440af2cc7e0
Summary:
For Flipper Desktop, Electron based, the origin maybe file:// as shown in tests:
```
Refused socket connection from cross domain request, origin: file://, host: localhost:52342.
Expected origins: http://localhost:52342 or http://[::1]:52342 or http://::1:52342 or http://localhost:3000.
Expected hosts: localhost:52342 or [::1]:52342 or ::1:52342 or localhost:3000
```
This change effectively adds `file://` as a valid origin.
Reviewed By: passy
Differential Revision: D37212809
fbshipit-source-id: 311a93bb8872587d15c6be4329238af6b0f6988d
Summary:
After doing some tests, any error thrown during ws events can result in flipper-server shutting down.
To avoid this, effectively, errors throughout should be properly handled.
The problem is that there's no guarantees this is or will be the case.
Instead, wrap the event handlers in a safe function execution wrapper. Any errors will be caught and logged.
Reviewed By: aigoncharov
Differential Revision: D37206923
fbshipit-source-id: 6f7cadc297ac39768030962c6eaadde55048fd21
Summary: We have several folders Flipper uses that sometimes we forget to create before Flipper starts. With this diff we have a single place to initialise the necessary folder structure.
Reviewed By: lblasa
Differential Revision: D37036601
fbshipit-source-id: f945f2bfdfc6be24ba87bd4b13c7fcef3fd74451
Summary:
This changes moves most of the functionality found in flipper-server to flipper-server-core.
flipper-server will mostly be a package that wraps around flipper-server-core. Staying in flipper-server:
- Command line args
- Orchestration to start the necessary servers
Reviewed By: aigoncharov
Differential Revision: D36807087
fbshipit-source-id: f29002c7cc5d08b8c5184fdaaa02ba22562a9f45
Summary: Tail is a server-side logging utility. We cannot add it to flipper-frontend-core as it is going to be included into the browser bundle then and break the build.
Reviewed By: antonk52
Differential Revision: D36771864
fbshipit-source-id: 169cdb88543f1e47f39e8c0976c3a3f45c0439d5
Summary: Allows to attribute errors to flipper server or flipper electron
Reviewed By: passy
Differential Revision: D36698504
fbshipit-source-id: 6d07216fd05aa48b7c8cca5b53145916b64526eb
Summary:
Bumps [ws](https://github.com/websockets/ws) from 8.5.0 to 8.6.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/websockets/ws/releases">ws's releases</a>.</em></p>
<blockquote>
<h2>8.6.0</h2>
<h1>Features</h1>
<ul>
<li>Add the ability to remove confidential headers on a per-redirect basis (<a href="https://github-redirect.dependabot.com/websockets/ws/issues/2030">https://github.com/facebook/flipper/issues/2030</a>).</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="ba214d9693"><code>ba214d9</code></a> [dist] 8.6.0</li>
<li><a href="8e3f1181f2"><code>8e3f118</code></a> [feature] Introduce the <code>'redirect'</code> event (<a href="https://github-redirect.dependabot.com/websockets/ws/issues/2030">https://github.com/facebook/flipper/issues/2030</a>)</li>
<li><a href="69e682806d"><code>69e6828</code></a> [ci] Test on node 18</li>
<li><a href="0b6eb71665"><code>0b6eb71</code></a> [ci] Do not test on node 17</li>
<li><a href="d062ded622"><code>d062ded</code></a> [example] Fix require path</li>
<li><a href="2cf6202f8a"><code>2cf6202</code></a> [example] Use the <code>WebSocket.WebSocket{,Server}</code> aliases</li>
<li><a href="62e9b199ad"><code>62e9b19</code></a> [doc] Fix nits</li>
<li><a href="2619c003ce"><code>2619c00</code></a> [minor] Fix nit in comment</li>
<li><a href="d086f4bcbb"><code>d086f4b</code></a> [minor] Make <code>abortHandshake()</code> emit the error in the next tick</li>
<li><a href="ff80d665f9"><code>ff80d66</code></a> [test] Do not use a relative URL</li>
<li>Additional commits viewable in <a href="https://github.com/websockets/ws/compare/8.5.0...8.6.0">compare view</a></li>
</ul>
</details>
<br />
[](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
<details>
<summary>Dependabot commands and options</summary>
<br />
You can trigger Dependabot actions by commenting on this PR:
- `dependabot rebase` will rebase this PR
- `dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `dependabot merge` will merge this PR after your CI passes on it
- `dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `dependabot cancel merge` will cancel a previously requested merge and block automerging
- `dependabot reopen` will reopen this PR if it is closed
- `dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
</details>
Pull Request resolved: https://github.com/facebook/flipper/pull/3708
Reviewed By: timur-valiev
Differential Revision: D36371198
Pulled By: mweststrate
fbshipit-source-id: df9befdb3f95be2b8c564f87287bd8621e3a0c59
Summary: Expose uuid from flipper-common as it is required in multiple packages
Reviewed By: lblasa
Differential Revision: D36441889
fbshipit-source-id: 1fa539cb437976dbefe7d5d9a52e5e098a6402a7
Summary:
Currently, Flipper Server has a few productions dependencies (mac-ca, node-fetch) that are not bundled with the Flipper Server. It makes it harder to distribute Flipper Server, as now all potential consumers need not only to download the bundle, but also install these additional dependencies.
This diff makes it possible to bundle `mac-ca` and `node-fetch` with Flipper Server. As a result, Flipper Server becomes dependency-free in production.
Reviewed By: lblasa
Differential Revision: D36345213
fbshipit-source-id: 2cd6ba1b3301b45dc2295891964ba020fd107586
Summary: Reverts D36263724 (0ee8f09fe5) and fixes the underlying crash by setting only physical devices in the permissive mode
Reviewed By: passy
Differential Revision: D36275055
fbshipit-source-id: 25a691e9c07e20a3341630db508795c133a9bd81
Summary:
Original commit changeset: 471470c5ca91
Original Phabricator Diff: D35356211 (501abc6b55)
Recently, bloks users reported that android emulators lost connection upon launching Flipper. (S270689)
Manual bisecting indicates that remote emulators won't crash on v0.142.362128844 (4/6) but crash on 0.143.365099607 (4/21).
Looking at https://www.internalfb.com/code/fbsource/[history]/xplat/scripts/.flipperversion.v2, and backing out D35356211 (501abc6b55) fixes the issue.
It's still unclear why setting `setIntoPermissiveMode` would crash/disconnect the android emulators, I'd defer Flipper team to investigate this further but this diff should unblock all the android bloks emulator + Flipper use case.
Reviewed By: lblasa
Differential Revision: D36263724
fbshipit-source-id: e8674730c0185457f6eda347ce7d9a41f9e1a2a4
Summary: More bumps for patch and minor releases. allow-large-files
Reviewed By: aigoncharov
Differential Revision: D36104098
fbshipit-source-id: 6db995e660afbe4febd72aa70ed8150cc16a8c93
Summary: Caused some inconsistencies when running `tsc`. This brings them back in line.
Reviewed By: aigoncharov
Differential Revision: D36101548
fbshipit-source-id: b8f757c59f879911c9b0920fe11396246ffa37e2
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
Summary: Added a clearer message to the null checks, to give some clue on what goes wrong
Reviewed By: lawrencelomax
Differential Revision: D35246065
fbshipit-source-id: d33a6184bf722a386c2b2dff1afd41db20efe90b
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
Summary: Well, and added another word.
Reviewed By: lblasa
Differential Revision: D34944504
fbshipit-source-id: eb4e7db05ee846721fa18899aa50596124632b5b
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
Summary: It's unused, can only assume that it was a log buffer in some distant time which is now hidden behind a separate log listener class
Reviewed By: passy
Differential Revision: D34787086
fbshipit-source-id: 0f920649c119efc5172ca7dcc6b53cfb802a5cbf
Summary:
Logcat can sometimes fail to clear the logs for some reason.
There's nothing we can do about this as we're directly calling out to adb.
Reviewed By: lawrencelomax
Differential Revision: D34749970
fbshipit-source-id: 2166717ace491f7b73b380576392638ef9276b78
Summary:
New round of releases and PRs came up, so bumping again.
Very selective Metro update as some dependencies don't play well together. A bunch of other dependencies use ESM and fail at various stages of the build or runtime process.
Reviewed By: mweststrate
Differential Revision: D34688830
fbshipit-source-id: 2ff5c46c253b814140f634a986ba0d246e9b0945
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
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
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
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
Summary: Provide server add-on writers with a well-known fetch API
Reviewed By: mweststrate
Differential Revision: D34447630
fbshipit-source-id: 70386940c12f9e53aa97b3530a7edf1d40b5f2e2
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