Add BABEL_7_TO_8_DANGEROUSLY_DISABLE_VERSION_CHECK#17569
Merged
JLHwung merged 2 commits intobabel:mainfrom Nov 11, 2025
Merged
Conversation
Collaborator
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/60135 |
|
commit: |
liuxingbaoyu
approved these changes
Oct 24, 2025
JLHwung
reviewed
Oct 24, 2025
|
|
||
| if ( | ||
| typeof process !== "undefined" && | ||
| process.env.BABEL_ALLOW_VERSION_MISMATCH |
Contributor
There was a problem hiding this comment.
The naming seems a bit neutral. Could we rename it to BABEL_8_DANGEROUSLY_DISABLE_ASSERT_VERSION? Such that:
- The naming conveys that it is a workaround and should be removed once plugins migrated to Babel 8
- This temporary flag should be only shipped to Babel 8. It does not skip the assertVersion check in Babel 7
- This flag only affects the behaviour of the
assertVersionhelper. It does not revert any AST differences
Contributor
This is a good idea. I agree. |
Member
Author
|
Updated to log a warning, only happen in Babel 8, and I called it |
BABEL_ALLOW_VERSION_MISMATCH to suppress version checkBABEL_7_TO_8_DANGEROUSLY_DISABLE_VERSION_CHECK
Member
Author
|
Once this is released I can try again if React Native's preset is compatible. |
liuxingbaoyu
approved these changes
Oct 30, 2025
kadhirash
pushed a commit
to kadhirash/babel
that referenced
this pull request
Nov 11, 2025
* Add `BABEL_ALLOW_VERSION_MISMATCH` to suppress version check * update
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1, Fixes #2It seems like there are many plugins that would support Babel 8 if not for the
assertVersioncheck. Ideally all of their maintainers would actually verify that it works with Babel 8 and adjust the check, but let's provide this workaround to help with the migration.It seems like we have no tests for
assertVersion.