From 9a9d5853f2965946baa083ae40392fee1c368c1d Mon Sep 17 00:00:00 2001 From: Murilo Dal Ri Date: Fri, 28 Jun 2024 10:37:16 +0100 Subject: [PATCH] Upgrade to govuk frontend 5.1 --- Gemfile | 4 +- Gemfile.lock | 158 ++++++++++++++++------- app/assets/config/manifest.js | 1 + app/assets/javascripts/application.js | 2 +- app/assets/javascripts/es6-components.js | 11 ++ app/views/layouts/application.html.erb | 1 + 6 files changed, 127 insertions(+), 50 deletions(-) create mode 100644 app/assets/javascripts/es6-components.js diff --git a/Gemfile b/Gemfile index 6ce807431..2329137ab 100644 --- a/Gemfile +++ b/Gemfile @@ -12,7 +12,7 @@ gem "gds-sso" gem "gds_zendesk" gem "govuk_admin_template" gem "govuk_app_config" -gem "govuk_publishing_components" +gem "govuk_publishing_components", git: "https://github.com/alphagov/govuk_publishing_components.git", branch: "upgrade-to-govuk-frontend-5.1" gem "govuk_sidekiq" gem "gretel" gem "jquery-ui-rails", github: "jquery-ui-rails/jquery-ui-rails", tag: "v7.0.0" # https://github.com/jquery-ui-rails/jquery-ui-rails/pull/139#issuecomment-1768150544 @@ -22,7 +22,7 @@ gem "redis" gem "select2-rails" gem "sentry-sidekiq" gem "sprockets-rails" -gem "uglifier" +gem "terser" gem "validates_timeliness", "~> 7.0.0.beta2" group :development do diff --git a/Gemfile.lock b/Gemfile.lock index a0b5ac98b..23283ec1d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,3 +1,18 @@ +GIT + remote: https://github.com/alphagov/govuk_publishing_components.git + revision: 29e8b077cdc6f69493805b67cbbec856dde008ea + branch: upgrade-to-govuk-frontend-5.1 + specs: + govuk_publishing_components (39.0.0) + govuk_app_config + govuk_personalisation (>= 0.7.0) + kramdown + plek + rails (>= 6) + rouge + sprockets (>= 3) + sprockets-rails + GIT remote: https://github.com/jquery-ui-rails/jquery-ui-rails.git revision: 413265e81f790f795239e07e7e25e01429b2f18d @@ -89,7 +104,7 @@ GEM autoprefixer-rails (10.4.16.0) execjs (~> 2) aws-eventstream (1.3.0) - aws-partitions (1.949.0) + aws-partitions (1.950.0) aws-sdk-core (3.200.0) aws-eventstream (~> 1, >= 1.3.0) aws-partitions (~> 1, >= 1.651.0) @@ -146,20 +161,27 @@ GEM drb (2.2.1) erubi (1.13.0) execjs (2.9.1) - factory_bot (6.4.5) + factory_bot (6.4.6) activesupport (>= 5.0.0) factory_bot_rails (6.4.3) factory_bot (~> 6.4) railties (>= 5.0.0) - faraday (2.9.0) + faraday (2.9.2) faraday-net_http (>= 2.0, < 3.2) faraday-multipart (1.0.4) multipart-post (~> 2) faraday-net_http (3.1.0) net-http ffi (1.17.0-aarch64-linux-gnu) + ffi (1.17.0-aarch64-linux-musl) + ffi (1.17.0-arm-linux-gnu) + ffi (1.17.0-arm-linux-musl) ffi (1.17.0-arm64-darwin) + ffi (1.17.0-x86-linux-gnu) + ffi (1.17.0-x86-linux-musl) + ffi (1.17.0-x86_64-darwin) ffi (1.17.0-x86_64-linux-gnu) + ffi (1.17.0-x86_64-linux-musl) gds-api-adapters (96.0.2) addressable link_header @@ -180,9 +202,24 @@ GEM zendesk_api (>= 1.37, < 4.0) globalid (1.2.1) activesupport (>= 6.1) - google-protobuf (3.25.3-aarch64-linux) - google-protobuf (3.25.3-arm64-darwin) - google-protobuf (3.25.3-x86_64-linux) + google-protobuf (4.27.2) + bigdecimal + rake (>= 13) + google-protobuf (4.27.2-aarch64-linux) + bigdecimal + rake (>= 13) + google-protobuf (4.27.2-arm64-darwin) + bigdecimal + rake (>= 13) + google-protobuf (4.27.2-x86-linux) + bigdecimal + rake (>= 13) + google-protobuf (4.27.2-x86_64-darwin) + bigdecimal + rake (>= 13) + google-protobuf (4.27.2-x86_64-linux) + bigdecimal + rake (>= 13) googleapis-common-protos-types (1.15.0) google-protobuf (>= 3.18, < 5.a) govuk_admin_template (7.0.0) @@ -205,20 +242,11 @@ GEM govuk_personalisation (0.16.0) plek (>= 1.9.0) rails (>= 6, < 8) - govuk_publishing_components (39.2.0) - govuk_app_config - govuk_personalisation (>= 0.7.0) - kramdown - plek - rails (>= 6) - rouge - sprockets (>= 3) - sprockets-rails - govuk_sidekiq (7.1.3) + govuk_sidekiq (7.1.1) gds-api-adapters (>= 19.1.0) govuk_app_config (>= 1.1) redis-namespace (~> 1.6) - sidekiq (~> 6.5) + sidekiq (~> 6) govuk_test (4.1.0) brakeman (>= 5.0.2) capybara (>= 3.36) @@ -245,7 +273,7 @@ GEM railties (>= 4.2.0) thor (>= 0.14, < 2.0) json (2.7.2) - jwt (2.8.1) + jwt (2.8.2) base64 kaminari (1.2.2) activesupport (>= 4.1.0) @@ -266,6 +294,7 @@ GEM listen (3.9.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) + logger (1.6.0) logstasher (2.1.5) activesupport (>= 5.2) request_store @@ -279,14 +308,15 @@ GEM net-smtp marcel (1.0.4) matrix (0.4.2) - method_source (1.0.0) + method_source (1.1.0) mime-types (3.5.2) mime-types-data (~> 3.2015) mime-types-data (3.2024.0604) mini_mime (1.1.5) minitest (5.24.1) msgpack (1.7.2) - multi_xml (0.6.0) + multi_xml (0.7.1) + bigdecimal (~> 3.1) multipart-post (2.4.1) mutex_m (0.2.0) net-http (0.4.1) @@ -304,8 +334,14 @@ GEM nio4r (2.7.3) nokogiri (1.16.6-aarch64-linux) racc (~> 1.4) + nokogiri (1.16.6-arm-linux) + racc (~> 1.4) nokogiri (1.16.6-arm64-darwin) racc (~> 1.4) + nokogiri (1.16.6-x86-linux) + racc (~> 1.4) + nokogiri (1.16.6-x86_64-darwin) + racc (~> 1.4) nokogiri (1.16.6-x86_64-linux) racc (~> 1.4) null_logger (0.0.1) @@ -530,7 +566,7 @@ GEM plek (5.2.0) prometheus_exporter (2.1.1) webrick - pry (0.14.1) + pry (0.14.2) coderay (~> 1.1) method_source (~> 1.0) pry-byebug (3.10.1) @@ -542,19 +578,19 @@ GEM puma (6.4.2) nio4r (~> 2.0) racc (1.8.0) - rack (2.2.9) - rack-protection (3.2.0) + rack (3.1.5) + rack-protection (4.0.0) base64 (>= 0.1.0) - rack (~> 2.2, >= 2.2.4) + rack (>= 3.0.0, < 4) rack-proxy (0.7.7) rack - rack-session (1.0.2) - rack (< 3) + rack-session (2.0.0) + rack (>= 3.0.0) rack-test (2.1.0) rack (>= 1.3) - rackup (1.0.0) - rack (< 3) - webrick + rackup (2.1.0) + rack (>= 3) + webrick (~> 1.8) rails (7.1.3.4) actioncable (= 7.1.3.4) actionmailbox (= 7.1.3.4) @@ -591,7 +627,7 @@ GEM rainbow (3.1.1) rake (13.2.1) rb-fsevent (0.11.2) - rb-inotify (0.10.1) + rb-inotify (0.11.1) ffi (~> 1.0) rdoc (6.7.0) psych (>= 4.0.0) @@ -669,17 +705,32 @@ GEM rubocop (~> 1.61) ruby-progressbar (1.13.0) rubyzip (2.3.2) - sass-embedded (1.70.0-aarch64-linux-gnu) - google-protobuf (~> 3.25) - sass-embedded (1.70.0-arm64-darwin) - google-protobuf (~> 3.25) - sass-embedded (1.70.0-x86_64-linux-gnu) - google-protobuf (~> 3.25) + sass-embedded (1.77.5-aarch64-linux-gnu) + google-protobuf (>= 3.25, < 5.0) + sass-embedded (1.77.5-aarch64-linux-musl) + google-protobuf (>= 3.25, < 5.0) + sass-embedded (1.77.5-arm-linux-gnueabihf) + google-protobuf (>= 3.25, < 5.0) + sass-embedded (1.77.5-arm-linux-musleabihf) + google-protobuf (>= 3.25, < 5.0) + sass-embedded (1.77.5-arm64-darwin) + google-protobuf (>= 3.25, < 5.0) + sass-embedded (1.77.5-x86-linux-gnu) + google-protobuf (>= 3.25, < 5.0) + sass-embedded (1.77.5-x86-linux-musl) + google-protobuf (>= 3.25, < 5.0) + sass-embedded (1.77.5-x86_64-darwin) + google-protobuf (>= 3.25, < 5.0) + sass-embedded (1.77.5-x86_64-linux-gnu) + google-protobuf (>= 3.25, < 5.0) + sass-embedded (1.77.5-x86_64-linux-musl) + google-protobuf (>= 3.25, < 5.0) sassc (2.4.0) ffi (~> 1.9) select2-rails (4.0.13) - selenium-webdriver (4.21.1) + selenium-webdriver (4.22.0) base64 (~> 0.2) + logger (~> 1.4) rexml (~> 3.2, >= 3.2.5) rubyzip (>= 1.2.2, < 3.0) websocket (~> 1.0) @@ -698,10 +749,11 @@ GEM shoulda-context (2.0.0) shoulda-matchers (4.5.1) activesupport (>= 4.2.0) - sidekiq (6.5.5) + sidekiq (6.0.4) connection_pool (>= 2.2.2) - rack (~> 2.0) - redis (>= 4.5.0) + rack (>= 2.0.0) + rack-protection (>= 2.0.0) + redis (>= 4.1.0) simplecov (0.22.0) docile (~> 1.1) simplecov-html (~> 0.11) @@ -722,14 +774,14 @@ GEM statsd-ruby (1.5.0) stringio (3.1.1) strscan (3.1.0) + terser (1.2.3) + execjs (>= 0.3.0, < 3) thor (1.3.1) timecop (0.9.10) timeliness (0.4.5) timeout (0.4.1) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - uglifier (4.2.0) - execjs (>= 0.3.0, < 3) unicode-display_width (2.5.0) uri (0.13.0) validates_timeliness (7.0.0.beta2) @@ -757,7 +809,7 @@ GEM xpath (3.2.0) nokogiri (~> 1.8) zeitwerk (2.6.16) - zendesk_api (3.0.5) + zendesk_api (3.1.0) faraday (> 2.0.0) faraday-multipart hashie (>= 3.5.2, < 6.0.0) @@ -767,8 +819,20 @@ GEM PLATFORMS aarch64-linux + aarch64-linux-gnu + aarch64-linux-musl + arm-linux + arm-linux-gnu + arm-linux-gnueabihf + arm-linux-musl + arm-linux-musleabihf arm64-darwin - x86_64-linux + x86-linux + x86-linux-gnu + x86-linux-musl + x86_64-darwin + x86_64-linux-gnu + x86_64-linux-musl DEPENDENCIES aws-sdk-s3 @@ -782,7 +846,7 @@ DEPENDENCIES gds_zendesk govuk_admin_template govuk_app_config - govuk_publishing_components + govuk_publishing_components! govuk_sidekiq govuk_test gretel @@ -804,11 +868,11 @@ DEPENDENCIES simplecov spring sprockets-rails + terser timecop - uglifier validates_timeliness (~> 7.0.0.beta2) web-console webmock BUNDLED WITH - 2.4.9 + 2.5.6 diff --git a/app/assets/config/manifest.js b/app/assets/config/manifest.js index fdde31cbe..4233c01bf 100644 --- a/app/assets/config/manifest.js +++ b/app/assets/config/manifest.js @@ -5,3 +5,4 @@ //= link_directory ../javascripts/legacy .js //= link_tree ../builds +//= link es6-components.js diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 41dd920a8..0900877b1 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -1,2 +1,2 @@ //= require govuk_publishing_components/dependencies -//= require govuk_publishing_components/all_components +//= require govuk_publishing_components/components/details diff --git a/app/assets/javascripts/es6-components.js b/app/assets/javascripts/es6-components.js new file mode 100644 index 000000000..dcb642001 --- /dev/null +++ b/app/assets/javascripts/es6-components.js @@ -0,0 +1,11 @@ +// 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/skip-link +//= require govuk_publishing_components/components/layout-header diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 211b21caa..86d4d5980 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -11,6 +11,7 @@ <%= csp_meta_tag %> <%= stylesheet_link_tag "legacy/application", :media => "all" %> <%= javascript_include_tag "legacy/application" %> + <%= javascript_include_tag 'es6-components', type: "module" %> <% end %> <% content_for :favicon do %>