Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Benefits of using Bower over Git Submodules

What are the advantages of using Bower vs Git Submodules?

Since Bower just clones the repo locally and provides you with a link to the executable, I personally find that using submodules is simpler and does the job just as well.

Is there something I'm missing here, is there a very good reason for introducing Bower to your stack and repositories?

like image 761
kht Avatar asked Sep 22 '14 18:09

kht


2 Answers

Here are a few reasons I can think of:

  • Versions - Bower enables you to define on which version of a package you want to depend, including latest version, version ranges and more
  • Registry - Bower has a registry which saves you the need of finding the correct Git repositories of each one of your dependencies
  • Transitive dependencies - Bower will install all the transitive dependencies for you
  • Ignore - Bower packages can define which resources to ignore when installing the package

Most of these advantages are not specific for Bower but rather the advantages of using a package manager instead of doing it manually by yourself.

like image 174
Dror Bereznitsky Avatar answered Oct 17 '22 10:10

Dror Bereznitsky


Because, it saves time. Say if you're jquery#X.X version and you want to install jquery#Y.X version, all you have to do is:

bower install jquery#Y.X

and then you can conveniently remove the older version of jquery by:

bower uninstall jquery#X.X

and it also allows you to clearly state dependencies in a bower.json file.

It also makes it easier for one to find documentation and exact version of the dependency that your project requires. Usually with the traditional way you either forget the version or the source you downloaded the file from.

like image 3
nkh Avatar answered Oct 17 '22 09:10

nkh