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

Pain in the Asset Pipeline

Pain in the Asset Pipeline

The slides from my talk at OxRUG on the 2nd of December 2015, on Ruby's asset pipelines and the future.

Ryan Brooks

December 03, 2015
Tweet

More Decks by Ryan Brooks

Other Decks in Programming

Transcript

  1. Developer performance 1. Sourcemaps 2. Asset compilation 3. Modular sources

    4. Auto-prefixing & polyfills 5. Linting 6. Testing 7. Auto-reloading
  2. SPROCKETS / | - a p p | | -

    a s s e t s | | - j a v a s c r i p t s | | | - a p p . j s | | - v e n d o r | | | - b o w e r _ c o m p o n e n t s | | | - j q u e r y | | | - d i s t | | | - j q u e r y . j s | | - s t y l e s | | - s t y l e . s a s s | | - p u b l i c | - a p p l i c a t i o n . j s | - a p p l i c a t i o n . c s s
  3. SPROCKETS / / = r e q u i r

    e ' b o w e r _ c o m p o n e n t s / E l e m e n t . c l o s e s t / c l o s e s t . j s ' / / = r e q u i r e ' b o w e r _ c o m p o n e n t s / j q u e r y / d i s t / j q u e r y . j s ' / / = r e q u i r e ' b o w e r _ c o m p o n e n t s / j q u e r y - u j s / s r c / r a i l s . j s ' / / = r e q u i r e ' b o w e r _ c o m p o n e n t s / l o d a s h / l o d a s h . j s ' / / = r e q u i r e ' b o w e r _ c o m p o n e n t s / a n g u l a r / a n g u l a r . j s '
  4. SPROCKETS BAD, HULK SMASH ✅ Minification ✅ Concatenation ✅ SCSS/LESS

    compilation ✅ (Rails only) ❌ ❌ Modular JavaScript ❌ JavaScript best practices ❌ Not being quirky ❌ Dev == Prod ❌ Keeping pace with modern frontend development Autoprefixing ES6/ES2015 JavaScript Sourcemaps
  5. The plan: 1. Use existing source location 2. Compile to

    a new directory 3. Switch the ERBs 4. Deprecate Sprockets and rejoice!
  6. What actually happened: ✅ Use existing source location ❌ Compile

    to a new directory ❌ Switch the ERBs ❌ Deprecate Sprockets and rejoice!
  7. { " a p p . j s " :

    " a p p - a 4 1 d 8 c d 1 . j s " , " u n i c o r n . c s s " : " u n i c o r n - d 4 1 d 8 c d 9 8 f . c s s " }