Skip to content

Feature/optional chaining#11221

Merged
sokra merged 5 commits intomasterfrom
feature/optional-chaining
Aug 7, 2020
Merged

Feature/optional chaining#11221
sokra merged 5 commits intomasterfrom
feature/optional-chaining

Conversation

@vankop
Copy link
Copy Markdown
Member

@vankop vankop commented Jul 23, 2020

What kind of change does this PR introduce?

closes #11186
closes #10227

cherry-pick from #11198

Did you add tests for your changes?

yes

Does this PR introduce a breaking change?

no

What needs to be documented once your changes are merged?

nothing

@webpack-bot
Copy link
Copy Markdown
Contributor

For maintainers only:

  • This needs to be documented (issue in webpack/webpack.js.org will be filed when merged)
  • This needs to be backported to webpack 4 (issue will be created when merged)

* @returns {boolean}
*/
module.exports = function (config) {
if (config.mode === "production") return false;
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Terser does not supports optional chaining yet.
terser/terser#567

nullish coalescing works on try.terser.org, but not optimized.

@sokra sokra force-pushed the feature/optional-chaining branch from 0fbb348 to 1eacb07 Compare August 7, 2020 12:45
@webpack-bot
Copy link
Copy Markdown
Contributor

Thank you for your pull request! The most important CI builds succeeded, we’ll review the pull request soon.

@sokra sokra merged commit 792ce1d into master Aug 7, 2020
@sokra sokra deleted the feature/optional-chaining branch August 7, 2020 17:24
@sokra
Copy link
Copy Markdown
Member

sokra commented Aug 7, 2020

Thanks

@dreyks
Copy link
Copy Markdown

dreyks commented Aug 12, 2020

Thanks!

Is there an estimation on when this will be released?

@chenxsan
Copy link
Copy Markdown
Member

@dreyks
Copy link
Copy Markdown

dreyks commented Aug 12, 2020

will it be ported to the stable branch or will it only be available in webpack 5?

@alexander-akait
Copy link
Copy Markdown
Member

@dreyks only for webpack@5

@dreyks
Copy link
Copy Markdown

dreyks commented Aug 19, 2020

btw terser 5.2.0 is out now with the optional chaining support

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[webpack 5] Identifier of ?. is not correctly parsed Unexpected token error at code with optional chaining when using Typescript

6 participants