Skip to content
Please note that GitHub no longer supports Internet Explorer.

We recommend upgrading to the latest Microsoft Edge, Google Chrome, or Firefox.

Learn more
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable optional chaining by default in @babel/preset-env #10809

Closed
nicolo-ribaudo opened this issue Dec 4, 2019 · 6 comments · Fixed by #10811
Closed

Enable optional chaining by default in @babel/preset-env #10809

nicolo-ribaudo opened this issue Dec 4, 2019 · 6 comments · Fixed by #10811

Comments

@nicolo-ribaudo
Copy link
Member

@nicolo-ribaudo nicolo-ribaudo commented Dec 4, 2019

Feature Request

Optional chaining is Stage 4!

This means that it should be enabled by default in @babel/preset-env 🎉

It should be done similarly to this commit: b92ad31

  1. Add it to packages/babel-preset-env/src/available-plugins.js
  2. Add the compat-table mapping to packages/babel-preset-env/data/plugin-features.js (you can find the correct feature name at https://kangax.github.io/compat-table/esnext/)
  3. Run cd packages/preset-env and yarn build-data to update the data about the supported browser versions
  4. Add it to @babel/preset-env-standalone (packages/babel-preset-env-standalone/src/available-plugins.js)
  5. Update the test as needed (you don't need to write new tests)
  6. PR! 🎉

If it is the first time that you contribute to Babel, follow these steps: (you need to have make and yarn available on your machine)

  1. Write a comment there to let other possible contributors know that you are working on this bug.
  2. Fork the repo
  3. Run git clone https://github.com/<YOUR_USERNAME>/babel.git && cd babel
  4. Run yarn && make bootstrap
  5. Wait
  6. Run make watch (or make build whenever you change a file)
  7. Add a test if needed (only input.js; output.js will be automatically generated)
  8. Update the code!
  9. yarn jest babel-preset-env 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 you prefer, you can run OVERWRITE=true yarn jest babel-preset-env and they will be automatically updated.
  10. If it is working, run make test to run all the tests
  11. Run git push and open a PR!
@rajasekarm

This comment has been minimized.

Copy link
Member

@rajasekarm rajasekarm commented Dec 4, 2019

I can give a PR now.

@nicolo-ribaudo

This comment has been minimized.

Copy link
Member Author

@nicolo-ribaudo nicolo-ribaudo commented Dec 4, 2019

I was going to mark this as a good first issue for new contributors 😅

@rajasekarm

This comment has been minimized.

Copy link
Member

@rajasekarm rajasekarm commented Dec 4, 2019

sure, we can do that as well.

@Druotic

This comment has been minimized.

Copy link
Contributor

@Druotic Druotic commented Dec 4, 2019

I'll take a stab at this 👍 - it sounds straight forward enough.

@PerpetualWar

This comment has been minimized.

Copy link

@PerpetualWar PerpetualWar commented Jan 27, 2020

is this gonna happen soon ?

@nicolo-ribaudo

This comment has been minimized.

Copy link
Member Author

@nicolo-ribaudo nicolo-ribaudo commented Jan 27, 2020

It has been released in v7.8.0

@Jakobo Jakobo mentioned this issue Feb 1, 2020
3 of 3 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.