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.0 #3376

Merged
merged 4 commits into from
Jul 15, 2024
Merged

Conversation

MartinJJones
Copy link
Contributor

@MartinJJones MartinJJones commented Jun 10, 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)
  • The Sass variables below have been removed, using them will have no effect:
    • $govuk-compatibility-govuktemplate
    • $govuk-use-legacy-palette
    • $govuk-typography-use-rem
  • The Sass variable $govuk-new-link-styles is now set to true by default, so it does not need to be set

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 finder-frontend-pr-3376 June 10, 2024 11:17 Inactive
@MartinJJones MartinJJones force-pushed the upgrade-to-govuk-frontend-5.1.0 branch from 5b8a7e0 to 795e329 Compare June 10, 2024 11:22
@govuk-ci govuk-ci temporarily deployed to finder-frontend-pr-3376 June 10, 2024 11:22 Inactive
@MartinJJones MartinJJones force-pushed the upgrade-to-govuk-frontend-5.1.0 branch from 795e329 to 591dde3 Compare July 5, 2024 15:10
@govuk-ci govuk-ci had a problem deploying to finder-frontend-pr-3376 July 5, 2024 15:10 Failure
@MartinJJones MartinJJones added the do-not-merge Indicates that a PR should not be merged into master / release branches label Jul 5, 2024
@MartinJJones MartinJJones changed the title Upgrade to govuk frontend 5.1.0 [DO NOT MERGE] Upgrade to govuk frontend 5.1.0 Jul 5, 2024
Copy link
Contributor

@andysellick andysellick 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. I note that the tests are failing, but only because this branch doesn't have the v5 upgrade as part of it yet, so that's fine.

@MartinJJones MartinJJones force-pushed the upgrade-to-govuk-frontend-5.1.0 branch from 591dde3 to 2a88393 Compare July 12, 2024 12:27
@govuk-ci govuk-ci had a problem deploying to finder-frontend-pr-3376 July 12, 2024 12:27 Failure
@govuk-ci govuk-ci temporarily deployed to finder-frontend-pr-3376 July 15, 2024 09:43 Inactive
MartinJJones and others added 4 commits July 15, 2024 10:47
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"`.
- $govuk-new-link-styles is now set to true by default
- The other SCSS variables are deprecated 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
@AshGDS AshGDS force-pushed the upgrade-to-govuk-frontend-5.1.0 branch from 774896b to ab15234 Compare July 15, 2024 09:48
@govuk-ci govuk-ci temporarily deployed to finder-frontend-pr-3376 July 15, 2024 09:48 Inactive
@AshGDS AshGDS changed the title [DO NOT MERGE] Upgrade to govuk frontend 5.1.0 Upgrade to govuk frontend 5.1.0 Jul 15, 2024
@AshGDS AshGDS removed the do-not-merge Indicates that a PR should not be merged into master / release branches label Jul 15, 2024
@AshGDS AshGDS marked this pull request as ready for review July 15, 2024 10:58
@AshGDS AshGDS merged commit 49dfca0 into main Jul 15, 2024
13 checks passed
@AshGDS AshGDS deleted the upgrade-to-govuk-frontend-5.1.0 branch July 15, 2024 10:59
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