Why Rails Needs Bower11 Dec 2013
Part 1 of 2.
Summary: The rails stack should use Bower to manage JS/CSS assets and stop packaging assets in Rails Engines.
I bet you’re probably thinking I’m some ultra hipster dev who is drinking his second organic wheat grass shake of the morning. :P. Here’s the back story and why I think Bower is superior to Rails Engines.
But packaging assets in Rails Engines was also frustrating on 2 main fronts:
- Rails engines relied on different
- Only the popular Frontend Tooling had Rails Engine gems, and it wasn’t “dead simple” for frontend devs “engininze” their styling.
Side question: You might ask, “Why did you want asset files in an Engine? All you need is the js/css/images in the assets folder and you’re good.” From a technical perspective, yes, copy and pasting the assets into your app works, but the mere existence of these files does not explain their purpose or what other asset files may depend on them. This becomes deadly for a 10 person dev team. Unexplained architectural decisions create enormous technical debt.
bower_components to the asset compilation path. But more importantly, we need to be embrace multi-dimensional dependency management with open arms.
In a follow up post, I’ll show how to setup Bower and Rails.