Commit Graph

361 Commits

Author SHA1 Message Date
Andrey Goncharov
3491926d17 Support importing multiple files and encoding
Summary:
1. Support importing multiple files
2. Support file encoding

Reviewed By: mweststrate

Differential Revision: D32540132

fbshipit-source-id: 7c2a96ac585f58d01457cb487527940e333da615
2021-11-26 08:30:13 -08:00
John Knox
2d948fe4f4 Dedupe server error notifications
Summary:
These notifications, when emit, don't get deduped, so if connection timeouts keep happening, like in [this](https://fb.workplace.com/groups/flippersupport/posts/1257144721432850), then you get tons of notifications.

This dedupes them if all the info is the same.

Reviewed By: mweststrate

Differential Revision: D32560073

fbshipit-source-id: beb4d67e2a97841bb91add7847157176dee4a5f4
2021-11-19 06:56:47 -08:00
Michel Weststrate
52fca0859e Fix debug output in unit tests
Summary:
unit tests for deeplinks were logging full device / client objects instances, changed it to log the meta data only (description resp. query).

Since Jest buffers console output, this might even help test stability

Maybe console.debug shouldn't even be printed in Jest? See next diff

Reviewed By: passy

Differential Revision: D32557412

fbshipit-source-id: ff7fbf0cb5d8684d5333a62dac02fd5a59a6e358
2021-11-19 04:01:02 -08:00
Michel Weststrate
35c482ac92 Fix emotion cache output garbage in unit tests
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
2021-11-19 04:01:02 -08:00
John Knox
8af1e816bc Fix client-switching bug
Summary:
When a new client connects, we dispatch the NEW_CLIENT event.

The reducer of this event contains logic for determining if flipper should switch to display the newly connected client or not, and if so, it will dispatch SELECT_CLIENT.

For that reason, flipperServer always dispatching SELECT_CLIENT bypasses the "should switch?" logic and always switches whenever a new client connects. This is disruptive to working and not desired.

Removing this dispatch so that we rely on the NEW_CLIENT reducer to decide.

Bug report: https://fb.workplace.com/groups/flippersupport/posts/1255964631550859

Reviewed By: aigoncharov

Differential Revision: D32532942

fbshipit-source-id: 0ff2693745e37378362254053ae5fd6fc0d11de2
2021-11-19 03:36:51 -08:00
Andrey Goncharov
a279b9bc43 Remove fs.readFile from some plugins
Summary:
1. Remove fs.readFile from some plugins
2. Add "importFile" to FlipperLib and RenderHost

See D32492149 for context

Followups:

1. Decapitate Stella's sendToPhone
2. Decapitate crash reporter
3. Figure out how to approach navigation
4. Figure out how to approach FileSelector

Reviewed By: mweststrate

Differential Revision: D32496775

fbshipit-source-id: e150aa56a2c2c1eb12a4c03c801f76cd76485a9d
2021-11-18 09:15:30 -08:00
Andrey Goncharov
2c7bc0a952 Remove fs.write from plugins
Summary:
1. Remove "fs.writeFile" from plugins
2. Remove "showSaveDialog" from "FlipperLib"
3. Add "exportFile" to "FlipperLib" and "RenderHost"

As we are going to use Flipper in a browser as well, instead of providing low-level abstraction like "showSaveDialog", we should provide more high-level ones like "exportFile". In browsers it does not make too much sense to expose "showSaveDialog" as there is not way to use the returned file path to write to it.
In the end, "exportFile" is going to trigger a file download for browsers and show the save dialog and write to the returned file path for Electron.

Reviewed By: mweststrate

Differential Revision: D32492149

fbshipit-source-id: 0673119bdb7670a5872f5982c7d82dfc44eb7906
2021-11-18 09:15:30 -08:00
dependabot[bot]
32a58f0fec Bump redux from 4.1.1 to 4.1.2 in /desktop (#3057)
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 />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=redux&package-manager=npm_and_yarn&previous-version=4.1.1&new-version=4.1.2)](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
2021-11-18 06:22:40 -08:00
Pascal Hartig
c0a0fa5dd8 Bump deps
Summary: Preempting dependabot by bumping a few patch and minor releases.

Reviewed By: timur-valiev

Differential Revision: D32434931

fbshipit-source-id: 77a3ec760f08262a118e12318d7601e031730a9a
2021-11-16 10:33:14 -08:00
Michel Weststrate
7e50c0466a Move app/src (mostly) to flipper-ui-core/src
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
2021-11-16 05:29:21 -08: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