Skip to content
This repository was archived by the owner on Nov 2, 2026. It is now read-only.

Commit cf3e024

Browse files
committed
Migrate from Sprockets to Propshaft
* We don't actually need a JavaScript runtime installed at all. * We don't transpile nor bundle anything. * dartsass handles the CSS compilation. * remove Yarn stuff from .gitignore since we don't use it any more. * Update hardcoded asset paths to use helpers as appropriate. * Remove unused code (empty application.js, Sprockets config, et c.) * Use Ruby ~> 3.4 instead of hardcoding 3.4.9. * Use `SECRET_KEY_BASE_DUMMY` instead of `SECRET_KEY_BASE` when precompiling assets in Docker. * Update JSON Gem for vulnerability while we're here. Implements: AP-808
1 parent ef718c0 commit cf3e024

17 files changed

Lines changed: 83 additions & 1749 deletions

File tree

‎.gitignore‎

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,6 @@
1313
# Build/test artifacts
1414
/artifacts/
1515

16-
# Yarn v3 -- see https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored
17-
18-
.pnp.*
19-
.yarn/*
20-
!.yarn/patches
21-
!.yarn/plugins
22-
!.yarn/releases
23-
!.yarn/sdks
24-
!.yarn/versions
25-
2616
############################################################
2717
# Generated ignores
2818

@@ -399,3 +389,6 @@ Temporary Items
399389
.apdisk
400390
.irb_history
401391
.local
392+
393+
/app/assets/builds/*
394+
!/app/assets/builds/.keep

‎.ruby-version‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.4.9
1+
~> 3.4

‎CHANGES.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# 1.2.2 (unreleased)
2+
* AP-808: Migrate from Sprockets to Propshaft
3+
We don't need a JS runtime at all, so this involved a lot of cleanup.
4+
* Update JSON gem for security patch
5+
16
# 1.2.1 (2026-07-29)
27
* AP-803: Update to Rails 8.1.3.1 for security patches
38

‎Dockerfile‎

Lines changed: 3 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# The base stage scaffolds elements which are common to building and running
55
# the application, such as installing ca-certificates, creating the app user,
66
# and installing runtime system dependencies.
7-
FROM ruby:3.4.9-slim AS base
7+
FROM ruby:3.4-slim AS base
88

99
# ------------------------------------------------------------
1010
# Declarative metadata
@@ -39,27 +39,6 @@ RUN apt-get install -y --no-install-recommends \
3939
gpg \
4040
libyaml-dev
4141

42-
# Install Node.js and Yarn from their own repositories
43-
44-
# Add Node.js package repository (version 16 LTS release) & install Node.js
45-
# -- note that the Node.js setup script takes care of updating the package list
46-
RUN curl -fsSL https://deb.nodesource.com/setup_16.x | bash - \
47-
&& apt-get install -y --no-install-recommends nodejs
48-
49-
# Add Yarn package repository, update package list, & install Yarn
50-
RUN curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | tee /usr/share/keyrings/yarnkey.gpg >/dev/null \
51-
&& echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" | tee /etc/apt/sources.list.d/yarn.list \
52-
&& apt-get update -qq \
53-
&& apt-get install -y --no-install-recommends yarn
54-
55-
# Remove packages we only needed as part of the Node.js / Yarn repository
56-
# setup and installation -- note that the Node.js setup scripts installs
57-
# a full version of Python, but at runtime we only need a minimal version
58-
RUN apt-mark manual python3-minimal \
59-
&& apt-get autoremove --purge -y \
60-
curl \
61-
python3
62-
6342
# ------------------------------------------------------------
6443
# Run configuration
6544

@@ -112,13 +91,6 @@ COPY --chown=$APP_USER:$APP_USER Gemfile* .ruby-version ./
11291
RUN bundle config set --local path /usr/local/bundle
11392
RUN bundle install
11493

115-
# ------------------------------------------------------------
116-
# Install JS packages
117-
118-
# Install JS packages
119-
COPY --chown=$APP_USER:$APP_USER package.json yarn.lock ./
120-
RUN yarn install
121-
12294
# ------------------------------------------------------------
12395
# Copy codebase
12496

@@ -129,6 +101,7 @@ COPY --chown=$APP_USER:$APP_USER . .
129101

130102
# ------------------------------------------------------------
131103
# Development configuration
104+
RUN bundle exec rails dartsass:build
132105

133106
# Show the home page
134107
ENV LIT_SHOW_HOMEPAGE=1
@@ -160,16 +133,11 @@ COPY --from=development --chown=$APP_USER /usr/local/bundle /usr/local/bundle
160133
RUN bundle config set frozen 'true'
161134
RUN bundle install --local
162135

163-
# Ensure JS modules are installed and yarn.lock is synced
164-
RUN yarn install --immutable
165-
166136
# ------------------------------------------------------------
167137
# Precompile production assets
168138

169139
# Pre-compile assets so we don't have to do it after deployment.
170-
# NOTE: dummy SECRET_KEY_BASE to prevent spurious initializer issues
171-
# -- see https://github.com/rails/rails/issues/32947
172-
RUN SECRET_KEY_BASE=1 rails assets:precompile --trace
140+
RUN SECRET_KEY_BASE_DUMMY=1 rails assets:precompile --trace
173141

174142
# ------------------------------------------------------------
175143
# Preserve build arguments

‎Gemfile‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,19 @@ gem 'berkeley_library-docker', '~> 0.2.0'
1010
gem 'berkeley_library-logging', '~> 0.2'
1111
gem 'berkeley_library-util', '~> 0.3'
1212
gem 'browser', '~> 4.2'
13+
gem 'dartsass-rails'
1314
gem 'jbuilder', '~> 2.13'
1415
gem 'mutex_m'
1516
gem 'non-stupid-digest-assets', '~> 1.0' # Allow static pages (e.g. 404.html) to link to compiled assets
1617
gem 'okcomputer', '~> 1.19'
1718
gem 'omniauth-cas', '~> 3.0'
1819
gem 'omniauth-rails_csrf_protection', '~> 1.0'
20+
gem 'propshaft'
1921
gem 'puma', '>= 6.0', '< 8'
2022
gem 'puma-plugin-delayed_stop', '~> 0.1.2'
2123
gem 'rack', '~> 3.2.6'
2224
gem 'rails', '~> 8.1.3', '>= 8.1.3.1'
2325
gem 'rest-client', '~> 2.1'
24-
gem 'sassc-rails', '~> 2.1'
25-
gem 'sprockets', '~> 4.0'
26-
gem 'sprockets-rails', '~> 3.4', require: 'sprockets/railtie'
2726
gem 'typesafe_enum', '~> 0.2'
2827

2928
group :development, :test do

‎Gemfile.lock‎

Lines changed: 65 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,9 @@ GEM
131131
bigdecimal
132132
rexml
133133
crass (1.0.7)
134+
dartsass-rails (0.5.1)
135+
railties (>= 6.0.0)
136+
sass-embedded (~> 1.63)
134137
date (3.5.1)
135138
diff-lcs (1.6.2)
136139
docile (1.4.1)
@@ -152,6 +155,27 @@ GEM
152155
ffi (1.17.4-x86_64-linux-musl)
153156
globalid (1.4.0)
154157
activesupport (>= 6.1)
158+
google-protobuf (4.35.1)
159+
bigdecimal
160+
rake (~> 13.3)
161+
google-protobuf (4.35.1-aarch64-linux-gnu)
162+
bigdecimal
163+
rake (~> 13.3)
164+
google-protobuf (4.35.1-aarch64-linux-musl)
165+
bigdecimal
166+
rake (~> 13.3)
167+
google-protobuf (4.35.1-arm64-darwin)
168+
bigdecimal
169+
rake (~> 13.3)
170+
google-protobuf (4.35.1-x86_64-darwin)
171+
bigdecimal
172+
rake (~> 13.3)
173+
google-protobuf (4.35.1-x86_64-linux-gnu)
174+
bigdecimal
175+
rake (~> 13.3)
176+
google-protobuf (4.35.1-x86_64-linux-musl)
177+
bigdecimal
178+
rake (~> 13.3)
155179
hashdiff (1.2.1)
156180
hashie (5.1.0)
157181
logger
@@ -169,7 +193,7 @@ GEM
169193
jbuilder (2.15.1)
170194
actionview (>= 7.0.0)
171195
activesupport (>= 7.0.0)
172-
json (2.21.1)
196+
json (2.21.2)
173197
language_server-protocol (3.17.0.5)
174198
lint_roller (1.1.0)
175199
listen (3.10.0)
@@ -264,6 +288,10 @@ GEM
264288
prettyprint
265289
prettyprint (0.2.0)
266290
prism (1.9.0)
291+
propshaft (1.3.2)
292+
actionpack (>= 7.0.0)
293+
activesupport (>= 7.0.0)
294+
rack
267295
public_suffix (7.0.5)
268296
puma (7.2.1)
269297
nio4r (~> 2.0)
@@ -396,14 +424,22 @@ GEM
396424
base64
397425
ostruct
398426
ruby-progressbar (1.13.0)
399-
sassc (2.4.0)
400-
ffi (~> 1.9)
401-
sassc-rails (2.1.2)
402-
railties (>= 4.0.0)
403-
sassc (>= 2.0)
404-
sprockets (> 3.0)
405-
sprockets-rails
406-
tilt
427+
sass-embedded (1.102.0-aarch64-linux-gnu)
428+
google-protobuf (~> 4.31)
429+
sass-embedded (1.102.0-aarch64-linux-musl)
430+
google-protobuf (~> 4.31)
431+
sass-embedded (1.102.0-arm-linux-gnueabihf)
432+
google-protobuf (~> 4.31)
433+
sass-embedded (1.102.0-arm-linux-musleabihf)
434+
google-protobuf (~> 4.31)
435+
sass-embedded (1.102.0-arm64-darwin)
436+
google-protobuf (~> 4.31)
437+
sass-embedded (1.102.0-x86_64-darwin)
438+
google-protobuf (~> 4.31)
439+
sass-embedded (1.102.0-x86_64-linux-gnu)
440+
google-protobuf (~> 4.31)
441+
sass-embedded (1.102.0-x86_64-linux-musl)
442+
google-protobuf (~> 4.31)
407443
securerandom (0.4.1)
408444
simplecov (0.22.0)
409445
docile (~> 1.1)
@@ -417,12 +453,7 @@ GEM
417453
concurrent-ruby (~> 1.0)
418454
logger
419455
rack (>= 2.2.4, < 4)
420-
sprockets-rails (3.5.2)
421-
actionpack (>= 6.1)
422-
activesupport (>= 6.1)
423-
sprockets (>= 3.0.0)
424456
thor (1.5.0)
425-
tilt (2.7.0)
426457
timeout (0.6.1)
427458
tsort (0.2.0)
428459
typesafe_enum (0.3.1)
@@ -470,6 +501,7 @@ DEPENDENCIES
470501
byebug
471502
capybara
472503
colorize
504+
dartsass-rails
473505
dotenv-rails
474506
jbuilder (~> 2.13)
475507
listen (>= 3.0)
@@ -478,6 +510,7 @@ DEPENDENCIES
478510
okcomputer (~> 1.19)
479511
omniauth-cas (~> 3.0)
480512
omniauth-rails_csrf_protection (~> 1.0)
513+
propshaft
481514
puma (>= 6.0, < 8)
482515
puma-plugin-delayed_stop (~> 0.1.2)
483516
rack (~> 3.2.6)
@@ -491,11 +524,8 @@ DEPENDENCIES
491524
rubocop-rspec (~> 3.10.2)
492525
rubocop-rspec_rails
493526
ruby-prof (~> 2.0)
494-
sassc-rails (~> 2.1)
495527
simplecov (~> 0.21)
496528
simplecov-rcov (~> 0.2)
497-
sprockets (~> 4.0)
498-
sprockets-rails (~> 3.4)
499529
typesafe_enum (~> 0.2)
500530
web-console (>= 4.1.0)
501531
webmock
@@ -537,6 +567,7 @@ CHECKSUMS
537567
connection_pool (3.0.2) sha256=33fff5ba71a12d2aa26cb72b1db8bba2a1a01823559fb01d29eb74c286e62e0a
538568
crack (1.0.1) sha256=ff4a10390cd31d66440b7524eb1841874db86201d5b70032028553130b6d4c7e
539569
crass (1.0.7) sha256=94868719948664c89ddcaf0a37c65048413dfcb1c869470a5f7a7ceb5390b295
570+
dartsass-rails (0.5.1) sha256=f19510fb1b29c76c1739a06954d615f1d20ad653b6fc668dd7c68542bb303a1a
540571
date (3.5.1) sha256=750d06384d7b9c15d562c76291407d89e368dda4d4fff957eb94962d325a0dc0
541572
diff-lcs (1.6.2) sha256=9ae0d2cba7d4df3075fe8cd8602a8604993efc0dfa934cff568969efb1909962
542573
docile (1.4.1) sha256=96159be799bfa73cdb721b840e9802126e4e03dfc26863db73647204c727f21e
@@ -555,6 +586,13 @@ CHECKSUMS
555586
ffi (1.17.4-x86_64-linux-gnu) sha256=9d3db14c2eae074b382fa9c083fe95aec6e0a1451da249eab096c34002bc752d
556587
ffi (1.17.4-x86_64-linux-musl) sha256=3fdf9888483de005f8ef8d1cf2d3b20d86626af206cbf780f6a6a12439a9c49e
557588
globalid (1.4.0) sha256=037f12fbf1d9d7a014d501c2d5c77356fd4ddd96d7a7991d6700bba96706f427
589+
google-protobuf (4.35.1) sha256=a3a6471331d918f58dfa4d014a8f6286f0af2cf4840216bde52fcf2ea3fe3726
590+
google-protobuf (4.35.1-aarch64-linux-gnu) sha256=50ca44d0eeff3f8475e630a1accdd974256f3510694d574e2c9d6119ea8bc9e1
591+
google-protobuf (4.35.1-aarch64-linux-musl) sha256=d5c65cef6bd6498a9e5ed5f88cf6cf7e341c10b0a005e32137d5d1a2b6e8c18a
592+
google-protobuf (4.35.1-arm64-darwin) sha256=d9c957df04fa89c749fa9a72a7b383eb4296efc9b2303dc6fd6fbe39c698ad6b
593+
google-protobuf (4.35.1-x86_64-darwin) sha256=66b62b4df00931018a692806df66393efa960d6d2b7da69735187249f950d3ee
594+
google-protobuf (4.35.1-x86_64-linux-gnu) sha256=c786439087512a3fbd199e9897d265b855f951d4027e218ea55e858d45969edd
595+
google-protobuf (4.35.1-x86_64-linux-musl) sha256=91890eb0002934a339fdb7d77a147c46b7474b6799db27872b747b905837f744
558596
hashdiff (1.2.1) sha256=9c079dbc513dfc8833ab59c0c2d8f230fa28499cc5efb4b8dd276cf931457cd1
559597
hashie (5.1.0) sha256=c266471896f323c446ea8207f8ffac985d2718df0a0ba98651a3057096ca3870
560598
http-accept (1.7.0) sha256=c626860682bfbb3b46462f8c39cd470fd7b0584f61b3cc9df5b2e9eb9972a126
@@ -563,7 +601,7 @@ CHECKSUMS
563601
io-console (0.8.2) sha256=d6e3ae7a7cc7574f4b8893b4fca2162e57a825b223a177b7afa236c5ef9814cc
564602
irb (1.18.0) sha256=de9454a0703a54704b9811a5ef31a60c86949fbf4013fcf244fabc7c775248e3
565603
jbuilder (2.15.1) sha256=2430bec28fb0cebacb5875b1009cf9d8bc3c303ccb810c4c8b062a4b51457637
566-
json (2.21.1) sha256=13a43df75d95641443f5702dff350f237164a9d811ff0f2c2800d4d980220583
604+
json (2.21.2) sha256=1f1d3b7cf2b3ba1a69beca0bb6db13d5438b80bff3cd54cdaaa620b9b07c1c6a
567605
language_server-protocol (3.17.0.5) sha256=fd1e39a51a28bf3eec959379985a72e296e9f9acfce46f6a79d31ca8760803cc
568606
lint_roller (1.1.0) sha256=2c0c845b632a7d172cb849cc90c1bce937a28c5c8ccccb50dfd46a485003cc87
569607
listen (3.10.0) sha256=c6e182db62143aeccc2e1960033bebe7445309c7272061979bb098d03760c9d2
@@ -607,6 +645,7 @@ CHECKSUMS
607645
pp (0.6.4) sha256=dfcb0fce700c41456265922884f9fe195d7fbb0674a3578e6c0f69588e82b570
608646
prettyprint (0.2.0) sha256=2bc9e15581a94742064a3cc8b0fb9d45aae3d03a1baa6ef80922627a0766f193
609647
prism (1.9.0) sha256=7b530c6a9f92c24300014919c9dcbc055bf4cdf51ec30aed099b06cd6674ef85
648+
propshaft (1.3.2) sha256=1d56a3e56a92c21bfc29caf07406b5386b00d4c47ddf357cf989a5a234b1389e
610649
public_suffix (7.0.5) sha256=1a8bb08f1bbea19228d3bed6e5ed908d1cb4f7c2726d18bd9cadf60bc676f623
611650
puma (7.2.1) sha256=d7bf0e9cabd532e0d401e142cd94e3ac531e993610e2d80e6fbf9c26961414b0
612651
puma-plugin-delayed_stop (0.1.2) sha256=cb30cd2ba10a59e330f38e9ece2a298fecce79b46a9f90c57da9f7d3e5731171
@@ -646,17 +685,21 @@ CHECKSUMS
646685
ruby-marc-spec (0.1.3) sha256=4207c760d87c667dfaad6bfb44b0e473da4efe22bb3c18046571bd6703afc0da
647686
ruby-prof (2.0.5) sha256=dbc3b5112089538ac33303145db0cbd77cbdcdbc05b09e44a967ff72a36d6c0e
648687
ruby-progressbar (1.13.0) sha256=80fc9c47a9b640d6834e0dc7b3c94c9df37f08cb072b7761e4a71e22cff29b33
649-
sassc (2.4.0) sha256=4c60a2b0a3b36685c83b80d5789401c2f678c1652e3288315a1551d811d9f83e
650-
sassc-rails (2.1.2) sha256=5f4fdf3881fc9bdc8e856ffbd9850d70a2878866feae8114aa45996179952db5
688+
sass-embedded (1.102.0-aarch64-linux-gnu) sha256=087f377fa4135a8f67f5f422781b59815e99b8fd3aec335935c50a47c2a205fd
689+
sass-embedded (1.102.0-aarch64-linux-musl) sha256=12bb4091972499241c35304ca11ca2c314764badf1b9933a8d437ba62432b538
690+
sass-embedded (1.102.0-arm-linux-gnueabihf) sha256=566b1188e4f923366f494a5d95e4e5e03864ae55bae5ea52beb2c30b1b9e2915
691+
sass-embedded (1.102.0-arm-linux-musleabihf) sha256=1ca396610bf4f4aa8f849b67a9f2720f67d9f3b42651072eafee786aece314cf
692+
sass-embedded (1.102.0-arm64-darwin) sha256=8e18b2dd94b232c2dd73984c579f77bbc1a066028f4675c8989ac34fa40d14dc
693+
sass-embedded (1.102.0-x86_64-darwin) sha256=3e78c6ac5be0ba4236d075bd044a49d0f515d54799f7d6f253c71d325ffedac0
694+
sass-embedded (1.102.0-x86_64-linux-gnu) sha256=9815b7604123a9a44a65d44d5e58e7af1c7005174b745cda83bad4c9e3760ab3
695+
sass-embedded (1.102.0-x86_64-linux-musl) sha256=9e3c15eb5d83784adf3b946d4fc5d8a32aed25566a2fee939f25dd1e1d217ddf
651696
securerandom (0.4.1) sha256=cc5193d414a4341b6e225f0cb4446aceca8e50d5e1888743fac16987638ea0b1
652697
simplecov (0.22.0) sha256=fe2622c7834ff23b98066bb0a854284b2729a569ac659f82621fc22ef36213a5
653698
simplecov-html (0.13.2) sha256=bd0b8e54e7c2d7685927e8d6286466359b6f16b18cb0df47b508e8d73c777246
654699
simplecov-rcov (0.3.7) sha256=372f50bf6df6b6350b7d0c840f2f8bdabe021861a43c26877b747c9ac96139fc
655700
simplecov_json_formatter (0.1.4) sha256=529418fbe8de1713ac2b2d612aa3daa56d316975d307244399fa4838c601b428
656701
sprockets (4.2.2) sha256=761e5a49f1c288704763f73139763564c845a8f856d52fba013458f8af1b59b1
657-
sprockets-rails (3.5.2) sha256=a9e88e6ce9f8c912d349aa5401509165ec42326baf9e942a85de4b76dbc4119e
658702
thor (1.5.0) sha256=e3a9e55fe857e44859ce104a84675ab6e8cd59c650a49106a05f55f136425e73
659-
tilt (2.7.0) sha256=0d5b9ba69f6a36490c64b0eee9f6e9aad517e20dcc848800a06eb116f08c6ab3
660703
timeout (0.6.1) sha256=78f57368a7e7bbadec56971f78a3f5ecbcfb59b7fcbb0a3ed6ddc08a5094accb
661704
tsort (0.2.0) sha256=9650a793f6859a43b6641671278f79cfead60ac714148aabe4e3f0060480089f
662705
typesafe_enum (0.3.1) sha256=15b58de378999858c74aaa1d4e119d77d0ace95cac25cabf21256dd103886597

‎app/assets/builds/.keep‎

Whitespace-only changes.

‎app/assets/config/manifest.js‎

Lines changed: 0 additions & 4 deletions
This file was deleted.

‎app/assets/javascripts/application.js‎

Lines changed: 0 additions & 11 deletions
This file was deleted.

‎app/assets/stylesheets/includes/main.scss‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -319,13 +319,13 @@ strong {
319319
/// additional MediaElement.js styles
320320

321321
.mejs__overlay-button {
322-
background-image: url("/assets/icons/mejs-controls.svg");
322+
background-image: url("/icons/mejs-controls.svg");
323323
}
324324
.mejs__overlay-loading-bg-img {
325-
background-image: url("/assets/icons/mejs-controls.svg");
325+
background-image: url("/icons/mejs-controls.svg");
326326
}
327327
.mejs__button > button {
328-
background-image: url("/assets/icons/mejs-controls.svg");
328+
background-image: url("/icons/mejs-controls.svg");
329329
}
330330

331331
// ////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)