Commit Graph

283 Commits

Author SHA1 Message Date
Michel Weststrate
96cd25fcc1 Fix NPE in Interactive.tsx
Summary: Fixed some incorrect non-null assertions that showed up in monitoring.

Reviewed By: timur-valiev

Differential Revision: D32278433

fbshipit-source-id: afe4913d8aef38c371461b4d0b817b2625153de1
2021-11-09 05:23:07 -08:00
dependabot[bot]
b9e41cc787 Bump @emotion/css from 11.1.3 to 11.5.0 in /desktop (#3020)
Summary:
Bumps [emotion/css](https://github.com/emotion-js/emotion) from 11.1.3 to 11.5.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/emotion-js/emotion/releases"><code>@​emotion/css</code>'s releases</a>.</em></p>
<blockquote>
<h2><code>@​emotion/css</code><a href="https://github.com/11"><code>@​11</code></a>.5.0</h2>
<h3>Patch Changes</h3>
<ul>
<li>
<p><a href="https://github-redirect.dependabot.com/emotion-js/emotion/pull/2498">https://github.com/facebook/flipper/issues/2498</a> <a href="e5beae8e32"><code>e5beae8e</code></a> Thanks <a href="https://github.com/Andarist"><code>@​Andarist</code></a>! - Fixed an edge case issue with incorrect rules being generated. When a context selector (<code>&amp;</code>) was used not at the beginning of a selector (which is not valid SCSS but is allowed by the Stylis parser that we are using) within a group of selectors containing a pseudoclass then it was not replaced correctly with the current context selector.</p>
</li>
<li>
<p>Updated dependencies [<a href="e5beae8e32"><code>e5beae8e</code></a>, <a href="9ae4a91a08"><code>9ae4a91a</code></a>, <a href="f2eda82954"><code>f2eda829</code></a>]:</p>
<ul>
<li><code>@​emotion/cache</code><a href="https://github.com/11"><code>@​11</code></a>.5.0</li>
<li><code>@​emotion/sheet</code><a href="https://github.com/1"><code>@​1</code></a>.0.3</li>
</ul>
</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="4be3391914"><code>4be3391</code></a> Version Packages (<a href="https://github-redirect.dependabot.com/emotion-js/emotion/issues/2495">https://github.com/facebook/flipper/issues/2495</a>)</li>
<li><a href="f2eda82954"><code>f2eda82</code></a> Prevent flush from raising error on detached tag (<a href="https://github-redirect.dependabot.com/emotion-js/emotion/issues/2447">https://github.com/facebook/flipper/issues/2447</a>)</li>
<li><a href="d7d768e056"><code>d7d768e</code></a> Implement automatic adding of jsxImportSource pragma definition (<a href="https://github-redirect.dependabot.com/emotion-js/emotion/issues/2353">https://github.com/facebook/flipper/issues/2353</a>)</li>
<li><a href="685bbec099"><code>685bbec</code></a> Improve readability of the <code>extractCriticalToChunks</code> example in the docs (<a href="https://github-redirect.dependabot.com/emotion-js/emotion/issues/2460">https://github.com/facebook/flipper/issues/2460</a>)</li>
<li><a href="218e4f78ca"><code>218e4f7</code></a> Add <code>RegExp</code> as a valid type for the <code>target</code> option accepted by `toHaveStyle...</li>
<li><a href="eda5e687c0"><code>eda5e68</code></a> Fix error in alternative JS environments (<a href="https://github-redirect.dependabot.com/emotion-js/emotion/issues/2500">https://github.com/facebook/flipper/issues/2500</a>)</li>
<li><a href="84522ded6e"><code>84522de</code></a> fix: update docs references (<a href="https://github-redirect.dependabot.com/emotion-js/emotion/issues/2497">https://github.com/facebook/flipper/issues/2497</a>)</li>
<li><a href="500cdd828b"><code>500cdd8</code></a> Support typings for Jest v27 (<a href="https://github-redirect.dependabot.com/emotion-js/emotion/issues/2456">https://github.com/facebook/flipper/issues/2456</a>)</li>
<li><a href="e5beae8e32"><code>e5beae8</code></a> Fixed an issue with context selector not at the beginning (<a href="https://github-redirect.dependabot.com/emotion-js/emotion/issues/2498">https://github.com/facebook/flipper/issues/2498</a>)</li>
<li><a href="63a0a6c5d1"><code>63a0a6c</code></a> Fix URLs in the <code>docs/extract-static.mdx</code> (<a href="https://github-redirect.dependabot.com/emotion-js/emotion/issues/2496">https://github.com/facebook/flipper/issues/2496</a>)</li>
<li>Additional commits viewable in <a href="https://github.com/emotion-js/emotion/compare/emotion/css@11.1.3...@emotion/css@11.5.0">compare view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=@emotion/css&package-manager=npm_and_yarn&previous-version=11.1.3&new-version=11.5.0)](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/3020

Reviewed By: passy

Differential Revision: D32202498

Pulled By: mweststrate

fbshipit-source-id: bcc677dad5e218a72a2e58b55632f93509ecde99
2021-11-05 05:29:55 -07:00
dependabot[bot]
b98eddd82f Bump jest-mock-console from 1.1.0 to 1.2.3 in /desktop (#2989)
Summary:
Bumps [jest-mock-console](https://github.com/bpedersen/jest-mock-console) from 1.1.0 to 1.2.3.
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a href="https://github.com/bpedersen/jest-mock-console/commits">compare view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=jest-mock-console&package-manager=npm_and_yarn&previous-version=1.1.0&new-version=1.2.3)](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/2989

Reviewed By: passy

Differential Revision: D32202558

Pulled By: mweststrate

fbshipit-source-id: c8a21d7639f66d2825558b7ee4e01b58a86aac83
2021-11-05 05:29:55 -07:00
dependabot[bot]
199b14a4eb Bump @emotion/react from 11.4.1 to 11.5.0 in /desktop (#3022)
Summary:
Bumps [emotion/react](https://github.com/emotion-js/emotion) from 11.4.1 to 11.5.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/emotion-js/emotion/releases"><code>@​emotion/react</code>'s releases</a>.</em></p>
<blockquote>
<h2><code>@​emotion/react</code><a href="https://github.com/11"><code>@​11</code></a>.5.0</h2>
<h3>Patch Changes</h3>
<ul>
<li>
<p><a href="https://github-redirect.dependabot.com/emotion-js/emotion/pull/2498">https://github.com/facebook/flipper/issues/2498</a> <a href="e5beae8e32"><code>e5beae8e</code></a> Thanks <a href="https://github.com/Andarist"><code>@​Andarist</code></a>! - Fixed an edge case issue with incorrect rules being generated. When a context selector (<code>&amp;</code>) was used not at the beginning of a selector (which is not valid SCSS but is allowed by the Stylis parser that we are using) within a group of selectors containing a pseudoclass then it was not replaced correctly with the current context selector.</p>
</li>
<li>
<p><a href="https://github-redirect.dependabot.com/emotion-js/emotion/pull/2500">https://github.com/facebook/flipper/issues/2500</a> <a href="eda5e687c0"><code>eda5e687</code></a> Thanks <a href="https://github.com/Jarred-Sumner"><code>@​Jarred-Sumner</code></a>! - Fix error loading <code>@​emotion/react</code> in alternative JS environments</p>
</li>
<li>
<p>Updated dependencies [<a href="e5beae8e32"><code>e5beae8e</code></a>, <a href="9ae4a91a08"><code>9ae4a91a</code></a>, <a href="f2eda82954"><code>f2eda829</code></a>]:</p>
<ul>
<li><code>@​emotion/cache</code><a href="https://github.com/11"><code>@​11</code></a>.5.0</li>
<li><code>@​emotion/sheet</code><a href="https://github.com/1"><code>@​1</code></a>.0.3</li>
</ul>
</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="4be3391914"><code>4be3391</code></a> Version Packages (<a href="https://github-redirect.dependabot.com/emotion-js/emotion/issues/2495">https://github.com/facebook/flipper/issues/2495</a>)</li>
<li><a href="f2eda82954"><code>f2eda82</code></a> Prevent flush from raising error on detached tag (<a href="https://github-redirect.dependabot.com/emotion-js/emotion/issues/2447">https://github.com/facebook/flipper/issues/2447</a>)</li>
<li><a href="d7d768e056"><code>d7d768e</code></a> Implement automatic adding of jsxImportSource pragma definition (<a href="https://github-redirect.dependabot.com/emotion-js/emotion/issues/2353">https://github.com/facebook/flipper/issues/2353</a>)</li>
<li><a href="685bbec099"><code>685bbec</code></a> Improve readability of the <code>extractCriticalToChunks</code> example in the docs (<a href="https://github-redirect.dependabot.com/emotion-js/emotion/issues/2460">https://github.com/facebook/flipper/issues/2460</a>)</li>
<li><a href="218e4f78ca"><code>218e4f7</code></a> Add <code>RegExp</code> as a valid type for the <code>target</code> option accepted by `toHaveStyle...</li>
<li><a href="eda5e687c0"><code>eda5e68</code></a> Fix error in alternative JS environments (<a href="https://github-redirect.dependabot.com/emotion-js/emotion/issues/2500">https://github.com/facebook/flipper/issues/2500</a>)</li>
<li><a href="84522ded6e"><code>84522de</code></a> fix: update docs references (<a href="https://github-redirect.dependabot.com/emotion-js/emotion/issues/2497">https://github.com/facebook/flipper/issues/2497</a>)</li>
<li><a href="500cdd828b"><code>500cdd8</code></a> Support typings for Jest v27 (<a href="https://github-redirect.dependabot.com/emotion-js/emotion/issues/2456">https://github.com/facebook/flipper/issues/2456</a>)</li>
<li><a href="e5beae8e32"><code>e5beae8</code></a> Fixed an issue with context selector not at the beginning (<a href="https://github-redirect.dependabot.com/emotion-js/emotion/issues/2498">https://github.com/facebook/flipper/issues/2498</a>)</li>
<li><a href="63a0a6c5d1"><code>63a0a6c</code></a> Fix URLs in the <code>docs/extract-static.mdx</code> (<a href="https://github-redirect.dependabot.com/emotion-js/emotion/issues/2496">https://github.com/facebook/flipper/issues/2496</a>)</li>
<li>Additional commits viewable in <a href="https://github.com/emotion-js/emotion/compare/emotion/react@11.4.1...@emotion/react@11.5.0">compare view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=@emotion/react&package-manager=npm_and_yarn&previous-version=11.4.1&new-version=11.5.0)](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/3022

Reviewed By: passy

Differential Revision: D32202484

Pulled By: mweststrate

fbshipit-source-id: 85c7df21741e7e19108039199c8c3671258a7c87
2021-11-05 05:29:54 -07:00
Daniel Kohli
67b4b53c20 Rotate Styling for Vertical Sidebar
Summary: - We are using the `Sidebar` component in our `LogViewer` implementation and we noticed that it needed some styling updates to be used properly as a vertical `Sidebar`.

Reviewed By: mweststrate

Differential Revision: D32083159

fbshipit-source-id: 441f3972ae900b5d5f353d3c7b56117c489850ba
2021-11-03 09:48:38 -07:00
Michel Weststrate
2e7015388c Remove remaining Electron imports from product code: paths & env
Summary:
This diff removes most remaining Electron imports, by storing env and path constants on the RenderHost. As nice side effect those paths are all cached now as well.

To make sure RenderHost is initialised before Flipper itself, forced loading Flipper through a require. Otherwise the setup is super sensitive to circular import statements, since a lot of module initialisation code depends on those paths / env vars.

Reviewed By: nikoant

Differential Revision: D31992230

fbshipit-source-id: 91beb430902272aaf4b051b35cdf12d2fc993347
2021-11-03 07:01:21 -07:00
Michel Weststrate
72ce759e61 Remove some unhandled rejections in tests
Summary: Fixed several tests that caused uncaught promise rejects to fire after the tests finished. This caused jest to fail if there are too many of them.

Reviewed By: aigoncharov

Differential Revision: D32118124

fbshipit-source-id: 50734dab6dee2efec7f056940af72858b27b1707
2021-11-03 03:14:08 -07:00
Anton Kastritskiy
4a4cc21d89 Refine DataSource id to use actual key type instead of a wide string type
Summary: Current implementation uses type `string` as a key for indexing items stored in datasource. However, users can provide any key as an index which means that the type of index item can be anything, not only string. This diff introduces a more refined types for the key. It adds another requirement to provide a key property to a generic which is used to infer the index type.

Reviewed By: mweststrate, aigoncharov

Differential Revision: D31895751

fbshipit-source-id: 19ba907bd6f35df87e3fa442db5fc5cec6af174d
2021-10-28 10:44:01 -07:00
Pascal Hartig
0f9698312a Fix capitalization of method reference
Summary: Docs only.

Reviewed By: jknoxville

Differential Revision: D31928323

fbshipit-source-id: 14be8bf89215054e6561fc38f73040ccfae229c4
2021-10-27 02:48:07 -07:00
Michel Weststrate
9763af4c96 Decouple open/save dialogs, reload, shouldUseDarkColors from Electron
Summary: Per title. Less imports from Electron.

Reviewed By: timur-valiev, aigoncharov

Differential Revision: D31923504

fbshipit-source-id: dc7557cf7c88c0c8168ba22f7dca7b3e2d339a09
2021-10-26 12:07:22 -07:00
Daniel Kohli
fa7e8a6b37 Add max-width Style Prop to Tabs.tsx
Summary:
- We're using the `Tabs` component from `flipper-plugin` and upon adding them, we noticed that our view being displayed within the tabs no longer scrolled and the tab internally was being stretched far off the screen. (D31538124)
- After egp did some digging, he discovered that by adding the `maxWidth` style property to the inner `Layout.Container`, the tab no longer stretched and the scrolling was restored.
- We played around by adding wrapper elements around the contents of our Tab and adding the same style prop, but this did not yield the same result.

***Would Love some input from the Flipper team as to the best way to ensure that this won't break other's plugins.  Thank you!***

Reviewed By: mweststrate

Differential Revision: D31672790

fbshipit-source-id: 99cab1873f359f4c1827e4c94f2527636884c237
2021-10-25 14:13:35 -07:00
Pascal Hartig
b3fa8dd6c1 Dep bump
Summary:
Took a few iterations to make offline mirror happy, but everything is green now.

allow-large-files

Reviewed By: nikoant

Differential Revision: D31690614

fbshipit-source-id: 38d0d6cb5e3f63b3707d917a1ed6fc6144762731
2021-10-19 09:21:36 -07:00
Michel Weststrate
91d96774f6 Move files to flipper-common
Summary: Moved Logger, sleep, timeout and server contract types to flipper-common packages.

Reviewed By: passy

Differential Revision: D31475790

fbshipit-source-id: 42d2147698875f9e919ad5250f9953f3bff3ec2d
2021-10-12 16:00:52 -07:00
Michel Weststrate
cfd44b592a Further decouple server from UI
Summary: Further decoupling of `server/` from the rest of the code base. Also fixed a problem with promise chaining causing promises to create unhandled rejection errors.

Reviewed By: passy

Differential Revision: D31474919

fbshipit-source-id: 027cccbe9b57d856c94d63c093d39b6cb3e53312
2021-10-12 16:00:52 -07:00
Pascal Hartig
dd190ef2e0 Big dep bump
Summary: Conservatively bumping only patch versions (except the ones we know break stuff).

Reviewed By: nikoant

Differential Revision: D31511737

fbshipit-source-id: 5b55b4689e71975824577f0ac43d806ca37ea232
2021-10-11 02:32:44 -07:00
Michel Weststrate
c3ff0ff355 Set up Flipper decapitated packages
Summary:
This diff introduces the packages necessary for Flipper decapitated.

* flipper-common: utilities & types shared between client, server, flipper-plugin
* flipper-server-core: all device & client management goes in here. Basically flipper's backend
* flipper-ui-core: all UI goes in here, as far as it doesn't depend on Electron
* desktop: the Electron app, will load server-core and ui-core, and glue them together, providing implementations for some electron specific stuff like dialgos
* flipper-server: A node process hosting flipper-server-core, that can be connected to over websockets. And probably can serve a browser version of the UI as well.
* flipper-ui-browser: thin wrapper around flipper-ui-core, providing some browser specific behavior / stubs.
* flipper-dump: (might remove later), but want to hack a quick and dirt flipper dump in here, as alternative way to test flipper-server-core.

This diff just creates the packages, but doesn't move any code, so it can be summarized as:

restoftheowl

Reviewed By: nikoant

Differential Revision: D30218646

fbshipit-source-id: 735598a1261a98e584f52504b5eba01ec0afa162
2021-10-08 01:33:03 -07:00
Michel Weststrate
d56375970d Cleaning up sheet abstraction to use Ant/flipper-plugin dialogs instead
Summary:
This diff cleans up order remaining dialogs, the ones involved in exporting to file or url. Includes some legacy component cleanup boyscouting, but not too much.

This removes a lot of code where state of the wizard was stored globally, and makes it locally instead.

Other code that was removed involves interaction with the old UI, which allowed import / export to be running in the background as well. (which is no longer needed since we optimised the process)

Reviewed By: timur-valiev

Differential Revision: D30192000

fbshipit-source-id: 13be883c5bf217a3d58b610b78516359e9bd0ebc
2021-10-06 09:10:19 -07:00
Michel Weststrate
9e5575cf69 Dialog management cleanup
Summary:
This diff moves the dialogs

* Settings
* Plugin Manager
* Doctor
* Sign in
* Changelog

To use the imperative dialog APIs, rather then organising them through reducers which adds a lot of indirection which isn't really needed but hard to follow.

Reviewed By: passy

Differential Revision: D30192002

fbshipit-source-id: ba38b2e700da3e442653786448fcbf85074981ad
2021-10-06 09:10:19 -07:00
Michel Weststrate
740093d0d9 Separate Client in server and client part
Summary: This diff separates the concept of a Client as now on the UI, from the concept of a Client as known on the server, and makes all interactions with client and vice versa async.

Reviewed By: timur-valiev

Differential Revision: D31235682

fbshipit-source-id: 99089e9b390b4c5359f97f6f2b15bf4b182b6cb9
2021-10-06 09:10:19 -07:00
Pascal Hartig
4aa7439fbf Fix Flipper lints #10
Summary:
Grey -> gray. "Cancelled" seems quite common in APIs though, so I disabled that.
A few promise cleanups

Reviewed By: aigoncharov

Differential Revision: D31323610

fbshipit-source-id: c8863d995936f451c24eb408fe5c26677187f089
2021-10-01 08:08:35 -07:00
Michel Weststrate
ef6e802244 Some Client related cleanups
Summary:
Client up `client.device` (which had no code references anymore) / `client.deviceSync`. Cleaned up feature code for old SDKs (pre 2, which is 3 years old).

This makes decapitating Client a little simpler in the rest of the stack.

Reviewed By: passy

Differential Revision: D31235436

fbshipit-source-id: 919679c1830e2b9368d0787d7b363c090305edb8
2021-09-29 07:01:18 -07:00
Michel Weststrate
f98526a2c9 Added unit tests to protect against broken startup sequence
Summary: Add unit tests to test errors thrown from plugins during initialisation, as follow up for D31127969 (a72e46c792). From the 4 tests cases added (first load plugin then device, device then plugin, first load plugin then client, first client then plugin), the first case was indeed failing before the mentioned diff and not registering the device.

Reviewed By: passy

Differential Revision: D31142583

fbshipit-source-id: 8e44c667316192231d1bb5e4d76c5bf1207ba835
2021-09-27 12:16:20 -07:00
Michel Weststrate
3882357579 Factor out realDevice [7/n]
Summary: `device.realDevice` was the escape hatch used in Sandy plugins to give access to device specific features like taking screenshots, clearing logs or accessing `adb`. Since in decapitated Flipper that won't be possible anymore (since plugins run in the client but device implementations on the server), all escape hatches have been bridged in this stack, and we can get of the `realDevice` interaction, by explicitly exposing those cases, which makes it type safe as well.

Reviewed By: passy

Differential Revision: D31079509

fbshipit-source-id: c9ec2e044d0dec0ccb1de287cf424907b198f818
2021-09-22 09:03:33 -07:00
Michel Weststrate
11a27f9e1a Support forward command [6/n]
Summary: Support the adb forward command

Reviewed By: jameslawson

Differential Revision: D31055957

fbshipit-source-id: bc0593320d0e187ddfc8120c1684746f9e9c4cf5
2021-09-22 09:03:33 -07:00
Michel Weststrate
8cf182cc26 Restore adb executeShell [5/n]
Summary: Expose executeShell explicitly through the device interface

Reviewed By: jameslawson

Differential Revision: D31055959

fbshipit-source-id: b14395d0783ede265c6ae39c397ea93a85a78336
2021-09-22 09:03:32 -07:00
Michel Weststrate
3428ce2968 Restore device icons [3/n]
Summary: Restored support for device icons which was disabled in previous diff

Reviewed By: passy

Differential Revision: D31054802

fbshipit-source-id: 107a53f06159211534cb9a2316340af7a7ca530a
2021-09-22 09:03:32 -07:00
Michel Weststrate
2d838efd4d Separate device in server and client version [2/n]
Summary:
This stack takes care of handling care of moving all device interactions over the (possible) async channel FlipperServer. The FlipperServer interface (see previous diff) allows listening to specific server events using `on`, and emit commands to be executed by the server by using `exec` (e.g. `exec('take-screenshot', serial) => Promise<buffer>`).

FlipperServerImpl implements this interface on the server side.

The device implementations are split as follows

```
server / backend process:

ServerDevice
- iOSDevice
- AndroidDevice
- MetroDevice
- DummyDevice
- Mac/Windows Device

frontend / ui:

BaseDevice: a normal connected, device, implements device apis as they already existed
- ArchivedDevice (note that this doesn't have a server counterpart)
- TestDevice (for unit tests, with stubbed backend communication)

```

All features of devices are for simplicity unified (since the deviations are small), where specific device types might not implement certain features like taking screenshots or running shell commands.

To avoid making this diff unnecessarily big, some open Todo's will be addressed later in this stack, and it shouldn't be landed alone.

Reviewed By: timur-valiev

Differential Revision: D30909346

fbshipit-source-id: cce0bee94fdd5db59bebe3577a6084219a038719
2021-09-22 09:03:32 -07:00
Michel Weststrate
845d0755f1 Move common types to flipper-plugin [1/n]
Summary: This is the first diff in a stack of many where server and UI logic is further decoupled to be only communication through an event listener / emitting commands, where all data going over these media is json serializable. In this diff we extract the common interfaces that are to be used by both server and UI layer.

Reviewed By: passy

Differential Revision: D30899609

fbshipit-source-id: dc3c783707d47671f1d0f5dbf99cde17a8f69062
2021-09-22 09:03:32 -07:00
Michel Weststrate
d7da816e36 Fixed issue where plugins weren't reset properly when reconnecting a device
Summary: If a device disconnects and reconnects while keeping the plugin open, a new pluginInstance is available, but the React component would not be remounted since both the old and new pluginInstance have the same identifier (device/client/plugin). This change makes sure that if a different pluginInstance arrives, the rendering will be reinitialised as well.

Reviewed By: lblasa

Differential Revision: D31018845

fbshipit-source-id: ac09e7ac519c7aebfb4f8dc0cc7c6cda6fbbf633
2021-09-17 07:24:57 -07:00
Michel Weststrate
93201b4e5d Fixed React key warning
Summary: Seems Antd always requires a `key` for Menu Items, even when React doesn't strictly need them.

Reviewed By: timur-valiev

Differential Revision: D30839589

fbshipit-source-id: 9cbef32c8fa083a7e23e486e15c537b4a9259a08
2021-09-09 07:01:04 -07:00
Michel Weststrate
1a91dc53fd Upgrade TS to 4.4
Summary: per title. TS 4.4 is awesome btw, with the much improved control flow analysis.

Reviewed By: timur-valiev

Differential Revision: D30806769

fbshipit-source-id: a41aa7bf10fdb0047ddb6210082b5e1fbdfb255f
2021-09-08 09:59:38 -07:00
Pascal Hartig
23d50520e3 Upgrade immer
Summary: Includes a security fix.

Reviewed By: timur-valiev

Differential Revision: D30767179

fbshipit-source-id: 9051ecdfa7b1f957080f12ca13f7652c2e92c69a
2021-09-07 03:12:59 -07:00
Pascal Hartig
4ba426debd Add button for emu launch selection
Summary: Based on afcoplan's feedback, now we're showing a button for launching the emulators instead of having it inline.

Reviewed By: mweststrate

Differential Revision: D30603659

fbshipit-source-id: edae6c63fd58647b406398c897215910938ae429
2021-09-02 04:27:08 -07:00
Pascal Hartig
d48293c30f Bump dependencies
Summary: Again, bundling a bunch of dependabot tasks I've received.

Reviewed By: mweststrate

Differential Revision: D30667465

fbshipit-source-id: 1acd29a36a642984105bbccfc75e0e3dd9e0f79b
2021-09-02 03:30:25 -07:00
Michel Weststrate
a2644b4a2e handle device / client absence for deeplinks
Summary:
This diff makes the new deeplink format feature complete, make sure VPN connection, plugin installation, client & device selection are now all handled. See the test plan for examples.

Changelog: Flipper now supports a richer protocol for opening deeplinks: https://fbflipper.com/docs/extending/deeplinks#open-plugin

Reviewed By: timur-valiev

Differential Revision: D30423809

fbshipit-source-id: e6cf4bf852b2c64e9a79a33ef0842eb27f68f840
2021-08-20 02:24:03 -07:00
Michel Weststrate
846246ffae Introduce options dialog, cleaned up state managament
Summary: Made it easier to build 'pick' dialogs, and introduced Dialogs.options for a set of radio buttions

Reviewed By: timur-valiev

Differential Revision: D30424708

fbshipit-source-id: 98abd0d64f47c552c81053b4433e5fc524574145
2021-08-20 02:24:03 -07:00
Pascal Hartig
797007f367 Make error message unique
Summary: We're currently getting errors for every duplicate key and can't easily unify them, so we're adding the additional information to a warning instead.

Reviewed By: mweststrate

Differential Revision: D30337821

fbshipit-source-id: db9dc44d7d3424de169bed9b4447b482e411eb19
2021-08-16 05:32:36 -07:00
Pascal Hartig
781df776f2 Rename default branch references to main (#2689)
Summary:
I really hope I hit everything and didn't break anything that wasn't
referring to branch names.

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

Test Plan:
_eyes

CI

|[Site Preview: flipper](https://our.intern.facebook.com/intern/staticdocs/eph/D30305789/V2/flipper/)

Reviewed By: timur-valiev

Differential Revision: D30305789

Pulled By: passy

fbshipit-source-id: 5daaa09250bb96bb50be679fc01dae86c666eb73
2021-08-13 15:00:39 -07:00
Michel Weststrate
5e8c968222 Move devices to server folder
Summary:
This is the first of many diffs that extracts the connection, device, client detection out of the flipper core, to create a reusable flipper-server library that can be used in e.g. flipper-dump.

To keep diffs a little smaller, the current connection logic is first moved to the `server/` directory, and decoupled manually from the rest of the core, before moving it over to a separate package.

This first diffs moves the `comms/`, `devices/` and certificate utilities to the `server` directory.

Further untangling will follow in next diffs

Reviewed By: timur-valiev

Differential Revision: D30246551

fbshipit-source-id: c84259bfb1239119b3267a51b015e30c3c080866
2021-08-12 05:43:43 -07:00
Michel Weststrate
8d7caa9dd4 Introduce Dialog.alert
Summary: Introduce `Dialog.alert` to show users a FYI message, and be able to wait for it to be handled, as utility around several `Modal` utilities.

Reviewed By: jknoxville

Differential Revision: D29875484

fbshipit-source-id: 5d2ea83e486631ac18a81800b467f97dfaac6d34
2021-08-10 13:24:23 -07:00
Michel Weststrate
4b892e7373 Check Flipper version when handling deeplinks
Summary: Check if Flipper is up to date before handling deeplink.

Reviewed By: nikoant

Differential Revision: D29846236

fbshipit-source-id: 011d05958346c3d18c76cf0ae63c3cb087f5933c
2021-08-10 13:24:23 -07:00
Pascal Hartig
47faeade61 Patch dep bump
Summary: Excluding `react-virtual` which seems to include a breaking change with the patch release.

Reviewed By: jknoxville

Differential Revision: D30189687

fbshipit-source-id: b40cb5edd407fd03009ee38c0af5202c8deaaa26
2021-08-10 11:08:22 -07:00
Pascal Hartig
6791b29e45 Big dep bump
Summary: The markdown bump required ignoring another prop, the rest was smooth.

Reviewed By: timur-valiev

Differential Revision: D30067682

fbshipit-source-id: 6038ffe29d2e0041c81bac132eed747cbfe40f54
2021-08-03 05:18:34 -07:00
Pascal Hartig
27eaf4f03d Tuesday dep bump
Summary:
allow-large-files
Got a ton of open bumps in GitHub. Want to address a bunch of them in one swoop.

Reviewed By: jknoxville, nikoant

Differential Revision: D29933570

fbshipit-source-id: d5dc18fab22e8c5b300ab318e60dd1514aecfd52
2021-07-27 11:42:46 -07:00
Michel Weststrate
62674da74e Introduce Spinner and Dialog.loading
Summary: Per title

Reviewed By: nikoant

Differential Revision: D29790505

fbshipit-source-id: 7c995be59418ffd4c337eb8d1905bd2f2466e5cd
2021-07-22 04:17:45 -07:00
Michel Weststrate
f74029699f Introduce Dialog abstraction
Summary: Introduce convenience abstractions to make it easier to manage dialogs imperatively, by promisyfying common dialog abstractions.

Reviewed By: jknoxville, nikoant

Differential Revision: D29790462

fbshipit-source-id: c092c15cf569ec353b9c1042f25cd67e6c76db01
2021-07-22 04:17:45 -07:00
Michel Weststrate
a78b6124d7 Add option to jest to run tests only locally, or on linux (#2609)
Summary:
Pull Request resolved: https://github.com/facebook/flipper/pull/2609

Make it possible to mark some tests to run on non-CI, or unix only

Reviewed By: nikoant

Differential Revision: D29813506

fbshipit-source-id: 140f8a4eaed5af3282ab9d139b46a52818be0934
2021-07-21 05:43:11 -07:00
Pascal Hartig
8124663c5c Disable filter data test
Summary:
This seems to be time-sensititve and breaks
occassionally on GitHub Actions.

Reviewed By: fabiomassimo

Differential Revision: D29760768

fbshipit-source-id: 12b496257d01d169c52f3a430175846f9a7eb227
2021-07-19 03:54:06 -07:00
Michel Weststrate
32d61886b8 Restore messages sidebar in FlipperMessages
Summary:
Restored sidebar in Flipper messages plugin, by using a Container, as DetailsSidebar is only valid in a PluginContainer context.

Also made tab rendering a bit more condensed while at it.

Reviewed By: timur-valiev

Differential Revision: D29734639

fbshipit-source-id: d3ec6f354e14194035e93daa014985721844416d
2021-07-16 08:01:56 -07:00
Michel Weststrate
d23ccfcd44 Restore copy on text
Summary:
Some folks were missing the copy as text ManagedTable used to have, so introduced both the options to either copy as text (visible columns or custom copy handler) or as JSON

Changelog: It is now possible to both copy as text or as JSON from data tables

Reviewed By: jknoxville

Differential Revision: D29712096

fbshipit-source-id: 27bd2e869a247bd0896ce2774c08651123fd531d
2021-07-16 03:43:36 -07:00