Summary:
This allows bundles to have their `.buildignore` file. I did that first to remove some things from the `static` folder, but it turned out that those aren't just unnecessary for the bundle but completely unused in general. I still think there may be a case for allowing this on a per-package basis.
Right now it excludes `.ts` files, license files and readmes. Full list of excluded files is here: P129474747
It adds up to about 6MB in the *DEFLATE compressed* bundle.
Reviewed By: nikoant
Differential Revision: D21176143
fbshipit-source-id: a13e900152617fdf1c2dbfa6330c0a06a75e5484
Summary: It seems that these are not referenced anywhere in the repository.
Reviewed By: mweststrate
Differential Revision: D21176051
fbshipit-source-id: 502d4a2020d230f8c57bee31e15fbcf996484676
Summary: Re-use the same function for plugin building both at publishing time by "flipper-pkg" and in runtime by Flipper itself.
Reviewed By: jknoxville
Differential Revision: D21129685
fbshipit-source-id: b7bff6737310352d28a14223128f127ac4d2eebf
Summary:
Added versioning for plugin format.
The first version is where "main" points to source code entry and plugins are bundled by Flipper in run-time on loading them.
The second version is where "main" points to the already existing bundle and Flipper just loads it without bundling. The plugins of version 2 must be bundled using "flipper-pkg" tool before publishing.
Changelog: Support new packaging format for plugins.
Reviewed By: mweststrate
Differential Revision: D21074173
fbshipit-source-id: 7b70250e48e5bd5d359c96149fb5b14e67783c4d
Summary: "flipper-pkg" added ~2MB to Flipper disttributive size, because of heavy dependencies which are only required for CLI functionality. See size warning in diff D21068373 in this stack where I added pkg as dependency to flipper. Here I'm splitting it into library and CLI packages, so Flipper app will only reference the library.
Reviewed By: passy
Differential Revision: D21087336
fbshipit-source-id: d9d62f1e75a835d1c0fa78ff1addb0d9a761a9c7
Summary:
Just a convenient feature: `yarn start --open-dev-tools` opens Dev Tools window alongside with Flipper window.
Changelog: new command-line flag "--open-dev-tools" to automatically open Chrome Dev Tools for Flipper debugging.
Reviewed By: mweststrate
Differential Revision: D21074769
fbshipit-source-id: 12ae33ab74a3d35c54051321396d8701d72c7e32
Summary: Moved getWatchFolders script to flipper-pkg and used it from other packages. Script helps to resolve all the folders with package dependencies including symlinked folders in case if plugin is a part of yarn workspaces.
Reviewed By: mweststrate
Differential Revision: D21068373
fbshipit-source-id: 8691837fdb1aef333dab4c13d8758262838d36ee
Summary: Updated Metro to the latest version 0.59.0
Reviewed By: passy
Differential Revision: D21027614
fbshipit-source-id: 0b2c1c422dfed7e8426bb9a36c5626f3a96eb8f6
Summary: Currently Flipper shows empty Changelog with only "pre-history" entry. This is because of path in generation script is wrong now. Flipper shows Changelog.md from desktop/static, so generated entries should be added there rather than to Changelog.md in the root.
Reviewed By: passy
Differential Revision: D21016884
fbshipit-source-id: 8709a2556374ec70bc665eaf0729bb85fd0d913f
Summary:
This diff enables optional [Fast Refresh](https://reactnative.dev/docs/fast-refresh) for Flipper in dev mode. It can be opted-in using additional argument "--fast-refresh": `yarn start --fast-refresh`. I've copy-pasted the most part of implementation from React Native with some minor changes.
I made this optional for now as it works not ideally. In most cases which I checked it works fine, however for some files it falls back to full refresh (e.g. when `desktop/plugins/network/index.tsx` changed) and sometimes doesn't refresh content even after change detected and re-compiled (e.g. when `src/ui/components/searchable/Searchable.tsx` is changed, Network plugin which is dependent on it is not refreshed automatically).
State from redux is restored after fast refresh, but local state in class-based components is cleared. For function-based components local state is also stored, so it's an additional point to make plugins components functional :)
Also, for now there is no UI for Fast Refresh (loading indicator etc), information is just logged to console.
Changelog: Experimental support for Fast Refresh in dev mode can be enabled by `yarn start --fast-refresh`.
Reviewed By: jknoxville
Differential Revision: D20993073
fbshipit-source-id: 65632788df105a85fac0b924b7808120900b349e
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:
Refactored plugins compilation script by splitting it into 3 scripts: 1) search plugins 2) compile plugins 3) watch plugins.
No functional changes in this review, it's just preparation for further changes.
Reviewed By: passy
Differential Revision: D20860443
fbshipit-source-id: 02900430199875574b992e597d09b82d0d7f32ef
Summary:
Treat only packages with "flipper-plugin" keyword as Flipper plugins. This will allow to place lib packages re-used by different plugins into "plugins" folder.
Changelog: Internals: it is now possible to add modules for re-use by different plugins into `desktop/plugins` folder.
Reviewed By: mweststrate
Differential Revision: D20898133
fbshipit-source-id: 8934870350ce42af3dc8060d1494025519ed307e
Summary: We cannot just add internal plugins as workspaces to the root package.json in "sonar/desktop" as they are not open-sourced, so public build will break. Instead, I have created root package.json for internal plugins and added all internal plugins as workspaces there. This means all these plugins will use the single root yarn.lock and installation of their dependencies will be faster. This also means that plugins can declare dependencies to other local packages included into workspaces and they will be symlinked automatically.
Reviewed By: mweststrate
Differential Revision: D20806237
fbshipit-source-id: f8b3327166963dec7da8ac74079682aebe4527e1
Summary:
***
☝️ **Important announcement:** Greenkeeper will be saying goodbye 👋 and passing the torch to Snyk on June 3rd, 2020! [Find out how to migrate to Snyk and more at greenkeeper.io](https://greenkeeper.io)
***
## The dependency [electron-devtools-installer](https://github.com/MarshallOfSound/electron-devtools-installer) was updated from `2.2.4` to `3.0.0`.
This version is **not covered** by your **current version range**.
If you don’t accept this pull request, your project will work just like it did before. However, you might be missing out on a bunch of new features, fixes and/or performance improvements from the dependency update.
---
**Publisher:** [marshallofsound](https://www.npmjs.com/~marshallofsound)
**License:** MIT
<details>
<summary>Release Notes for v3.0.0</summary>
<h1><a href="https://urls.greenkeeper.io/MarshallOfSound/electron-devtools-installer/compare/v2.2.4...v3.0.0">3.0.0</a> (2020-04-07)</h1>
<h3>Bug Fixes</h3>
<ul>
<li>make extension store directory recursively (<a href="82479523e2">8247952</a>)</li>
<li>only allow installs from the main process (<a href="fc1d8781b6">fc1d878</a>)</li>
<li>support dynamic application path (<a href="https://urls.greenkeeper.io/MarshallOfSound/electron-devtools-installer/issues/88" data-hovercard-type="pull_request" data-hovercard-url="/MarshallOfSound/electron-devtools-installer/pull/88/hovercard">https://github.com/facebook/flipper/issues/88</a>) (<a href="e9471f9042">e9471f9</a>)</li>
<li>use ES6 standard imports for electron modules. Closes <a href="https://urls.greenkeeper.io/MarshallOfSound/electron-devtools-installer/issues/116" data-hovercard-type="pull_request" data-hovercard-url="/MarshallOfSound/electron-devtools-installer/pull/116/hovercard">https://github.com/facebook/flipper/issues/116</a> (<a href="dc0f6e4391">dc0f6e4</a>)</li>
</ul>
<h3>Features</h3>
<ul>
<li><strong>test:</strong> add mobx to unit tests (<a href="https://urls.greenkeeper.io/MarshallOfSound/electron-devtools-installer/issues/95" data-hovercard-type="pull_request" data-hovercard-url="/MarshallOfSound/electron-devtools-installer/pull/95/hovercard">https://github.com/facebook/flipper/issues/95</a>) (<a href="6d4f699877">6d4f699</a>)</li>
<li>Only allow installs from the main process (<a href="d692149da5">d692149</a>)</li>
</ul>
<h3>BREAKING CHANGES</h3>
<ul>
<li>Only allow installs from the main process</li>
</ul>
<p>The remote is being deprecated and as such we should not rely on it for what is a buggy and very small usability tweak.</p>
</details>
<details>
<summary>Commits</summary>
<p>The new version differs by 22 commits.</p>
<ul>
<li><a href="d692149da5"><code>d692149</code></a> <code>feat: Only allow installs from the main process</code></li>
<li><a href="0f3ebfc9d3"><code>0f3ebfc</code></a> <code>chore: update NPM readme badge</code></li>
<li><a href="ba9648c2b9"><code>ba9648c</code></a> <code>chore: update README badges</code></li>
<li><a href="776912cf7d"><code>776912c</code></a> <code>BREAKING CHANGE: Only allow installs from the main process</code></li>
<li><a href="ae075d13bc"><code>ae075d1</code></a> <code>build: update CFA plugin</code></li>
<li><a href="0dde83b4a7"><code>0dde83b</code></a> <code>build: use latest v10 node for release CI</code></li>
<li><a href="cc8700c784"><code>cc8700c</code></a> <code>build: update version number for CFA</code></li>
<li><a href="9628782f2f"><code>9628782</code></a> <code>build: add CFA</code></li>
<li><a href="7d5f157939"><code>7d5f157</code></a> <code>docs: clean up README</code></li>
<li><a href="6d4f699877"><code>6d4f699</code></a> <code>feat(test): add mobx to unit tests (https://github.com/facebook/flipper/issues/95)</code></li>
<li><a href="dc0f6e4391"><code>dc0f6e4</code></a> <code>fix: use ES6 standard imports for electron modules. Closes https://github.com/facebook/flipper/issues/116</code></li>
<li><a href="82479523e2"><code>8247952</code></a> <code>fix: make extension store directory recursively</code></li>
<li><a href="fc1d8781b6"><code>fc1d878</code></a> <code>fix: only allow installs from the main process</code></li>
<li><a href="a5dfe4c1b1"><code>a5dfe4c</code></a> <code>build: rename prepublish to prepare, closes https://github.com/facebook/flipper/issues/120</code></li>
<li><a href="a5242e1fd8"><code>a5242e1</code></a> <code>build: update dependencies</code></li>
</ul>
<p>There are 22 commits in total.</p>
<p>See the <a href="0b07982a06...d692149da5">full diff</a></p>
</details>
---
<details>
<summary>FAQ and help</summary>
There is a collection of [frequently asked questions](https://greenkeeper.io/faq.html). If those don’t help, you can always [ask the humans behind Greenkeeper](https://github.com/greenkeeperio/greenkeeper/issues/new).
</details>
---
Your [Greenkeeper](https://greenkeeper.io) bot 🌴
Pull Request resolved: https://github.com/facebook/flipper/pull/988
Test Plan:
{F233368502}
Tested in Flipper
Reviewed By: cekkaewnumchai
Differential Revision: D20889307
Pulled By: passy
fbshipit-source-id: 63ed886cceefe34dc7d4212f25d05c5e13f7dab8
Summary:
This adds another field to the exit data to record whether we had a clean exit where the app was closed as it should.
Note that doing a reload inside Flipper will be recorded as an unclean exit.
Reviewed By: passy
Differential Revision: D20915481
fbshipit-source-id: 240192d7a69bf620bfaa316e3e5cb0f45d6a34cc
Summary:
# Zero Redux DevTools
Our awesome new Zero Rating SDK is based on a Redux/Saga Library, and part of the reason for it is the amazing DevTools we can add around it.
State & Sagas visibility, manipulation, and even time-machine.
Comes as a Flipper Plugin to Android first, then iOS.
Inspired by JavaScript's [Redux DevTools @ GitHub](https://github.com/reduxjs/redux-devtools).
## This Diff
**Adding UI to our Flipper Desktop App.**
- React components to structure our plugin. Root + Tabs.
- Currently enabled: Actions Tab. with Actions (& state) Details side view
- Currently Disabled: SDK Tab, Sagas Tab.
- added a get "PluginFeatures" command to enable/disable desktop feature based on the app implementation (Fb4a/ FBLite / Wild, etc)
{F232877109}
Reviewed By: egergo
Differential Revision: D20350029
fbshipit-source-id: 000a7fda70026fbc3e121e46a6ac5905af9c807d
Summary:
React component to show Bloks scripts + simple ad-hoc code formatter
built on top of codemirrror https://codemirror.net/
Differential Revision: D20868214
fbshipit-source-id: 7c399347a6595b9aad354bad166bb72890a9ce57
Summary:
Fixed error "SHA-1 for file is not computed" on 3rd party plugin compilation in dev mode. The error started to appear after moving to yarn workspaces.
Changelog: Fixed error "SHA-1 for file is not computed" on 3rd party plugin compilation in dev mode (yarn start).
Reviewed By: mweststrate
Differential Revision: D20789712
fbshipit-source-id: bbc2fcca197955da50ebf2b51a1fd9cb62f79727
Summary: Publish all the public packages (excluding those with "private=true") included as workspaces to "desktop" project.
Reviewed By: jknoxville
Differential Revision: D20765097
fbshipit-source-id: 444541e9a682a90eba02cb3da85ada9bd00d93d0
Summary:
Automatically bump versions for all local npm packages included as workspaces and fix local dependencies correspondingly.
As a part of this I have also aligned versioning for all the packages by using the same version for all of them.
Reviewed By: jknoxville
Differential Revision: D20745632
fbshipit-source-id: 2d438c4b23ee72f7d7c068c5ce161063c7ceb9e5
Summary: Import ws package in a usual way instead of importing it as source code
Reviewed By: jknoxville
Differential Revision: D20724584
fbshipit-source-id: 39cad6e544b71e66560a9351f1e5a0c89be2c152
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:
These aren't updated but - importantly - are pinning
some deps with security vulns.
Reviewed By: nikoant
Differential Revision: D20645332
fbshipit-source-id: 491721d5a856e55f23e6a9608ae11632e1667eb2
Summary:
This gets us on the latest Prettier 2.x:
https://prettier.io/blog/2020/03/21/2.0.0.html
Notably, this adds support for TypeScript 3.8,
which introduces new syntax, such as `import type`.
Reviewed By: zertosh
Differential Revision: D20636268
fbshipit-source-id: fca5833d003804333a05ba16325bbbe0e06d6c8a
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: Fix for build on windows
Reviewed By: mweststrate
Differential Revision: D20601309
fbshipit-source-id: 9845964513d7904f58e3511b1c4daa8716f7b054
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:
Follow up of D20454562
We now set an origin header, but use https instead of http, which is currently not supported by the public RN version (for the internal RN version support was added in D20526486).
However, not promoting ourselves as running on a secured connection seems like the more trustworthy thing to do, and better reflects reality.
Reviewed By: nikoant
Differential Revision: D20534363
fbshipit-source-id: e26fabd77013920e4c58fdbf552bb909f0499cae
Summary:
In this diff we persist data about the state of the app when exiting, and to make sure we capture it in crashes, do that as part of track-usage events as well.
with the exit data we also capture what kind of device and plugin the user was using, so that we can detect anomalies like flipper needing restarting more often for certain plugins
during startup, we will always send an event how long it was since the last startup, including the above information
Reviewed By: passy
Differential Revision: D20515200
fbshipit-source-id: ead971e05542e0ef58ed5e5b204af70b51a15b9b
Summary:
Added a menu option to show the current changelog.
Automatically showing it will be done in a next diff.
Reviewed By: passy
Differential Revision: D20219725
fbshipit-source-id: 96727d2e4b2280a814f28298e7440db5e4dd7870
Summary:
Currenty in the prod version of Flipper the endpoints of media upload and flipper trace fail with status code 400. Reason being different origin and refferer as compared to the dev version. This diff matches the origin and the refferer with the dev one.
I referenced Anton's diff D20278701.
Reviewed By: nikoant
Differential Revision: D20454562
fbshipit-source-id: 20f80a731878fb491d08a208d64fc9260e442fa3
Summary:
Pull Request resolved: https://github.com/facebook/flipper/pull/878
1) Enabled eslint error reporting for unresolved imports and fixed all the errors
2) Enabled eslint for typings (d.ts) and fixed all the errors
Reviewed By: passy
Differential Revision: D20335151
fbshipit-source-id: 7b142281a406b32df0f02a5cd0d7d05eba941acd
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