Demystifying the Asset Pipeline

Episode #387 by Teacher's Avatar David Kimura

Summary

The asset pipeline can be confusing. So, in this episode, we explore Sprockets and the movement towards Propshaft, a new Rails library for managing assets. We'll also have a look at some nuances with jsbundling and how to overcome them.
rails assets 19:47

Chapters

  • Introduction (0:00)
  • importmaps (2:16)
  • jsbundling (3:51)
  • jsbundling and cssbundling (7:26)
  • rails assets:precompile (9:57)
  • looking at build conflicts (11:19)
  • propshaft (15:42)
  • From sprockets to propshaft (17:33)

Resources

Propshaft Upgrade Guide - https://github.com/rails/propshaft/blob/main/UPGRADING.md
CSS Bundling for Rails - https://github.com/rails/cssbundling-rails
JavaScript Bundling for Rails - https://github.com/rails/jsbundling-rails

This episode is sponsored by Honeybadger

Summary

# Terminal
rails new example4 --javascript esbuild --css bootstrap -a propshaft
bin/dev