Commit Graph

7132 Commits

Author SHA1 Message Date
Andrey Goncharov
d1ed676a48 Remove dynamic dependencies from flipper-server
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
2022-05-13 03:19:47 -07:00
Kevin Strider
21dfeca756 setup.mdx (setup - Databases)
Summary: Add reference to Features page

Reviewed By: passy

Differential Revision: D36344280

fbshipit-source-id: ef6df2fd647f30bddf53d3c00ea0fa09e54583d6
2022-05-13 02:48:47 -07:00
Kevin Strider
aa172f2c77 setup.mdx (setup - Layout)
Summary: Restyle of page, including changes to spelling, grammar, links, and structure (where relevant).

Reviewed By: passy

Differential Revision: D36344857

fbshipit-source-id: f332a1e3422fb7e19d175a305d51b9b34e279e2a
2022-05-13 02:41:20 -07:00
Billy Ng
3804ccf898 Revert D36052198: Partially remove dependency on folly async
Differential Revision:
D36052198 (ade685c621)

Original commit changeset: 170d64a324a1

Original Phabricator Diff: D36052198 (ade685c621)

fbshipit-source-id: 69d2b18e70a6267667432d6ed9dc1c5bc545b417
2022-05-12 18:47:41 -07:00
Lorenzo Blasa
ade685c621 Partially remove dependency on folly async
Summary:
This change isolates the usage of folly async from Flipper. Is now self-contained in Flipper Folly schedulers.

Users of Flipper can decide not to use the types defined in that header and implement their own.

NOTE: changes are minimal, we are just replacing direct calls to folly event base with a scheduler which simply relays this on to folly.

Reviewed By: fabiomassimo

Differential Revision: D36052198

fbshipit-source-id: 170d64a324a1f1f100224e2622a59cbac3c8b642
2022-05-12 17:56:17 -07:00
Lorenzo Blasa
216c926ca5 Remove dead code in connection context store
Summary:
^
It was used by rsocket.

Reviewed By: fabiomassimo

Differential Revision: D36246038

fbshipit-source-id: 8bdc77d9e1ecf22402436e0102b5522ed36aff27
2022-05-12 09:16:13 -07:00
Lorenzo Blasa
63dde6e5cf Exceptions
Summary:
Flipper doesn really use library specific exceptions throughout, and that's OK.

Introducing SSLException as a replacement for the existing Folly Async Socket SSL exception.

This exception originally thrown by rsocket. Because we had rsocket and websockets using the same code, websockets were creating and throwing this same exception.

With rsocket gone, we can fully replace the usage of that exception. This is also needed as to decouple Flipper from folly async components.

Reviewed By: fabiomassimo

Differential Revision: D36245624

fbshipit-source-id: f5c97c5efe063280ce95be130008dee7f4e5d788
2022-05-12 09:16:13 -07:00
Kevin Strider
16a0a27672 setup.mdx (SetUp - Crash Reporter and Images)
Summary:
Restyle of pages, including changes to spelling, grammar, links, and structure (where relevant):

Crash Reporter
Images

Reviewed By: lblasa

Differential Revision: D36316967

fbshipit-source-id: aa91459f858e650cb7195436f94239e630373747
2022-05-12 07:54:19 -07:00
Lorenzo Blasa
afcc695edf Scheduler
Summary: Introduce a 'Scheduler' interface which will allow to decouple from the existing used Folly scheduler.

Reviewed By: fabiomassimo

Differential Revision: D36245587

fbshipit-source-id: 2f28bc1612e37ae53060a134d1c8059231fbc8ad
2022-05-12 07:37:11 -07:00
Maninder Singh
996132afbd Migrate 'Sandbox' plugin to Sandy API
Summary:
As part of an ongoing effort to migrate Flipper plugins to new Sandy arch, this diff aims to help by migrating the 'Sandbox' Plugin.

Most of the changes were straightforward, as in, could be done by following this excellent migration guide : https://www.internalfb.com/intern/staticdocs/flipper/docs/extending/sandy-migration/

Only thing which caused few issues was the "onready" behaviour. In the old pattern, the 'init' method used to get executed on every render. So it was ok to check for "isconnected" prop there.

