Skip to content

Instantly share code, notes, and snippets.

@patricksrobertson
Last active August 29, 2015 14:11
Show Gist options
  • Select an option

  • Save patricksrobertson/b1444663e71d7f97b520 to your computer and use it in GitHub Desktop.

Select an option

Save patricksrobertson/b1444663e71d7f97b520 to your computer and use it in GitHub Desktop.

Breaking up with Asset Pipeline TL;DR

BEFORE

  • metric crapton of coffee files, plus sourcemaps (~3 year actively developed BackboneJS app with ~7 pages)
  • metric crapton of sass files, no sourcemaps (our designer hated us with a passion for the lack of sourcemaps)
  • development page load time ~45seconds - 1 minute
  • Assload of mocha/chai tests, run with konacha (rails engine)
    • Took ~4 minutes for konacha to load all test files, pain in the ass
    • Had to split up konacha suite into 3 parts for CI
  • Legacy Jasmine specs run with jasmine engine
  • New Backbone apps had their own Jasmine suites (konacha couldn't load multiple spec helpers)
  • Used Rails' require directive
  • Used EJS gem which had no concept of HTML safe strings
  • Cucumber suite on CI needed to be broken into ~8 features per CI worker or suffer extremely flaky consequences

AFTER

  • Dev page load is pretty much instant (~ 1 sec)
  • JS/EJS/CSS reload takes ~2 seconds (just doing full recompile ATM)
  • Sass files now have sourcemaps!
  • Karma test suite takes ~12 seconds in entirety for mocha/jasmine stuff. Most of time is booting PhantomJS server :)
  • Now EJS templates are HTML safe (our users loved finding where we missed stuff!)
  • Cucumber suite now runs ~16 features per file -- keeps our workers at ~10 mins runtime. Considerably reduced flakiness
  • Our gulpfile manifest is the most hideous thing in the history of the world due to string based load order
  • CI for JS tests no longer requires any hint of Ruby -- runs hella fast, freeing up CI workers.

Next Steps

  • Delta reload of assets to shave off ~1 sec on compile time
  • Some sort of module loader (ES6, Require.js, whatever) to tame the manifests.
  • Rewrite pages from Backbone.JS to Ember-CLI because we fucking hate the backbone.

Conclusion

Worth.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment