Skip to content

Rails: Asset Pipeline Lesson #25588

Open
Open
@crespire

Description

@crespire

Describe your suggestion

I wanted to start a conversation about re-writing the Rails Asset Pipeline lesson(s?), as there have been some big changes in the space and more on the way in the future with propshaft.

Right now, the asset pipeline lesson structure covers Rails 6 stuff first, then introduces Rails 7's import maps.

Here's my proposal on how we should change the lessons:

  • Move webpack and webpacker discussion out of the Asset Pipeline lesson. This content should be moved into a second lesson which covers various common Rails asset pipeline configurations in a section called Asset Pipeline Configurations for Rails 6 or similar.
  • The current Asset Pipeline lesson should be a more general introduction and discuss the tooling and current recommended/default approaches to serving assets in a modern Rails application. I think that means we should probably discuss what Sprockets is and how it relates to Webpack/Webpacker, esbuild and importmaps, then break down those options and their differences. Currently, the lesson is very general in its content, then talks at length about webpacker with anote that the Rails 7 stuff is in the next lesson.
  • The second lesson, currently focused on import maps only, should be re-written to speak about specific configurations that are popular/standard now. There is some discussion to be had here on what we should discuss in depth vs just mention. I believe we should highlight the different combinations available, chiefly:
    • In Rails 7, a setup with Sprockets plus importmaps for Javascript - this is the default rails new setup
    • In Rails 7, a setup with Sprockets plus esbundling for Javascript - I believe this is the default setup for any of the alternate options like -c tailwind
    • In Rails 6 (default) and 7 (option with jsbundling), Sprockets with webpacker (shakapacker) for Javascript - I feel strongly this option should not be recommended for Rails 7, but recommended as the approach for Rails 6 (just due to how the rails new is set up). My view is that if we encourage folks to use a bundler in Rails 7, it should be esbuild via jsbundling-rails.

I spoke with @kobaltz about including his excellent "Demystifying the Asset Pipeline" Drifting Ruby episode and he has graciously agreed to allow us to link it as an additional resource. I feel strongly that, before we do that, we should update the content so it aligns more with what is currently prevalent/available.

Path

Ruby / Rails

Lesson Url

https://www.theodinproject.com/paths/full-stack-ruby-on-rails/courses/ruby-on-rails#assets-and-navigation

Checks

(Optional) Discord Name

crespire#8269

(Optional) Additional Comments

No response

Metadata

Metadata

Labels

Content: Ruby on RailsInvolves the Ruby on Rails courseStatus: StaleThis issue/PR has been inactive for over 30 days and will be closed if inactivity continues

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions