• Post Reply Bookmark Topic Watch Topic
  • New Topic

Front End Tooling: Is bower still relevant?

 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65678
129
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Such is the nature of the front-end ecosystem: everything's obsolete already. 

Seriously, scuttlebutt is that bower is old-hat and npm is in. What say you?
 
Stefan Baumgartner
Author
Greenhorn
Posts: 7
5
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you had asked me two months ago, I would have said that Bower still has a lot of relevance. Bower has one significant point that NPM still can't provide, which is a true flat dependency tree. They are crucial for browser applications where you just don't want to have multiple versions of the same dependency in the package you deliver. NPM2 had nested trees, NPM3 has semi-flat trees, but having just one version of a certain dependency guaranteed, that's still unique to Bower. You need that for JavaScript applications where your bundling tool doesn't take care of the right dependency selection (which rarely works satisfying). That's also why Bower still was underneath CLI tools for Ember, Angular, Polymer and consorts. However, just a few months ago a consortium of said projects (plus Facebook) decided to develop Yarn, which is a new dependency manager that deals with both Bower and NPM dependencies and works a supercharged alternative for NPM. It's goal is to feature nested, semi-nested and flat dependency trees to take care of both client and server-side applications in the best way possible. The flat dependency tree feature still leaves something to be desired, but hey, the project is  in its early stages and has lots of backing from the community, so let's see how that turns out.

Also, Yarn actually made me find out what all the white space on the book cover is for:

 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65678
129
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Stefan Baumgartner wrote:Also, Yarn actually made me find out what all the white space on the book cover is for:



LOL!
 
paul nisset
Ranch Hand
Posts: 248
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,
Can you explain what flat versus nested dependency trees means and how this impacts the use of a dependency management tool like Bower ,npm etc...?

Thank you ,
Paul
 
Stefan Baumgartner
Author
Greenhorn
Posts: 7
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Alright, the short version: Let's say your application has a few dependencies: A, B, and C. B and C also have a dependency called D. Now in a flat dependency tree, D is just allowed to exist once. It's on the same level as A, B, and C:



In a nested dependency tree, you are allowed to have multiple versions of D. So B and C come with their own D dependency:



This also means that once you bundle or deploy your application, you would have to include both D versions in your app. You don't want this in client-side applications, because the amount of code you deliver goes directly over the wire into your browser. Direct effect on parsing time, execution time, page load, etc. That's why you usually go for flat dependency trees in client side apps.

Bower uses flat, NPM uses semi-nested (which means it goes for flat unless it can't, which is almost all the time).
 
Stefan Baumgartner
Author
Greenhorn
Posts: 7
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh, and the long version is in chapter 4 of the book ;-)
 
paul nisset
Ranch Hand
Posts: 248
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Stefan .

I'm used to flat dependencies . For example ,I never have more than one version of a library in my  maven script.
I use Java and having more than one version of a library linked in to an application would cause problems.

So the concept of a nested dependency is new to me.

I can see how the scenario you described would happen with Javascript but it sounds like a maintenance nightmare.  
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!