I like Rails, but one thing that Rails falls short in is Javascript dependency management.
While Rails Assets, a proxy that allows for listing Bower packages in your Gemfile makes managing front-end libraries good enough for most front-end work, RailsAssets itself is mainly addressing asset management; it doesn’t allow for integrated management of additional development tools and binaries, useful for e.g. JavaScript-testing (besides the fact that Bower is kind of considered to be deprecated these days).
There are different ways of bundling Javascript, but since Rails 5.1, yarn
is the defacto choice for Rails.
You can install yarn either trough npm npm install -g yarn
, or if you’re on a mac, using homebrew: brew install yarn
. I chose the latter.
To prepare your rails project run rails yarn:install
.
There are [different testing fram…
Dit artikel van murblog van Maarten Brouwers (murb) is in licentie gegeven volgens een Creative Commons Naamsvermelding 3.0 Nederland licentie .