Now the 'plugin' method is only executed once => and since the device might not be connected then, the "onReady" method (which is equivalent to old 'init' method) didn't work.

To fix this => the init method has been replace with "onConnect".

Reviewed By: lblasa

Differential Revision: D36284538

fbshipit-source-id: 4b2bf74c6d11625e4bd784fbb29fd270158a41ff
2022-05-12 06:27:22 -07:00
Kevin Strider
a51f0443b5 troubleshooting.mdx (SetUp - Troubleshooting)
Summary: A tiny change.  Gotta change it!!!!! :)

Reviewed By: lblasa

Differential Revision: D36343514

fbshipit-source-id: 363412e72eaa4186cf3e0f2590463ed1bd6ea384
2022-05-12 05:46:03 -07:00
Kevin Strider
96e0fffc25 supporting-layout.mdx (SetUp - Implementing Layout Inspection)
Summary: Restyle of the page, including changes to spelling, grammar, links, and structure (where relevant).

Reviewed By: lblasa

Differential Revision: D36315001

fbshipit-source-id: 6a628abb9328e1c9dbe38c98fd6a12f84563efd4
2022-05-12 03:21:01 -07:00
Kevin Strider
ab8bd29822 establishing-a-connection.mdx (SetUp - Secure Connection)
Summary: Restyle of the page, including changes to spelling, grammar, links, and structure (where relevant).

Reviewed By: lblasa

Differential Revision: D36313447

fbshipit-source-id: 99f94779caefd7f9f64121a40928c2be2d1f3ff4
2022-05-12 03:19:32 -07:00
Kevin Strider
0b16f3a031 NEW troubleshooting section (SetUp)
Summary: Restyle of Trobleshooting, which involved changes to sidebar.js and splitting up the previous troubleshooting page into five separate pages.

Reviewed By: lblasa

Differential Revision: D36282539

fbshipit-source-id: e60834e2b4d98b70b23bb11309c3438d85e4de0e
2022-05-11 08:58:34 -07:00
Kevin Strider
6cdda85ec9 new-clients.mdx (SetUp - Implementing a Flipper Client)
Summary: Restyle of the page, including changes to spelling, grammar, links, and structure (where relevant).

Reviewed By: nikoant

Differential Revision: D36312999

fbshipit-source-id: 737a1f8a9dc659c7351ac55e0ccc1d4083393aa5
2022-05-11 08:36:41 -07:00
Lorenzo Blasa
242d26e199 Rename and documentation for start dev server (attach)
Summary:
Same as with the previous diff.

The function doesn't really start a server. Instead it attaches the routing of messages from the existing server into FlipperServer.

Reviewed By: passy

Differential Revision: D36310703

fbshipit-source-id: 7ac9a742fb36c3806597382c9aadcf96f4770484
2022-05-11 06:56:20 -07:00
Lorenzo Blasa
582966d139 Attach instead of start dev server and documentation updates
Summary:
^

Instead of 'start' use 'attach' as it seems closer to what the function actually does.

Reviewed By: passy

Differential Revision: D36310846

fbshipit-source-id: db90efc6ec3207b1a5a38139a3ba01d2f7d2aebd
2022-05-11 06:56:20 -07:00
Lorenzo Blasa
453ec4bd83 Rename base server to just server
Summary:
^

BaseServer doesn't really have any meaning. So, change it to just Server as it really creates the Express app and HTTP server attached to it.

Reviewed By: passy

Differential Revision: D36310822

fbshipit-source-id: eee5a2a395ca726679c1c4756ed58d4bc6be3cb8
2022-05-11 06:56:20 -07:00
Lorenzo Blasa
2493de75ab Remove unused import
Summary: ^

Reviewed By: passy

Differential Revision: D36310809

fbshipit-source-id: c9faa2b685fc57c8a022cf497a843f3c137716d7
2022-05-11 06:56:20 -07:00
Lorenzo Blasa
1818b87166 Rename startWebServerDev to startDevServer
Summary:
Rename 'startWebServerDev' to just 'startDevServer'.

It isn't really starting a web server though, more like installing routings and middleware to the existing created server.

