Summary: This diff makes most stuff that is read from the `os` package, and version info etc available from the `serverConfig` object, so that flipper-ui-core no longer needs the `os` package.
Reviewed By: passy
Differential Revision: D32694848
fbshipit-source-id: 93af1e95d898da9aaf351a6970b5a7652ee835c8
Summary: This diff makes plugin loading async, which we'd need in a browser env (either because we'd use `import()` or we need to fetch the source and than eval it), and deals with all the fallout of that
Reviewed By: timur-valiev
Differential Revision: D32669995
fbshipit-source-id: 73babf38a6757c451b8200c3b320409f127b8b5b
Summary:
Follow up of D32665064, this diff moves all plugin management logic from flipper-ui to flipper-server. Things like downloading, installing, querying new plugins.
Loading plugins is handled separately in the next diff.
Reviewed By: nikoant
Differential Revision: D32666537
fbshipit-source-id: 9786b82987f00180bb26200e38735b334dc4d5c3
Summary:
This diff moves RenderHost initialisation to jest, which is thereby treated as just another 'Host' like flipper-ui, the electron app etc. A benefit is that it provides a mocked flipperServer by default that can be used to mock or intercept requests. See LaunchEmulator.spec as example.
Also made the jest setup scripts strongly typed by converting them to TS.
This change allows the test stub configuration, which was OS dependent, out of flipper-ui-core.
Reviewed By: nikoant
Differential Revision: D32668632
fbshipit-source-id: fac0c09812b000fd7d1acb75010c35573087c99f
Summary: Moved all types related to plugin descriptions from plugin-lib (which handles downloads and such) to flipper-common. The goal of that is to remove all plugin-lib usage from ui-core to server-core, so that the UI itself doesn't do any file operations anymore related to plugins. That will be done in next diffs, this just moves types but no code.
Reviewed By: nikoant, aigoncharov
Differential Revision: D32665064
fbshipit-source-id: 86d908e7264569b0229b09290a891171876c8e00
Summary:
perf_hooks is no longer needed as these APIs are widely available in both browser and electron.
Still needed in unit tests, as they run from Node
Reviewed By: lblasa, aigoncharov
Differential Revision: D32648253
fbshipit-source-id: 5718ea99b57f96f6858311fd0815ad18c476c99e
Summary:
Notice during debugging that devices keep unregistering. Doesn't lead to any practical issues, but still incorrect.
Also noticed that the server didn't restart when changing flipper-server-core, or recompile its deps, so fixed that as well.
Reviewed By: passy
Differential Revision: D32644276
fbshipit-source-id: 5384a30c9d293acda04b6e6f940268ddcd65a870
Summary:
This diff sets up the socket connection between flipper-browser and flipper-server, and verifies that the initial UI initialisation work (e.g. `get-config` command works). The initial RenderHost is initialised as well based on the config and browser APIs.
Note that flipper-ui-core itself isn't started yet, as that has still a plethora of node imports, so Metro will correctly refuse to bundle
Not in this diff
* remove Node usage from flipper-ui-core
* implement all RenderHost APIs
Reviewed By: aigoncharov
Differential Revision: D32644074
fbshipit-source-id: 2c8065caf0191771a3867b69a431ca50eeb7a5a3
Summary: 'events' doesn't exist in the browser, so picked a popular package with the same API
Reviewed By: lblasa, aigoncharov
Differential Revision: D32643057
fbshipit-source-id: 91309e53e16f3279048aa976cdb098eaa4a7d7db
Summary: The previous started up a dev / web server for bundling in flipper-server, this diff starts the flipper server itself, so that we can connect the client to it (done in next diffs)
Reviewed By: passy, aigoncharov
Differential Revision: D32627390
fbshipit-source-id: b48de20f076e1e13842368d16a090708d533b69e
Summary:
This sets up the metro bundler for flipper-server, to be able to serve the front end.
Note that this is a setup that is only relevant for development purposes
Done in this diff:
* setup metro
* setup fast refresh
* setup nodemon to be able to refresh on server changes
Not done in this diff
* Setup FlipperServerImpl in the flipper-server
* Load flipper-ui-core in flipper-ui-browser
* Load plugins
* Support options, env vars etc etc
* Make flipper-server stand alone (it is largely self contained, but still requires some static resources like theming)
Reviewed By: passy, aigoncharov
Differential Revision: D32626137
fbshipit-source-id: 47f580356ddf0993392d3b583082b187661727e9
Summary:
Watch folders weren't updated for cross plugin/flipper boundaries that have recently been removed
Fix changes in several source folders not being picked up when fast refresh wasn't enabled
Reviewed By: passy, aigoncharov
Differential Revision: D32626139
fbshipit-source-id: 2c830ec8154ff859ce1e3ee101e5963162d2e0a2
Summary: This diff moves keychain storage to the server. Figured to leave request logic itself in the UI-core, as basically all use cases happen there, except for streaming download for mobile build plugin, so sending the requests from the backend doesn't really seem to add value, unless we run into some CORS issues later.
Reviewed By: passy
Differential Revision: D32596715
fbshipit-source-id: f5ab9d794f91a6eb8a8dc07ae723bf2890726771
Summary:
This diff moves a lot of stuff from the client to the server. This diff is fairly large, as a lot of concept closely relate, although some things have split off to the earlier diffs in the stack, or are still to follow (like making intern requests).
This diff primarily moves reading and storing settings and GKs from client to server (both flipper and launcher settings). This means that settings are no longer persisted by Redux (which only exists on client). Most other changes are fallout from that. For now settings are just one big object, although we might need to separate settings that are only make sense in an Electron context. For example launcher settings.
Reviewed By: passy, aigoncharov
Differential Revision: D32498649
fbshipit-source-id: d842faf7a7f03774b621c7656e53a9127afc6192
Summary: This diff makes sure flipper-ui-core no longer depends on flipper-server-core. Currently server config is still transferred from UI to server, which doesn't really make sense in future scenarios where server might start before client, but will address that separately
Reviewed By: timur-valiev, aigoncharov
Differential Revision: D32462835
fbshipit-source-id: 498a944256ba1aabbf963b896953e64d11e27214
Summary:
Removed loadGKs and loadDistilleryGKs from the `flipper` API, as it leaked implementation details of GK that didn't work well with decapitation later in this diff, and refactored it to using `getFlipperLib().GK`.
After that discovered that those APIs are actuallly only used by nt-shared's performGKcheck, which was already removed from all usages in D27736036, so just removed the code altogether. But left loading distillery GKs in place, since that is good infra structure to provide anyway(?), although we don't have active use cases atm
Reviewed By: jknoxville
Differential Revision: D32529600
fbshipit-source-id: a03fb14ada21018d329eea78a59f1b20610b2fd3
Summary: Uses the new statuses emitted by DevTools in https://github.com/facebook/react/pull/22848 to better handle the connection state when connecting to DevTools from Flipper.
Reviewed By: bvaughn
Differential Revision: D32891240
fbshipit-source-id: 142d9996e05b5113e6dca28074c461d5a5acd38f
Summary:
This commit makes it so when we load DevTools from within Flipper we log it as a Flipper load and not a regular standalone app load.
Note that the logging only applies internally.
Reviewed By: bvaughn
Differential Revision: D32884616
fbshipit-source-id: 90d0962bac9c1abdde36a70fd361251d7e607b57
Summary:
Pull Request resolved: https://github.com/facebook/flipper/pull/3139
This commit adds new UI in the top level toolbar to allow internal FB users to switch between the internal build of devtools and the OSS one.
## Scenarios
**Internal (when `client.isFB`)**
- DevTools version will default to the internal version, and will render a `Select` component with option to switch to the OSS version.
- If a global install of DevTools is present, the selection menu will also offer the option to switch to the global DevTools version.
**External (when `!client.isFB`)**
Will preserve previous behavior:
- Uses the OSS version by default, and doesn't provide option to switch to internal version.
- If a global installation is present, will render a `Switch` component that allows switching between OSS and global installation.
### Implementation
This commit refactors some parts of the DevTools plugin to provide a bit more clarity in the loading sequence by renaming and modifying some of the messaging, and fixing lint warnings.
A change introduced here is that when switching or loading devtools, when we attempt to reload the device via Metro, don't immediately show a "Retry" button, since at that point nothing has gone wrong, and the Retry button will only occur if the Metro reload doesn't occur after a few seconds.
In a future commit, this [PR in Devtools](https://github.com/facebook/react/pull/22848) will allow us to clear any loading messages once DevTools has successfully connected.
Reviewed By: lunaruan, mweststrate
Differential Revision: D32773200
fbshipit-source-id: aa15ffecba7b2b2ea74e109e9f16334d47bf5868
Summary:
This commit update the React DevTools Flipper plugin to use the internal build of `react-devtools-core/standalone`.
The internal build of `react-devtools-core/standalone` is generated by the new sync script: `js1 upgrade react-devtools-core`, which places the build under `xplat/sonar/desktop/plugins/public/reactdevtools/fb`.
As a follow up, we can add a dropdown to allow users to select which version of React DevTools they'd like to use.
Reviewed By: mweststrate
Differential Revision: D31904288
fbshipit-source-id: ce0880284bd7f9ccaa6258a7c2956f20771e81a9
Summary: This build was created from git revision 90e5d3638844414e1b9df0fe66c3fc46b211d210.
Reviewed By: lunaruan
Differential Revision: D31866508
fbshipit-source-id: 104cc38647f9a43d1cd2862c0ae412ecabe05bdf
Summary:
Pull Request resolved: https://github.com/facebook/flipper/pull/3125
Better stream creation and disposal.
A report was generated with the following error:
StrictMode policy violation: android.os.strictmode.LeakedClosableViolation: A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.
Changelog: Close input stream after use which was causing strict mode policy violation crashes and possibly leaking resources.
Reviewed By: passy
Differential Revision: D32830690
fbshipit-source-id: de3ffaf1b600590c4060a381fae66e73e08745cb
Summary:
When a client disconnects while it's still initialising, we get a critical error.
But this is expected to happen now and again, so adding a specific error for it, and handling it accordingly.
It doesn't change the control flow, just the logging.
Reviewed By: nikoant
Differential Revision: D32794062
fbshipit-source-id: cf27fb9c345aa6369d338838a46e75a6b7afde41
Summary:
{F684271717}
^
This is causing the error being reported quite a lot. The identifier doesn't provide much information to the person analysing the error. Only ever useful if debugging.
Reviewed By: antonk52, mweststrate
Differential Revision: D32828150
fbshipit-source-id: f29fbf6bfe389fec6ef888fc01be6c058193709d
Summary:
Bit off an odd one but according to the crash report in T107008330,
the screenshot can sometimes be not a real buffer. This may not actually
fix things but should give us some more insights into what's up.
Changelog: Better handling of screenshot taking in navigation
Reviewed By: mweststrate
Differential Revision: D32797863
fbshipit-source-id: 6d16ccb82fb8258591f9bc5f79c00811b18b9c51
Summary:
Currently, we register global error handlers inside of ErrorReporter. To make these global error visible to the user we pipe them to `console.error`. All console methods are monkey-patched in our Logger. Logger uses ErrorReporter to report errors to LogView. It leads to duplicate errors in LogView.
In this diff, we extract startGlobalErrorHandling which should help us avoid duplication.
Reviewed By: passy
Differential Revision: D32759909
fbshipit-source-id: 6376e193c0ba6f0b46aaccc139ecf5066a04da11
Summary:
1. Add `path` replacement
1. Remove Node's path for all plugins but MobileBuildsPluginContainer (it is probably going to be moved to the server)
Reviewed By: mweststrate
Differential Revision: D32766327
fbshipit-source-id: e636f273842506e752b97cf1b28ce7ac51ce9a12
Summary: Starting just with Android On Demand. iOS will follow shortly.
Reviewed By: antonk52
Differential Revision: D32724229
fbshipit-source-id: b4276aae2a7349815d691b854adcfc531b702ae7
Summary: The errors files for this aren't actionable and cannot be deduplicated because of the information included. Better to treat this as a warning.
Reviewed By: nikoant
Differential Revision: D32758656
fbshipit-source-id: 5255d694b8783b7bb49f981933741063d012df98
Summary: We can't action tasks based on this report, so better to raise it as a warning.
Reviewed By: nikoant
Differential Revision: D32758850
fbshipit-source-id: 2e8ff984f40d2d0431db192e8f2d983d52b77ccd
Summary: By tracking when clients connect and disconnect, we will be able to answer how long does it take for clients to connect
Reviewed By: passy
Differential Revision: D32697702
fbshipit-source-id: b01893f500c97b08eb4434733058f58433d7f4ef
Summary:
Bumps [reselect](https://github.com/reduxjs/reselect) from 4.0.0 to 4.1.5.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/reduxjs/reselect/releases">reselect's releases</a>.</em></p>
<blockquote>
<h2>v4.1.5</h2>
<p>This release updates the TS types to correctly infer selector parameters when input selectors have <code>undefined</code> or <code>null</code> as a parameter type or have optional parameters, and exports the <code>CreateSelectorFunction</code> type to fix uses of <code>createStructuredSelector</code>.</p>
<p>(The types fixes feel like playing whack-a-mole, but they keep getting better!</p>
<h2>What's Changed</h2>
<ul>
<li>Fix intersection of parameters that are undefined by <a href="https://github.com/markerikson"><code>@markerikson</code></a> in <a href="https://github-redirect.dependabot.com/reduxjs/reselect/pull/556">reduxjs/reselect#556</a></li>
<li>Export CreateSelectorFunction to fix createStructuredSelector usage by <a href="https://github.com/markerikson"><code>@markerikson</code></a> in <a href="https://github-redirect.dependabot.com/reduxjs/reselect/pull/557">reduxjs/reselect#557</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a href="https://github.com/reduxjs/reselect/compare/v4.1.4...v4.1.5">https://github.com/reduxjs/reselect/compare/v4.1.4...v4.1.5</a></p>
<h2>v4.1.4</h2>
<p>This release has (you guessed it) more fixes to the TS types: a change to parameter merging that fixes breakage with selectors and RTK Query's API state, a simplification of the <code>OutputSelectorFields</code> type to improve selector variable readability, another update to parameter merging to flag nested <code>never</code> fields as compile errors, and a fix to <code>createStructuredSelector</code> parameters to resolve a lib compilation problem.</p>
<h2>Changelog</h2>
<h3>More TS Fixes</h3>
<p>The parameter merging fixes in 4.1.3 tried to "unwrap/expand" the parameter types to make them more readable, such as showing intersected objects as <code>{a, b, c}</code> instead of <code>{a} & {b} & {c}</code>. This was done with a recursive expansion type. That turned out to break with the complex state types used by RTK Query. We've updated the type expansion to only be a single level instead, which fixes the compilation issue.</p>
<p>The <code>OutputSelectorFields</code> type previously took two generics: the <code>Combiner</code> function, and a <code>Result</code> type. This led to extra values being shown in hover previews for selectors. By inferring <code>Result = ReturnType<Combiner></code>, we were able to drop the second generic and cut down on the amount of types shown in previews.</p>
<p>A user noted that intersected objects with top-level incompatible fields (like <code>{a: string} & {a: number}</code>) resulted in empty objects, but no compile error. We've updated the parameter merging to flag those as <code>never</code> and catch the problem at compile time. Deeper nested incompatible fields should already be caught by TS.</p>
<p>The previous fix to <code>createStructuredSelector</code> missed a step in the spreading process, which has now been fixed.</p>
<h2>What's Changed</h2>
<ul>
<li>Switch package management to Yarn v3 by <a href="https://github.com/markerikson"><code>@markerikson</code></a> in <a href="https://github-redirect.dependabot.com/reduxjs/reselect/pull/551">reduxjs/reselect#551</a></li>
<li>Fix parameter expansion and improve OutputSelector readability by <a href="https://github.com/markerikson"><code>@markerikson</code></a> in <a href="https://github-redirect.dependabot.com/reduxjs/reselect/pull/552">reduxjs/reselect#552</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a href="https://github.com/reduxjs/reselect/compare/v4.1.3...v4.1.4">https://github.com/reduxjs/reselect/compare/v4.1.3...v4.1.4</a></p>
<h2>v4.1.3</h2>
<p>This release rewrites the TS type inference of input selector parameters for correctness, fixes inference of <code>createStructuredSelector</code> inputs, and fixes an issue with the <code>OutputSelectorFields</code> type not being exported.</p>
<h2>Changelog</h2>
<h3>Input Selector Parameter Inference Improvements</h3>
<p>Reselect's types have always been extremely tricky, because it involves passing multiple input selectors with potentially heterogeneous, and then nested function composition of multiple selectors. Additionally, the input selectors can be passed as individual arguments or a single array of input selectors.</p>
<p>The <a href="https://github.com/reduxjs/reselect/blob/v4.0.0/src/index.d.ts">4.0.0 typedefs</a> dealt with this by hand-writing dozens of overloads, which was absolutely impossible to maintain.</p>
<p>In 4.1, we took advantage of TS's improved abilities to infer array/tuple types to consolidate the typedefs.</p>
<p>One of the issues that happened as a result was that arguments at the same input parameter index were being "unioned" together, rather than "intersectioned". For example, in this complex selector:</p>
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/reduxjs/reselect/blob/master/CHANGELOG.md">reselect's changelog</a>.</em></p>
<blockquote>
<h1>Change log</h1>
<p>All notable changes to this project will be documented in this file.
This project adheres to <a href="http://semver.org/">Semantic Versioning</a>.</p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="2f892bb92e"><code>2f892bb</code></a> 4.1.5</li>
<li><a href="901dab0a56"><code>901dab0</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/reduxjs/reselect/issues/557">https://github.com/facebook/flipper/issues/557</a> from reduxjs/feature/csf-export</li>
<li><a href="9f5998e727"><code>9f5998e</code></a> Include 4.5 in the TS test matrix</li>
<li><a href="ad1eb084af"><code>ad1eb08</code></a> Export CreateSelectorFunction to fix createStructuredSelector usage</li>
<li><a href="71e6cb6bce"><code>71e6cb6</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/reduxjs/reselect/issues/556">https://github.com/facebook/flipper/issues/556</a> from reduxjs/feature/param-undefined-intersections</li>
<li><a href="8b920d58ab"><code>8b920d5</code></a> Remove leftover TODO typetest comments and fix Selector usage</li>
<li><a href="0f4e2d249d"><code>0f4e2d2</code></a> Update param inference to handle undefined and unions correctly</li>
<li><a href="d7131c0fb3"><code>d7131c0</code></a> 4.1.4</li>
<li><a href="42b63810fb"><code>42b6381</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/reduxjs/reselect/issues/552">https://github.com/facebook/flipper/issues/552</a> from reduxjs/feature/413-ts-checks</li>
<li><a href="7ed20fc036"><code>7ed20fc</code></a> Fix issues with createStructuredSelector parameters</li>
<li>Additional commits viewable in <a href="https://github.com/reduxjs/reselect/compare/v4.0.0...v4.1.5">compare view</a></li>
</ul>
</details>
<details>
<summary>Maintainer changes</summary>
<p>This version was pushed to npm by <a href="https://www.npmjs.com/~acemarke">acemarke</a>, a new releaser for reselect since your current version.</p>
</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/3111
Reviewed By: jknoxville
Differential Revision: D32698523
Pulled By: passy
fbshipit-source-id: 0272e28e796e04ed5df604d63307bacaaab35229
Summary:
We generate two types of pages for plugin docs currently:
1) Full page used on Flipper docs website
2) Page without nav/header/footer which is used to embed docs into Flipper
The problem is that both of them now indexed and can both appear in search result.
See e.g. search results for keyword "android" which contains a lot of such embedded pages just because they have their first sections with name "Android" and because of that indexed to the top although shouldn't appear in search results at all.
{F683602640}
This diff disables indexing for embedded pages as it should be only possible to open them in Flipper.
Reviewed By: passy
Differential Revision: D32727589
fbshipit-source-id: 2068b8d39f19004a449098652c4c0cc2c7272d40
Summary:
By default docusaurus generates pages and routes for every mdx file it finds under the root dir. So even for the mdx files which are only used as includes and don't even have headers, page is still created, then index and often looks very weird, e.g. title is the same as file name etc. See e.g. this one: https://www.internalfb.com/intern/staticdocs/flipper/docs/fb/portal-troubleshooting/
I went through Flipper docs and renamed all mdx files which are only used as includes to prepend them with underscore. Everything which name is starting with underscore, or which is inside a folder which name is starting with underscore is considered private by docusaurus and skipped.
Reviewed By: passy
Differential Revision: D32722547
fbshipit-source-id: 0524d4dd56960714fbdd2b01ad8383cd16de4948
Summary:
Bumps [constraintlayout](https://github.com/androidx/constraintlayout) from 2.1.1 to 2.1.2.
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a href="https://github.com/androidx/constraintlayout/commits">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/3076
Reviewed By: jknoxville
Differential Revision: D32698537
Pulled By: passy
fbshipit-source-id: 4c9bbbdb3cbc03bfca3ecabef3f81d1300e8b269