Summary:
This diff adds `types` fields on the compiler config for every project. This way we can make sure that for example node types and packages are not available in flipper-ui-core. Without an explicit types field, all types would be shared between all packages, and implicitly included into the compilation of everything. For the same reason `types/index.d.ts` has been removed, we want to be intentional on which types are being used in which package.
This diff does most of the work, the next diff will fine tune the globals, and do some further cleanup.
As an alternative solution I first tried a `nohoist: **/node_modules/types/**` and make sure every package list explicitly the types used in package json, which works but is much more error prone, as for example two different react types versions in two packages will cause the most unreadable compiler error due to the types not being shared and not literally the same.
Reviewed By: lawrencelomax
Differential Revision: D33124441
fbshipit-source-id: c2b9d768f845ac28005d8331ef5fa1066c7e4cd7
Summary:
This diff removes most deps from the root package.json, which now only contains electron and shared build / test infra structure: lint, prettier, jest, typescript.
This makes it possible to control much better which packages are used where, as all sub packages now have their deps explicitly in their package.json instead of incidentally shared. This allows for example to disable DOM types for all packages by default (flipper-plugin, ui(-core) and app still request it), and in the next diff I hope to add to this that nodeJS types are no longer shared either, so that UI oriented packages will generate compile errors when using Node built-ins
This diff removes most deps that were currently unused, and dedupes a bunch of other ones, so the build should probably be a bit smaller now as well:
{F686704253}
{F686704295}
Reviewed By: antonk52
Differential Revision: D33062859
fbshipit-source-id: 5afaa4f2103d055188382a3370c1fffa295a298a
Summary:
Changelog: Register shortcuts only for Flipper application instead of globally. Fixes https://github.com/facebook/flipper/issues/3090
As reported, during decapitation we accidentally started registering shortcuts globally, rather per app as it used to be in the menu's. This diff fixes that and also makes sure shortcuts are supported in the browser version of flipper
Reviewed By: lawrencelomax
Differential Revision: D33158445
fbshipit-source-id: 8371e5b96e772152eeb93ba990e1f5edb9e67085
Summary: Since no plugin directly uses adbkit or crc32 anymore, we removed them from the globals. They wouldn't work in the browser anyway
Reviewed By: aigoncharov
Differential Revision: D33019084
fbshipit-source-id: 66ab0756399fdb401c63f5e8271bdd62cb79ab4a
Summary: This diff stubs all node modules when running in the browser, so that, albeit with a lot of errors and without plugins, the UI loads in a browser. To be continued in the rest of this diff
Reviewed By: antonk52
Differential Revision: D32665705
fbshipit-source-id: 4632e241f59c5b9712a41d01a26878afb01f69b5
Summary: This diff replaces the WebView we use to render plugin docs with an Iframe.
Reviewed By: nikoant, aigoncharov
Differential Revision: D32797111
fbshipit-source-id: 8ea0e0bd1cbea33dd7e389600951c020a88e4267
Summary: Added a command to let a file be opened by the OS, and some other small bits and pieces to make Flipper browser compatible.
Reviewed By: lblasa
Differential Revision: D32721748
fbshipit-source-id: a4ad1c2f662f4651ddf6c20c57e5af1e123914a8
Summary: Per title. Two new server API's: get-healthchecks, and run-healtcheck. Types have all been moved to flipper-common, so that they can be used by doctor, server-core and ui-core packages. Since it were quite some, moved them into a FlipperDoctor namespace.
Reviewed By: nikoant
Differential Revision: D32720510
fbshipit-source-id: 37aa35cde6ebd58479cf0dffec5b7b2da6d22198
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: '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:
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:
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:
emotion/cache started generating nonsense warnings about SSR again when running unit tests. This is because atm emotion/cache is 3(!) times in our dep tree, and the wrong one got patched. Tried to dedupe that, but it seems inevitable:
- emotion/react requires v. 11.6.0 of it
- emotion/css requires v. 11.5.0 because a newer version of that package hasn't been released
- console-feed still uses emotion 10.
So instead, just added an other patch
Reviewed By: passy
Differential Revision: D32557413
fbshipit-source-id: 8a61a8065d21123453b3345b25ff87a9865094ed
Summary:
Bumps [redux](https://github.com/reduxjs/redux) from 4.1.1 to 4.1.2.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/reduxjs/redux/releases">redux's releases</a>.</em></p>
<blockquote>
<h2>v4.1.2</h2>
<p>This release fixes a small specific TS types issue where state types that had a nested <code>unknown</code> field inside would cause compilation failures when used as the <code>preloadedState</code> argument.</p>
<h2>What's Changed</h2>
<ul>
<li>Fix preloaded state type by <a href="https://github.com/phryneas"><code>@phryneas</code></a> in <a href="https://github-redirect.dependabot.com/reduxjs/redux/pull/4078">reduxjs/redux#4078</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a href="https://github.com/reduxjs/redux/compare/v4.1.1...v4.1.2">https://github.com/reduxjs/redux/compare/v4.1.1...v4.1.2</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="795a11c823"><code>795a11c</code></a> 4.1.2</li>
<li><a href="a03a79bc9e"><code>a03a79b</code></a> Merge commit '4d0730e9df2b23e88a588ba7f82f45ee7a642817' into 4.x</li>
<li><a href="ef5e57ea62"><code>ef5e57e</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/reduxjs/redux/issues/4078">#4078</a> from phryneas/fix-preloadedState</li>
<li><a href="cf2f265574"><code>cf2f265</code></a> Apply kindOf fix from <a href="https://github-redirect.dependabot.com/reduxjs/redux/issues/4160">#4160</a></li>
<li><a href="9ab0a70012"><code>9ab0a70</code></a> Update test/typescript/store.ts</li>
<li><a href="83af794b06"><code>83af794</code></a> small fix to PreloadedState</li>
<li>See full diff in <a href="https://github.com/reduxjs/redux/compare/v4.1.1...v4.1.2">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/3057
Reviewed By: mweststrate
Differential Revision: D32529287
Pulled By: passy
fbshipit-source-id: 5fe0c0c4e9b71f912b0e2d024465b0bdca9af303
Summary: Preempting dependabot by bumping a few patch and minor releases.
Reviewed By: timur-valiev
Differential Revision: D32434931
fbshipit-source-id: 77a3ec760f08262a118e12318d7601e031730a9a
Summary:
This diff moves all UI code from app/src to app/flipper-ui-core. That is now slightly too much (e.g. node deps are not removed yet), but from here it should be easier to move things out again, as I don't want this diff to be open for too long to avoid too much merge conflicts.
* But at least flipper-ui-core is Electron free :)
* Killed all cross module imports as well, as they where now even more in the way
* Some unit test needed some changes, most not too big (but emotion hashes got renumbered in the snapshots, feel free to ignore that)
* Found some files that were actually meaningless (tsconfig in plugins, WatchTools files, that start generating compile errors, removed those
Follow up work:
* make flipper-ui-core configurable, and wire up flipper-server-core in Electron instead of here
* remove node deps (aigoncharov)
* figure out correct place to load GKs, plugins, make intern requests etc., and move to the correct module
* clean up deps
Reviewed By: aigoncharov
Differential Revision: D32427722
fbshipit-source-id: 14fe92e1ceb15b9dcf7bece367c8ab92df927a70
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