-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
breaking(preset-env): remove isPluginRequired export
#17670
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
base: main
Are you sure you want to change the base?
Conversation
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/60485 |
| function supportsStaticESM(caller: CallerMetadata | undefined) { | ||
| // TODO(Babel 8): Fallback to true | ||
| // TODO(Babel 9): Fallback to true | ||
| return !!caller?.supportsStaticESM; |
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 Babel 8 caller is always provided, right? So we can change the type signature and remove ?.
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.
I don't think so. The @babel/core does not provide any default values for the caller in normalizeOptions or loadPrivatePartialConfig. Maybe we can at least defaults caller to an empty object, or { name: "unknown Babel caller" }.
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.
Oh I see, undefined seems fine then.
| @@ -1,4 +1,3 @@ | |||
| // TODO(Babel 8): Remove this file | |||
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.
This todo item was removed because removing this file essentially renders the shippedProposals option useless and thus it is subject to removal. The current status quo is that the shippedProposals does not add new plugins, but situations could change if any browsers implemented a stage-3 proposal that is also supported by Babel.
Do we want to remove this option or keep this file?
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.
I agree with keeping it
|
commit: |
7d80551 to
45c2505
Compare
Fixes #1, Fixes #2In this PR we removed the
isPluginRequiredAPI frompreset-env. The API has been moved toisRequiredexport from@babel/helper-compilation-targets.Also cleaned up all
Babel 8todo comments inpreset*packages.