Skip to content

Commit f45669a

Browse files
authored
Rails 8 Part 2 - Propshaft (#131)
1 parent 6fbadd7 commit f45669a

File tree

4 files changed

+20
-22
lines changed

4 files changed

+20
-22
lines changed

Gemfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ source "https://rubygems.org"
22

33
# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
44
gem "rails", "~> 8.0.1"
5-
# The original asset pipeline for Rails [https://github.com/rails/sprockets-rails]
6-
gem "sprockets-rails"
5+
# The modern asset pipeline for Rails [https://github.com/rails/propshaft]
6+
gem "propshaft"
77
# Use postgresql as the database for Active Record
88
gem "pg", "~> 1.5"
99
# Use the Puma web server [https://github.com/puma/puma]

Gemfile.lock

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,8 @@ GEM
163163
net-smtp (0.5.0)
164164
net-protocol
165165
nio4r (2.7.4)
166+
nokogiri (1.17.2-aarch64-linux)
167+
racc (~> 1.4)
166168
nokogiri (1.17.2-arm64-darwin)
167169
racc (~> 1.4)
168170
nokogiri (1.17.2-x86_64-linux)
@@ -172,6 +174,11 @@ GEM
172174
ast (~> 2.4.1)
173175
racc
174176
pg (1.5.9)
177+
propshaft (1.1.0)
178+
actionpack (>= 7.0.0)
179+
activesupport (>= 7.0.0)
180+
rack
181+
railties (>= 7.0.0)
175182
psych (5.1.2)
176183
stringio
177184
public_suffix (6.0.1)
@@ -265,16 +272,11 @@ GEM
265272
rexml (~> 3.2, >= 3.2.5)
266273
rubyzip (>= 1.2.2, < 3.0)
267274
websocket (~> 1.0)
268-
sprockets (4.2.1)
269-
concurrent-ruby (~> 1.0)
270-
rack (>= 2.2.4, < 4)
271-
sprockets-rails (3.5.2)
272-
actionpack (>= 6.1)
273-
activesupport (>= 6.1)
274-
sprockets (>= 3.0.0)
275275
stimulus-rails (1.3.4)
276276
railties (>= 6.0.0)
277277
stringio (3.1.1)
278+
tailwindcss-rails (2.7.9-aarch64-linux)
279+
railties (>= 7.0.0)
278280
tailwindcss-rails (2.7.9-arm64-darwin)
279281
railties (>= 7.0.0)
280282
tailwindcss-rails (2.7.9-x86_64-linux)
@@ -308,6 +310,7 @@ GEM
308310
zeitwerk (2.7.1)
309311

310312
PLATFORMS
313+
aarch64-linux
311314
arm64-darwin-21
312315
arm64-darwin-22
313316
arm64-darwin-23
@@ -324,12 +327,12 @@ DEPENDENCIES
324327
jbuilder
325328
lookbook
326329
pg (~> 1.5)
330+
propshaft
327331
puma (>= 5.0)
328332
rails (~> 8.0.1)
329333
redis (>= 4.0.1)
330334
rubocop-rails-omakase
331335
selenium-webdriver
332-
sprockets-rails
333336
stimulus-rails
334337
tailwindcss-rails
335338
turbo-rails
Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
/*
2-
* This is a manifest file that'll be compiled into application.css, which will include all the files
3-
* listed below.
2+
* This is a manifest file that'll be compiled into application.css.
43
*
5-
* Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
6-
* vendor/assets/stylesheets directory can be referenced here using a relative path.
4+
* With Propshaft, assets are served efficiently without preprocessing steps. You can still include
5+
* application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
6+
* cascading order, meaning styles declared later in the document or manifest will override earlier ones,
7+
* depending on specificity.
78
*
8-
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
9-
* compiled file so the styles you add here take precedence over styles defined in any other CSS
10-
* files in this directory. Styles in this file should be added after the last require_* statement.
11-
* It is generally better to create a new file per style scope.
12-
*
13-
*= require_tree .
14-
*= require_self
9+
* Consider organizing styles into separate files for maintainability.
1510
*/

app/views/layouts/application.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
<%# Includes all stylesheet files in app/assets/stylesheets %>
2121
<%= stylesheet_link_tag "tailwind", "inter-font", "data-turbo-track": "reload" %>
22-
<%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
22+
<%= stylesheet_link_tag :app, "data-turbo-track": "reload" %>
2323
<%= javascript_importmap_tags %>
2424
<script src="https://kit.fontawesome.com/16cd28e879.js" crossorigin="anonymous"></script>
2525
</head>

0 commit comments

Comments
 (0)