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.
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.
In this PR we removed some plugins, which seems to be a breaking change for TS users.
There was a problem hiding this comment.
Removing the .d.ts file completely is also a breaking change, right?
There was a problem hiding this comment.
No, it just can't be generated automatically anymore. :)
The ones we edited manually are still there.
There was a problem hiding this comment.
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.
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.
The ?? false here seems to never be run?
There was a problem hiding this comment.
bool can return undefined. While it's ok usually, in this case undefined was included in the generated code.