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

GOV.UK frontend upgrade from version 4 to 5 #192

Merged
merged 5 commits into from
Dec 11, 2024
Merged

Conversation

garethfoote
Copy link
Contributor

@garethfoote garethfoote commented Dec 10, 2024

This PR also includes the linting fix

There are a couple of minor changes needed to get this working:

  • Change imports from e.g. "govuk-frontend/govuk/base" to "govuk-frontend/dist/govuk/base"
  • Add JS to top of <body> to init JS only in supported browser - docs
  • Init'ing a module slightly differently - I think we only do this with header atm. - docs
    • e.g. from new Header(element).init() to new Header(element)

Benefits of updating to v5

  • find it easier to make future changes to comply with WCAG 2.2 accessibility requirements
  • have the option to use the new task list component
  • import less code to your project as our JavaScript code is 25% smaller and our CSS is 5% smaller
  • only run JavaScript in browsers where GOV.UK Frontend is supported which reduces the load in older browsers
  • see new error messages that explain when our components fail to initialise

@garethfoote garethfoote requested a review from TomJKing December 10, 2024 17:07
TomJKing
TomJKing previously approved these changes Dec 11, 2024
Copy link
Contributor

@TomJKing TomJKing left a comment

Choose a reason for hiding this comment

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

Looks good. Thanks for doing this.

@garethfoote garethfoote dismissed TomJKing’s stale review December 11, 2024 09:17

The merge-base changed after approval.

@garethfoote
Copy link
Contributor Author

@TomJKing @Tom-Hallett Apologies, this needs another approval because I merged with the previous PR.

Also, adding the comments from our Slack chat:

Just another heads-up…when I merge the govuk-frontend upgrade PR, the npm build of TDR Components will include v5 CSS, Sass and JS. I think that shouldn’t cause an issue because you’re still pulling in govuk-frontend v4 into the TDR front end.
But do you want to do anything in case there are any issues? The TDR Components version before the upgrade to v5 (which includes the linting fix) is 1.0.45 .

Copy link
Contributor

@TomJKing TomJKing left a comment

Choose a reason for hiding this comment

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

Looks good. Thanks.

@garethfoote garethfoote merged commit b194f94 into main Dec 11, 2024
7 checks passed
@garethfoote garethfoote deleted the govukfrontendv5 branch December 11, 2024 10:09
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.

2 participants