If the flow plugin runs before the class properties one (or if the class properties plugin isn't used), we remove uninitialize class fields:
currently becomes
while it should be
If someone still wants the old behavior, they can either use flow comments (as offically recommended), or use the ignoreUninitialized option which will soon be added to the class properties plugin (#9141).
Is there anyone who wants to contribute for the first time to Babel? 🙂
NOTE ⚠️⚠️⚠️ Since this is a breaking change, we won't merge the PR for a long time (before Babel 8), and it might seem that we are ignoring it.
If you don't know how to clone Babel, follow these steps: (you need to have make and yarn available on your machine).
- Write a comment there to know other possible contributors that you are working on this bug.
- Fork the repo
- Run
git clone https://github.com/<YOUR_USERNAME>/babel.git && cd babel
- Run
yarn && make bootstrap
- Wait ⏳
- Run
make watch (or make build whenever you change a file)
- Change the wrong
output.js files in the tests/fixture folder of @babel/plugin-transform-flow-strip-types (if there are any)
- Update the code!
yarn jest [name-of-the-package-to-test] to run the tests
- If some test outputs don't match but the new results are correct, you can delete the bad
output.js files and run the tests again
- If it is working, run
make test tu run all the tests
- Run
git push and open a PR!
If the flow plugin runs before the class properties one (or if the class properties plugin isn't used), we remove uninitialize class fields:
currently becomes
while it should be
If someone still wants the old behavior, they can either use flow comments (as offically recommended), or use the
ignoreUninitializedoption which will soon be added to the class properties plugin (#9141).Is there anyone who wants to contribute for the first time to Babel? 🙂
If you don't know how to clone Babel, follow these steps: (you need to have
makeandyarnavailable on your machine).git clone https://github.com/<YOUR_USERNAME>/babel.git && cd babelyarn && make bootstrapmake watch(ormake buildwhenever you change a file)output.jsfiles in thetests/fixturefolder of@babel/plugin-transform-flow-strip-types(if there are any)yarn jest [name-of-the-package-to-test]to run the testsoutput.jsfiles and run the tests againmake testtu run all the testsgit pushand open a PR!