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
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:
Before this diff, the crash reporteer plugin for android just used to show messages which were error and had tag as "AndroidRuntime". This diff fixes this and instead accepts multiple different tags which might be related to crashes.
The issue with triggering the notification for all kind of messages would be that, the user might get many. For the jni errors, the stack trace of it are shown as multiple entry instead of one entry in logcat. So to combine all the stack trace into one callstack message, this diff adds a timer of 10ms and combines the messages which occur in that timespan and then trigger the notification.
Reviewed By: danielbuechele
Differential Revision: D13772505
fbshipit-source-id: fec6f5a7f9f46948c9f9dc5b2a7b92690913c8aa
Summary:
We've only got about a 75% success rate at initializing an adb client: https://fburl.com/scuba/tr5tkehi
This is the second attempt to fix this. The first one D13487864 was reverted because it used 'adb' instead of the full path, and when run as a GUI app, you don't get the PATH variable typically set up in .bashrc files etc.
Fixing it by using the full $ANDROID_HOME path.
For facebook users, this will always be guessed correctly, but for OSS it could be installed anywhere, so we might get it wrong - it's common for $ANDROID_HOME to not be set at all on mac systems, and setting it for GUI apps is not exactly trivial: https://superuser.com/questions/476752/setting-environment-variables-in-os-x-for-gui-applications
Leaving the previous implementation as a fallback for OSS users and in case this method fails for some reason.
Metrics wrapped around each implementation as well as the entire thing, so we can see if it solves the issue.
Reviewed By: passy
Differential Revision: D13818981
fbshipit-source-id: d90bfd9ec80621526accc080778afc44f2a099d9
Summary:
Part 3 and final part of adding customizable ports. To use this, the iOS / Android apps have to also be started with the same custom ports.
Example usage: `FLIPPER_PORTS=8189,8188 yarn start`
Reviewed By: passy
Differential Revision: D13801761
fbshipit-source-id: 3dd80a3001ed0855e54cc568fa94eb6fac5fc7f1
Summary:
Apparently this seems to be the only way to make build work, with the updated licenses. It also follows the same strategy as Travis.
I am using double pipe in `sdkmanager` command execution, to avoid breaking the build, because `sdkmanager` returns exit code 141 in case it meets the requirements requested. (e.g.: `yes | sdkmanager --licenses` returns 141, which in turn breaks the build due to `set -eo pipefail` Bash flags, that CircleCI is using in order to execute any scripts)
For the record, I tried the following solutions, that did not work:
* Add accepted license SHA in Android SDK licenses folder.
* Accept all licenses prior to running the other jobs (with a separate job, working as a dependency to the rest of the Workflow jobs) (`yes | sdkmanager --licenses`)
* Accept all licenses prior to executing any Gradle command (without a separate job) (`yes | sdkmanager --licenses`)
Pull Request resolved: https://github.com/facebook/flipper/pull/362
Differential Revision: D13817430
Pulled By: passy
fbshipit-source-id: d8c95fc5b9202306dd50ea103b6e90142e73ef61
Summary: This adds some frankly disgusting magic to the bump script to determine the next viable snapshot version and creates a second commit.
Reviewed By: jknoxville
Differential Revision: D13801765
fbshipit-source-id: 40728afe9dfde3da7a4fced645a89ed293109878
Summary:
Part 2 of changing flipper to use customizable ports: iOS SDK.
Still to go: JS app.
env var should be of the format:
`FLIPPER_PORTS=1111,2222` for insecure port: 1111 and secure port: 2222.
Reviewed By: danielbuechele
Differential Revision: D13800988
fbshipit-source-id: 3560ba850389964f4b784551b803c45c6524e6f0
Summary: Due to a change in the roadmap the plugin has been renamed to Sections
Reviewed By: danielbuechele
Differential Revision: D13505447
fbshipit-source-id: ff171c5b69ef8186744298a32c7c6b9de49daf2a
Summary:
A new test uses a non-public dependency causing the travis CI to fail.
Use the standard roboelectric one instead.
Reviewed By: passy
Differential Revision: D13801098
fbshipit-source-id: 9fcda26fceaed22d18bd743f10bf39eaae0da7a6
Summary:
Compiled statically for darwin and Linux (x86_64). Also
changed some flags to make this reproducible.
Reviewed By: danielbuechele
Differential Revision: D13801305
fbshipit-source-id: d98701afca3c4787922d377bc6b674b59421f5b8
Summary: Makes building a bit easier and I can have my own README in there.
Reviewed By: jknoxville
Differential Revision: D13784725
fbshipit-source-id: b694c1ce812d4e383ad44faeacd8e0094a96b432
Summary:
Add Podfile documentation so that projects that use `use_frameworks!` have a way to import Flipper into their project
Pull Request resolved: https://github.com/facebook/flipper/pull/347
Reviewed By: passy
Differential Revision: D13761700
Pulled By: priteshrnandgaonkar
fbshipit-source-id: 36d8a5d590b96203ac30fd5d0ca32cae4f194024
Summary:
Part 1 of enabling flipper to run on custom ports: android SDK.
Still to go: iOS SDK and desktop
This should allow you to run mobile apps that use flipper on different ports than the default (8089,8088).
`adb shell`
`su`
`setprop flipper.ports 1111,2222`
From what I can tell, this only works on rooted devices.
Reviewed By: passy
Differential Revision: D13753238
fbshipit-source-id: c5f370c9d8c7382e8c17fb81d4010c642ef7c114
Summary:
After the LogManager interface change this file wasn't updated.
The test isn't enabled at the moment, but I don't know why flow didn't notice this.
Reviewed By: passy
Differential Revision: D13783861
fbshipit-source-id: 09d887f6567300aa9a16ec2a97b17a2d9de338d1
Summary:
Currently, when bumping the version, the script will override "-SNAPSHOT" mentions in both the docs and the properties. This requires some manual fixup after every release. With this change, you can pass "-s" or "--snapshot" to change the version number to a snapshot release and it will only affect the places where that change is necessary.
Did some overall cleanup, too, like getting rid of the macro magic to determine the current location which messes with tooling.
This does *not* include the updated binaries yet. I'll put them up as a separate diff.
Reviewed By: priteshrnandgaonkar
Differential Revision: D13782177
fbshipit-source-id: 87ad0ab20a5f544ddb6aa3e2d30949bbabbabfc4
Summary:
It turns out puma was erroring on the GK field inside the log json, because of improperly escaped " in the fields.
To simplify it I'm changing it to use simple comma separated key:value pairs, since they are always plain string and boolean values.
"gatekeepers":"TEST_PASSING_GK:false,TEST_FAILING_GK:false,devtools_sonar_team:false"
Reviewed By: passy
Differential Revision: D13782283
fbshipit-source-id: 3f331dc9189b1a57f69a2af0d4393baf45e1fa55
Summary:
We had a promise for initializing the servers, but it wasn't rejected when server startup failed.
Fixed by resolving / rejecting based on the listen / error events fired from the server.
Reviewed By: passy
Differential Revision: D13762580
fbshipit-source-id: a0d1a56473f84dc416e5ce2de91a53b21574f452
Summary: Android and iOS each have a separate metric
Reviewed By: passy
Differential Revision: D13763758
fbshipit-source-id: f679360ec0ee008b434bfe12107ac6548d882a1f
Summary: I made that release so it better be good.
Reviewed By: jknoxville
Differential Revision: D13761454
fbshipit-source-id: 28cc1e113e91c3cb96b493a67b21afa77ea61a27
Summary:
Android SDK license SHA has been updated as of January 16, 2019 so it needs to be re-accepted. This is only needed for CircleCI since in Travis setup `sdkmanager` is used in order to accept the Licenses.
Pull Request resolved: https://github.com/facebook/flipper/pull/359
Differential Revision: D13751841
Pulled By: passy
fbshipit-source-id: f3d84277f06bedf06b7a766429d9f7e3275bb516
Summary:
This helps Kotlin nullity inference and *should* already be enforced
by Infer/Eradicate. More details here: https://medium.com/square-corner-blog/non-null-is-the-default-58ffc0bb9111
Reviewed By: jknoxville
Differential Revision: D13732788
fbshipit-source-id: c0c60f0f8e9dc8bffe3780c7a1a700d682a6d2b8
Summary: Manually checked that the snapshot doesn't contain the auto updater.
Reviewed By: jknoxville
Differential Revision: D13715520
fbshipit-source-id: 720fed1e9952b788bce3311ecb508cfcfdc1758a
Summary: Provide a `--no-updater` option that disables the in-app auto updater when passed.
Reviewed By: jknoxville
Differential Revision: D13713919
fbshipit-source-id: 49a647105fea1efa23f653e4a6ed452b3489879b
Summary: This diff adds support to send crash notification whenever the cpp exception of Flipper is suppressed. Also updated the tests regarding the same
Reviewed By: jknoxville
Differential Revision: D13635822
fbshipit-source-id: 01e4a57c391476e5b044e64946d337cb4582a527
Summary: To allow comparisons between metrics/errors in and out of GKs.
Reviewed By: passy
Differential Revision: D13714754
fbshipit-source-id: 311a1cd7bd5a7b2332e20a32d37d0fb323d00569
Summary:
The folly version which we were using to build open source was v2018.08.06.00, which is very outdated.
This PR updates the version of the folly to the latest one.
Pull Request resolved: https://github.com/facebook/flipper/pull/355
Reviewed By: passy
Differential Revision: D13710812
Pulled By: priteshrnandgaonkar
fbshipit-source-id: 62b205d10c18f4338ead69612b24805c697081fb
Summary: Will allow us to look into bad sessions if necessary.
Reviewed By: passy
Differential Revision: D13695386
fbshipit-source-id: 2cfc8ec28ef4cb387ef7a5a58b02aa77a367ae81
Summary: Remove `$Subtype` and `$Supertype` utilities. Replacement was done on a best-effort basis. In many cases it sufficed to replace `$Supertype<T>` and `$Subtype<T>` with `T`, but when this was not possible `any | T` and `any & T` were used instead.
Reviewed By: jbrown215
Differential Revision: D13624765
fbshipit-source-id: 82ee9d43cfc318ed4bd2d84e0f4c5c1d8f488a9c
Summary: Will provide some visibility on error rates.
Reviewed By: passy
Differential Revision: D13671492
fbshipit-source-id: 60971a7e8163c58dd4d6540e57e05b38c852744e
Summary: This tracker isn't really used, but at least now it can benefit from having the sessionId.
Reviewed By: passy
Differential Revision: D13671367
fbshipit-source-id: 3a79e843e3fabab191d0d7471d56a81b1a91a1e9
Summary:
The advantage of this is that anyone can now log without needing to carry around a Logger object.
Primary reason is for making metrics less intrusive in the codebase.
Reviewed By: passy
Differential Revision: D13671368
fbshipit-source-id: 162ab1351a124683aef13983fc3bcec01385cd1a
Summary:
The gradle dependency on soloader was using a wrong groupId (flipper instead of soloader)
Pull Request resolved: https://github.com/facebook/flipper/pull/354
Differential Revision: D13671271
Pulled By: passy
fbshipit-source-id: b03a77199bb14601fb6a3a1f21e8c404d0072104
Summary:
- Refactored [Crash Reporter Plugin's](https://fbflipper.com/docs/crash-reporter-plugin.html) android implementation to show the crash notification for all kind of crashes. It sniffs the logcat and fires notification whenever crash happens.
- "Plugin not showing?" in the plugin list now supports more cases for telling you what went wrong.
- Plugins are now sorted by name.
Reviewed By: jknoxville
Differential Revision: D13650988
fbshipit-source-id: 8b4861befa962162dea84a1394ea2829b88ab4c9
Summary: We've seen some flakiness here, so adding this to get better visibility on it.
Reviewed By: passy
Differential Revision: D13635051
fbshipit-source-id: 98d2dcc0bb11f3afb2f27942b9f4bf241808a4fc