Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Rails Assets wroc_love.rb

Rails Assets wroc_love.rb

wroc_love.rb 2014 lighting talk - the state and future of rails-assets.org

Tymon Tobolski

March 16, 2014
Tweet

More Decks by Tymon Tobolski

Other Decks in Programming

Transcript

  1. State of the art • /vendor/assets • asset gems Ruby

    World JavaScript World • /vendor/assets • bower
  2. So what's the problem? • Asset Gems won't package themselves

    • Asset Gems are always step behind official libraries • Unnecessary stuff like ruby helpers :-(
  3. source 'https://rubygems.org' +source 'https://rails-assets.org' ! gem 'rails' ! group :assets

    do gem 'sass-rails' gem 'uglifier' gem 'coffee-rails' + gem 'rails-assets-bootstrap' + gem 'rails-assets-angular' + gem 'rails-assets-leaflet' end
  4. application.js ! ! ! //= require_self +//= require bootstrap +//=

    require angular +//= require leaflet //= require_tree . application.css ! ! /* *= require_self +*= require bootstrap +*= require leaflet *= require_tree . */
  5. Is it any good? • No more vendor/assets :-) •

    Proper versioning :-D • Dependency resolution x-D • Just works!
  6. What's the catch? • Rails Assets is centralized solution •

    Only tag releases are bundled to .gem files • Mixing assets definitions with gem definitions • Long gem names (rails-assets-jquery)
  7. application.js ! ! ! //= require_self +//= require bootstrap +//=

    require angular +//= require leaflet //= require_tree . application.css ! ! /* *= require_self +*= require bootstrap +*= require leaflet *= require_tree . */