-
Notifications
You must be signed in to change notification settings - Fork 17
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
Conversation
1fcb0a3
to
4700fba
Compare
4700fba
to
339a982
Compare
There was a problem hiding this 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.
339a982
to
eb6b76b
Compare
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
eb6b76b
to
830181d
Compare
What
es6-components.js
fileWhy
Move components that rely on govuk-frontend modules to seperate
es6-components.js
fileIn the event that a browser below the target for
govuk-frontend
loads a page with JS on it, attempting to parse the JS fromgovuk-frontend
will cause an error. To avoid this from happening, JS that containsgovuk-frontend
JS has been moved to seperate file which will be loaded in a script tag withtype="module"
. This will prevent the JS from being parsed and so prevent the errorRemove Sass variables
$legacy
attribute ingovuk-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
Follow these steps if you are doing a Rails upgrade.