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

Use Terser instead of Uglifier #3167

Merged
merged 1 commit into from
May 7, 2024
Merged

Conversation

MartinJJones
Copy link
Contributor

@MartinJJones MartinJJones commented Apr 23, 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 government-frontend/application.js 122KB 22.7KB
terser government-frontend/application.js 122KB 22.8KB

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-ci govuk-ci temporarily deployed to government-frontend-pr-3167 April 23, 2024 10:48 Inactive
@MartinJJones MartinJJones force-pushed the move-from-uglifier-to-terser branch from 2f8562d to b1270cb Compare April 23, 2024 10:52
@govuk-ci govuk-ci temporarily deployed to government-frontend-pr-3167 April 23, 2024 10:52 Inactive
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.
@MartinJJones MartinJJones force-pushed the move-from-uglifier-to-terser branch from b1270cb to 36bc9b1 Compare May 2, 2024 11:15
@govuk-ci govuk-ci temporarily deployed to government-frontend-pr-3167 May 2, 2024 11:15 Inactive
@MartinJJones MartinJJones requested review from andysellick and AshGDS May 7, 2024 08:39
@MartinJJones MartinJJones marked this pull request as ready for review May 7, 2024 08:39
@MartinJJones MartinJJones merged commit 62eea48 into main May 7, 2024
15 checks passed
@MartinJJones MartinJJones deleted the move-from-uglifier-to-terser branch May 7, 2024 14:28
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.

4 participants