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
Remove backward compatibility for union types #11468
Conversation
@@ -95,15 +95,11 @@ function getTypeAnnotationBindingConstantViolations(binding, path, name) { | |||
return; | |||
} | |||
|
|||
if (t.isTSTypeAnnotation(types[0]) && t.createTSUnionType) { | |||
if (t.isTSTypeAnnotation(types[0])) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we always have createTSUnionType
in Babel 8
} | ||
|
||
return t.createUnionTypeAnnotation(types); | ||
return t.createFlowUnionType(types); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We always have createFlowUnionType
in Babel 8 as well 👌
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/21220/ |
Test case can be found here |
🧪 |
@nicolo-ribaudo do I need anything to help with before merging? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, this looks good to me!
If you want to make CI pass you can rebase the PR, but it's not really needed since the failing test has been disabled on next-8-dev.
@Beraliv thanks for the PRs! |
Several requests regards TypeScript union types saved backward compatibility
Here I remove them for major update (Babel 8)
Related issue:
Related PRs: