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

Move from Uglifier to Terser #3606

Merged
merged 1 commit into from
May 7, 2024
Merged

Conversation

MartinJJones
Copy link
Contributor

@MartinJJones MartinJJones commented May 2, 2024

What

Use Terser instead of Uglifier to compile JavaScript.

Why

This change is preparation for upgrading to V5 of govuk-frontend in the govuk-publishing-components gem.

govuk-frontend v5 now targets browsers that support ES6. This means that the UMD modules used in govuk_publsihing_components from govuk-frontend use features of ES6 and so it means that Uglifier can't be used anymore because it only supports ES5.

Trello card

Further info

JS Size

minifier file minified JS minified JS (gzip)
uglifer collections/application.js 95KB 21.2KB
terser collections/application.js 95.1KB 21.2KB

Browser testing

I've tested the changes on Integration using the browsers below, functionality works as expected without any console errors.

  • Chrome
  • Firefox
  • Safari
  • IE11

govuk_publishing_components has govuk-frontend as a dependency.

govuk-frontend v5 now targets browsers that support ES6. This means that the UMD modules used in govuk_publsihing_components from govuk-frontend use features of ES6 and so it means that Uglifier can't be used anymore because it only supports ES5.
@govuk-ci govuk-ci temporarily deployed to collections-pr-3606 May 2, 2024 13:33 Inactive
@MartinJJones MartinJJones marked this pull request as ready for review May 7, 2024 08:37
@MartinJJones MartinJJones merged commit 0cca523 into main May 7, 2024
19 checks passed
@MartinJJones MartinJJones deleted the move-from-uglifier-to-terser branch May 7, 2024 12:58
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.

3 participants