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/parser #10810

Closed
nicolo-ribaudo opened this issue Dec 4, 2019 · 5 comments
Closed

Enable optional chaining by default in @babel/parser #10810

nicolo-ribaudo opened this issue Dec 4, 2019 · 5 comments

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/parser 🎉

It should be done similarly to this commit: 24c4901

  1. Remove all the this.hasPlugin and this.expectPlugin checks related to this plugin in packages/babel-parser/src
  2. Remove all the usages of optionalChaining in @babel/parser's tests
  3. Probably there is a test to ensure that the plugin is required; it can be removed.
  4. Move the tests from the experimental folder to es2020
  5. 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-parser 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-parser 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!
@VivekNayyar

This comment has been minimized.

Copy link

@VivekNayyar VivekNayyar commented Dec 4, 2019

I would like to take this up.

@vivek12345

This comment has been minimized.

Copy link
Contributor

@vivek12345 vivek12345 commented Dec 4, 2019

Saw that it's a good first issue now. So may be someone who hasn't contributed before should get a chance

@jackisherwood

This comment has been minimized.

Copy link
Contributor

@jackisherwood jackisherwood commented Dec 5, 2019

Can I take this?

@JLHwung

This comment has been minimized.

Copy link
Contributor

@JLHwung JLHwung commented Dec 5, 2019

@jackisherwood It's yours.

@JLHwung

This comment has been minimized.

Copy link
Contributor

@JLHwung JLHwung commented Jan 14, 2020

Closing this since #10817 has been merged.

@JLHwung JLHwung closed this Jan 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.