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

Upgrade to govuk frontend 5.1 #3648

Merged
merged 4 commits into from
Jul 15, 2024
Merged

Conversation

MartinJJones
Copy link
Contributor

@MartinJJones MartinJJones commented Jun 6, 2024

What

  • Move components that rely on govuk-frontend modules to separate es6-components.js file
  • Remove Sass variables
  • Update polyfill file paths

Why

Move components that rely on govuk-frontend modules to seperate es6-components.js file

In the event that a browser below the target for govuk-frontend loads a page with JS on it, attempting to parse the JS from govuk-frontend will cause an error. To avoid this from happening, JS that contains govuk-frontend JS has been moved to seperate file which will be loaded in a script tag with type="module". This will prevent the JS from being parsed and so prevent the error

Remove Sass variables

  • The $legacy attribute in govuk-colour has been deprecated and using it will have no effect (other than generating warnings on pre-compilation)

Update polyfill file paths

Browser polyfills are no longer included in v5 of govuk-frontend, any Polyfills provided in v4 of govuk-frontend will be included in the new version of the govuk-publishing-components gem.

The intention is for this PR to include the bump to the govuk-frontend v5 version of the govuk-publishing-components gem, this will also fix the failing tests relating to the missing polyfill.

Trello

⚠️ This repo is Continuously Deployed: make sure you follow the guidance ⚠️

Follow these steps if you are doing a Rails upgrade.

@govuk-ci govuk-ci temporarily deployed to collections-pr-3648 June 6, 2024 14:13 Inactive
@MartinJJones MartinJJones force-pushed the upgrade-to-govuk-frontend-5.1 branch from 1fcb0a3 to 4700fba Compare June 6, 2024 15:59
@govuk-ci govuk-ci temporarily deployed to collections-pr-3648 June 6, 2024 15:59 Inactive
@MartinJJones MartinJJones force-pushed the upgrade-to-govuk-frontend-5.1 branch from 4700fba to 339a982 Compare July 5, 2024 15:44
@MartinJJones MartinJJones changed the title Upgrade to govuk frontend 5.1 [DO NOT MERGE] Upgrade to govuk frontend 5.1 Jul 5, 2024
Copy link
Member

@hannalaakso hannalaakso left a comment

Choose a reason for hiding this comment

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

Changes look good to me 👍 I've looked at both the code changes and run the app locally to check there are no errors on a selection of pages.

As discussed with Martin, I'm commenting instead of approving as we still have some failing tests on the PR. Once the new gem is released, these tests should pass and the PR can be approved at that point.

@MartinJJones MartinJJones force-pushed the upgrade-to-govuk-frontend-5.1 branch from 339a982 to eb6b76b Compare July 12, 2024 12:22
patrickpatrickpatrick and others added 3 commits July 15, 2024 10:43
To prevent browsers evaluating JS that isn't supported, components that contain code from govuk-frontend have been moved to a separate file `es6-components.js` which is included in `application.html.erb` as a script tag with `type="module"`
Remove $legacy attribute in govuk-colour, this is no longer supported from v5 of govuk-frontend
Updated to continue to use the closest Polyfill from v4 of govuk-frontend which is now included in the publishing_components_gem
@hannalaakso hannalaakso force-pushed the upgrade-to-govuk-frontend-5.1 branch from eb6b76b to 830181d Compare July 15, 2024 09:52
@hannalaakso hannalaakso changed the title [DO NOT MERGE] Upgrade to govuk frontend 5.1 Upgrade to govuk frontend 5.1 Jul 15, 2024
@hannalaakso hannalaakso marked this pull request as ready for review July 15, 2024 10:59
@hannalaakso hannalaakso merged commit 2d8d855 into main Jul 15, 2024
14 checks passed
@hannalaakso hannalaakso deleted the upgrade-to-govuk-frontend-5.1 branch July 15, 2024 11:00
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