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 #3206

Merged
merged 4 commits into from
Jul 15, 2024
Merged

Upgrade to govuk frontend 5.1 #3206

merged 4 commits into from
Jul 15, 2024

Conversation

MartinJJones
Copy link
Contributor

@MartinJJones MartinJJones commented May 31, 2024

What

  • Move components that rely on govuk-frontend modules to separate es6-components.js file
  • Remove Sass variables
  • Update test for phase banner string

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 test for phase banner text

In govuk-frontend v5 the phase banner text is no longer uppercase, now only the first letter of a word is capitalised and the rest of the content lowercase

Trello

The intention is for the PR to include the upgrade to the version of the publishing_components_gem as well, once released. This will also fix the failing test.


⚠️ 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 government-frontend-pr-3206 May 31, 2024 10:41 Inactive
@govuk-ci govuk-ci temporarily deployed to government-frontend-pr-3206 May 31, 2024 11:24 Inactive
@MartinJJones MartinJJones force-pushed the upgrade-to-govuk-frontend-5.1 branch from 1d4042a to 7732439 Compare June 4, 2024 09:18
@govuk-ci govuk-ci temporarily deployed to government-frontend-pr-3206 June 4, 2024 09:19 Inactive
@MartinJJones MartinJJones force-pushed the upgrade-to-govuk-frontend-5.1 branch from 7732439 to b0f20a6 Compare June 11, 2024 08:30
@govuk-ci govuk-ci temporarily deployed to government-frontend-pr-3206 June 11, 2024 08:30 Inactive
@MartinJJones MartinJJones force-pushed the upgrade-to-govuk-frontend-5.1 branch from b0f20a6 to abf2cde Compare July 5, 2024 15:55
@govuk-ci govuk-ci temporarily deployed to government-frontend-pr-3206 July 5, 2024 15:55 Inactive
@MartinJJones MartinJJones changed the title Upgrade to govuk frontend 5.1 [DO NOT MERGE] Upgrade to govuk frontend 5.1 Jul 5, 2024
@andysellick
Copy link
Contributor

@MartinJJones one failing test still, on the label text thing test/integration/service_manual_phase_label_test.rb:32

@MartinJJones
Copy link
Contributor Author

MartinJJones commented Jul 10, 2024

@MartinJJones one failing test still, on the label text thing test/integration/service_manual_phase_label_test.rb:32

Thanks Andy, this is expected, the test will pass once the version of the gem is bumped to the v5 release as part of this PR. Happy to wait on this and get approval on release day once the test is passing.

@MartinJJones MartinJJones force-pushed the upgrade-to-govuk-frontend-5.1 branch from abf2cde to 77d49b5 Compare July 12, 2024 12:24
@govuk-ci govuk-ci temporarily deployed to government-frontend-pr-3206 July 12, 2024 12:24 Inactive
patrickpatrickpatrick and others added 4 commits July 15, 2024 10:44
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
@hannako hannako force-pushed the upgrade-to-govuk-frontend-5.1 branch from 77d49b5 to a64367e Compare July 15, 2024 09:59
@govuk-ci govuk-ci temporarily deployed to government-frontend-pr-3206 July 15, 2024 09:59 Inactive
@hannako hannako changed the title [DO NOT MERGE] Upgrade to govuk frontend 5.1 Upgrade to govuk frontend 5.1 Jul 15, 2024
@hannako hannako marked this pull request as ready for review July 15, 2024 10:44
@hannako hannako merged commit cce3ffb into main Jul 15, 2024
11 checks passed
@hannako hannako deleted the upgrade-to-govuk-frontend-5.1 branch July 15, 2024 10: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.

6 participants