• Complain

Ambler Tim - JavaScript Frameworks for Modern Web Dev

Here you can read online Ambler Tim - JavaScript Frameworks for Modern Web Dev full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. City: Berkeley;CA;New York;NY, year: 2015, publisher: Springer, Apress, genre: Computer. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

Ambler Tim JavaScript Frameworks for Modern Web Dev
  • Book:
    JavaScript Frameworks for Modern Web Dev
  • Author:
  • Publisher:
    Springer, Apress
  • Genre:
  • Year:
    2015
  • City:
    Berkeley;CA;New York;NY
  • Rating:
    5 / 5
  • Favourites:
    Add to favourites
  • Your mark:
    • 100
    • 1
    • 2
    • 3
    • 4
    • 5

JavaScript Frameworks for Modern Web Dev: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "JavaScript Frameworks for Modern Web Dev" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

Ambler Tim: author's other books


Who wrote JavaScript Frameworks for Modern Web Dev? Find out the surname, the name of the author of the book and a list of all author's works by series.

JavaScript Frameworks for Modern Web Dev — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "JavaScript Frameworks for Modern Web Dev" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make
Tim Ambler and Nicholas Cloud 2015
Tim Ambler and Nicholas Cloud JavaScript Frameworks for Modern Web Dev 10.1007/978-1-4842-0662-1_1
1. Bower
Tim Ambler 1 and Nicholas Cloud 1
(1)
TN, US
Electronic supplementary material
The online version of this chapter (doi: 10.1007/978-1-4842-0662-1_1 ) contains supplementary material, which is available to authorized users.
Great things are done by a series of small things brought together.
Vincent Van Gogh
The concept of package managemen t , also known as dependency management , is not new. Utilities within this category provide developers with a mechanism for managing the various third-party libraries that a project relies on. Widely used examples include
  • npm : The package manager for Node.js
  • Composer : A tool for dependency management in PHP
  • pip : The PyPA recommended tool for installing Python packages
  • NuGet : The package manager for the Microsoft development platform including .NET
While package management is hardly a new idea, a practice that has only recently begun to see widespread adoption is the application of this concept to the management of front-end web assetsthe JavaScript libraries, stylesheets, fonts, icons, and images that serve as the building blocks of modern web applications. The need for such structure has become evident as the foundations on which modern web applications are built have grown in complexity. Web applications that once relied on a small selection of broadly defined, one size fits all third-party libraries (e.g., jQuery) now find themselves using the work of many more smaller libraries, each with a tightly defined purpose. Benefits of this approach include smaller modules that are easier to test, as well as an enhanced degree of flexibility on the part of the parent application, which can more easily extend third-party libraries or replace them altogether when necessary.
This chapter is designed to get you up and running quickly with Bower, the front-end package manager whose roots lie in open source initiatives at Twitter. Topics covered include
  • Installing and configuring Bower
  • Adding Bower to a project
  • Finding, adding, and removing packages
  • Semantic Versioning
  • Managing the dependency chain
  • Creating Bower packages
Getting Started
All interaction with Bower occurs through a command-line utility that can be installed via npm. If you do not already have Bower installed, you should install it before you continue, as shown in Listing .
Listing 1-1. Installing the bower Command-Line Utility via npm
$ npm install -g bower
$ bower --version
1.3.12
Note
Nodes package manager (npm) allows users to install packages in one of two contexts: locally or globally. In this example, bower is installed within the global context, which is typically reserved for command-line utilities.
Configuring Bower
Bower is configured on a per-project basis through a single (optional) JSON file that exists in your projects root folder, .bowerrc . For the purposes of this introduction, well only look at the most frequently changed setting within this file (see Listing ).
Listing 1-2. The .bowerrc File from This Chapters Sample Project
// example-bootstrap/.bowerrc
{
"directory": "./public/bower_components"
}
By default, Bower will store your projects dependencies in the bower_components folder. You will likely want to change this location, and the directory setting allows you to do so.
The Manifest
Bower provides developers with a single point of entry from which third-party libraries can be found, added, upgraded, and removed. As these actions occur, Bower updates a JSON file referred to as the manifest with an up-to-date list of the projects dependencies. The Bower manifest for this chapters sample project is shown in Listing . In this example, Bower is aware of a single dependency, the Bootstrap CSS framework.
Listing 1-3. Bower Manifest for This Chapters Sample Project
// example-bootstrap/bower.json
{
"name": "example-bootstrap",
"version": "1.0.0",
"homepage": " https://github.com/username/project ",
"authors": [
"John Doe "
],
"dependencies": {
"bootstrap": "3.2.0"
}
}
If we were to accidentally delete all of our projects dependencies by removing the public/bower_components folder, we could easily restore our project to its previous state by issuing a single command, as shown next. Doing so would cause Bower to compare its manifest with our projects current file structure, determine what dependencies are missing, and restore them.
$ bower install
As a result of this behavior, we have the option of ignoring our projects /public/bower_components folder within version control. By committing only Bowers manifest, and not the dependencies themselves, our projects source code can be kept in a cleaner state, containing only files that pertain directly to our own work.
Note
Opinions differ as to whether or not keeping your projects dependencies out of version control is a good idea. On the one hand, doing so results in a cleaner repository. On the other hand, this also opens the door to potential problems should you (or the Bower registry, or GitHub, etc.) encounter connection issues. The general consensus seems to be that if you are working on a deployable project (i.e., an application, not a module), committing your dependencies is the preferred approach. Otherwise, keeping your projects dependencies out of version control is probably a good idea.
Creating a New Manifest
When you begin to use Bower within a project for the first time, its typically best to allow Bower to create a new manifest for you, as shown next. Afterward, you can modify it further if necessary.
$ bower init
Finding, Adding, and Removing Bower Packages
Bowers command-line utility provides a number of useful commands for locating, installing, and removing packages. Lets take a look at how these commands can help simplify the process of managing a projects external dependencies.
Finding Packages
One of the primary ways in which Bower can improve your development workflow is by providing you with a centralized registry from which third-party libraries can be found. To search the Bower registry, simply pass the search argument to Bower, followed by a keyword to search for, as shown in Listing . In this example, only a short excerpt from the returned list of search results is shown.
Listing 1-4. Searching Bower for jQuery
$ bower search jquery
Search results:
jquery git://github.com/jquery/jquery.git
jquery-ui git://github.com/components/jqueryui
jquery.cookie git://github.com/carhartl/jquery-cookie.git
jquery-placeholder git://github.com/mathiasbynens/jquery-placeholder.git
Adding Packages
Each search result includes the name under which the package was registered, along with the URL of the GitHub repository at which it can be accessed directly. Once we have located the desired package, we can add it to our project as shown in Listing .
Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «JavaScript Frameworks for Modern Web Dev»

Look at similar books to JavaScript Frameworks for Modern Web Dev. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «JavaScript Frameworks for Modern Web Dev»

Discussion, reviews of the book JavaScript Frameworks for Modern Web Dev and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.