From feca39d1c1b87065b5766406ffc0880763850096 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 21 Mar 2023 13:32:06 +0000 Subject: [PATCH 1/2] Bump sprockets from 4.0.3 to 4.2.0 Bumps [sprockets](https://github.com/rails/sprockets) from 4.0.3 to 4.2.0. - [Release notes](https://github.com/rails/sprockets/releases) - [Changelog](https://github.com/rails/sprockets/blob/main/CHANGELOG.md) - [Commits](https://github.com/rails/sprockets/compare/v4.0.3...v4.2.0) --- updated-dependencies: - dependency-name: sprockets dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile | 2 +- Gemfile.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile b/Gemfile index 5fbcadf44b..b0719145ea 100644 --- a/Gemfile +++ b/Gemfile @@ -107,7 +107,7 @@ gem "clockwork" gem "mini_racer", "~> 0.6.3" gem "nokogiri", ">= 1.10.4" gem "image_processing" -gem "sprockets", "~> 4.0.0" +gem "sprockets", "~> 4.2.0" group :production do # Reduce the noise of logs and include custom fields to it for easier access diff --git a/Gemfile.lock b/Gemfile.lock index c4ccaac201..63023431db 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -553,9 +553,9 @@ GEM snaky_hash (2.0.0) hashie version_gem (~> 1.1) - sprockets (4.0.3) + sprockets (4.2.0) concurrent-ruby (~> 1.0) - rack (> 1, < 3) + rack (>= 2.2.4, < 4) sprockets-rails (3.4.2) actionpack (>= 5.2) activesupport (>= 5.2) @@ -691,7 +691,7 @@ DEPENDENCIES simple_form simplecov skylight - sprockets (~> 4.0.0) + sprockets (~> 4.2.0) standard (~> 1.25) stimulus-rails strong_migrations (= 1.4.4) From aba856f964f6c6f4b311d2cd28a80b44ff69cfbb Mon Sep 17 00:00:00 2001 From: Brock Wilcox Date: Sat, 25 Mar 2023 23:05:07 -0400 Subject: [PATCH 2/2] Add work-around for sprockets fingerprint issue --- config/initializers/sprockets_fix.rb | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 config/initializers/sprockets_fix.rb diff --git a/config/initializers/sprockets_fix.rb b/config/initializers/sprockets_fix.rb new file mode 100644 index 0000000000..a4f22a76b2 --- /dev/null +++ b/config/initializers/sprockets_fix.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Sprockets + module ServerWithFixedPathFingerprint + + # PATCHED: Require longer (min 10 instead of 7) fingerprint so that we can distinguish + # "stimulus-loading-0aa2105d29558f3eb790d411d7d8fb66.js" + # from + # "stimulus-loading.js" + # ... where it thinks "loading" is the fingerprint without this change + def path_fingerprint(path) + # WAS: + # path[/-([0-9a-zA-Z]{7,128})\.[^.]+\z/, 1] + # PATCH: + path[/-([0-9a-zA-Z]{10,128})\.[^.]+\z/, 1] + end + end + + ::Sprockets::Server.prepend ::Sprockets::ServerWithFixedPathFingerprint +end