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 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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Summary:
This means that Linux builds have a `flipper` executable
in the directory again.
Reviewed By: cekkaewnumchai
Differential Revision: D20915156
fbshipit-source-id: 9f792bcffef41168fe5a3e43c29b59f37a4cc673
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
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
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
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
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