Commit Graph

396 Commits

Author SHA1 Message Date
Pascal Hartig
4d58563168 Ignore unnecessary build artifacts
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
2020-04-24 08:35:32 -07:00
generatedunixname89002005306973
99c5a427c7 Flipper Release: v0.39.0
Summary: Releasing version 0.39.0

Reviewed By: mweststrate

Differential Revision: D21199718

fbshipit-source-id: 1082098a2b4fcfaa7b7efb201e8321331fd4bdc4
2020-04-23 03:57:12 -07:00
Pascal Hartig
f5ed06cbd7 Remove unused pattern.gif
Summary: Can't find a reference to this.

Reviewed By: jknoxville

Differential Revision: D21177180

fbshipit-source-id: 52da3987d99d2648d67aa65a20b796be94d9b856
2020-04-23 02:05:56 -07:00
Pascal Hartig
7e768f3e1f Remove unused static resources
Summary: It seems that these are not referenced anywhere in the repository.

Reviewed By: mweststrate

Differential Revision: D21176051

fbshipit-source-id: 502d4a2020d230f8c57bee31e15fbcf996484676
2020-04-22 05:07:07 -07:00
Michel Weststrate
18b88a7e03 Flipper Release: v0.38.0
Summary: Releasing version 0.38.0

Reviewed By: cekkaewnumchai

Differential Revision: D21155371

fbshipit-source-id: 554393fc357135cd8538c9b77eee023f8a3e1525
2020-04-21 13:10:56 -07:00
Anton Nikolaev
8a7470556e Re-use pkg-lib for runtime plugin compilation
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
2020-04-20 06:59:38 -07:00
Anton Nikolaev
ca2d04a5da Versioning for plugin format
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
2020-04-20 06:03:16 -07:00
Anton Nikolaev
21b79af5f2 Split package "flipper-pkg" into two: lib and cli
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
2020-04-17 10:01:31 -07:00
Anton Nikolaev
8addd43f09 Flag "--open-dev-tools" to automatically open dev tools on startup
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
2020-04-17 06:19:26 -07:00
Anton Nikolaev
ebfd045328 Fix symlinks resolution for plugin dependencies
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
2020-04-17 05:24:35 -07:00
Anton Nikolaev
627cc8fe7f Update Metro
Summary: Updated Metro to the latest version 0.59.0

Reviewed By: passy

Differential Revision: D21027614

fbshipit-source-id: 0b2c1c422dfed7e8426bb9a36c5626f3a96eb8f6
2020-04-15 03:59:38 -07:00
Anton Nikolaev
a08bed86b7 Fix changelog.md generation
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
2020-04-14 09:21:58 -07:00
Anton Nikolaev
a54aad57a7 Fast refresh
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
2020-04-14 07:20:40 -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
Anton Nikolaev
cc96fc984c Refactor plugins compilation script
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
2020-04-14 07:20:39 -07:00
Anton Nikolaev
61a889a385 Treat only packages with "flipper-plugin" keyword as Flipper plugins
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
2020-04-14 07:20:39 -07:00
Anton Nikolaev
452c52c291 Add internal plugins as workspaces to single package.json
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
2020-04-14 07:20:38 -07:00
generatedunixname89002005306973
2d27b90bd9 Flipper Release: v0.37.0
Summary: Releasing version 0.37.0

Reviewed By: jknoxville

Differential Revision: D20919249

