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
Babel 7.14 upgrade #30
Conversation
d7dcb38
to
937790d
Compare
let safe = obj === null || obj === void 0 ? void 0 : (_obj$qux = obj.qux) === null || _obj$qux === void 0 ? void 0 : _obj$qux.baz; // undefined |
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.
Regression?
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.
That's the question, yes basically it shouldn't...
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.
So it's a bug in Chrome (hence node), forcing Babel to transform it.
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.
Thanks; can we try bugfixes: true
? babel/babel#13145 (comment)
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.
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.
@ChrisRast, @pascalduez: I don't know, do we match the condition for node? bugfixes: options.targets && options.targets.esmodules === true,
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.
I tried, no difference. And it's not something we do in the preset anyway.
@@ -53,6 +53,7 @@ module.exports = (context, options = {}) => { | |||
let plugins = [ | |||
'@babel/plugin-transform-flow-strip-types', // 2 | |||
['@babel/plugin-proposal-class-properties', { loose: true }], | |||
['@babel/plugin-proposal-private-methods', { loose: true }], |
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.
Shouldn't we remove them instead ?
Thus, you can remove @babel/plugin-proposal-class-properties and @babel/plugin-proposal-private-methods, since they are now enabled by default in @babel/preset-env.
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.
That was my first try obviously, but I want to keep the loose
option only for this plugin, not much choice.
Also it warns because the loose
option is different for both plugins, hence the private-methods
addition...
I would be in favor of not using the loose
mode for those anymore (more compiled code), but probably in a major?
9662b93
to
937790d
Compare
See https://babeljs.io/blog/2021/04/29/7.14.0