Using bower to manage frontend deps

With #7577, we’ll be replacing the service, which was previously used to pull frontend dependencies as gems, by bower. Please note, that this change has no bearing on the use of the Rails Asset Pipeline, the files go through the pipeline same as before, only come from a different source.

  • to install a new dependency (using c3 as an example JS library), use bower install --save c3

  • to download new dependencies after a git pull, please use bin/update (which handles bundler, bower, and migrations), however, bower install will do if you really want to update only these

  • the actual files get downloaded under vendor/assets/bower_components, which is gitignored, and added to config.assets.paths

  • to install a new purely-devel dependency, use bower install --save-dev c3 (but don’t, as we never call bower install -p)

If you don’t have bower installed, the usual way of installing bower is via npm: npm install -g bower (or sudo npm install -g bower). If you don’t have npm: brew install node (on MacOS X) or dnf install npm (Fedora) or apt install npm (Debian)

1 Like

Bump… #7577 has been merged

@himdel are those instructions need to be updated in the developer documentation? (if yes, pls add there)

@abonas pretty sure that’s already handled by and and :slight_smile: