Skip to content
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

Add optional chaining and nullish coalescing operators support #7438

Merged

Conversation

renatoagds
Copy link
Contributor

Since optional-chaining and nullish coalescing has been moved to Stage 3, we're now able to add them to CRA.

Closes #7431

@existentialism
Copy link
Contributor

existentialism commented Jul 27, 2019

We should wait until babel/babel#10269 lands and is released.

@bugzpodder bugzpodder modified the milestones: 3.1, 3.2 Jul 27, 2019
@mrmckeb
Copy link
Contributor

mrmckeb commented Jul 28, 2019

Agreed @existentialism.

It's also important to note that TypeScript users will need to wait until TypeScript 3.7 lands, as TypeScript 3.6 is feature-complete. Which is sad, as I want to use it now - but great that the TS team is on top of this.

@yasso1am
Copy link

How does one go about updating a project created with CRA2 with typescript to include the optional chaining and nullish operator?

@mrmckeb
Copy link
Contributor

mrmckeb commented Jul 29, 2019

@yasso1am, please see the comment right before yours. We're waiting on this still from the TS team.

@montogeek
Copy link
Contributor

@mrmckeb TS team progress is a blocker to merge and release this change?

@montogeek
Copy link
Contributor

@renatoagds Could you please fix merge conflict issues to keep this PR ready to merge? :)

@renatoagds
Copy link
Contributor Author

@montogeek as soon babel/babel#10269 get released I'll update here.

@leepowelldev
Copy link

Keen to see this land

@eladmotola
Copy link

@renatoagds babel 7.6.0 came out an hour ago with this change

@a-tokyo
Copy link

a-tokyo commented Sep 9, 2019

Excited for this!! 🎉

@mlshv
Copy link

mlshv commented Sep 18, 2019

I think it is now ready to be shipped

@ianschmitz
Copy link
Contributor

We will ship once TypeScript includes support.

@montogeek
Copy link
Contributor

This shouldn't wait for TS support, yes, CRA supports TS, but it shouldn't be a blocker for the JavaScript ecosystem. Please release it.

@topaxi
Copy link
Contributor

topaxi commented Sep 19, 2019

@montogeek I kinda agree, but there might arise issues where standalone JS files work fine, but once a TS file imports a JS file with unsupported syntax things might go wrong.

@mAAdhaTTah
Copy link

Does TS actually import / parse .js files? I thought it just used .d.ts files next to them?

@topaxi
Copy link
Contributor

topaxi commented Sep 19, 2019

Yes it does, it can infer some basic shapes of classes/objects and even parse and use jsdoc type annotations.

@yordis
Copy link

yordis commented Sep 19, 2019

This is when I wish people lock the thread.

Everyone from the CRA knows what to do about this and when.

And from now on,

Only people complaining or pointing on obvious things (like it is ready from Babel, just read the thread please) will creating unnecessary notifications.

@facebook facebook locked as off-topic and limited conversation to collaborators Sep 19, 2019
Copy link
Contributor

@ianschmitz ianschmitz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A reminder that we'll want to bump the plugin versions including @typescript-eslint/* before releasing this

@iansu
Copy link
Contributor

iansu commented Oct 10, 2019

Even though the TypeScript 3.7 beta is now available this still won't work properly. typescript-eslint does not have support for parsing the new syntax yet: typescript-eslint/typescript-eslint#1033

@iansu
Copy link
Contributor

iansu commented Oct 24, 2019

We are now waiting on Prettier support, which is tracked here:

prettier/prettier#6595
prettier/prettier#6609

@ianschmitz ianschmitz changed the title Add plugins for optional chaining and nullish coalescing operator Add optional chaining and nullish coalescing operators support Nov 9, 2019
@ianschmitz ianschmitz merged commit d12b4b6 into facebook:master Nov 9, 2019
@ianschmitz
Copy link
Contributor

Thanks @renatoagds!

I'll add tests in a follow-up PR.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for optional chaining and nullary coalescing