Commit Graph

28 Commits

Author SHA1 Message Date
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
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
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
2e7015388c Remove remaining Electron imports from product code: paths & env
Summary:
This diff removes most remaining Electron imports, by storing env and path constants on the RenderHost. As nice side effect those paths are all cached now as well.

To make sure RenderHost is initialised before Flipper itself, forced loading Flipper through a require. Otherwise the setup is super sensitive to circular import statements, since a lot of module initialisation code depends on those paths / env vars.

Reviewed By: nikoant

Differential Revision: D31992230

fbshipit-source-id: 91beb430902272aaf4b051b35cdf12d2fc993347
2021-11-03 07:01:21 -07:00
Pascal Hartig
2525a5efd4 Fix Flipper lints #9
Summary:
This introduces a few more lints in fact because I renamed the icon functions
to make clear that they use sync methods under the hood.

Reviewed By: timur-valiev

Differential Revision: D31964701

fbshipit-source-id: d0beb58b5b301f5428fdbfe8c65784df0d86eaad
2021-10-28 05:47:40 -07:00
Pascal Hartig
04616ad647 Allow saving source maps during build
Summary: This makes it possible to save source maps to a separate folder so we can upload them from CI.

Reviewed By: nikoant

Differential Revision: D29521599

fbshipit-source-id: a137659092b7648858b97ecf5b5c60c88889517a
2021-07-05 06:05:43 -07:00
Pascal Hartig
6d1cecdeee Retry icon download
Summary:
In public CI (only?), asset downloads sometimes fail with a spurious 404.
We already have retrying in place, but it will obviously not do that on a 500.

Reviewed By: nikoant

Differential Revision: D28744817

fbshipit-source-id: b6a185d8e9db45e02c6427233a0171b00c552751
2021-05-27 06:26:48 -07:00
Anton Nikolaev
8d508c8634 Build script updated to allow specifying directory with default plugins
Summary: This change allows passing a directory containing plugin packages to include them into Flipper distributive. This is used by release command on Sandcastle (see D28626715).

Reviewed By: passy

Differential Revision: D28628425

fbshipit-source-id: 9c5d7527721f99b43991bace0b5e2f3a4ede0d13
2021-05-25 01:41:57 -07:00
Anton Nikolaev
a4eb2a56d6 Option for "yarn start" and "yarn build" scripts to pre-install default plugin packages instead of bundling them
Summary:
Sorry for long diff! I can try to split it if necessary, but many changes here are 1-1 replacements / renames.

**Preambule**
Currently we bundle default plugins into the Flipper main bundle. This helps us to reduce bundle size, because of plugin dependencies re-use. E.g. if multiple plugins use "lodash" when they are bundled together, only one copy of "lodash" added. When they are bundled separately, the same dependency might be added to each of them. However as we're not going to include most of plugins into Flipper distributive anymore and going to rely on Marketplace instead, this bundling doesn't provide significant size benefits anymore. In addition to that, bundling makes it impossible to differentiate whether thrown errors are originated from Flipper core or one of its plugins.

Why don't we remove plugin bundling at all? Because for "dev mode" it actually quite useful. It makes dev build start much faster and also enables using of Fast Refresh for plugin development (fast refresh won't work for plugins loaded from disk).

**Changes**
This diff introduces new option "no-bundled-plugins" for "yarn start" and "yarn build" commands. For now, by default, we will continue bundling default plugins into the Flipper main bundle, but if this option provided then we will build each default plugin separately and include their packages into the Flipper distributive as "pre-installed" to be able to load them from disk even without access to Marketplace.

For "yarn start", we're adding symlinks to plugin folders in "static/defaultPlugins" and then they are loaded by Flipper. For "yarn build" we are dereferencing these symlinks to include physical files of plugins into folder "defaultPlugins" of the produced distributive. Folder "defaultPlugins" is excluded from asar, because loading of plugins from asar archive might introduce some unexpected issues depending on their implementation.

Reviewed By: mweststrate

Differential Revision: D28431838

fbshipit-source-id: f7757e9f5ba9183ed918d70252de3ce0e823177d
2021-05-18 08:08:30 -07:00
dependabot[bot]
674f71a426 Bump prettier from 2.2.1 to 2.3.0 in /desktop (#2300)
Summary:
Bumps [prettier](https://github.com/prettier/prettier) from 2.2.1 to 2.3.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/prettier/prettier/releases">prettier's releases</a>.</em></p>
<blockquote>
<h2>2.3.0</h2>
<p><a href="https://github.com/prettier/prettier/compare/2.2.1...2.3.0">diff</a></p>
<p>{emoji:1f517} <a href="https://prettier.io/blog/2021/05/09/2.3.0.html">Release Notes</a></p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/prettier/prettier/blob/main/CHANGELOG.md">prettier's changelog</a>.</em></p>
<blockquote>
<h1>2.3.0</h1>
<p><a href="https://github.com/prettier/prettier/compare/2.2.1...2.3.0">diff</a></p>
<p>{emoji:1f517} <a href="https://prettier.io/blog/2021/05/09/2.3.0.html">Release Notes</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="2afc3b9ae6"><code>2afc3b9</code></a> Release 2.3.0</li>
<li><a href="7cfa9aa89b"><code>7cfa9aa</code></a> Fix pre-commit hook setup command (<a href="https://github-redirect.dependabot.com/prettier/prettier/issues/10710">#10710</a>)</li>
<li><a href="c8c02b4753"><code>c8c02b4</code></a> Build(deps-dev): Bump concurrently from 6.0.2 to 6.1.0 in /website (<a href="https://github-redirect.dependabot.com/prettier/prettier/issues/10834">#10834</a>)</li>
<li><a href="6506e0f50e"><code>6506e0f</code></a> Build(deps-dev): Bump webpack-cli from 4.6.0 to 4.7.0 in /website (<a href="https://github-redirect.dependabot.com/prettier/prettier/issues/10836">#10836</a>)</li>
<li><a href="69fae9c291"><code>69fae9c</code></a> Build(deps): Bump flow-parser from 0.150.0 to 0.150.1 (<a href="https://github-redirect.dependabot.com/prettier/prettier/issues/10839">#10839</a>)</li>
<li><a href="164a6e2351"><code>164a6e2</code></a> Switch CLI to async (<a href="https://github-redirect.dependabot.com/prettier/prettier/issues/10804">#10804</a>)</li>
<li><a href="d3e7e2f634"><code>d3e7e2f</code></a> Build(deps): Bump codecov/codecov-action from v1.4.1 to v1.5.0 (<a href="https://github-redirect.dependabot.com/prettier/prettier/issues/10833">#10833</a>)</li>
<li><a href="9e09845da0"><code>9e09845</code></a> Build(deps): Bump <code>@​angular/compiler</code> from 11.2.12 to 11.2.13 (<a href="https://github-redirect.dependabot.com/prettier/prettier/issues/10838">#10838</a>)</li>
<li><a href="1bfab3d045"><code>1bfab3d</code></a> Build(deps-dev): Bump eslint from 7.25.0 to 7.26.0 (<a href="https://github-redirect.dependabot.com/prettier/prettier/issues/10840">#10840</a>)</li>
<li><a href="387fce4ed8"><code>387fce4</code></a> Minor formatting tweaks (<a href="https://github-redirect.dependabot.com/prettier/prettier/issues/10807">#10807</a>)</li>
<li>Additional commits viewable in <a href="https://github.com/prettier/prettier/compare/2.2.1...2.3.0">compare view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=prettier&package-manager=npm_and_yarn&previous-version=2.2.1&new-version=2.3.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/2300

Reviewed By: passy

Differential Revision: D28323849

Pulled By: cekkaewnumchai

fbshipit-source-id: 1842877ccc9a9587af7f0d9ff9432c2075c8ee22
2021-05-11 05:51:56 -07:00
dependabot[bot]
12717e1b9d Bump app-builder-lib from 22.9.1 to 22.10.5 in /desktop (#2072)
Summary:
allow-large-files
Bumps [app-builder-lib](https://github.com/electron-userland/electron-builder) from 22.9.1 to 22.10.5.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/electron-userland/electron-builder/releases">app-builder-lib's releases</a>.</em></p>
<blockquote>
<h2>22.10.5</h2>
<p>We have a new maintainer — welcome Mike Maietta (<a href="https://github.com/mmaietta"><code>@​mmaietta</code></a>)!</p>
<p><strong>electron-updater</strong>  4.3.8 contains fix for <a href="https://github.com/electron-userland/electron-builder/issues/5595">#5595</a>. This version is a pre-release.</p>
<h3>Bug Fixes</h3>
<ul>
<li>Look for the Amazon cred header to remove auth header (<a href="https://github.com/electron-userland/electron-builder/issues/5594">#5594</a>) (<a href="46a8840bb4">46a8840</a>)</li>
<li><strong>mac:</strong> fix &quot;Contents/Info.plist&quot; don't have identical SHAs when creating a universal build (<a href="https://github.com/electron-userland/electron-builder/issues/5550">#5550</a>) (<a href="0ba839b72b">0ba839b</a>)</li>
<li>updating nsis script to properly identify arm64 vs x64 vs ia32 package files within universal installers. (<a href="https://github.com/electron-userland/electron-builder/issues/5558">#5558</a>) (<a href="60f7fe367c">60f7fe3</a>)</li>
<li><strong>mac:</strong> Allow arm64 macs to update to x64 version if no arm64 version available (<a href="https://github.com/electron-userland/electron-builder/issues/5524">#5524</a>) (<a href="dc5c2f8e77">dc5c2f8</a>)</li>
<li><strong>mac:</strong> Pass platformName and options in doPack (<a href="https://github.com/electron-userland/electron-builder/issues/5511">#5511</a>) (<a href="f78e3f48d7">f78e3f4</a>)</li>
<li><strong>mac:</strong> Workaround for hdiutil randomly failing (<a href="https://github.com/electron-userland/electron-builder/issues/5431">#5431</a>) (<a href="https://github.com/electron-userland/electron-builder/issues/5464">#5464</a>) (<a href="53270cfe4e">53270cf</a>)</li>
<li>binary detection signing (<a href="https://github.com/electron-userland/electron-builder/issues/5493">#5493</a>) (<a href="a6e86b5930">a6e86b5</a>), closes <a href="https://github.com/electron-userland/electron-builder/issues/5465">#5465</a></li>
<li>ci-tests (<a href="https://github.com/electron-userland/electron-builder/issues/5523">#5523</a>) (<a href="ced6e50b93">ced6e50</a>)</li>
</ul>
<h3>Features</h3>
<ul>
<li><strong>electron-updater:</strong> follow <code>autoInstallOnAppQuit = false</code> on macOS (<a href="https://github.com/electron-userland/electron-builder/issues/5271">#5271</a>) (<a href="1643d56960">1643d56</a>)</li>
<li>add support for executableName to non-Linux Platforms (<a href="https://github.com/electron-userland/electron-builder/issues/5409">#5409</a>) (<a href="106b68010f">106b680</a>)</li>
<li>Custom electronDist callback (<a href="https://github.com/electron-userland/electron-builder/issues/5527">#5527</a>) (<a href="4f4e018771">4f4e018</a>)</li>
<li>macOS default architecture (<a href="https://github.com/electron-userland/electron-builder/issues/5495">#5495</a>) (<a href="https://github.com/electron-userland/electron-builder/issues/5504">#5504</a>) (<a href="5203d7eb15">5203d7e</a>)</li>
</ul>
<h2>22.10.4</h2>
<h3>Bug Fixes</h3>
<ul>
<li>CI unit tests (<a href="https://github.com/electron-userland/electron-builder/issues/5489">#5489</a>) (<a href="637334ddba">637334d</a>)</li>
</ul>
<h3>Features</h3>
<ul>
<li>Apple Silicon Universal Support (<a href="https://github.com/electron-userland/electron-builder/issues/5481">#5481</a>) (<a href="ca20151c34">ca20151</a>)</li>
<li><strong>mas:</strong> Apple Silicon support (<a href="https://github.com/electron-userland/electron-builder/issues/5484">#5484</a>) (<a href="6b7d30555d">6b7d305</a>)</li>
</ul>
<h3>Reverts</h3>
<ul>
<li>Revert &quot;fix: codesign all binary-like files (<a href="https://github.com/electron-userland/electron-builder/issues/5322">#5322</a>)&quot; (<a href="https://github.com/electron-userland/electron-builder/issues/5488">#5488</a>) (<a href="026227888f">0262278</a>), closes <a href="https://github.com/electron-userland/electron-builder/issues/5322">#5322</a> <a href="https://github.com/electron-userland/electron-builder/issues/5488">#5488</a></li>
</ul>
<h2>22.10.3</h2>
<h3>Bug Fixes</h3>
<ul>
<li>signing of playwright (<a href="https://github.com/electron-userland/electron-builder/issues/5451">#5451</a>) (<a href="50750683b1">5075068</a>)</li>
<li><strong>dmg:</strong> new version of mac_alias (<a href="https://github.com/electron-userland/electron-builder/issues/5460">#5460</a>) (<a href="a8acb583bc">a8acb58</a>)</li>
<li>compiler error and test updates (<a href="https://github.com/electron-userland/electron-builder/issues/5449">#5449</a>) (<a href="0dec1b8c19">0dec1b8</a>)</li>
<li><strong>AppImage:</strong> Add default argument --no-sandbox (<a href="https://github.com/electron-userland/electron-builder/issues/4496">#4496</a>) (<a href="ede6d50ddb">ede6d50</a>)</li>
<li><strong>linux:</strong> Linux icon is not set if path is not explicitly defined in config (<a href="https://github.com/electron-userland/electron-builder/issues/5385">#5385</a>) (<a href="9fd950bc04">9fd950b</a>)</li>
<li><strong>nsis:</strong> cs locale typos in messages (<a href="https://github.com/electron-userland/electron-builder/issues/5358">#5358</a>) (<a href="0fb69b5d11">0fb69b5</a>)</li>
<li>codesign all binary-like files (<a href="https://github.com/electron-userland/electron-builder/issues/5322">#5322</a>) (<a href="27ea1b2b9c">27ea1b2</a>)</li>
</ul>

</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="79940292bd"><code>7994029</code></a> Cannot read property 'log' of undefined (<a href="https://github.com/electron-userland/electron-builder/issues/5622">#5622</a>)</li>
<li><a href="1643d56960"><code>1643d56</code></a> feat(electron-updater): follow <code>autoInstallOnAppQuit = false</code> on macOS (<a href="https://github.com/electron-userland/electron-builder/issues/5271">#5271</a>)</li>
<li><a href="0360cd1705"><code>0360cd1</code></a> chore(build-utils): remove unreachable useless statement in createMessage (<a href="https://github.com/electron-userland/electron-builder/issues/5">https://github.com/facebook/flipper/issues/5</a>...</li>
<li><a href="c348e318ce"><code>c348e31</code></a> Add &quot;open&quot; guard for AsarUtil to fix concurrent builds (<a href="https://github.com/electron-userland/electron-builder/issues/5567">#5567</a>)</li>
<li><a href="11aa06c701"><code>11aa06c</code></a> Detect CI tag for Bitbucket pipelines</li>
<li><a href="8decc18674"><code>8decc18</code></a> (fix) master branch depCheck + tests (<a href="https://github.com/electron-userland/electron-builder/issues/5630">#5630</a>)</li>
<li><a href="46a8840bb4"><code>46a8840</code></a> fix: Look for the Amazon cred header to remove auth header (<a href="https://github.com/electron-userland/electron-builder/issues/5594">#5594</a>)</li>
<li><a href="0ba839b72b"><code>0ba839b</code></a> fix(mac): fix &quot;Contents/Info.plist&quot; don't have identical SHAs when creating a...</li>
<li><a href="60f7fe367c"><code>60f7fe3</code></a> fix: updating nsis script to properly identify arm64 vs x64 vs ia32 package f...</li>
<li><a href="5de0db981d"><code>5de0db9</code></a> chore: lint</li>
<li>Additional commits viewable in <a href="https://github.com/electron-userland/electron-builder/compare/v22.9.1...v22.10.5">compare view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=app-builder-lib&package-manager=npm_and_yarn&previous-version=22.9.1&new-version=22.10.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)

</details>

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

Reviewed By: passy

Differential Revision: D27230105

Pulled By: priteshrnandgaonkar

fbshipit-source-id: e53e942319a15d982797f7ce3af128a8b25b357f
2021-03-23 08:46:58 -07:00
Anton Nikolaev
f508a35ff9 Fix patch release versioning for open-source version
Summary: Patch was always set to "0" for open source releases even if it is set to "1" in package.json

Reviewed By: passy

Differential Revision: D26975947

fbshipit-source-id: b3f127c9746797fbb5a79dfcd9bd52210c3a7df8
2021-03-11 04:32:21 -08:00
Pascal Hartig
aacf5b8565 Hard-code mutable version info for Windows
Summary:
This is quite hacky but avoids having to patch electron-builder directly.

We're intercepting the signing/editing process on Windows and triggering it ourselves while overriding version information that otherwise changes for every release causing cache invalidations to occur. This does *not* change the version display in the app as we're not depending on the PE metadata but on the version in the `package.json`.

Reviewed By: nikoant, mweststrate

Differential Revision: D25973921

fbshipit-source-id: 0fad07f3597fba9927643d24fba12f8750ca54bc
2021-01-21 03:43:17 -08:00
Pascal Hartig
4a8e98733d Simpler win sign exception
Summary:
We're skipping the signing and editing of EXEs on Windows. This is only temporary but I want to have an atomic commit we can go back to. This is to avoid cache eviction due to version numbers being encoded in the binary.

This means you're not getting the logo on the binary and copyright information, etc. We're not actually shipping these right now, so the real-world impact of this is zero.

Reviewed By: mweststrate

Differential Revision: D25973944

fbshipit-source-id: d076919acfaac1f618178294baff3e9122d820bf
2021-01-20 09:14:21 -08:00
Anton Nikolaev
c14bab3677 Unbundle less popular plugins for Insiders builds
Summary: Unbundle most of plugins from Insiders version of Flipper. Users will need to install them from Marketplace.

Reviewed By: passy

Differential Revision: D25558043

fbshipit-source-id: 648b0d4c83d9096972b5463cdcaa3de23426bdda
2020-12-15 09:31:59 -08:00
Anton Nikolaev
56361debb2 Differentiate insider builds from stable builds
Summary: Each build will have an embedded file specifying the target release channel for the build. This allows us to do some customisations, e.g. show "Insiders" label in the title and enable Sandy by default for insiders builds.

Reviewed By: jknoxville

Differential Revision: D25399045

fbshipit-source-id: 8e26d0754d0713ced823f86b30b54491d55b4d97
2020-12-08 12:38:02 -08:00
Anton Nikolaev
bc9412426f Parse build script args with yargs
Summary: We have some custom parsing here and there and I'm going to add some more args, so decided it's better to cleanup this a bit.

Reviewed By: jknoxville

Differential Revision: D25398421

fbshipit-source-id: 9d43029eef07648d0b01590e9cf7e7fe400b31d0
2020-12-08 12:38:02 -08:00
Pascal Hartig
3a839bddae Download icons with retry
Summary:
This quite often fails in CI. Adobe's fetch has some very sensible defaults
and will do exponential backoff and retry for up to a minute.
That should hopefully fix issues where we have to restart the whole build
just to fix one measly icon download.

Reviewed By: jknoxville

Differential Revision: D24649807

fbshipit-source-id: efbc9eb29e4b5a0f74b0b6ad6dea4aaf86391363
2020-11-05 05:17:29 -08:00
Pascal Hartig
421733682f Add snap build option for Linux
Summary: Asked for in https://github.com/facebook/flipper/issues/1184.

Reviewed By: mweststrate

Differential Revision: D21719920

fbshipit-source-id: 80187dfdc3d04e66bf79f0317e86719bede2f497
2020-05-26 07:05:03 -07:00
Joao Alves
d7bfa993a5 Add deb target to linux build (#1093)
Summary:
I'm adding the `.deb` option to linux build, it makes easier to install.
```bash
cd desktop
yarn build --linux --linux-deb
```

## Changelog

- Add deb target to linux build
Pull Request resolved: https://github.com/facebook/flipper/pull/1093

Reviewed By: mweststrate

Differential Revision: D21378807

Pulled By: passy

fbshipit-source-id: a72a85705d3c464cddd80091d38c92012bdbee2c
2020-05-04 06:15:47 -07:00
Pascal Hartig
65f935efab Fix CFBundleVersion
Summary:
This defaults to the `version` and is used to update the inline plists
of the Frameworks that are bundled with the MacOS app bundle. Setting
them to a fixed value means that they remain unchanged across rebuilds
(bringing them in line with Linux and Windows equivalents). This
is required to ship them as separate bundles for the launcher.

Why 50? The reason this was introduced was to allow people to override
this to values >= 50 as this is somehow a Mac App Store requirement:
https://github.com/electron-userland/electron-builder/issues/565#issuecomment-230678643

Reviewed By: priteshrnandgaonkar

Differential Revision: D21179072

fbshipit-source-id: a6f10b7508526b4305b229bd160d6e570ddce822
2020-04-23 01:49:36 -07:00
Anton Nikolaev
553c54b63e Include default plugins into app bundle (#998)
Summary:
Pull Request resolved: https://github.com/facebook/flipper/pull/998

After this diff all the default plugins (which are distributed with Flipper) will be included into the main app bundle instead of bundling each of them separately and then loading from file system. This is done by auto-generating plugins index in build-time and importing it from Flipper app bundle, so Metro can follow these imports and bundle all the plugins to the app bundle.
This provides several benefits:
1) reduced Flipper bundle size (~10% reduction of zipped Flipper archive), because Metro bundles each of re-used dependencies only once instead of bundling them for each plugin where such dependency used.
2) Faster Flipper startup because of reduced bundle and the fact that we don't need to load each plugin bundle from disk - just need to load the single bundle where everything is already included.
3) Metro dev server for plugins works in the same way as for Flipper app itself, e.g. simple refresh automatically recompiles bundled plugins too if there are changes. This also potentially should allow us to enable "fast refresh" for quicker iterations while developing plugins.
4) Faster build ("yarn build --mac" is 2 times faster on my machine after this change)

Potential downsides:
1) Currently all the plugins are identically loaded from disk. After this change some of plugins will be bundled, and some of them (third-party) will be loaded from disk.
2) In future when it will be possible to publish new versions of default plugins separately, installing new version of such plugin (e.g. with some urgent fix) will mean the "default" pre-built version will still be bundled (we cannot "unbundle" it :)), but we'll skip it and instead load new version from disk.

Changelog: Internals: include default plugins into the main bundle instead producing separate bundles for them.

Reviewed By: passy

Differential Revision: D20864002

fbshipit-source-id: 2968f3b786cdd1767d6223996090143d03894b92
2020-04-14 07:20:39 -07:00
Pascal Hartig
41a911379d Set product name and executable
Summary:
This means that Linux builds have a `flipper` executable
in the directory again.

Reviewed By: cekkaewnumchai

Differential Revision: D20915156

fbshipit-source-id: 9f792bcffef41168fe5a3e43c29b59f37a4cc673
2020-04-08 06:14:13 -07:00
Anton Nikolaev
da7449c20b Enable Metro caching
Summary:
Enabling Metro cache for dev mode. For release builds we reset the cache.

Cache is used for faster compilation in dev mode for both main and renderer bundles, as well as for plugins.

Currently we have few side effects based on env vars, so cache is invalidated when they are changed. Also the cache is invalidated when transformations are changed (changed code, bumped dependency etc). Also added a script to reset the cache if something is going wrong.

Reviewed By: mweststrate

Differential Revision: D20691464

fbshipit-source-id: 478947d438bd3090f052dbfa6ad5c649523ecacb
2020-03-30 09:28:35 -07:00
Anton Nikolaev
c1bb656a0d Re-use babel transformations
Summary:
SORRY FOR BIG DIFF, but it's really hard to split it as all these changes are cross-dependent and should be made at once:
1. Moved transformations to separate package "flipper-babel-transformer" and linked it using yarn workspaces to "static" and "pkg" packages where they are re-used. Removed double copies of transformations we had before int these two packages.
2. Converted transformations to typescript
3. Refactored transformations to avoid relying on file system paths for customisation (FB stubs and Electron stubs for headless build)
4. As babel transformations must be built before other builds - enabled incremental build for them and changed scripts to invoke the transformations build before other build scripts
5. As we need to deploy all the dependencies including the fresh "flipper-babel-transformer" as a part of "static" - implemented script which copies package with all the dependencies taking in account yarn workspaces (hoisting and symlinks)

Reviewed By: passy, mweststrate

Differential Revision: D20690662

fbshipit-source-id: 38a275b60d3c91e01ec21d1dbd72d03c05cfac0b
2020-03-27 03:26:51 -07:00
Pascal Hartig
fc9ed65762 prettier 2
Summary:
Quick notes:

- This looks worse than it is. It adds mandatory parentheses to single argument lambdas. Lots of outrage on Twitter about it, personally I'm {emoji:1f937_200d_2642} about it.
- Space before function, e.g. `a = function ()` is now enforced. I like this because both were fine before.
- I added `eslint-config-prettier` to the config because otherwise a ton of rules conflict with eslint itself.

Close https://github.com/facebook/flipper/pull/915

Reviewed By: jknoxville

Differential Revision: D20594929

fbshipit-source-id: ca1c65376b90e009550dd6d1f4e0831d32cbff03
2020-03-24 09:38:11 -07:00
Anton Nikolaev
863f89351e Yarn workspaces
Summary:
1) moved "sonar/desktop/src" to "sonar/desktop/app/src", so "app" is now a separate package containing the core Flipper app code
2) Configured yarn workspaces with the root in "sonar/desktop": app, static, pkg, doctor, headless-tests. Plugins are not included for now, I plan to do this later.

Reviewed By: jknoxville

Differential Revision: D20535782

fbshipit-source-id: 600b2301960f37c7d72166e0d04eba462bec9fc1
2020-03-20 13:37:41 -07:00
Anton Nikolaev
85c13bb1f3 Move desktop-related code to "desktop" subfolder (#872)
Summary:
Pull Request resolved: https://github.com/facebook/flipper/pull/872
Move all the JS code related to desktop app to "desktop" subfolder.

The structure of "desktop" folder:
- `src` - JS code of Flipper desktop app executing in Electron Renderer (Chrome) process. This folder also contains all the Flipper plugins in subfolder "src/plugins".
- `static` - JS code of Flipper desktop app bootstrapping executing in Electron Main (Node.js) process
- `pkg` - Flipper packaging lib and CLI tool
- `doctor` - Flipper diagnostics lib and CLI tool
- `scripts` - Build scripts for Flipper desktop app
- `headless` - Headless version of Flipper app
- `headless-tests` - Integration tests running agains Flipper headless version

Reviewed By: passy

Differential Revision: D20249304

fbshipit-source-id: 9a51c63b51b92b758a02fc8ebf7d3d116770efe9
2020-03-14 14:35:17 -07:00