Summary: On a fresh VS Code install, only the internal Prettier plugin is available, but not the open source version, which we need as the internal one doesn't work on Flipper (probably due to TypeScript?)
Reviewed By: lblasa
Differential Revision: D36275616
fbshipit-source-id: bccbbcd372f7a7ecca46eb83f5515543e611235c
Summary:
Upgrading to TypeScript 3.9 so that we can use `// ts-expect-error`, that allows us to basically write unit tests for typings.
Fixed the typescript path in `settings.json`, because otherwise VSCode kept picking the built-in version (3.8.3 atm) of ts when opening the `sonar` folder as workspace.
Reviewed By: passy
Differential Revision: D22255818
fbshipit-source-id: ae54aedb237445f32f1797b4290656dbfb0e528f
Summary:
Had some horrible dev experience caused by VSCode and Jest not agreeing what snapshots should look like, every time saving a test in VSCode, it would break the jest snapshots. After investigating eslint and prettier, turned out VSCode itself was the culprit. Caused by a global user setting, but this makes sure nobody else runs into it :)
Also made sure Jest uses the correct prettier settings (it didn't before).
Reviewed By: passy
Differential Revision: D22114656
fbshipit-source-id: aef6c278a668bce049c96aba95c7a5101ca840ad
Summary:
This diff adds compatibility with https://marketplace.visualstudio.com/items?itemName=Orta.vscode-jest and makes sure the `yarn jest` command works without further arguments by defaulting to the unit test setup.
This makes tests runnable from VSCode, highlights which tests passed, and show errors inline (and coverage as well if desired), and will report failing tests in the problems panel.
{F235815220}
The debugger can be started right from the code pane as well by clicking the tiny 'debug'
{F235815208}
Currently set up the defaults to not start tests after startup, as it can be CPU hogging, so simply run the command CMD+SHIFT+P 'start jest runner' instead.
Reviewed By: passy
Differential Revision: D21325241
fbshipit-source-id: 7b87297a710a18bbac394110dc2006218ccc7d86
Summary: Dev mode: fixed loading of plugins located outside of the Flipper source root folder, e.g. in ~/flipper-plugins as suggested in tutorial docs.
Reviewed By: passy
Differential Revision: D21306639
fbshipit-source-id: bb9044b25324065f0c12169b95fbe663da8d4305
Summary: Auto-format for js files was broken on my machine. It seems that there is a conflict between eslint and prettier and the latter is trying to format files after eslint using different rules for that. Option to disable prettier formatting for already formatted files fixed this issue for me.
Reviewed By: jknoxville
Differential Revision: D20994053
fbshipit-source-id: 6e90be7f58f2891ce2143bca8c3d76118b9cfba3
Summary:
1) Forced consistend line endings in VSCode on all OSes
2) Copied VSCode settings to both root folder and "desktop" subfolder so both these folders can be opened as VSCode workspace
Reviewed By: passy
Differential Revision: D20724126
fbshipit-source-id: b9e35c6a055457e05cd1c2d6145a58820cc511f8
Summary:
1) Add VSCode settings to the source control, so users won't need to configure them
2) Copy VSCode settings to both "sonar" and "sonar/desktop" folders so both folders can be opened for development
Reviewed By: passy
Differential Revision: D20594643
fbshipit-source-id: 4331659008e4dbf9dfcc44a3723ab0612a3bd333
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
Summary:
As a first step I've configured bundling for the main process code using Metro. For now I haven't converted anything to ts, just made that possible.
The bundle is just produced into the "static" directory. To avoid too many changes I kept the "static" folder as it is, but probably non-static code should be moved from there.
Also installed modules from "node_modules" for the main process are not bundled to avoid potential issues with node native modules.
Reviewed By: mweststrate
Differential Revision: D19960982
fbshipit-source-id: efbd426254e2b37c913c5f5f75f042c50ccee2f3
Summary: The task for attaching to both Main and Renderer processes makes debugging in certain scenarios easier.
Reviewed By: passy
Differential Revision: D19813764
fbshipit-source-id: d81e07e5fb135b5bb904a3f6532347eca1a9bbb1
Summary: Just a small task to make debugging of the main process easier
Reviewed By: jknoxville
Differential Revision: D19792592
fbshipit-source-id: 9d1060dbb58a01615230bff2361144cfc88e41b7
Summary:
This diff enables debugging in VSCode. Debugging works for both Flipper core and plugin code. To start debugging:
1. yarn start
2. Go to "Debug and Run" tab in VSCode, select task "Attach to Running Renderer" and launch it (or just press F5).
{F227135377}
3. Debugger will be attached and all the breakpoints set in VSCode will be hit.
Reviewed By: passy
Differential Revision: D19578566
fbshipit-source-id: 609766471ad196a2ee8d4086ddb84b7af4ef05ef
Summary: React 16 is not compatible with react-emotion 9 (it prints warnings, see also https://github.com/emotion-js/emotion/issues/644). So we should upgrade to 10.
Reviewed By: mweststrate
Differential Revision: D18905889
fbshipit-source-id: c00d2dbbadb1c08544632cb9bfcd63f2b1818a25