Skip to content

breaking(preset-env): remove isPluginRequired export#17670

Merged
nicolo-ribaudo merged 3 commits into
babel:mainfrom
JLHwung:babel-preset-star-cleanup
Jan 9, 2026
Merged

breaking(preset-env): remove isPluginRequired export#17670
nicolo-ribaudo merged 3 commits into
babel:mainfrom
JLHwung:babel-preset-star-cleanup

Conversation

@JLHwung

@JLHwung JLHwung commented Dec 16, 2025

Copy link
Copy Markdown
Contributor
Q                       A
Fixed Issues? Fixes #1, Fixes #2
Patch: Bug Fix?
Major: Breaking Change? Yes
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link babel/website#3148
Any Dependency Changes?
License MIT

In this PR we removed the isPluginRequired API from preset-env. The API has been moved to isRequired export from @babel/helper-compilation-targets.

Also cleaned up all Babel 8 todo comments in preset* packages.

@JLHwung JLHwung added PR: Breaking Change 💥 A type of pull request used for our changelog categories for next major release PR: Needs Docs labels Dec 16, 2025
@babel-bot

babel-bot commented Dec 16, 2025

Copy link
Copy Markdown
Collaborator

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;

Copy link
Copy Markdown
Member

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 ?.

Copy link
Copy Markdown
Contributor Author

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" }.

Copy link
Copy Markdown
Member

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

@JLHwung JLHwung Dec 17, 2025

Copy link
Copy Markdown
Contributor Author

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?

Copy link
Copy Markdown
Member

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

@pkg-pr-new

pkg-pr-new Bot commented Dec 17, 2025

Copy link
Copy Markdown

Open in StackBlitz

commit: 45c2505

@nicolo-ribaudo
nicolo-ribaudo merged commit 7f682c1 into babel:main Jan 9, 2026
54 checks passed
@nicolo-ribaudo
nicolo-ribaudo deleted the babel-preset-star-cleanup branch January 9, 2026 17:11
This was referenced Feb 12, 2026
@github-actions github-actions Bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Apr 11, 2026
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Apr 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

outdated A closed issue/PR that is archived due to age. Recommended to make a new issue PR: Breaking Change 💥 A type of pull request used for our changelog categories for next major release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants