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?

1

2 Answers 2

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.

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

2
  • Doesn't address the question of "why" use bower. You're explaining "how" to use bower. Nov 9, 2017 at 20:54
  • 1
    @silverfox1948 thanks for the heads up on the question update, I updated my answer
    – JohnRiv
    Nov 9, 2017 at 21:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.