magesuite / magepack

Next generation Magento 2 advanced JavaScript bundler.
Open Software License 3.0
438 stars 91 forks source link

Upgrade terser to version >= 5.2 / optional chaining problem #136

Open Yonn-Trimoreau opened 2 years ago

Yonn-Trimoreau commented 2 years ago

Hi,

I use optional chaining pretty heavily in my project (https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Operators/Optional_chaining), and some of the extensions I have installed also make use of this perfectly legal and widely usable syntax (https://caniuse.com/mdn-javascript_operators_optional_chaining).

Terser became compatible with optional chaining as of version 5.2 (https://github.com/terser/terser/issues/567#issuecomment-675583347), and magepack still uses v4.8 (https://github.com/magesuite/magepack/blob/master/package.json#L24).

I have tried upgrading to the latest version of terser in a forked version (https://github.com/Yonn-Trimoreau/magepack/commit/12329e3003f51eb680cb647efae918a5fb225816), and magepack seems to work perfectly fine.

Can you please upgrade?

Thanks in advance, Best regards

edward-simpson commented 2 years ago

Any way to expedite this? Optional chaining's been supported by modern browsers for a while now and it's frustrating to not be able to use it without having to pull files out of the bundle

edward-simpson commented 2 years ago

Created a PR to move this along a bit

fredden commented 2 years ago

It looks like https://github.com/magesuite/magepack/commit/b96eeccd3605d6fcfac8d4cc26445c3b0072990f upgrades Terser to 5.15.0. I can't find a pull request for that commit though. @Szpadel, this issue can probably be marked as complete when you have released a new version of magepack which includes this commit/change.

fredden commented 2 years ago

This was fixed in version 2.9.0.