Summary:
Previously, at 1-minute intervals, if the flipper window was focused on, it would report the currently active plugin.
We'd sum all those "ping" events and that would approximate the number of full minutes spent in total across all users.
It's quite coarse grained, if you're focused on the window for 30 seconds, there's a 50% change your ping will get used.
While being reasonable across many users, it doesn't allow analysis like how many plugins do people typically use in a session, because we probably won't see all the plugins they use.
New approach, for every minute flipper is open, report the focused and unfocused time spent in each plugin, as well as the total across all plugins.
This should give us the previous data but with much more precision.
Should be especially helpful for plugins with low numbers of users, you typically interact with emulators while using a plugin, so it's not continually in focus, so you miss a lot of usage events.
enhance_bladerunner
Reviewed By: nikoant
Differential Revision: D19392796
fbshipit-source-id: af9244e993edff9b381144ca587c3a77fdf8c98a
Summary:
Passing in unknown options along with `flutter-static` now shows the default warning message as part of the API.
## Changelog
show default warning message on firing in unknown flags
Pull Request resolved: https://github.com/facebook/flipper/pull/715
Test Plan: Tested `yarn start` with unknown arguments. Now raises an error.
Reviewed By: mweststrate
Differential Revision: D19389776
Pulled By: passy
fbshipit-source-id: 2f844e38c8be0e4e53b171b98035338226a0a08a
Summary: `compilePlugins.js` was still flow typed, but our current formatting setup breaks the file as soon as it is changed. This diff removes the (minimal) flow types and applies prettier
Reviewed By: jknoxville
Differential Revision: D18297696
fbshipit-source-id: 4af2318083188d8758981183f10ccd80e14feea2
Summary:
In the previous implementation plugins were downloaded from npm, but dependencies weren't. This diff uses the `live-plugin-manager` which does mostly what we want. It install a package from NPM with all its dependencies.
live-plugin-manager puts the plugin and its dependencies in the same folder. We expect the plugins to be in `node_modules`. For this reason, we are installing the plugin into `$pluginName/node_modules` and move the plugin after the installation out of the `node_modules` folder.
* Fixed plugin loading path for thirdparty plugins.
* Disabled hot reloading for plugins in the flipper folder to prevent reloads when moving around files and installing dependencies here.
* an empty `.watchmanconfig` is created, because metro requires it
* tsx files are added to the list of supported extensions for metro
Reviewed By: passy
Differential Revision: D17570413
fbshipit-source-id: ecbedc60841b36188fec9c83da41ef1f27e5e155
Summary:
In my last plugin for React VR I used spawn heavily to call adb and python2. It worked out well, but after Flipper released, I noticed that all my spawn commands were broken.
I found that Electron start in different way when bundled as production bundle, and because of it, it does not inherit process.env.PATH in a same way as it do this for development mode. (only linux/mac issue)
In this diff I used npm package which detects linux/mac and executes bash command which returns all the env variables from the system. After it, it takes PATH and merge it with process.env.PATH.
Reviewed By: passy
Differential Revision: D16457847
fbshipit-source-id: 60226f2d7977f1dfec49de6e889f3115d8688991
Summary: When Trace has been uploaded, load it inside a webview in Flipper.
Reviewed By: habond
Differential Revision: D16185763
fbshipit-source-id: 3217211f1d5035fc16d733ef48db44d8f8d9d360
Summary:
Non-final identifiers make code harder to understand.
This is particularly true for JavaScript where even the *type*
can change as a value gets reassigned later.
This enforces to use `const` whereever possible, but doesn't
"outlaw" `let`. Mixed destructuring is also still allowed.
Used `eslint --fix` to change all existing cases.
Reviewed By: jknoxville
Differential Revision: D16131329
fbshipit-source-id: 2eceaca7c603b71b36e005be5d135e1849f2518d
Summary:
We in React VR were need newer Chrome DevTools version to make our plugin work properly. Chromium version with required fixes were shipped in electron 5.0.0.
This diff bumps electron version and explicitly allows node integration (accessing require, process and other node related functions from window object in index.html), because it was disabled by default in 5.0.0.
Reviewed By: jknoxville
Differential Revision: D15693539
fbshipit-source-id: 4f71a07b2afaa489aec46940c924f4ad30ad0413
Summary:
Flipper Electron delegates to the Launcher if it is found right on startup to fetch the most recent/compatible version of Flipper. The Launcher then opens the downloaded app with a `--no-launcher` option to avoid bouncing back and forth between the Electron app and the Launcher.
This depends on the argument processing working unchanged. In the past this has been somewhat difficult to guarantee as this doesn't happen in one place and dev/prod builds have handled arguments different due to Electron weirdness (requiring a `--` passed in, for instance).
If anything here goes wrong, we end up in a very nasty scenario where the launcher and the Electron app rapidly open and close, making it nearly impossible for users to escape that vicious cycle. `pkill -f Flipper` being the best option, if you can focus a terminal for long enough.
In order to avoid this from ever happening in the future, this introduces a quick check for the last startup is written with a timestamp and if this is less than 5s in the past, we will skip delegating to the Launcher altogether, keeping the current instance running.
Reviewed By: jknoxville
Differential Revision: D14598136
fbshipit-source-id: b3335ce7ec7dc3e5e014d459db31df4c8a774fc6
Summary:
When passing --file or --url explicitly on startup, they should
be used in the same way that event handlers are used.
Reviewed By: jknoxville
Differential Revision: D14598688
fbshipit-source-id: 07179227da3b6c754a4d3a9e15342474e39d72b7
Summary:
Changes where we delegate to the launcher to a later point so we can successfully intercept file open events and custom URI events.
There's more information in Phase 1 in this paragraph of the doc: https://fb.quip.com/tpqnAbxnJw1w#UNZACAnVVGs
Reviewed By: danielbuechele
Differential Revision: D14563585
fbshipit-source-id: a8757a6072386e56102f15b0668456369a44aad7
Summary:
Positional arguments with yargs are a mess, so I'm adding a `--file` instead.
This can then be used to pass parameters on through the launcher.
Reviewed By: danielbuechele
Differential Revision: D14525320
fbshipit-source-id: f04ebed85b6eb9e3c82e76736695d41e7bafb301
Summary:
Adding support for downloading archived Flipper data using a URL handler.
A URL looks like `flipper://import/?url=` and will download the file specified in the url param. While downloading the file, a spinner is shown in the app's titlebar.
Reviewed By: jknoxville
Differential Revision: D14262763
fbshipit-source-id: 6538fc78c07a48cef7b71b3f7bdbcb712d054593
Summary:
Started with upgrading electron from 3.0.0 to 4.0.5. This required a bunch of subsequent updates:
* upgrading `electron-builder` to latest version, because the old version couldn't build electron 4 apps.
* `appDir` is deprecated in builder config, `projectDir` is used instead, which we already had set, so its fine to just remove this ([see GitHub commit](a5e457163e)).
* upgrading `jest-runner/electron` because the old version couldn't run electron 4 tests.
* upgrading our custom dependency resolution to use electron 4.0.5, because the test runner still resolves to 2.0.8 ([see GitHub issue](https://github.com/facebook-atom/jest-electron-runner/issues/31)).
* updating `sandcastle.sh` to use the new cache files from D14131344.
* removing `package-lock.json` as is was causing warnings. We use `yarn` and `yarn.lock` anyways. This file must have been committed by accident.
* updating our check to only run one version of Flipper at a time to use the new electron API `app.requestSingleInstanceLock` as the old one was removed in electron 4.
* updating the snapshot test that checks App rendering, which changed a little due to the electron upgrade.
* upgrading flow-type definitions to `electron-v4.0.5.js` generated by [electron-flowtype-definitions](https://github.com/danielbuechele/electron-flowtype-definitions).
**PS: Best new feature in Electron 4: Copy&paste working in dev tools**
Reviewed By: jknoxville
Differential Revision: D14131360
fbshipit-source-id: d7ed9643875629a1fa1860bb61b11dd0c64112ab
Summary:
Allows the launcher to provide messages to the user. Currently, in the form
of the red notification bar at the bottom. This is just meant as a temporary measure
during the alpha to have some clearly noticeable way of getting the user's attention.
I consider removing this a blocker for the release as this mechanism is not well
suited for this in many ways.
The current use case for this is providing a warning if a cached version is used
instead of the requested one, e.g. "Could not fetch requested Flipper version 'deadbeef', using cached version instead."
Reviewed By: jknoxville, priteshrnandgaonkar
Differential Revision: D14073687
fbshipit-source-id: 85630347027063103315eeb1286731fe2478e261
Summary: This diff imports and exports data in a `.flipper` file extension. This diff also adds the support to open flipper app by double clicking on the `.flipper` file.
Reviewed By: danielbuechele
Differential Revision: D14042846
fbshipit-source-id: 17e6b55bf2796d9abdf985411fce799600f7792b
Summary:
This seems like a better approach than ad-hoc lookup in
`electron.remove.argv`. Left a note to a task to provide
a better interface to this.
I also need this in order to ensure we're starting
Flipper through the launcher which needs to happen
before we start the Electron runtime.
Reviewed By: jknoxville
Differential Revision: D13881355
fbshipit-source-id: 69c70d71035a47084f789ddb4dc969b45ba4648b
Summary:
Instead of replacing the tilde with home-dirs on an incomplete, ad-hoc
basis, let's use a package for this. It also supports `~USER` resolution
which someone might reasonbly expect to work if `~/DIR` is working.
Reviewed By: jknoxville
Differential Revision: D13940956
fbshipit-source-id: 5bfa9b8b2540fed8c05c856ff736e48e925f985d
Summary:
`static/index.js` is called by Electron's main process, it does the setup required to run Flipper. However, some of this setup is electron specific, other is not. This moves all non-Electron specific code into `setup.js` which later can be called from node, too. All Electron specific stuff is still in `static/index.js`.
On a side note, this remove the renaming from `.sonar` to `.flipper` config folder, as I think most users should have been migrated by now, users that are not yet migrated will lose their settings, which isn't too much of an issue as our settings are very minimal anyways.
Reviewed By: passy
Differential Revision: D13638253
fbshipit-source-id: 22ab2a65ffec87b40bd86899630d582d9dc5d05c
Summary: This diff adds action buttons to the notifications. Notifications with actions can only be sent from the main process. This is why we need to send a message to the main process which then shows the notification. The action callbacks are sent back to the renderer process to handle the action and log the event.
Reviewed By: passy
Differential Revision: D12999886
fbshipit-source-id: b415fded3172582fad11d88cabf0cfc5b3b8d4f9
Summary:
- Set userPrefferedPlugin for external deeplink
- Listen for deeplink in renderer process and navigate accordingly
Reviewed By: passy
Differential Revision: D10339035
fbshipit-source-id: 4de6249a0672f9ce02b0dfb78a4563302c308578
Summary: This diff adds a basic setup of deeplink, with this diff whenever the link is entered in the browser the flipper app is opened and the corresponding.
Reviewed By: passy
Differential Revision: D10149797
fbshipit-source-id: ddff3d794aec66f9e878abcf4c81e87dfadca070
Summary: When no config folder exists, a folder named `.sonar` was created. Instead `.flipper` should be created.
Reviewed By: hning
Differential Revision: D9754717
fbshipit-source-id: 89a7f5c80a9202f448a6bafcf461c941b656c15e
Summary:
I wanted to use Flipper/Sonar in a fullscreen/split screen environment end was surprised the feature was disabled. When I checked the blame it looks like it's been like this from the get go, so there might not even be a real reason to have it disabled. Please correct me if I'm wrong.
The default value for `fullsreenable` is true. Removing setting the
parameter reenables the feature.
- Flipped the switch, saw it go fullscreen
- Also works in split screens
Pull Request resolved: https://github.com/facebook/flipper/pull/259
Reviewed By: danielbuechele
Differential Revision: D9630068
Pulled By: passy
fbshipit-source-id: 650e54895dc596090e2edcf2802bb0020f207ecc
Summary: The console was pretty spammy. This fixes some issues that were logged and changes many log statements to `console.debug` which are not shown by default.
Reviewed By: passy
Differential Revision: D9303011
fbshipit-source-id: 1102f4f8814152a45f155cb43488a515c2d4eee4
Summary: Adds tracking from opening the application to the interface being shown.
Reviewed By: passy
Differential Revision: D9239037
fbshipit-source-id: eba60a9e839f9cc2b7a3c8706c6b9d63acb854b4
Summary: The sidebar is now shown, even if no device is connected. This prevents the jumping layout when Flipper launches, but still has not connected to devices.
Reviewed By: passy
Differential Revision: D9263892
fbshipit-source-id: d5b96a8619393ee4002863a83d9024f00c6cb396
Summary:
To make the transition from the old to the new name as smooth as possible, we want to allow people to launch the app using its old name via Spotlight.
Therefore, we set a comment on the executable with the old name. These comments are indexed by Spotlight and the app can be launched with the old name.
Reviewed By: passy, priteshrnandgaonkar
Differential Revision: D9149323
fbshipit-source-id: b812776350b3fc57dc3a193bcd96c343a13a039f
Summary: `~` is not supported by node's `fs` functions. So we are replacing it manually.
Reviewed By: priteshrnandgaonkar
Differential Revision: D8658889
fbshipit-source-id: 36c9885a00a7e07e54ab416d6fda3b29bbda73b6
Summary:
There are 3 sources where plugins can be loaded from:
* `src/plugins`
* `src/fb/plugins`
* any path specified in `~/.sonar/config.json`
Plugins found in the first two directories are bundled with the app when building.
Reviewed By: jknoxville
Differential Revision: D8636061
fbshipit-source-id: 2064090d43d11695ffd99df195e5b594559fe087