I had a hard time finding an overview of the differences between component and bower. Which one is better, what is the better package manager to use? Are there any alternatives to these two I should consider?
A "component" is a part of a system. Bower is package manager.
Which one is better? Read the Bower FAQ for differences.
Bower seems to make better what it aims for, that is a package manager for the web.
There are also Jam, Volo, or Ender. And of course, NPM.
For popularity and adoption check, you can check Ohloh
UPDATE:
Component package manager https://github.com/component/component is also a package manager for the web. It uses GitHub as a back-end database for modules, so modules that are not on GitHub will not be listed. This approach however makes things easier, as there is no need for additional credentials; authors just use GitHub.
Personally, I think Component should adapt a distinctive name, so that it would be not confused with the general word "component."
The team behind component have now written their own opinionated answer to this: https://github.com/component/guide/blob/master/component/vs.md#component-vs-bower
Copying the content as of today:
Bower is more similar to
npm
than to Component. Likenpm
, Bower'sbower.json
manifest is inclusive except for everything in the relevant.ignore
file. Component, on the other hand, is exclusive, downloading files only specified in thecomponent.json
.However, the major difference between Bower and Component is that
component.json
s are more strict and opinionated: all files listed in thecomponent.json
are assumed to be mandatory. On the other hand, files listed in abower.json
are generally optional.A strict manifest specification allows Component to easily integrate a build process. However, this is impossible with Bower as people publish different types of modules (globals, plugins, AMD, and CommonJS), as well as optional files as shown in this react-bower issue, making an integrated build process very difficult.
Component's integrated build system allows you to simply include one script and one stylesheet in your page. There's no juggling
<script src="bower_components/jquery"><script>
calls and such.Like
npm
,bower
is slower than Component at installing, has an unnecessary publish step, does not support multiple versions of dependencies, and does not cache installations.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With