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 use govuk-frontend v5 #363

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
Draft

Upgrade to use govuk-frontend v5 #363

wants to merge 10 commits into from

Conversation

kr8n3r
Copy link
Contributor

@kr8n3r kr8n3r commented Sep 17, 2024

TODO

  • silence dart sass warnings if possible - see 7c49add

What’s changed

  • updated asset pipeline and packages used to be able to import govuk-frontend v5
  • new govuk_frontend_all entry point that imports all.bundle from govuk-frontend
  • updated javascript and sass compilers
  • updated location paths for govuk-frontend
  • updated markup as per govuk-frontend release notes

Identifying a user need

These changes serve two purposes:

  1. bring tech-docs frontend dependencies up to date from a maintenance / upgradability point of view
  2. bring with it some WCAG 2.2 compliance govuk-frontend offers so that when it comes to assessment / audit, we're in a better position

How to review / test

See individual commits for more detail
Test in a downstream project:

@kr8n3r kr8n3r force-pushed the use-govuk-frontend-v5 branch 9 times, most recently from beb3201 to 99b78ce Compare September 18, 2024 14:21
@kr8n3r kr8n3r changed the title Use govuk frontend v5 Upgrade to use govuk-frontend v5 Sep 18, 2024
@kr8n3r kr8n3r force-pushed the use-govuk-frontend-v5 branch 5 times, most recently from 5438472 to 7d90d38 Compare September 19, 2024 19:28
govuk-frontend

As govuk-frontend encourages its use within
script type=module, we need to create a
separate entry for it as we do not want
any downstrema project to change the way they write
their own javascript.

This PR
- adds a new zgovuk_frontend.js` include to core layout
- removes `all.js` import from `govuk_tech_docs.js`
- creates a new `govuk_frontend_all.js` entry in
the lib that imports `all.bundle.js` from the
NPM package
- adds a new `govuk_frontend.js` entry point in
the example project that pulls in the
`govuk_frontend_all.js` from the lib
- adds new minifier - https://github.com/ahorek/terser-ruby
as the built-in one doesn't support ES6
To do: see if we can configure to silence warning

Built-in sassc compiler doesn't compile
stylesheet do to them, containing source maps

https://github.com/sass-contrib/sassc-embedded-shim-ruby
No longer needed with the upgrade to v5
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.

1 participant