IT:AD:Bower

Summary

When starting a new Project that needs IT:AD:Grunt and IT:AD:Bower, consider using IT:AD:Yeoman to start out.

Bower is a package installer for the web. Brought to us by IT:AD:Twitter (same people as Bootstrap).

In other words, it's the IT:AD:Nuget for Javascript (and other) front-end development dependency packages.

There are many front end packages out there, that have dependencies on each other. Bower can help.

Notes

Bower won't be replacing IT:AD:Nuget. Nuget has its place. It's the right tool for .NET server side development. But there is overlap with Bower for the client side package management – and in that area, Bower is better than Nuget1).

ACiD Summary

  • Advantages:
    • Saves time. Instead of hunting on the net for a website, then the download page, then the right version link…and then repeating it all over again for any dependencies – just type a command line bower install xyz and you're ready to roll.
    • Allows you to repeat the process even offline. When you download a package it downloads the package to your {current_directory}/bower_dependencies and to the {user}/bower directory. If offline, it use this cached version.
    • Not only does it downloading a package – it recursively download all the package's dependencies as well.
    • Make updating easier. Just need a bower update xyz and it will update the package and any dependencies.
    • A bower.json file makes it easier to express client dependencies. Easier for you to manage, easier for you to express to others what's needed.
    • Bower is better than Nuget for managing client side libraries for several reasons2).
  • Considerations:
    • Requires IT:AD:Node.JS and IT:AD:NPM
    • It also needs IT:AD:Git installed. Not because Bower users it, but because some packages use it.
    • You can download from various sources, but the default scenario is pretty coupled to IT:AD:GitHub.
      • In fact, one could say its basically “a shortcut to Git”3).
    • It creates a bower_dependencies folder in the current directory, and puts everything in there. So know what is your current directory.
    • Being a shortcut to git means the some packages will be lean, some package will be huge (backbone) as you are downloading a repo, which is often much bigger than you need. In other words, you have to be careful of what you are including in your solution or you start tracking stuff you do not need at all.
      • Consider leaving the folder out of the solution, and copying in only what you need.

    • Will be fully integrated in VS14, but for now, you'll need Visual Studio 2013.3 + some preview packages4).
  • Disadvantages:
    • Not enough devs know about it, adding a bit of ramp up cost as they wrap their mind around it. But it's rather easy, so not too much.