-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Clean all always enabled parser plugins #16572
Clean all always enabled parser plugins #16572
Conversation
liuxingbaoyu
commented
Jun 12, 2024
Q | A |
---|---|
Fixed Issues? | Ref: #16456 |
Patch: Bug Fix? | |
Major: Breaking Change? | |
Minor: New Feature? | |
Tests Added + Pass? | Yes |
Documentation PR Link | |
Any Dependency Changes? | |
License | MIT |
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/57655 |
The CI error is good, the associated PR has been opened. |
Merged, please rerun. |
Gulpfile.mjs
Outdated
) | ||
); | ||
if (bool(process.env.BABEL_8_BREAKING)) { | ||
tasks.push( |
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.
Why only for Babel 8? We already publish this file for Babel 7 too, as far as I know.
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.
In this PR we removed some plugins, which seems to be a breaking change for TS users.
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.
Removing the .d.ts
file completely is also a breaking change, right?
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, it just can't be generated automatically anymore. :)
The ones we edited manually are still there.
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.
Right, but the one we publish is the auto-generated one: https://yarnpkg.com/package?q=%40babel%2Fparser&name=%40babel%2Fparser&file=%2Ftypings%2Fbabel-parser.d.ts
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.
Yes, it will become manually maintained after this PR.
Given that we are planning to release Babel 8, this seems acceptable.
fd2a67f
to
492c4b3
Compare
f3f0035
to
2476a82
Compare
@liuxingbaoyu I pushed a few commits to keep the auto-generation also for Babel 7, toggling between Babel 7 and Babel 8. What do you think about it? The CI failure is unrelated and also happens on |
2476a82
to
12a4a6a
Compare
@nicolo-ribaudo This looks great, thanks! |
transform: code => | ||
code.replace( | ||
/type BABEL_8_BREAKING\s*=\s*boolean/g, | ||
`type BABEL_8_BREAKING = ${bool(process.env.BABEL_8_BREAKING) ?? false}` |
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.
The ?? false
here seems to never be run?
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.
bool
can return undefined
. While it's ok usually, in this case undefined
was included in the generated code.