Commit Graph

16 Commits

Author SHA1 Message Date
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