-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
Update Babel to support new TypeScript 3.7.2 syntax features #7940
Comments
Even after installing the babel plugins, the eslint-typescript package has not updated far enough to fully support optional chaining and nullish coalescing: typescript-eslint/typescript-eslint#1116 This change will need to wait for them as well |
Would CRA even use a babel plugin for this? I would think typescript itself would be doing this. If I eject a CRA typescript project the only dependencies for typescript are Can you explain why it doesn't just work? Are the eslint dependencies what is showing the compile error? |
The problem here is that typescript is only used to type-check the code. The actual transpilation is done by babel. That's also the reason why CRA emits the code first (the app already reloads) and then afterward says that it's waiting for the type checking results. So even though the app would pass the type check, babel woult still fail to transpile the new typescript features like optional chaining. That's the reason why updating to a newer TS version is not enough. |
Related to #7438 |
Dupe of #7431. We'll be releasing support in the next few days. |
Hey guys, but I see that now
be enough? Without adding them as |
I'm still waiting for a CRA release to start using TS 3.7 for all our projects (monorepo). |
Is your proposal related to a problem?
When updating my projects TypeScript version to the new 3.7.2 and trying to use the new syntax, such as optional chaining:
foo?.bar()
I get an error during runtime saying that Babel does not support this feature:
Describe the solution you'd like
It would be nice if the Babel config made by CRA would install these new features. I do not want to have to eject to customize my Babel config.
Describe alternatives you've considered
I've tried installing the Babel plugin as described here with no luck:
https://babeljs.io/docs/en/babel-plugin-proposal-nullish-coalescing-operator
The text was updated successfully, but these errors were encountered: