Summary: Per title. Required as Scribe is now being used for device tests.
Reviewed By: jknoxville, danielbuechele
Differential Revision: D13971892
fbshipit-source-id: 2df36d44d4e45a579cc9cca0d4cad9105ba8a383
Summary:
It's a bit hacky but apparently the recommended solution:
https://stackoverflow.com/questions/28615293/is-there-a-jest-config-that-will-fail-tests-on-console-warn
This will bail when a call to `console.error` is used in a test.
If you *need to* use console.error in a test, then mock it.
This will likely not pass yet, but let's fix all failures and then land it.
Reviewed By: danielbuechele
Differential Revision: D13898383
fbshipit-source-id: 0ca222a07433a9a311dc6bdf0d264342a59208be
Summary: While running in dev mode, there are no bundled plugins. This was causing an error messages being logged. Now we early return an empty array to prevent the error.
Reviewed By: passy
Differential Revision: D13971930
fbshipit-source-id: 4110a3ea5d6d2e60b3de17a43d497a3727b8e441
Summary:
Moves the JSON config access to one module instead of
ad-hoc de-serialising the object all over the place.
This also adds a type for it so we hopefully won't typo things that easily.
Reviewed By: danielbuechele
Differential Revision: D13956612
fbshipit-source-id: 48098deafedf18cc86c8802a3c40fba9394b8262
Summary:
- create a zip-file when building the headless version of Flipper
- restore pkg cache in Sandcastle from pantri
- run build script in sandcastle.
Changes need to go together with D13942919
Reviewed By: passy
Differential Revision: D13942701
fbshipit-source-id: caac7d6cda99fec2a6836c652957ff609a0bf8bb
Summary:
Instead of using IOSDevice, used ArchivedDevice, as it doesn't instantiate the loglistener which printed erros in the console when one ran the tests.
Look at the attached task.
Reviewed By: passy
Differential Revision: D13941803
fbshipit-source-id: 3e504a02522719985afaad25caf4d2a576bfc338
Summary: This diff adds support to specify custom location to save the flipper data to be exported
Reviewed By: passy
Differential Revision: D13916944
fbshipit-source-id: cfe816d07eb505d99c00f7798f3a97a2093ab265
Summary:
This diff adds the feature to import the exported flipper data. It has the following features
- Dialog to select the file
- Merges the data with an existing store.
Reviewed By: danielbuechele
Differential Revision: D13901944
fbshipit-source-id: 1b9755735419732a34254bdc39d911bcb51ad8fe
Summary: In preparation for the Sections plugin.
Reviewed By: mihaelao
Differential Revision: D13956804
fbshipit-source-id: a1c34d4a52d443f750f749e3637ac24fd25949ff
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: listening on `SIGINT` events and putting the serialized store to stdout.
Reviewed By: passy
Differential Revision: D13878051
fbshipit-source-id: 19c1d857a299ed9a474605169c54e5359e0515bd
Summary:
Wrapping console to send all console.logs to stderr, as we are planning to use stdout for the actual data.
By default only console.error messages are logged. I will add a `-v` argument to show all.
Also, displaying some ASCII-art and the version number when starting flipper CLI.
Reviewed By: passy
Differential Revision: D13843675
fbshipit-source-id: acaa70d16f12965a8426abca506049dbafb7962c
Summary:
* The generation of the version number is moved to build-utils so it can be used from the headless build process as well.
* The prelude script for the headless version exposes the version number on `global.__VERSION__`
* While at this file, moving some functions in the build process to use the Sync version. Doesn't matter for the build process anyways and the syntax is much nicer.
Reviewed By: passy
Differential Revision: D13843678
fbshipit-source-id: 7df8364044ab6ebc83a4060aab2e3a42ae48a934
Summary:
For the electron build, plugins are bundled with the app and loaded from there at launch. The headless version can't require from its binary, so plugins need to be required from another path.
This diff makes the path where bundled plugins are loaded from adjustable via an environment variable: `BUNDLED_PLUGIN_PATH`. If it's set, the plugins are loaded from this path, otherwise we default to the old behaviour of including them from `./defaultPlugins`.
For the headless version we expect the plugins to be in a folder called `plugins` next to the executable. This should later be configurable via an argument passed to the CLI.
Reviewed By: passy
Differential Revision: D13843676
fbshipit-source-id: 04237ae6631b4f2ba56887fe992a56f860724edc
Summary:
Building binaries for the headless version of Flipper. These binaries include node, so they can be run independent on any system.
allow-large-files
Reviewed By: passy
Differential Revision: D13843677
fbshipit-source-id: c053177328ddfcba11f9a293951ebe4db4d84034
Summary:
Pixels don't seem to allow modifying the modification time
of files on the "sdcard". You can repro this by getting a Pixel
device and running
```
$ adb shell touch /sdcard/boop
$ adb shell touch /sdcard/boop
touch: '/sdcard/boop': Invalid argument
```
Access time seems to work, strangely enough, but I'd rather
not play games and just create an empty file instead with echo.
Reviewed By: danielbuechele
Differential Revision: D13941381
fbshipit-source-id: 1321482a07a6698aa5eaf71e5a022c8e7dfe0b18
Summary:
For the Sections plugin I need to be able to highlight multiple views at the same time (without highlighting their parent view). This enables us to do that. Let me know if you have any concerns
Depends on D13803412
Reviewed By: astreet
Differential Revision: D13900729
fbshipit-source-id: cdea9c21ceb11563793410b2bb8f7f2c3a44cefb
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:
Just splitting the diff adding the dep from using it
because this is always quite noisy.
Reviewed By: jknoxville
Differential Revision: D13940957
fbshipit-source-id: b31a953a7ebdce9a6611c47ee007c051cdcac147
Summary: This diff makes sure that flipper error notifications are triggered only on the non-prod builds. Ideally we should have a preference in the flipper app itself, this we can work out later. As this diff solves the issue posted in the [group](https://fb.workplace.com/groups/230455004101832/permalink/561100837703912/).
Reviewed By: passy
Differential Revision: D13923819
fbshipit-source-id: 6598f00ab3a7b0c4a3b783120e62a1796fe4e5d2
Summary:
Upgrading to flow 0.91, fixing a bunch of `$FloxFixMe`s that were introduced by upgrading to 0.86.
Also fixing some linting issues.
Reviewed By: priteshrnandgaonkar
Differential Revision: D13900794
fbshipit-source-id: 5d0a1b62371f3b5d34b909bae0876583acb6f977
Summary:
- Added build-headless yarn target for producing a headless binary
- Crash Reporter plugin added. Details [here](https://fbflipper.com/docs/crash-reporter-plugin.html).
- Bug fixes and dependency updates
- Desktop notifications for all kinds of crashes with their callstack
- Desktop notifications when an exception occurs within [Litho's error boundaries](https://fblitho.com/docs/error-boundaries)
- Ability to deeplink to the crash entry in the Logs plugin for Android. This feature is not available in iOS as the callstack doesn't get logged through Flipper's Logs plugin
- Ability to copy the stacktrace by right-clicking it
- Ability to see the list of crashes in the Notifications hub
Reviewed By: passy
Differential Revision: D13880665
fbshipit-source-id: 92a3455bb826b6fb22858e2c4c88c0b9ace91a5f
Summary: Exposes crash reporter plugin and export data functionality to open source
Reviewed By: passy
Differential Revision: D13879149
fbshipit-source-id: ee10097cc9ff1af11e0350f50c855d7766076cd1
Summary: Makes the command easier as this is a one-liner
Reviewed By: passy
Differential Revision: D13878049
fbshipit-source-id: 99477939e51524234ae06c42687ae3a2db31211e
Summary:
Adds an optional "plugin" field to the tracked metrics. The idea is to be able to see failures in plugins.
Added it around all desktop -> sdk "call"s, so it won't require any effort from developers but we'll get lots of immediate data. E.g. How often layout -> getNodes fails. I think we can go modify the existing pipeline to take both platform and plugin data so we can get session roll-ups too.
Corresponding change to the puma app: D13882629, adds a plugin field to all tables so we can filter by plugin, or null for platform failures.
I'm thinking it will be worthwhile to expose some method to plugin developers, that lets them explicitly track failures. It would be better if it encapsulated their plugin id etc, so they just need to say what failed. But that can be done any time, I don't have any particular use cases in mind yet.
Reviewed By: passy
Differential Revision: D13878379
fbshipit-source-id: 2e2ef6b98f763e6edcfe937741d6988dae4b92d1
Summary: Change from `recordSuccessMetric` to `reportPlatformFailures`, because the next diff adds `reportPluginFailures` and I want to distinguish the two.
Reviewed By: passy
Differential Revision: D13878380
fbshipit-source-id: 9c6b8bfe1ed2e1a8bbe5aacbec31d24e9aa39171
Summary:
The function itself can easily be pure. Let's have the side-effects
(lookup of env variable and error handling) outside of it. Also
prevents spam in the test log (which I intend to make a test failure
going forwards).
Current output:
{F149794656}
Reviewed By: jknoxville
Differential Revision: D13894995
fbshipit-source-id: dacf51f8b35cb427740f9566ef993ffc6b2c3906
Summary:
Umm, this is embarrassing. I thouhgt I did this when I put
up the first diff? Apparently I didn't. Well, I just ran
this for `0.14.2` and now it actually does what it
says on the tin.
Reviewed By: danielbuechele
Differential Revision: D13861574
fbshipit-source-id: dd7ae30a97e6da036d3a30b43de941e82088062c
Summary: If one logListener was to throw an error, the others wouldn't receive the logs anymore.
Reviewed By: jknoxville
Differential Revision: D13881128
fbshipit-source-id: a653ba9279380c25bbc7ae2fd0c63de0884aa441
Summary: This diff updates the check which triggers crash notifications. We got a user feedback that crash reporter used to report non fatal crash too and it used to annoy users with bombardment of crash notifications.
Reviewed By: passy
Differential Revision: D13878272
fbshipit-source-id: 75446f08f806e8f28a6f68953c0a001fd18a7dc0
Summary:
We were using `window.performance` to measure performance. This was because the equivalent node.js API `perf_hooks` wasn't available in the electron version we were using back then.
However, `perf_hooks` has landed in electron meanwhile, so I am moving to this API, as it works for the headless version and jest tests, too.
This allows us to delete the babel transform that was used for node-based tests, where the browser API was replaced with the node API
Reviewed By: jknoxville
Differential Revision: D13860133
fbshipit-source-id: cf1395004fac046dd55751ff465af494173b2cbf
Summary:
Incorrect imports were causing an error: `invariant is not a function`.
This fixes the imports.
Reviewed By: jknoxville, priteshrnandgaonkar
Differential Revision: D13859945
fbshipit-source-id: 2a5f5f87b4df2840c8e6b749acb293b145805afa
Summary:
Added instructions on using custom ports.
We probably want to put the headless instructions here too when they're ready.
Reviewed By: danielbuechele
Differential Revision: D13860469
fbshipit-source-id: 76537a36e6fc85e805a29830927e4d59ee4f73e8
Summary: Adds tests for flipper import and export. Also fixed few edge cases which was discovered through tests. The edge case was that it didn't export device plugin states.
Reviewed By: danielbuechele
Differential Revision: D13828357
fbshipit-source-id: ddc4352b729ca7f05c5875f2f3fbdd2c7f4e2186
Summary:
This diff adds the capability to export the flipper data to a file. With this diff you can click on the "Export Flipper" option from the "Edit" menu in menubar. It will export it in the file at this location
`~/.flipper/MessageLogs.json`
We do not exactly export the store, but just the important part of it. We export in the following format
```
{
fileVersion: '1.0',
device: {
os: 'iOS',
title: 'iPhone 7',
serial: '',
deviceType: 'physical',
},
clients: [
{
query: {
app: 'Facebook',
},
d: '12345678'
},
{
query: {
app: 'Instagram',
},
id: '12345678'
}
],
store: {
pluginState: {},
notifications: {}
}
}
```
In next diff I will add the capability to select the folder to export the file too.
Reviewed By: danielbuechele
Differential Revision: D13751963
fbshipit-source-id: 7d3d49c6adf8145b2181d2332c7dbd589155cec3
Summary:
This adds the concept of a custom role description to Flipper's accessibility inspector. This functionality was added in support library version 24.1, and supported in Litho as of D8066609.
This will show both the AccessibilityNodeInfo's raw roleDescription under the AccessibilityNodeInfo section, as well as the derived role description under the main Accessibility section (see highlighted elements in screenshot below).
The difference between the raw role description and the derived role description is that the derived description will show any default description a role is given, such as "Button" for button roles. This makes it clear that the role-description property will override those default strings.
Unfortunately making these mutable requires the AccessibilityRoleUtil class be restructured a bit to support EnumMapping for its roles, which isn't very straightforward due to these default descriptions being stored in the AccessibilityRole enum, so that will have to wait for a future diff.
Screenshot:
{F149099209}
Reviewed By: danielbuechele
Differential Revision: D13759563
fbshipit-source-id: 6eeb22a35f529663725630936af9967ea1f19c0c
Summary:
I must have run this locally on an outdated version of eslint or the
plugin, because I did not see all the formatting errors. This is because
`eslint-plugin-prettier` dropped support for the `fb` preset (see https://github.com/prettier/eslint-plugin-prettier/pull/113/files). This restores the equivalent ruleset explicitly.
Pull Request resolved: https://github.com/facebook/flipper/pull/363
Reviewed By: danielbuechele
Differential Revision: D13839021
Pulled By: passy
fbshipit-source-id: 59e27a241e8aada8648b175ab8abbdfbd391556e
Summary:
This moves the version display from the updater component
to the titlebar itself, so it'll be shown even in dev mode.
This is already useful when using it on platforms like Linux
where the updater isn't supported, but will also help when
moving to the launcher model.
Reviewed By: jknoxville
Differential Revision: D13819139
fbshipit-source-id: cbc127b8ccdf932f823bc1f40319f296516dfc31
Summary:
Wanted to do that for a while, but the previous eslint error
blocked me. Continues running with the same level or warnings.
Reviewed By: jknoxville
Differential Revision: D13818478
fbshipit-source-id: ac12888dd4177316020c947925d4ff9d64784140
Summary:
Fixes required to be able to run Flipper in node.js:
* Adds checks if the `window`-object exists before using it, to allow running in node.
* Imports from within Flipper should directly reference the file they are requiring instead of `import from 'flipper'`. This was done in most of the places. Fixed a few occurrences where this wasn't the case. This is to prevent cyclic dependencies in node.
* shared packages (React, ReactDOM and Flipper) were exposed on the `window` before, changed this to `global` as this works in browser and node.
* Adds some missing methods to our electron stubs (used for testing and headless Flipper)
Reviewed By: passy
Differential Revision: D13786577
fbshipit-source-id: 145d560f1446e7d0bdec2acd8dd54dae983d7b36
Summary:
* Adds `build-headless.js` to bundle the app using metro
* the build script replaces the prelude code added by metro with our own to make it work in node. Metro will add an API to add custom prelude code in the next version.
* Pins down metro's dependency of `temp` to `v0.9.0` (instead of `0.8.3`) to be compatible with node 10. (This will be fixed in a metro upgrade)
Reviewed By: passy
Differential Revision: D13786574
fbshipit-source-id: bddb3542c370c068d90a90c4b59337f995e4fa3f
Summary:
Adding `headless/index.js` This is the entry point to the headless version of Flipper.
This creates a redux store, and initializes the dispatchers. As all business logic (adb connections, etc.) are managed by dispatchers, this spins up a working version of Flipper, listening on our ports, allowing connections to devices.
For APIs not available in node.js, we are adding polyfills. `WebSocket` is used by redux-devtools, `fetch` is used in a couple of places throughout the application. These polyfills are added to the global namespace, so the app can run the same as in the browser.
Reviewed By: passy
Differential Revision: D13786573
fbshipit-source-id: 685f67e1c0d2948de7c43b8a1e2dc10dc69aa743
Summary: Moving a couple of build function from `build-release` to `build-utils` so they can be shared between the desktop build process and the headless build process.
Reviewed By: passy
Differential Revision: D13786575
fbshipit-source-id: df0a0da6d9a643e3e1c65470e1e96254e8966dd9