Commit Graph

6303 Commits

Author SHA1 Message Date
Michel Weststrate
9e09c0d5f7 Stop exposing adbkit and crc32 as globals
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
2021-12-13 05:48:17 -08:00
Michel Weststrate
ac9080abac Remove 'process' usage
Summary: Removed process, adbkit and electron usages that were still remaining. Verified changes by disabling the built-in module stubbing (will be cleaned up further later in this stack).

Reviewed By: aigoncharov

Differential Revision: D33019083

fbshipit-source-id: 8bfce31f4b5ed349cb4fd86d34c9b41b9b8b8360
2021-12-13 05:48:17 -08:00
Michel Weststrate
3ef1923b29 Use uniform Socket message size to avoid disconnects
Summary: During startup the socket connection would close a few times, among others because Scribe dumps 1.3 MB of data after startup, and the maximum payload of `socket.io` defaults to 1MB. This diff changes it to 100MB (the max size used by `ws` library). We know that we need at least > 10 MB, as that is what plugins like Network cap at.

Reviewed By: aigoncharov

Differential Revision: D33017653

fbshipit-source-id: 1233af6fbdc4b9eed42786ee418cfd6d43b2b433
2021-12-13 05:48:17 -08:00
Michel Weststrate
accef856fc Remove remaining Node imports from core
Summary:
Removed remaining path / fs imports from Flipper core.

`expand-tide` needed replacement too, but noticed that it never actually rewrites paths since all use cases were already using absolute paths, so removed it instead.

Reviewed By: aigoncharov

Differential Revision: D33017654

fbshipit-source-id: e12f66ef68b5f9e4279411c94445a2fb87249e9a
2021-12-13 05:48:17 -08:00
Michel Weststrate
d95b15094f Implement fs.readFile / fs.writeFile
Summary: Per title. Made an explicit distinction between binary and non binary files, since they need to be encoded differently. This keeps both the implementation and API simpler (in terms of overloading / type checking)

Reviewed By: aigoncharov

Differential Revision: D33016031

fbshipit-source-id: 3c99956eb016849a908a171d88a7a64a88b76268
2021-12-13 05:48:17 -08:00
Michel Weststrate
7e9ad72baa Fix --no-bundled-plugins was not respected
Summary: Even with the `--no-bundled-plugins` flag, still a hundred plugins were loaded when running flipper-server

Reviewed By: timur-valiev, aigoncharov

Differential Revision: D32987158

fbshipit-source-id: 19e51e7e5f8ec9e664eb48cf2f2b8936f2f5ed73
2021-12-13 05:48:17 -08:00
Michel Weststrate
34a1da3345 Implement fs.stat and fs.readlink
Summary: Fixes issue for the stackTraceMapper

Reviewed By: aigoncharov

Differential Revision: D32987161

fbshipit-source-id: 660f49a1bdf61b2fd2963874ef23dfd284f71128
2021-12-13 05:48:17 -08:00
Michel Weststrate
af83523798 Fixed intern requests not being serializable
Summary: Intern requests didn't work in the browser version of Flipper, as the axios objects that are returned from the server end up as garbage over the socket. Fixed that by construction the proper result object.

Reviewed By: timur-valiev, aigoncharov

Differential Revision: D32984537

fbshipit-source-id: 09c44ed95ce5e3f5e9495f2f9324f1f89e3c62ba
2021-12-13 05:48:16 -08:00
Michel Weststrate
0510786dec Fixed relilability issues in running health checks
Summary: Run doctor checks remained pending when the socket disonnected during a check. This

Reviewed By: aigoncharov

Differential Revision: D32984539

fbshipit-source-id: 277005e78803afaaa220cc5ca7fdc9cca6254453
2021-12-13 05:48:16 -08:00
Michel Weststrate
6f9983eb42 Add --open / --no-open to yarn flipper-server
Summary: As a convenience, open the browser by default when starting up

Reviewed By: timur-valiev

Differential Revision: D32984536

fbshipit-source-id: 540abf594f2f2553880f587bcd7d4811ea36fe74
2021-12-13 05:48:16 -08:00
Michel Weststrate
73c6e8ee05 Make flipper server debuggable
Summary: This diffs adds debugging support to flipper server, by adding VSCode config for it

Reviewed By: timur-valiev, aigoncharov

Differential Revision: D32982874

fbshipit-source-id: 8e187ad05a05566a598db04b97e8b08e3de7e835
2021-12-13 05:48:16 -08:00
Michel Weststrate
ae56f2b62f change server build process to respect babel transforms
Summary:
The build process for the server was a simple ts-node that compiled all deps. However, that didn't do any source transformations we need, like replacing `fb-stubs` with `fb` in facebook builds.

