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

[#6008] Use Uglifier's experimental Harmony mode for ES6 #6009

Merged
merged 1 commit into from
Feb 16, 2021

Conversation

garethrees
Copy link
Member

4d2ab5a introduces ES6 syntax, which Uglifier doesn't support by
default [1].

This commit enables the experimental "Harmony mode", along with
disabling mangle and compress as per the usage recommendations [2].

This doesn't seem like a good long-term solution, since development of
Harmony mode has stopped and may be removed. This at least allows us to
deploy 4d2ab5a for now.

Fixes #6008.

[1] https://github.com/lautis/uglifier#es6--es2015--harmony-mode
[2] https://github.com/lautis/uglifier#usage
[3] lautis/uglifier#142 (comment)

@garethrees
Copy link
Member Author

garethrees commented Dec 9, 2020

This doesn't seem like a good long-term solution, since development of
Harmony mode has stopped and may be removed. This at least allows us to
deploy 4d2ab5a for now.

The alternative is to remove ES6 syntax from 4d2ab5a, but I don't know off-hand how tricky that would be.

@gbp
Copy link
Member

gbp commented Dec 9, 2020

Superseded by #6010

@gbp gbp closed this Dec 9, 2020
@mysociety-pusher mysociety-pusher deleted the enable-uglifier-harmony-mode branch December 9, 2020 13:10
@gbp gbp restored the enable-uglifier-harmony-mode branch February 16, 2021 14:20
@gbp
Copy link
Member

gbp commented Feb 16, 2021

Looks like we might need this after all as ES6 syntax is also used in clipboard.js introduced in 366d87c

@gbp gbp reopened this Feb 16, 2021
4d2ab5a introduces ES6 syntax, which Uglifier doesn't support by
default [1].

This commit enables the experimental "Harmony mode", along with
disabling `mangle` and `compress` as per the usage recommendations [2].

This doesn't seem like a good long-term solution, since development of
Harmony mode has stopped and may be removed. This at least allows us to
deploy 4d2ab5a for now.

Fixes #6008.

[1] https://github.com/lautis/uglifier#es6--es2015--harmony-mode
[2] https://github.com/lautis/uglifier#usage
[3] lautis/uglifier#142 (comment)
@gbp gbp force-pushed the enable-uglifier-harmony-mode branch from dd0836c to 38cb5ec Compare February 16, 2021 14:21
Copy link
Member

@gbp gbp left a comment

Choose a reason for hiding this comment

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

uglifier HEAD has dropped the harmony option and are recommending https://github.com/ahorek/terser-ruby as a better option.

I've tested both and exactly the same JS is outputted.

For now lets stick with uglifier until:

  1. the next version is relaesed and switch to terser then
  2. we migrate to webpacker

@gbp gbp merged commit 04a2aa3 into develop Feb 16, 2021
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.

ES6 syntax breaks asset compilation
2 participants