Skip to content

Allow Babel 8 in compatible Babel 7 plugins#17580

Merged
nicolo-ribaudo merged 1 commit intobabel:mainfrom
nicolo-ribaudo:allow-babel-8-in-some-plugins
Nov 25, 2025
Merged

Allow Babel 8 in compatible Babel 7 plugins#17580
nicolo-ribaudo merged 1 commit intobabel:mainfrom
nicolo-ribaudo:allow-babel-8-in-some-plugins

Conversation

@nicolo-ribaudo
Copy link
Member

@nicolo-ribaudo nicolo-ribaudo commented Oct 29, 2025

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

This is the list of plugins from https://github.com/babel/babel/blob/main/test/babel-7-8-compat/data.json, for which we are testing Babel 8 compatibility, as well as all the syntax plugins.

This PR only affects Babel 7 plugins. Babel 8 plugins still require a Babel 8 version.

@nicolo-ribaudo nicolo-ribaudo added the PR: Internal 🏠 A type of pull request used for our changelog categories label Oct 29, 2025
@babel-bot
Copy link
Collaborator

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/60141

@pkg-pr-new
Copy link

pkg-pr-new bot commented Oct 29, 2025

Open in StackBlitz

commit: 324080a


export default declare((api, { deprecatedAssertSyntax }: Options) => {
api.assertVersion(REQUIRED_VERSION("^7.22.0"));
api.assertVersion(REQUIRED_VERSION("^7.22.0 || ^8.0.0-0"));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this plugin should be kept Babel 7 only. We should remove the deprecatedImportAssert parser plugin in Babel 8 and then archive this syntax plugin.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Babel 7's preset-env enables this plugin. I'd like to keep it as working (but effectively a no-op) in Babel 8 so that we keep compat with preset-env (at least, when compiling just up to a couple years back of features).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK.

@nicolo-ribaudo nicolo-ribaudo merged commit 445b575 into babel:main Nov 25, 2025
74 checks passed
@nicolo-ribaudo nicolo-ribaudo deleted the allow-babel-8-in-some-plugins branch November 25, 2025 09:01
@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 Feb 25, 2026
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 25, 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: Internal 🏠 A type of pull request used for our changelog categories

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants