-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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
[workspace] Bump babel dependencies to latest #16699
Conversation
@@ -133,6 +133,12 @@ | |||
"yarn-deduplicate": "^1.1.1" | |||
}, | |||
"resolutions": { | |||
"**/@babel/core": "^7.5.4", |
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.
These are dependencies of the workspace and nextjs.
Details of bundle changes.Comparing: d0e6458...7be9ea9
|
@@ -37,7 +37,7 @@ | |||
"react-dom": "^16.8.0" | |||
}, | |||
"dependencies": { | |||
"@babel/runtime": "^7.2.0", | |||
"@babel/runtime": "^7.4.4", |
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.
If we transpile with @babel/plugin-transform-runtime
then we need a production dependency that is equal or higher to the transform version. Otherwise missing dependencies can occur downstream. Consider the following scenario:
Downstream:
@material-ui/core
: 4.0.0
@babel/runtime
: 7.2.0
Upstream:
@babel/plugin-transform-runtime
: 7.2.0
Now we bump @babel/plugin-transform-runtime
by a minor. In that minor a @babel/plugin-transform-runtime
leverages a new helper method that is introduced in 7.3.0
. We release a new version of @material-ui/core
which is built with @babel/[email protected]
without bumping th @babel/runtime
dependency entry. Downstream updates @material-ui/core
but not @babel/runtime
since the semver range still matches. The downloaded package of @material-ui/core
has no access to the new helper function and crashes.
I think we got reports of this a couple of times. It's fixable downstream by bumping @babel/runtime
but wouldn't need intervention if we would also bump the entry of @babel/runtime
.
If I understand that changes correctly, we undo the tradeoff Next.js took regarding Babel. We will use a more recent version of Babel than Next.js uses. So we win access to the latest Babel enhancements, x months in advance. |
It's more about making sure we have a proper node_modules layout. We were using nextjs babel packages for months before we upgraded to The stance "can't introduce breakage if you don't upgrade" is motivated by the assumption that your current code is bug free which is just hybris. It's not about undoing a "tradeoff" but fixing a rational that is incomplete. Again it's less about features but making sure we have the latest fixes. |
Bump babel dependencies and force a single version.
Those don't really work as nested node_modules anyway since the babel.config lives at the root.