Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between component and bower?

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?

like image 387
Yoshua Wuyts Avatar asked Sep 09 '25 22:09

Yoshua Wuyts


2 Answers

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."

like image 86
Paul Verest Avatar answered Sep 12 '25 13:09

Paul Verest


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. Like npm, Bower's bower.json manifest is inclusive except for everything in the relevant .ignore file. Component, on the other hand, is exclusive, downloading files only specified in the component.json.

However, the major difference between Bower and Component is that component.jsons are more strict and opinionated: all files listed in the component.json are assumed to be mandatory. On the other hand, files listed in a bower.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.

like image 20
rgareth Avatar answered Sep 12 '25 12:09

rgareth