How Sprockets Works
summary
Explains Sprockets as a pipeline of concrete components: processors, environment, manifest with processors returning data+metadata, bundle and compressor roles, and source maps; contrasts on-the-fly compilation in development with precompile + manifest lookup in production to avoid repeated work. Shows Rails integration via sprockets-rails and the precompile list validation. Gives two real extensions used at Shopify: npm directive, SVG→PNG transform and shows how a transformer or directive is registered and used.
AI-written summary · about
chapters (12)
- 0:00Introduction to Sprockets
- 3:19Why asset pipeline needed
- 6:56Sprockets core components
- 10:14Processors and transformers
- 13:53Manifest and precompilation
- 16:28Environment and caching
- 18:34Rails integration
- 21:10Executing JavaScript in Ruby
- 23:16Asset serving in development
- 27:32Production vs development
- 27:54Extending Sprockets
- 30:27Importance of understanding tools
related talks
37mHow Sprockets Works
30mHow Sprockets works
20mMaster the Rails Asset Pipeline: Best Practices for Apps & Gems
34mFrom Sprockets to js-bundling: Evolution of JavaScript tooling in Rails!
24mPropshaft and the Modern Asset Pipeline
28mSaving Sprockets
19mMaster the Rails asset pipeline
34mSurviving the Big Rewrite
