Master the Rails Asset Pipeline: Best Practices for Apps & Gems
Adrian Marin
• Philadelphia, PA
•
Talk
Date: July 08, 2025
Published: not published
Announced: unknown
We've all faced it - asset pipeline issues blocking that Friday deploy. From mysterious JavaScript loads to incorrect asset paths in your gems, these roadblocks are frustrating. Learn to master Rails assets from development to production, with practical tips for managing all asset types. Walk away with debugging techniques and optimization strategies you can apply instantly to your apps and gems.
---
Asset management (JS and CSS) is not easy.
Rails' docs are full of jargon and expect the reader to know a lot about JS and how the browser works.
This leads to not understanding the different bits and pieces of the asset pipeline.
"Is it just one?", "What is Sprockets", "Is Propshaft enough?", "Is my app locked if I used Webpacker in the past?", "Is Vite bad for my app?"
These are some of the questions that pop up in people's heads lately and there's a bit hesitation of upgrading based on all this missed knowledge.
When we start talking about outside gems that need to ship external assets, there's a whole other can of worms. There's no documented way of doing it, developers duplicate dependencies (37signals included), and there's no silver bullet.
In my talk I'm going to touch on:
- what is the DOM and how the browser loads and runs JS
- what is the `defer` argument
- bundling vs not bundling
- what is this whole "Asset Pipeline" and the various bits and pieces
- the current modern alternatives (js-bundling, importmaps, Vite)
- how to ship assets in gems. I'm going to present three ways with their pros and cons
The talk will have snippets (with gists attached for future reference) and sample repos for the viewers' reference.
It's going to be technical but guided so the viewers will have a good progression of understanding.
RailsConf 2025