0

Why and how does Polymer use Bower?, and do I NEED to learn to use Bower to use Polymer?

I was going through the Catalog of components, and all of them seem to have a 'Bower Command'.

Thanks for your help.

Edit: Bower is a package manager just as npm, I do understand that much. What I meant to ask is: It can be argued that npm has a wider user base than Bower some even argue that we should stop using bower altogether like here and here. So, how is it beneficial to Polymer the use of bower when there are other options. Is what Polymer does only achievable through bower?

Community
  • 1
  • 1
Edd
  • 1,874
  • 3
  • 20
  • 29
  • 1
    At [Polymer Summit 2016](https://youtu.be/guYHn0P8bKQ?t=15m09s), the team outlined plans to support npm with yarn. – tony19 Dec 02 '16 at 11:27

2 Answers2

2

Bower just like npm is a package manager. Here you can see the difference between the two.

No, you don't need to use bower to use Polymer, but without that you'll have to manually download each components that you need, place it at the location from where you can refer it and keep track of newer versions of each package that you have used.

In case you are creating custom elements to publish the situation get even worse as you'll have to pass a file along with your project listing all the dependency and the user will have to manually download each dependency listed in your project and then will have to make sure that he has all the dependencies that were required by your dependencies and so on.

This will make process of custom elements or modules in general very hard to use. That's why such projects use some package management tool.

Community
  • 1
  • 1
a1626
  • 2,915
  • 1
  • 16
  • 34
1

Edit: since the original question has been edited to ask more about why, the short answer is Bower's focus was for web dependencies, so it results in a flat dependency tree. With Bower now deprecated, the Polymer team's recommendation is to use Yarn with the --flat option. That will also result in a flat dependency structure without multiple versions of the same dependency, which is critical to web development, and something NPM has stated they will never offer.

You should be seeing Components move from Bower to Yarn more, especially after Polymer 3 is released. For more information than you'd ever want about this topic, check out this discussion: https://github.com/package-community/discussions/issues/2

JohnRiv
  • 196
  • 1
  • 5