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
Allow using preset-env
with newer versions of compat-data
#11201
Allow using preset-env
with newer versions of compat-data
#11201
Conversation
@@ -11,7 +11,7 @@ | |||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-preset-env", | |||
"main": "lib/index.js", | |||
"dependencies": { | |||
"@babel/compat-data": "^7.8.6", | |||
"@babel/compat-data": "~7.8.6", |
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.
@babel/compat-data
is also depended by @babel/helper-compilation-targets
. By doing so we risk having two versions of @babel/compat-data
if one installs preset-env + helper-compilation-targets 7.8.0 while compat-data 7.9.0 has been published.
Can we fix this on the preset-env side? So it can work with higher compat-data
as long as we would not drop entries in minor releases. We can introduce an extra unit test as a sync reminder.
This reverts commit e7d57c7.
preset-env
with newer versions of compat-data
This fixes the following error when running "npm install" in graylog-web-plugin: error: [BABEL] graylog2-web-interface/packages/graylog-web-plugin/src/PluginManifest.js: Could not find plugin "proposal-numeric-separator". Ensure there is an entry in ./available-plugins.js for it. Related PR in babel: babel/babel#11201 Fixes #7731
Currently, adding a new plugin to
@babel/compat-data
breaks old@babel/preset-env
versions. This is becausepreset-env
iterates overcompat-data
's plugins, and throws if the plugin isn't defined inpreset-env
'savailable-plugins.js
file.This was found in #10971 (review)
Instead of removing the error (which is useful to keep the two lists in sync), I propose to set
compat-data
's version using~
. This is enough to solve the problem, because adding new plugins tocompat-data
is a new feature, requiring a minor version.This PR should be merged before 7.9.0: 7.8.0 was the first version with
@babel/compat-data
, and we should fix it in 7.8.x so that people using"@babel/preset-env": "~7.8.0"
don't get hit by this bug.