This diff works out the dev build process to align more with how other parts of the code base is build, by starting metro to build and bundle the server (only the sources of flipper-server, flipper-server-core and other flipper packages are bundled, node-deps are left as is).

To achieve this, since metro doesn't have support for 'external' packages like any arbitrarily other bundler, we recycle the electronRequire work around that is used in the desktop app as well

Reviewed By: aigoncharov

Differential Revision: D32949677

fbshipit-source-id: 00d326bb17b68aece6fb43af98d0def13b335e74
2021-12-13 05:48:16 -08:00
Flipper Bot
1ffd845fb2 Flipper Snapshot Bump: v0.125.1-SNAPSHOT
Summary: Releasing snapshot version 0.125.1-SNAPSHOT

Reviewed By: mweststrate

Differential Revision: D33041393

fbshipit-source-id: 928bab65a812c927e09272741a5a3b9f984a1958
2021-12-11 04:51:03 -08:00
Flipper Bot
b7ef9c7490 Flipper Release: v0.125.0
Summary: Releasing version 0.125.0

Reviewed By: mweststrate

Differential Revision: D33041394

fbshipit-source-id: f6b8a3a2298bfdcb2bb259214c2836b255c44e59
2021-12-11 04:51:03 -08:00
Michel Weststrate
c1f6ca84b6 Fix overflow issue in WelcomeScreen
Summary: Noticed that the welcome screen started bleeding in the sidebar when the screen is too small. Unlike the plugin container it lacked an overflow: hidden.

Reviewed By: timur-valiev, aigoncharov

Differential Revision: D32987160

fbshipit-source-id: be324247cdb4abfeec12c40624d65f9fa1e86eff
2021-12-10 17:59:33 -08:00
Michel Weststrate
fa67c21def Fix bug where client plugins weren't always started
Summary:
Changelog: Fixed issue where occasionally a plugin wouldn't open after starting Flipper

This fixes a long standing issue where rarely Flipper wouldn't show the selected plugin. This turned out to be a raise condition, that was easy to reproduce in the Flipper browser version; if a client register before all the plugins are loaded, the plugins that are enabled for that client, but not loaded yet, will not instantiate and hence not show up. This diff fixes that

Reviewed By: timur-valiev, aigoncharov

Differential Revision: D32987162

fbshipit-source-id: f3179cd9b6f2e4e79d05be1f2236f63acdf50495
2021-12-10 17:59:33 -08:00
Michel Weststrate
bb23b36051 Fixed flipper settings not being loaded / saved on fresh install
Summary:
I was running flipper-server on a fresh machine without Flipper installed and discovered that reading / writing settings failed since `~/.flipper` wasn't existing, due to using `access` instead of `pathExists`.

Added a warning about needing to restart the server after making changes, since that is tricky to do from the UI.

Fixed an issue in the settings screen, which would fs.stat as part of rendering, causing the Settings UI not to load.

Reviewed By: timur-valiev, aigoncharov

Differential Revision: D32984538

fbshipit-source-id: 2b2011ad9d84c72ac824d92a8c96f636237b8771
2021-12-10 17:59:33 -08:00
dependabot[bot]
4222acaf96 Bump anyhow from 1.0.50 to 1.0.51 in /packer (#3129)
Summary:
Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.50 to 1.0.51.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/dtolnay/anyhow/releases">anyhow's releases</a>.</em></p>
<blockquote>
<h2>1.0.51</h2>
<ul>
<li>Show doc for <code>Ok</code> fn</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="871be23b2c"><code>871be23</code></a> Release 1.0.51</li>
<li><a href="97cff686ef"><code>97cff68</code></a> Show doc for Ok fn</li>
<li>See full diff in <a href="https://github.com/dtolnay/anyhow/compare/1.0.50...1.0.51">compare view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=anyhow&package-manager=cargo&previous-version=1.0.50&new-version=1.0.51)](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/3129

Reviewed By: nikoant

Differential Revision: D33025282

Pulled By: passy

fbshipit-source-id: 4cc24a74933155c8d24e6030cab160b39623fbfc
2021-12-10 11:59:53 -08:00
dependabot[bot]
fd5e37a845 Bump clap from 2.33.3 to 2.34.0 in /packer (#3128)
Summary:
Bumps [clap](https://github.com/clap-rs/clap) from 2.33.3 to 2.34.0.
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a href="https://github.com/clap-rs/clap/commits">compare view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=clap&package-manager=cargo&previous-version=2.33.3&new-version=2.34.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/3128

Reviewed By: nikoant

Differential Revision: D33025279

Pulled By: passy

fbshipit-source-id: 8d6bb8582e71ba138b2a600cb104427fe86a7f0b
2021-12-10 11:56:16 -08:00
facebook-flipper-bot
c93ba46c6a Automated: Update Podfile.lock (#3149)
Summary:
This is an automated PR to update the Podfile.lock.
- Make sure that the Podfile.lock contains latest FlipperKit and Flipper pod versions.
- Also make sure that all the dependencies are updated to the latest one.
- This is auto-generated by [create-pull-request](https://github.com/peter-evans/create-pull-request)

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

Test Plan:
Imported from GitHub, without a `Test Plan:` line.

**Static Docs Preview: flipper**
|[Full Site](https://our.intern.facebook.com/intern/staticdocs/eph/D33025232/V2/flipper/)|

|**Modified Pages**|
|[docs/getting-started/ios-native](https://our.intern.facebook.com/intern/staticdocs/eph/D33025232/V2/flipper/docs/getting-started/ios-native/)|

Reviewed By: nikoant

Differential Revision: D33025232

Pulled By: passy

fbshipit-source-id: 0f90d48ae0c9a3ac95ac0c0996843e5d852cb046
2021-12-10 11:49:18 -08:00
dependabot[bot]
a0b38802e9 Bump tmpl from 1.0.4 to 1.0.5 in /desktop (#3144)
Summary:
Bumps [tmpl](https://github.com/daaku/nodejs-tmpl) from 1.0.4 to 1.0.5.
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a href="https://github.com/daaku/nodejs-tmpl/commits/v1.0.5">compare view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=tmpl&package-manager=npm_and_yarn&previous-version=1.0.4&new-version=1.0.5)](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)
You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/facebook/flipper/network/alerts).

</details>

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

Reviewed By: nikoant

Differential Revision: D33025249

Pulled By: passy

fbshipit-source-id: 67ff09cf061944a2db97e168242e3dfef22ec8e6
2021-12-10 11:46:59 -08:00
Andrey Goncharov
c96558a524 Remove fs and os usage from Mobile Builds plugin
Summary: Changelog: Expose env info and FS rm command to flipper plugins.

Reviewed By: mweststrate

Differential Revision: D32988478

fbshipit-source-id: 3d0233f9eb34d3478b07e39b9401c0e30ca95135
2021-12-10 06:36:13 -08:00
Andrey Goncharov
adb2573a1f Forbid imports from nested directories of flipper-common, flipper-plugin, flipper-ui-core
Summary:
Forbid imports from nested directories of flipper-common, flipper-plugin, flipper-ui-core

In the stack of D32926830 I occasionally imported from flipper-plugin/src/... which is not allowed. This should fix any auto-import related issues once and for all.

Reviewed By: timur-valiev

Differential Revision: D32987054

fbshipit-source-id: f19f6278219961ad283cacfec094a6c703ca93f8
2021-12-10 06:36:12 -08:00
Andrey Goncharov
9436c32ce9 Add unit tests for 'download-file' command
Reviewed By: mweststrate

Differential Revision: D32926830

fbshipit-source-id: fbd4dcb910ffdcdc365f5f0b4c401423f0256824
2021-12-10 06:36:12 -08:00
Andrey Goncharov
6aa0cef927 Use download file API in MobileBuildsPlugin
Summary:
Facenook:
Use downloadFile API in Mobile Builds plugin

Reviewed By: mweststrate

Differential Revision: D32922041

fbshipit-source-id: d554ed9287af3bda4329e87732ab4de67136c0d2
2021-12-10 06:36:12 -08:00
Andrey Goncharov
92f0ed67f4 Add download file API
Summary: Changelog: Expose "downloadFile" API to Flipper plugins. Allow them to download files form the web to Flipper Server.

Reviewed By: mweststrate

Differential Revision: D32950685

fbshipit-source-id: 7b7f666e165ff7bf209230cdc96078272ede3616
2021-12-10 06:36:12 -08:00
Andrey Goncharov
4cb80a452f Rename RemoteNodeAPI tp RemoteServerContext
Reviewed By: mweststrate

Differential Revision: D32921160

fbshipit-source-id: 9d6b723427d7a819f2fc1b7168f6d1077dc56bd9
2021-12-10 06:36:12 -08:00
Andrey Goncharov
0e785fb18d Add remote fs API
Summary: Changelog: Expose Flipper Server FS access to Flipper plugins

Reviewed By: lblasa

Differential Revision: D32883144

fbshipit-source-id: 47637b61849ef60a2d8fe91a0a28d2a358e0b8c4
2021-12-10 06:36:12 -08:00
Andrey Goncharov
a87b99cd3d Remove child_process from kaios-allocation, kaios-ram, uiqr
Summary:
Changelog: Remove child_process usage  from kaios-allocation, kaios-ram plugins
Facebok:
Remove child_process usage from uiqr plugin

Reviewed By: mweststrate

Differential Revision: D32881860

fbshipit-source-id: 4270aaf28808baee399e263a6a7528f20242784f
2021-12-10 06:36:12 -08:00
Andrey Goncharov
9df3437683 Remove child_process from Tracery and ReactDevTools
Summary: Changelog: Remove child_process usage  from ReactDevTools plugin

Reviewed By: mweststrate

Differential Revision: D32881744

fbshipit-source-id: c80c3f7589a2787c4b5916ff1eb9f28d4af79700
2021-12-10 06:36:12 -08:00
Andrey Goncharov
e458ae76f9 Add exec Node API to FlipperLib
Summary: Changelog: Allow flipper plugins to run "exec" Node API on Flipper server.

Reviewed By: mweststrate

Differential Revision: D32881149

fbshipit-source-id: 46486a47ee9824ca68897c19fd86b4afc7f8bf1d
2021-12-10 06:36:12 -08:00
Flipper Bot
8ca2c59499 Flipper Snapshot Bump: v0.124.1-SNAPSHOT
Summary: Releasing snapshot version 0.124.1-SNAPSHOT

Reviewed By: aigoncharov

Differential Revision: D32946870

fbshipit-source-id: 89c9fc803e20a6ecee4af40c0cd4abf2b791e7ef
2021-12-10 02:48:07 -08:00
Flipper Bot
a3401ff8fd Flipper Release: v0.124.0
Summary: Releasing version 0.124.0

Reviewed By: aigoncharov

Differential Revision: D32946871

fbshipit-source-id: eba5fe2e68bd181af02140cc9119f2518ad283ea
2021-12-10 02:48:07 -08:00
Andrey Goncharov
359e403639 Disable idb stdout buffering for logs
Summary:
Changelog: Disable idb stdout buffering for logs. Show logs on iOS devices without buffering.

Currently, idb buffers log output if it's redirected to a non-TTY. It is the default behavior for Python (read more about it [here](https://eklitzke.org/stdout-buffering)).
It leads to users seeing logs only in large chunks because the size of the buffer is substantial.
Setting PYTHONUNBUFFERED to a non-empty string disables Python output buffering.

Reviewed By: lblasa

Differential Revision: D32984711

fbshipit-source-id: 3e0a889b6b60b6d266f4a0c1894db937868c7433
2021-12-09 09:48:11 -08:00
Lorenzo Blasa
59641d7987 Do not reject promise for sendExpectResponse invokations
Summary:
On Flipper Desktop, rawCall uses sendExpectResponse from the client connection.
RSocket only rejects the promise if there's an error in the transport layer and thus is unable to send data over the wire.

WebSocket sends without errors as errors will always be reported via a different callback api.

Having said that, WebSocket client connections were rejecting the promise for a valid client response that contained an error instead of success, which in this specific case is expected.

The solution is to always resolve the promise with the response and let the Client interpret the response accordingly.

Changelog: Fixes an issue whereas client errors were erroneously disconnecting a client from the Desktop side

Reviewed By: aigoncharov

Differential Revision: D32983969

fbshipit-source-id: 4215d9234235a9e2035b1d743c317ebdf2f656a2
2021-12-09 06:10:32 -08:00
Andrey Goncharov
4c6643f019 Update release diff template o include the release smoke testing checklist
Reviewed By: mweststrate

Differential Revision: D32949812

fbshipit-source-id: b7e5fe14288191a6b5e2e20dc1e3374130907d7c
2021-12-09 04:47:07 -08:00
Michel Weststrate
92a743cc59 Processed some earlier review comments
Summary: Per title, processed some pending review comments made earlier in this stack

Reviewed By: aigoncharov

Differential Revision: D32916920

fbshipit-source-id: 01db85883596b5c85b77efc9cddadeac23cc4ef5
2021-12-08 04:30:57 -08:00
Michel Weststrate
3c6668a8b9 Make sure devices and clients are registered on session startup
Summary: This diff makes sure that when the client starts, it fetches all known devices and clients first, as it might have missed the 'connect' events for those. For Electron this wasn't needed, since the server starts with the UI, but this makes sure that a browser reload or a second connection sees the same devices & apps

Reviewed By: aigoncharov

Differential Revision: D32881589

fbshipit-source-id: 7b1cb3d296044f83dedcf3f3d8d02864690b6666
2021-12-08 04:30:57 -08:00
Michel Weststrate
943d535e86 Move sending intern requests from client to server
Summary: This diff moves send intern request from the browser to the server. The reason to make this change is that making such requests from a browser environment causes CORS restrictions to kick in.

Reviewed By: nikoant

Differential Revision: D32835449

fbshipit-source-id: e8e92e51ca963aa50b3c859bb61c2381171e85ae
2021-12-08 04:30:57 -08:00
Michel Weststrate
ad4a55f263 move node types, stub node modules
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
2021-12-08 04:30:57 -08:00
Michel Weststrate
d0402d7268 Move unloadModule to RenderHost
Summary: Define unload module on RenderHost. Not sure how to do that the browser and not sure how meaning full it is in a browser context.

Reviewed By: nikoant

Differential Revision: D32827050

fbshipit-source-id: 87025c6f5c2b950880712bff8df1c92a044a222e
2021-12-08 04:30:57 -08:00
Michel Weststrate
6c7a139554 Replace WebView with Iframe
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
2021-12-08 04:30:57 -08:00
Michel Weststrate
2b2cbb1103 Move offline icon storage to app/
Summary:
This diff splits Facebook management into a ui-core and electron part:

* Cleaned up code and introduces a uniform Icon type to describe a requested icon
* Computing icon urls is done in the ui-core
* Introduced a RenderHost hook that can transform the request icon into a different url, in this case, a url to load icons from disk in production builds

For the browser UI, the urls are currently no rewritten since we have only dev builds (which always used only FB urls already). We could do the same rewrite in the future and download the static assets during build time. But for now this means that in the browser implementation we depend on normal browser caching, with the biggest downside that icons might not appear if the user has no internet connections.

With this change we lost our last usage of staticPath computations in ui-core

Reviewed By: aigoncharov

Differential Revision: D32767426

fbshipit-source-id: d573b6a373e649c7dacd380cf63a50c2dbbd9e70
2021-12-08 04:30:57 -08:00
Michel Weststrate
86995e0d11 Introduce static resource URLs
Summary: Introduced an API that converts a filepath, relatively to the `desktop/static/` folder in a url that can be resolved by the render environment. This will generate `file://` urls in Electron, and root relative `/` urls in browser envs

Reviewed By: aigoncharov

Differential Revision: D32767427

fbshipit-source-id: 378da7709bcb19449873358a8703b9c5a5809c57
2021-12-08 04:30:57 -08:00
Michel Weststrate
129cbd6f7b Move changelog loading to server
Summary: per title

Reviewed By: aigoncharov

Differential Revision: D32723706

fbshipit-source-id: ce5108da9f5da6fdfa7d1a66a31a4f8f430eb78d
2021-12-08 04:30:56 -08:00
Michel Weststrate
eab4f0d3d3 Bits & pieces
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
2021-12-08 04:30:56 -08:00
Michel Weststrate
f5f9608098 Remove crypto dependency
Summary:
Remove crypto dep, which was only used by NUX, to hash the elements that has been confirmed.

Sadly trickier than hoped; there is no uniform api in both browser and Node available that can take a sha-256 hash, and the browser APIs are async.

Reviewed By: aigoncharov

Differential Revision: D32721204

fbshipit-source-id: 32625f83bf6c60cedc4fb7096240c2fa0d8434a7
2021-12-08 04:30:56 -08:00
Michel Weststrate
058785a509 Remove remaining process.env
Summary: Per title

Reviewed By: passy

Differential Revision: D32721205

fbshipit-source-id: 8e8a7fcac7d73f32d7fb59f852a8099cfe20e542
2021-12-08 04:30:56 -08:00
Michel Weststrate
2b4981c7cb Remove remaing from 'os' imports
Summary: Per title.

Reviewed By: passy

Differential Revision: D32721206

fbshipit-source-id: 9e465d0ed60c0c6da33c462aa76468faac620626
2021-12-08 04:30:56 -08:00
Michel Weststrate
2480ed30c5 Move flipper-doctor check running to flipper-server-core
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
2021-12-08 04:30:56 -08:00