fbshipit-source-id: 59ec28ba10043da03c460d9eaadb30a8fd2e4a6f
2020-04-09 03:07:19 -07:00
greenkeeper[bot]
52b244ca32 Update electron-devtools-installer in group static to the latest version � (#988)
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
2020-04-08 07:18:05 -07:00
Michel Weststrate
220052d70d measure clean versus unclean exits
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
2020-04-08 06:26:30 -07:00
Aviad Sachs
e787ce631e Plugin React Componenets (UI)
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
2020-04-08 04:34:56 -07:00
Timur Valiev
6300f9394b blocks scripts viewer/editor
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
2020-04-07 10:12:28 -07:00
Anton Nikolaev
e35bf2c1ae Flipper Release: v0.36.0
Summary: Releasing version 0.36.0

Reviewed By: passy

Differential Revision: D20835543

fbshipit-source-id: f5d9e8884410b294d4f37cb98db614da4592e6df
2020-04-03 08:36:49 -07:00
Anton Nikolaev
0711617c63 Fixed error with 3rd plugin compilation in dev mode
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
2020-04-01 03:07:39 -07:00
Anton Nikolaev
bf32297ad9 Publish all packages to npm on release
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
2020-03-31 06:34:39 -07:00
Anton Nikolaev
eb9a2cb5e7 Bump versions for all npm packages on release
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
2020-03-31 06:34:39 -07:00
Anton Nikolaev
2e88936a29 Import ws package
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
2020-03-31 02:45:07 -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
34a2ebe2e9 Remove yarn.lock for workspaces
Summary:
These aren't updated but - importantly - are pinning
some deps with security vulns.

Reviewed By: nikoant

Differential Revision: D20645332

fbshipit-source-id: 491721d5a856e55f23e6a9608ae11632e1667eb2
2020-03-25 08:08:46 -07:00
Timur Valiev
01aa61bcb3 rename to Execution Flows (Fury) + new icon + make public (non gk)
Reviewed By: SimoneCasagranda

Differential Revision: D20619591

fbshipit-source-id: af933bcf45a9bdd7057a9d16c97ea9f7650d5993
2020-03-25 04:25:45 -07:00
Anton Nikolaev
a46cb85bac Fix compilation of plugins in run-time after installation
Summary: Fixed compilation of installed plugins in run-time

Reviewed By: passy

Differential Revision: D20642377

fbshipit-source-id: d5012c88eebf1f7106de538b84c7695048408924
2020-03-25 03:26:59 -07:00
Michael Bolin
37f0260116 Back out "Upgrade Prettier from 1.17 to 2.0.2."
Differential Revision: D20639755

fbshipit-source-id: 5028563f9cf0527a30b4259daac50cdc03934bfd
2020-03-24 21:48:09 -07:00
Michael Bolin
8658fca4dd Upgrade Prettier from 1.17 to 2.0.2.
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
2020-03-24 20:24:52 -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
d9d3be33b4 Fix build on windows
Summary: Fix for build on windows

Reviewed By: mweststrate

Differential Revision: D20601309

fbshipit-source-id: 9845964513d7904f58e3511b1c4daa8716f7b054
2020-03-24 08:08:20 -07:00
Alexander Kawrykow
0b6b5a0582 Add basic tabbed layout
Summary: Adding a marketplace icon

Differential Revision: D20459204

fbshipit-source-id: 2c76e34c7911209b71be0c7194e27655f4a48dde
2020-03-20 17:35:36 -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
Michel Weststrate
068f19461a Use http://localhost for origin instead of https
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
2020-03-19 06:26:01 -07:00
Michel Weststrate
ddf5df98c7 Track flipper crashes / restarts
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
2020-03-19 02:50:48 -07:00
Michel Weststrate
3da7552779 Add 'show changelog' menu item [3/n]
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
2020-03-18 06:47:57 -07:00
Pascal Hartig
28e735a4c5 Fix prettier error (#893)
Summary:
^
Pull Request resolved: https://github.com/facebook/flipper/pull/893

Test Plan: eyes

Reviewed By: nikoant

Differential Revision: D20469555

Pulled By: passy

fbshipit-source-id: 70e3ebbc8a65de5f2fc407b9435d5b249f158f00
2020-03-16 11:00:57 -07:00
Pritesh Nandgaonkar
d75be90522 Fix the graph API failures
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
2020-03-16 05:23:15 -07:00
Anton Nikolaev
10d990c32c Move plugins to "sonar/desktop/plugins"
Summary:
Plugins moved from "sonar/desktop/src/plugins" to "sonar/desktop/plugins".

Fixed all the paths after moving.

New "desktop" folder structure:
- `src` - Flipper desktop app JS code executing in Electron Renderer (Chrome) process.
- `static` - Flipper desktop app JS code executing in Electron Main (Node.js) process.
- `plugins` - Flipper desktop JS plugins.
- `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 desktop app.
- `headless-tests` - Integration tests running agains Flipper headless version.

Reviewed By: mweststrate

Differential Revision: D20344186

fbshipit-source-id: d020da970b2ea1e001f9061a8782bfeb54e31ba0
2020-03-14 14:35:18 -07:00
Anton Nikolaev
beb5c85e69 Enable eslint import checks and fixed the reported errors (#878)
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
2020-03-14 14:35:18 -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