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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ GEM
govuk_personalisation (0.16.0)
plek (>= 1.9.0)
rails (>= 6, < 8)
govuk_publishing_components (39.2.5)
govuk_publishing_components (40.0.0)
govuk_app_config
govuk_personalisation (>= 0.7.0)
kramdown
Expand Down
3 changes: 2 additions & 1 deletion app/assets/config/manifest.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//= link_tree ../images
//= link application.js
//= link test-dependencies.js
//= link es6-components.js
//= link live_search.js

//= link_tree ../builds
//= link_tree ../builds
2 changes: 1 addition & 1 deletion app/assets/javascripts/analytics-ga4/ga4-finder-tracker.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//= require govuk/vendor/polyfills/Element/prototype/closest.js
//= require govuk_publishing_components/vendor/polyfills-govuk-frontend-v4/Element/prototype/closest.js
;(function (global) {
'use strict'

Expand Down
3 changes: 0 additions & 3 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,10 @@
// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
// about supported directives.
//= require govuk_publishing_components/lib
//= require govuk_publishing_components/components/checkboxes
//= require govuk_publishing_components/components/error-summary
//= require govuk_publishing_components/components/govspeak
//= require govuk_publishing_components/components/intervention
//= require govuk_publishing_components/components/metadata
//= require govuk_publishing_components/components/option-select
//= require govuk_publishing_components/components/radio
//= require govuk_publishing_components/analytics/explicit-cross-domain-links
//
//= require support
Expand Down
12 changes: 12 additions & 0 deletions app/assets/javascripts/es6-components.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// These modules from govuk_publishing_components
// depend on govuk-frontend modules. govuk-frontend
// now targets browsers that support `type="module"`.
//
// To gracefully prevent execution of these scripts
// on browsers that don't support ES6, this script
// should be included in a `type="module"` script tag
// which will ensure they are never loaded.

//= require govuk_publishing_components/components/checkboxes
//= require govuk_publishing_components/components/error-summary
//= require govuk_publishing_components/components/radio
5 changes: 0 additions & 5 deletions app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
$govuk-compatibility-govuktemplate: false;
$govuk-use-legacy-palette: false;
$govuk-new-link-styles: true;
$govuk-use-legacy-font: false;

// This flag stops the font from being included in this application's
// stylesheet - the font is being served by Static across all of GOV.UK, so is
// not needed here.
Expand Down
1 change: 1 addition & 0 deletions app/views/layouts/development_layout.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
render_component_stylesheets
%>
<%= javascript_include_tag "application", integrity: false %>
<%= javascript_include_tag 'es6-components', integrity: false, type: "module" %>
<meta name="robots" content="noindex">
</head>

Expand Down
1 change: 1 addition & 0 deletions app/views/layouts/finder_layout.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
%>
<%= javascript_include_tag 'test-dependencies.js' if Rails.env.test? %>
<%= javascript_include_tag 'application', integrity: false %>
<%= javascript_include_tag 'es6-components', integrity: false, type: "module" %>
<%= csrf_meta_tags %>
<%= yield :head %>

Expand Down
1 change: 1 addition & 0 deletions app/views/layouts/search_layout.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<title><%= yield :title %> - GOV.UK</title>
<link title="Search" rel="search" type="application/opensearchdescription+xml" href="/search/opensearch.xml"/>
<%= stylesheet_link_tag "application", media: "all", integrity: false %>
<%= javascript_include_tag 'es6-components', integrity: false, type: "module" %>
<%=
render_component_stylesheets
%>
Expand Down
Loading