Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ


Choose your language

InfoQ Homepage News jQuery 1.11 & 2.1 Now on npm and Bower

jQuery 1.11 & 2.1 Now on npm and Bower

This item in japanese

Lire ce contenu en français

The latest jQuery can be obtained from npm and Bower, has some performance improvements and bug fixes.

The jQuery team has released another synchronized version of their popular JavaScript library, 1.11 and 2.1.0. The source and minified files can be obtained from the download page, but they can also be accessed with npm or Bower. Other package managers are not planned to be supported at this time.

The latest jQuery has better performance with fewer forced layouts and a lower startup overhead:

Fewer forced layouts: In this release we declared war on places where we might inadvertently force the browser to do a time-consuming layout. We found a few and eliminated one in particular that could occur when changing class names. This can result in a big performance boost for some pages.

Granular custom builds: Our modularity is now defined by AMD, and it is easier to build small subsets of the library when space is at a premium. If you want to know more, we’ve hidden the details in the README file where nobody ever looks.

Lower startup overhead: The new modularity and avoidance of forced layouts led us to refactor our feature detects so that they run the first time they’re needed. If you never call the API needing that feature detect, you never run that code. Previously we ran all feature detects when the page loaded, that led to delays that were generally small, but added up–especially on mobile platforms.

The sourcemap comment in the minified file has been removed to avoid confusion among developers:

This release does not contain the sourcemap comment in the minified file. … We’ll still be generating and distributing sourcemaps, but you will need to add the appropriate sourcemap comment at the end of the minified file if the browser does not support manually associating map files (currently, none do). If you generate your own jQuery file using the custom build process, the sourcemap comment will be present in the minified file and the map is generated; you can either leave it in and use sourcemaps or edit it out and ignore the map file entirely.

A number of bugs have been fixed.

The jQuery 1.11 branch supports older browsers (IE 6, 7, 8) while the 2.1.0 branch adds support for developing in Node.js, Chrome and Firefox extensions, and other non-traditional web environments.

Rate this Article