Reviewed By: passy

Differential Revision: D36310765

fbshipit-source-id: 0af772012525fd7ad19e2aa6fa73cb3e7dcf2bef
2022-05-11 06:56:20 -07:00
Lorenzo Blasa
ec667bc26d Log listening port
Summary: Slight changes to the URL and port logging.

Reviewed By: passy

Differential Revision: D36310796

fbshipit-source-id: 553b9ce932792c471f8e0e2c1a0c7d79897ad59d
2022-05-11 06:56:20 -07:00
Andrey Goncharov
ad76060614 Expose intern graphQL reuqests to plugins
Summary: Some intern plugins use it, an dit is currently missing in FlipperLib

Reviewed By: timur-valiev

Differential Revision: D36313032

fbshipit-source-id: 5ea8e250f1d0bc8831727abd883d953286a022d4
2022-05-11 06:48:05 -07:00
dependabot[bot]
d0ccf51af6 Bump mockito-core from 4.4.0 to 4.5.1 (#3657)
Summary:
Bumps [mockito-core](https://github.com/mockito/mockito) from 4.4.0 to 4.5.1.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/mockito/mockito/releases">mockito-core's releases</a>.</em></p>
<blockquote>
<h2>v4.5.1</h2>
<p><!-- raw HTML omitted --><!-- raw HTML omitted --><em>Changelog generated by <a href="https://github.com/shipkit/shipkit-changelog">Shipkit Changelog Gradle Plugin</a></em><!-- raw HTML omitted --><!-- raw HTML omitted --></p>
<h4>4.5.1</h4>
<ul>
<li>2022-04-21 - <a href="https://github.com/mockito/mockito/compare/v4.5.0...v4.5.1">2 commit(s)</a> by Jeremy Landis, dependabot[bot]</li>
<li>Fixes <a href="https://github-redirect.dependabot.com/mockito/mockito/issues/2623">https://github.com/facebook/flipper/issues/2623</a>: Use zulu distribution and java 11 for release GHA job [(<a href="https://github-redirect.dependabot.com/mockito/mockito/issues/2624">https://github.com/facebook/flipper/issues/2624</a>)](<a href="https://github-redirect.dependabot.com/mockito/mockito/pull/2624">mockito/mockito#2624</a>)</li>
<li>Missing errorprone module for 4.5.0 in central as release was done with jdk 8 [(<a href="https://github-redirect.dependabot.com/mockito/mockito/issues/2623">https://github.com/facebook/flipper/issues/2623</a>)](<a href="https://github-redirect.dependabot.com/mockito/mockito/issues/2623">mockito/mockito#2623</a>)</li>
<li>Bump kotlinVersion from 1.6.20 to 1.6.21 [(<a href="https://github-redirect.dependabot.com/mockito/mockito/issues/2622">https://github.com/facebook/flipper/issues/2622</a>)](<a href="https://github-redirect.dependabot.com/mockito/mockito/pull/2622">mockito/mockito#2622</a>)</li>
</ul>
<h2>Missing <code>net.bytebuddy.utility.GraalImageCode</code> exception</h2>
<p>If you encounter any issues with missing ByteBuddy classes, make sure you are using ByteBuddy 1.12 or higher.</p>
<h2>v4.5.0</h2>
<p><!-- raw HTML omitted --><!-- raw HTML omitted --><em>Changelog generated by <a href="https://github.com/shipkit/shipkit-changelog">Shipkit Changelog Gradle Plugin</a></em><!-- raw HTML omitted --><!-- raw HTML omitted --></p>
<h4>4.5.0</h4>
<ul>
<li>2022-04-19 - <a href="https://github.com/mockito/mockito/compare/v4.4.0...v4.5.0">15 commit(s)</a> by Andrei Silviu Dragnea, Rafael Winterhalter, Rick Ossendrijver, dependabot[bot]</li>
<li>Bump versions.errorprone from 2.13.0 to 2.13.1 [(<a href="https://github-redirect.dependabot.com/mockito/mockito/issues/2621">https://github.com/facebook/flipper/issues/2621</a>)](<a href="https://github-redirect.dependabot.com/mockito/mockito/pull/2621">mockito/mockito#2621</a>)</li>
<li>Bump versions.errorprone from 2.12.1 to 2.13.0 [(<a href="https://github-redirect.dependabot.com/mockito/mockito/issues/2619">https://github.com/facebook/flipper/issues/2619</a>)](<a href="https://github-redirect.dependabot.com/mockito/mockito/pull/2619">mockito/mockito#2619</a>)</li>
<li>Groovy inline [(<a href="https://github-redirect.dependabot.com/mockito/mockito/issues/2618">https://github.com/facebook/flipper/issues/2618</a>)](<a href="https://github-redirect.dependabot.com/mockito/mockito/pull/2618">mockito/mockito#2618</a>)</li>
<li>Bump actions/setup-java from 2 to 3 [(<a href="https://github-redirect.dependabot.com/mockito/mockito/issues/2615">https://github.com/facebook/flipper/issues/2615</a>)](<a href="https://github-redirect.dependabot.com/mockito/mockito/pull/2615">mockito/mockito#2615</a>)</li>
<li>Bump versions.bytebuddy from 1.12.8 to 1.12.9 [(<a href="https://github-redirect.dependabot.com/mockito/mockito/issues/2614">https://github.com/facebook/flipper/issues/2614</a>)](<a href="https://github-redirect.dependabot.com/mockito/mockito/pull/2614">mockito/mockito#2614</a>)</li>
<li>Support subclass mocks on Graal VM. [(<a href="https://github-redirect.dependabot.com/mockito/mockito/issues/2613">https://github.com/facebook/flipper/issues/2613</a>)](<a href="https://github-redirect.dependabot.com/mockito/mockito/pull/2613">mockito/mockito#2613</a>)</li>
<li>Bump com.diffplug.spotless from 6.4.1 to 6.4.2 [(<a href="https://github-redirect.dependabot.com/mockito/mockito/issues/2611">https://github.com/facebook/flipper/issues/2611</a>)](<a href="https://github-redirect.dependabot.com/mockito/mockito/pull/2611">mockito/mockito#2611</a>)</li>
<li>Bump kotlinx-coroutines-core from 1.6.0-native-mt to 1.6.1-native-mt [(<a href="https://github-redirect.dependabot.com/mockito/mockito/issues/2609">https://github.com/facebook/flipper/issues/2609</a>)](<a href="https://github-redirect.dependabot.com/mockito/mockito/pull/2609">mockito/mockito#2609</a>)</li>
<li>Bump versions.errorprone from 2.10.0 to 2.12.1 [(<a href="https://github-redirect.dependabot.com/mockito/mockito/issues/2608">https://github.com/facebook/flipper/issues/2608</a>)](<a href="https://github-redirect.dependabot.com/mockito/mockito/pull/2608">mockito/mockito#2608</a>)</li>
<li>Bump kotlinVersion from 1.6.10 to 1.6.20 [(<a href="https://github-redirect.dependabot.com/mockito/mockito/issues/2607">https://github.com/facebook/flipper/issues/2607</a>)](<a href="https://github-redirect.dependabot.com/mockito/mockito/pull/2607">mockito/mockito#2607</a>)</li>
<li>Bump com.diffplug.spotless from 6.4.0 to 6.4.1 [(<a href="https://github-redirect.dependabot.com/mockito/mockito/issues/2606">https://github.com/facebook/flipper/issues/2606</a>)](<a href="https://github-redirect.dependabot.com/mockito/mockito/pull/2606">mockito/mockito#2606</a>)</li>
<li>Bump com.diffplug.spotless from 6.3.0 to 6.4.0 [(<a href="https://github-redirect.dependabot.com/mockito/mockito/issues/2605">https://github.com/facebook/flipper/issues/2605</a>)](<a href="https://github-redirect.dependabot.com/mockito/mockito/pull/2605">mockito/mockito#2605</a>)</li>
<li>Bump org.eclipse.osgi from 3.17.100 to 3.17.200 [(<a href="https://github-redirect.dependabot.com/mockito/mockito/issues/2597">https://github.com/facebook/flipper/issues/2597</a>)](<a href="https://github-redirect.dependabot.com/mockito/mockito/pull/2597">mockito/mockito#2597</a>)</li>
<li>Deprecate ListUtil and Fields classes [(<a href="https://github-redirect.dependabot.com/mockito/mockito/issues/2593">https://github.com/facebook/flipper/issues/2593</a>)](<a href="https://github-redirect.dependabot.com/mockito/mockito/pull/2593">mockito/mockito#2593</a>)</li>
<li>mockito-errorprone seems not compatible with ErrorProne 2.11.0 [(<a href="https://github-redirect.dependabot.com/mockito/mockito/issues/2554">https://github.com/facebook/flipper/issues/2554</a>)](<a href="https://github-redirect.dependabot.com/mockito/mockito/issues/2554">mockito/mockito#2554</a>)</li>
<li>NullPointerException from Groovy metaclass methods when using mockito-inline (but not mockito-core) [(<a href="https://github-redirect.dependabot.com/mockito/mockito/issues/2522">https://github.com/facebook/flipper/issues/2522</a>)](<a href="https://github-redirect.dependabot.com/mockito/mockito/issues/2522">mockito/mockito#2522</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="737f0a3517"><code>737f0a3</code></a> Fixes <a href="https://github-redirect.dependabot.com/mockito/mockito/issues/2623">https://github.com/facebook/flipper/issues/2623</a>: Use zulu distribution and java 11 for release GHA job (<a href="https://github-redirect.dependabot.com/mockito/mockito/issues/2624">https://github.com/facebook/flipper/issues/2624</a>)</li>
<li><a href="f48d794ad1"><code>f48d794</code></a> Bump kotlinVersion from 1.6.20 to 1.6.21 (<a href="https://github-redirect.dependabot.com/mockito/mockito/issues/2622">https://github.com/facebook/flipper/issues/2622</a>)</li>
<li><a href="2c0bf94609"><code>2c0bf94</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/mockito/mockito/issues/2613">https://github.com/facebook/flipper/issues/2613</a> from mockito/graal-support</li>
<li><a href="d23dc0e57a"><code>d23dc0e</code></a> Support subclass mocks on Graal VM.</li>
<li><a href="8314824b2c"><code>8314824</code></a> Bump versions.errorprone from 2.13.0 to 2.13.1 (<a href="https://github-redirect.dependabot.com/mockito/mockito/issues/2621">https://github.com/facebook/flipper/issues/2621</a>)</li>
<li><a href="20f1627828"><code>20f1627</code></a> Bump kotlinx-coroutines-core from 1.6.0-native-mt to 1.6.1-native-mt (<a href="https://github-redirect.dependabot.com/mockito/mockito/issues/2609">https://github.com/facebook/flipper/issues/2609</a>)</li>
<li><a href="d539af2d7a"><code>d539af2</code></a> Fix mockito-inline for Groovy projects (<a href="https://github-redirect.dependabot.com/mockito/mockito/issues/2618">https://github.com/facebook/flipper/issues/2618</a>)</li>
<li><a href="2947e9daf7"><code>2947e9d</code></a> Bump versions.errorprone from 2.12.1 to 2.13.0 (<a href="https://github-redirect.dependabot.com/mockito/mockito/issues/2619">https://github.com/facebook/flipper/issues/2619</a>)</li>
<li><a href="09ba42033e"><code>09ba420</code></a> Bump actions/setup-java from 2 to 3 (<a href="https://github-redirect.dependabot.com/mockito/mockito/issues/2615">https://github.com/facebook/flipper/issues/2615</a>)</li>
<li><a href="98b5ff9f4d"><code>98b5ff9</code></a> Bump versions.bytebuddy from 1.12.8 to 1.12.9 (<a href="https://github-redirect.dependabot.com/mockito/mockito/issues/2614">https://github.com/facebook/flipper/issues/2614</a>)</li>
<li>Additional commits viewable in <a href="https://github.com/mockito/mockito/compare/v4.4.0...v4.5.1">compare view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=org.mockito:mockito-core&package-manager=gradle&previous-version=4.4.0&new-version=4.5.1)](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/3657

Reviewed By: lawrencelomax

Differential Revision: D36101609

Pulled By: passy

fbshipit-source-id: b14c363fbc46024edcb8d40b1a57f71fea1a06b4
2022-05-11 04:41:08 -07:00
Kevin Strider
cc76c43720 javascript.mdx (SetUp - Javascript)
Summary: Restyle of the page, including changes to spelling, grammar, links, and structure (where relevant).

Reviewed By: lblasa

Differential Revision: D36278376

fbshipit-source-id: d5e208558df8471d1c4783f393f82eb6d14a311f
2022-05-10 09:32:53 -07:00
Kevin Strider
40fa16aac1 ios-native.mdx (SetUp - Generic iOS Apps)
Summary: Restyle of the page, including changes to spelling, grammar, links, and structure (where relevant).

Reviewed By: lblasa

Differential Revision: D36275804

fbshipit-source-id: 4d6538b0c3123dfd88980b05bee3cbb2b9c3d4f2
2022-05-10 09:09:57 -07:00
Pascal Hartig
14b83ad050 Don't tear down server on disconnect
Summary: These safeguards were added based on a discussion in D35088208 (56e94394ca) but turned out to be counter-productive. Every time a client disconnects now, we're tearing down the socket and the server, allowing for no future connections.

Reviewed By: lblasa

Differential Revision: D36252605

fbshipit-source-id: c3b6f85dea4054505a47d24a72a4aac403371c0f
2022-05-10 08:45:57 -07:00
Andrey Goncharov
754afd0d2d Fix and re-apply "[flipper] Automatically set Android devices into the permissive mode"
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
2022-05-10 08:42:58 -07:00
Kevin Strider
56ea2fc782 react-native-ios.mdx (SetUp - Manual iOS Setup)
Summary: Restyle of the page, including changes to spelling, grammar, links, and structure (where relevant).

Reviewed By: lblasa

Differential Revision: D36276846

fbshipit-source-id: ae933df0270fff6ffba9e011003174a2111e0fae
2022-05-10 06:11:30 -07:00
Andrey Goncharov
7b31a1c6b6 Add headless-demo plugin and its usage example
Summary:
Next steps:
1. Refactor it TS for consistency
2. Remove it in favor of tic-tac-toe integration

Reviewed By: mweststrate

Differential Revision: D36102002

fbshipit-source-id: 7dc930f67bed636159a2ec433d7405ab6ee09f97
2022-05-10 05:13:24 -07:00
Andrey Goncharov
b4498f070f Add flipper-server-companion to flipper-server
Summary: Start flipper-server-companion whenever a client connects to flipper-server and sets `server_companion` query parameter in a connection URL to true

Reviewed By: mweststrate

Differential Revision: D36098169

fbshipit-source-id: eb953e7d680b30aef1340f059264112387264c05
2022-05-10 05:13:24 -07:00
Andrey Goncharov
a6d7f98cfd Bundle headless plugins
Summary: Current temporary limitations: all headless plugins are bundled with Flipper.

Reviewed By: antonk52

Differential Revision: D36098168

fbshipit-source-id: c58abe41776157258a5c39a80a5c1a33cf3f42c5
2022-05-10 05:13:24 -07:00
Andrey Goncharov
1f2f799772 Setup globals and initialize flipper-server-companion
Summary:
We want Flipper plugins to share imports with Flipper:
- They must share the same React otherwise different Reacts could conflict with each other
- Other common modules are shared to decrease the bundle size for each plugin.

`setGlobalObject` provides shared modules to Flipper Plugins by adding them to the global context (window or process or global this).

In the headless context, we do not have React and other DOM-related libraries, so we provide stubs instead.

Reviewed By: passy

Differential Revision: D36130161

fbshipit-source-id: d30c59a6c3ae02e7f9244bc0bb5790079b771107
2022-05-10 05:13:24 -07:00
Andrey Goncharov
c1dc1788a5 Initialize flipper lib and render host in headless mode
Reviewed By: mweststrate

Differential Revision: D36130158

fbshipit-source-id: cfdd22456bd4674e027dbcf83e67bf52cd757cf7
2022-05-10 05:13:24 -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
e218b79de2 Implement companion
Summary: Add Flipper Server Companion implementation. It extends the list of commands handled by Flipper Server by adding commands to interact with device or app Flipper plugins.

Reviewed By: mweststrate

Differential Revision: D36130159

fbshipit-source-id: 2eb6ba0fbae0fa850eadb7d417aa476240994bd5
2022-05-10 05:13:24 -07:00
Andrey Goncharov
ecb92c195c Implement HeadlessPluginInitializer
Reviewed By: lblasa

Differential Revision: D36130160

fbshipit-source-id: 6edff1c54bf5bf8cb85387bc2877788f947f97a6
2022-05-10 05:13:24 -07:00
Andrey Goncharov
deaf2359b1 Implement HeadlessClient
Reviewed By: lblasa

Differential Revision: D36130082

fbshipit-source-id: 00f9709d9a4f245063ae428521031afe74a521d6
2022-05-10 05:13:24 -07:00
Andrey Goncharov
5d346b4991 Add flipper-server-companion
Summary: Flipper Server Companion starts headless plugins and exposes them over the wire

Reviewed By: passy

Differential Revision: D36098170

fbshipit-source-id: 3b1b077d1fa4adca5c340ad4475b80b229586e1b
2022-05-10 05:13:24 -07:00
Andrey Goncharov
d795117910 Expose exports from the root of flipper-frontend-core
Summary: flipper-frontend-core shares logic between different desktop flipper clients: flipper browser ui, flipper electron, flipper headless

Reviewed By: passy

Differential Revision: D36129747

fbshipit-source-id: 598382ad3897701b307a16a42dc65d4c277b3e15
2022-05-10 05:13:24 -07:00
Andrey Goncharov
7cae3af507 Add plugin initializer to flipper-frontend-core
Summary: Extract plugin initialization

Reviewed By: mweststrate

Differential Revision: D36129748

fbshipit-source-id: db56e24388f7ed858d2173b67affa37de842a9b1
2022-05-10 05:13:24 -07:00
Andrey Goncharov
ea6c293726 Set global replacements in flipper-frontend-core
Summary: Extract setting global replacements from plugin initialization

Reviewed By: mweststrate

Differential Revision: D36129749

fbshipit-source-id: 6f5b3e27c1b798124b5f2772e9099899ce521d0a
2022-05-10 05:13:24 -07:00
Andrey Goncharov
658cd1544d Add AbstractClient to flipper-frontend-core
Summary: AbstractClient provides basic interaction with Flipper Server and manages plugins

Reviewed By: mweststrate

Differential Revision: D36129750

fbshipit-source-id: 056589666c45821d0af276e3a1572708e0a3b903
2022-05-10 05:13:24 -07:00
Andrey Goncharov
f0b5e7cadb Copy RenderHost, FlipperLib initialization, device definition to flipper-frontend-core
Reviewed By: passy

Differential Revision: D36129746

fbshipit-source-id: 15e32b9482d7fe3a24567d2e6bc087095b98226e
2022-05-10 05:13:24 -07:00
Andrey Goncharov
db49673d8a Setup flipper-frontend-core
Reviewed By: passy

Differential Revision: D36129751

fbshipit-source-id: 7e2a792de412a7ada8c58e0d3f0c6c2d18828996
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
2854e75e9c Support exporting public API from a plugin
Reviewed By: passy

Differential Revision: D36098167

fbshipit-source-id: 90182248d0541a1d8eff92a391a56422537c0595
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
3ac93d301a Remove optional in plugin init/deinit
Reviewed By: mweststrate

Differential Revision: D35965072

fbshipit-source-id: 0be6b538d371e41b438263a6a4161b079861b293
2022-05-10 05:13:24 -07:00
Michel Weststrate
ee013e29fc Make sure public prettier plugin is recommended when developing on Flipper
Summary: On a fresh VS Code install, only the internal Prettier plugin is available, but not the open source version, which we need as the internal one doesn't work on Flipper (probably due to TypeScript?)

Reviewed By: lblasa

Differential Revision: D36275616

fbshipit-source-id: bccbbcd372f7a7ecca46eb83f5515543e611235c
2022-05-10 04:13:22 -07:00