Skip to content
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

Merged
merged 1 commit into from May 6, 2021
Merged

Babel 7.14 upgrade #30

merged 1 commit into from May 6, 2021

Conversation

pascalduez
Copy link
Member

@pascalduez pascalduez commented May 4, 2021

let safe = obj === null || obj === void 0 ? void 0 : (_obj$qux = obj.qux) === null || _obj$qux === void 0 ? void 0 : _obj$qux.baz; // undefined
Copy link
Member

Choose a reason for hiding this comment

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

Regression?

Copy link
Member Author

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...

Copy link
Member Author

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.

See
babel/babel#13145
babel/babel#13001

Copy link
Member

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)

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member

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,

Copy link
Member Author

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 }],
Copy link
Contributor

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.

Copy link
Member Author

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?

@pascalduez pascalduez merged commit adce304 into master May 6, 2021
@pascalduez pascalduez deleted the feature/babel-7.14 branch May 6, 2021 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants