Summary: as per title. see explanation in code comment
Reviewed By: jknoxville
Differential Revision: D14125820
fbshipit-source-id: 9b8e31214a65a184397852544cebd7b69ea0aadb
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:
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:
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: The fb-stubs transform is getting applied when it shouldn't. Fix it by only applying it if src/fb exists.
Reviewed By: danielbuechele
Differential Revision: D13236217
fbshipit-source-id: 940def377839d16f34c49504948cb062916a3d6a
Summary:
I tried switching Flipper to use the node.js module: https://nodejs.org/api/perf_hooks.html instead of electrons window.performance. But the module couldn't be found.
So instead, I'm just replacing it in the pure node tests.
This means tests without node can work without issues.
Reviewed By: danielbuechele
Differential Revision: D10302114
fbshipit-source-id: b3b8aa5fb350a8246fcdfc2a80cc72daec2448d7
Summary:
The idea behind this is to enable tests running in pure node, without electron, because electron requires display drivers and complicated things.
I've been lazy and only added the bare minimum electron api's for the connection test to pass.
It would be awesome to auto generate it properly.
Reviewed By: danielbuechele
Differential Revision: D10238132
fbshipit-source-id: d4a2da2baf5f8964184b532a581c3a75ee33ef06
Summary:
Disallowing plugins from requiring anything but flipper or their own package broke lots of plugins at yarn start.
The ones that broke, require from the static directory.
Allowing them for now to unblock people.
Reviewed By: passy
Differential Revision: D10358733
fbshipit-source-id: 37077c806e022a6eb7ecf9bc95a455bf6f9a34d8
Summary:
Plugins can not require files outside their folder, to make sure they don't pull in any dependencies from Flipper which are not exported by the main app.
However, those imports simply resolve to `undefined`. This diff adds a check in the babel-transform for plugins and throws an error if something from outside the plugin is required.
Reviewed By: passy
Differential Revision: D10297980
fbshipit-source-id: 1606f3211103281f9f4aa7bb2f3ca4d085d0ea1b
Summary:
Adds a test runner for jest test and adds three simple test cases:
- render the app
- start a server
- client connecting to the app
Test can be run using `yarn test`.
To make the test runner work, some changes needed to be made:
- remove the export of `init()` from `'flipper'`, because it was a cyclic dependency
- updating Button.js to the new ref-API
Reviewed By: jknoxville
Differential Revision: D10027078
fbshipit-source-id: 49107b0dd4dec666b92ecd841422fe7e6b3a7756
Summary: Adds support for optional chaining to the codebase, enables flow and eslint support for it.
Reviewed By: passy
Differential Revision: D9940732
fbshipit-source-id: 730aa76653bd22a8fa17a73e72b3a7329de0226c
Summary: upgrading to babel 7 and upgrading all presets and plugins as well
Reviewed By: passy
Differential Revision: D9940733
fbshipit-source-id: 24f45c78a9452899e6fb140a56028dd9fa0b5ea3