Skip to content

Commit

Permalink
Swap Sprockets for Propshaft
Browse files Browse the repository at this point in the history
  • Loading branch information
fumimowdan committed Oct 24, 2023
1 parent 91a74e3 commit d7f45c5
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 43 deletions.
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ gem "okcomputer"
gem "pg", "~> 1.5"
gem "puma", "~> 6.4"
gem "rails", "~> 7.0.8"
gem "sprockets-rails"
gem "tzinfo-data", platforms: %i[mingw mswin x64_mingw jruby]

gem "pagy"
Expand Down Expand Up @@ -88,3 +87,5 @@ gem "mail-notify", "~> 1.1"
gem "dartsass-rails", "~> 0.5.0"

gem "importmap-rails", "~> 1.2"

gem "propshaft", "~> 0.7.0"
14 changes: 6 additions & 8 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,11 @@ GEM
racc
pg (1.5.4)
phonelib (0.8.4)
propshaft (0.7.0)
actionpack (>= 7.0.0)
activesupport (>= 7.0.0)
rack
railties (>= 7.0.0)
pry (0.14.2)
coderay (~> 1.1)
method_source (~> 1.0)
Expand Down Expand Up @@ -435,13 +440,6 @@ GEM
snaky_hash (2.0.1)
hashie
version_gem (~> 1.1, >= 1.1.1)
sprockets (4.2.0)
concurrent-ruby (~> 1.0)
rack (>= 2.2.4, < 4)
sprockets-rails (3.4.2)
actionpack (>= 5.2)
activesupport (>= 5.2)
sprockets (>= 3.0.0)
thor (1.2.2)
timeout (0.4.0)
tzinfo (2.0.6)
Expand Down Expand Up @@ -505,6 +503,7 @@ DEPENDENCIES
pagy
pg (~> 1.5)
phonelib
propshaft (~> 0.7.0)
pry-byebug
puma (~> 6.4)
rails (~> 7.0.8)
Expand All @@ -520,7 +519,6 @@ DEPENDENCIES
sidekiq (~> 6.5)
sidekiq-cron (~> 1.10)
simplecov
sprockets-rails
tzinfo-data
uk_postcode
web-console
Expand Down
5 changes: 0 additions & 5 deletions app/assets/config/manifest.js

This file was deleted.

6 changes: 4 additions & 2 deletions app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Sassy
@import 'govuk-frontend/govuk/all';
@import 'custom';
@use 'govuk-frontend/govuk/all' with (
$govuk-assets-path: ""
);
@use 'custom';
12 changes: 6 additions & 6 deletions app/views/layouts/admin.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@

<meta http-equiv="X-UA-Compatible" content="IE=edge" />

<link rel="shortcut icon" sizes="16x16 32x32 48x48" href="<%= asset_url('images/favicon.ico') %>" type="image/x-icon" />
<link rel="mask-icon" href="<%= asset_url('images/govuk-mask-icon.svg') %>" color="blue">
<link rel="apple-touch-icon" sizes="180x180" href="<%= asset_url('images/govuk-apple-touch-icon-180x180.png') %>">
<link rel="apple-touch-icon" sizes="167x167" href="<%= asset_url('images/govuk-apple-touch-icon-167x167.png') %>">
<link rel="apple-touch-icon" sizes="152x152" href="<%= asset_url('images/govuk-apple-touch-icon-152x152.png') %>">
<link rel="apple-touch-icon" href="<%= asset_url('images/govuk-apple-touch-icon.png') %>">
<link rel="shortcut icon" sizes="16x16 32x32 48x48" href="<%= asset_path('images/favicon.ico') %>" type="image/x-icon" />
<link rel="mask-icon" href="<%= asset_path('images/govuk-mask-icon.svg') %>" color="blue">
<link rel="apple-touch-icon" sizes="180x180" href="<%= asset_path('images/govuk-apple-touch-icon-180x180.png') %>">
<link rel="apple-touch-icon" sizes="167x167" href="<%= asset_path('images/govuk-apple-touch-icon-167x167.png') %>">
<link rel="apple-touch-icon" sizes="152x152" href="<%= asset_path('images/govuk-apple-touch-icon-152x152.png') %>">
<link rel="apple-touch-icon" href="<%= asset_path('images/govuk-apple-touch-icon.png') %>">
<%= stylesheet_link_tag 'application', 'data-turbolinks-track': 'reload' %>

<%= javascript_importmap_tags %>
Expand Down
14 changes: 7 additions & 7 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@

<meta http-equiv="X-UA-Compatible" content="IE=edge" />

<link rel="shortcut icon" sizes="16x16 32x32 48x48" href="<%= asset_url('images/favicon.ico') %>" type="image/x-icon" />
<link rel="mask-icon" href="<%= asset_url('images/govuk-mask-icon.svg') %>" color="blue">
<link rel="apple-touch-icon" sizes="180x180" href="<%= asset_url('images/govuk-apple-touch-icon-180x180.png') %>">
<link rel="apple-touch-icon" sizes="167x167" href="<%= asset_url('images/govuk-apple-touch-icon-167x167.png') %>">
<link rel="apple-touch-icon" sizes="152x152" href="<%= asset_url('images/govuk-apple-touch-icon-152x152.png') %>">
<link rel="apple-touch-icon" href="<%= asset_url('images/govuk-apple-touch-icon.png') %>">
<link rel="shortcut icon" sizes="16x16 32x32 48x48" href="<%= asset_path('images/favicon.ico') %>" type="image/x-icon" />
<link rel="mask-icon" href="<%= asset_path('images/govuk-mask-icon.svg', type: :image) %>" color="blue">
<link rel="apple-touch-icon" sizes="180x180" href="<%= asset_path('images/govuk-apple-touch-icon-180x180.png', type: :image) %>">
<link rel="apple-touch-icon" sizes="167x167" href="<%= asset_path('images/govuk-apple-touch-icon-167x167.png', type: :image) %>">
<link rel="apple-touch-icon" sizes="152x152" href="<%= asset_path('images/govuk-apple-touch-icon-152x152.png', type: :image) %>">
<link rel="apple-touch-icon" href="<%= asset_path('images/govuk-apple-touch-icon.png', type: :image) %>">

<%= stylesheet_link_tag 'application', 'data-turbolinks-track': 'reload' %>

<%= javascript_importmap_tags %>

<meta property="og:image" content="<%= asset_url('images/govuk-opengraph-image.png') %>">
<meta property="og:image" content="<%= asset_path('images/govuk-opengraph-image.png') %>">
</head>

<body class="govuk-template__body app-body-class">
Expand Down
19 changes: 5 additions & 14 deletions config/initializers/assets.rb
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
# frozen_string_literal: true
# Dartsass load-path
Rails.application.config.dartsass.build_options << " --load-path #{Rails.root.join('node_modules')} "

# Be sure to restart your server when you modify this file.

# Version of your assets, change this if you want to expire all your assets.
Rails.application.config.assets.version = "1.0"
Rails.application.config.assets.paths << Rails.root.join("node_modules")

# Add additional assets to the asset load path.
# Rails.application.config.assets.paths << Emoji.images_path

# Precompile additional assets.
# application.js, application.css, and all non-JS/CSS in the app/assets
# folder are already added.
# Rails.application.config.assets.precompile += %w( admin.js admin.css )
## Propshaft
Rails.application.config.assets.paths << Rails.root.join("vendor/assets")
Rails.application.config.assets.excluded_paths << Rails.root.join("app/assets/stylesheets")

0 comments on commit d7f45c5

Please sign in to comment.