In association with heise online

25 June 2012, 14:31

jQuery 1.8 goes beta and grunts custom versions

  • Twitter
  • Facebook
  • submit to slashdot
  • StumbleUpon
  • submit to reddit

jQuery logo Customisation is key to the just announced beta 1.8 version of the jQuery JavaScript library. It is now possible to exclude modules from jQuery using a new build system based on grunt; this allows developers to drop modules for ajax, css, dimensions, effects or offset, depending on what their web application actually needs, reducing the amount of jQuery code downloaded to the browser. With all those modules excluded, jQuery is a lean 21KB (minified and gzipped), but the developers stress this is an optional process and they will continue distributing the complete library through content delivery networks. Details of the build system are available in the README file.

jQuery 1.8 beta also aims to ease the pain of vendor prefixes for CSS features that aren't yet standardised by automatically expanding property names for the current browser through the .css() function. A cleanup and rework of the animation engine has been so extensive, that there are now new extension points that should make it easier to add or modify animations, but documentation is currently sparse. The Sizzle CSS selector engine has also had a major rewrite resulting in a "widespread performance improvement", enhanced shortcuts and better handing of more edge cases and browser bugs.

The developers are also warning that in jQuery 1.9, the version after 1.8, they will be tightening up on the HTML taken by the $() function. This is because cross site scripting attacks could make use of the behaviour of the function to execute code in <script> tags. jQuery will become more careful about what it accepts as HTML code within $(), only allowing strings which start with "<" to be regarded as such. Preceding that tightening, jQuery 1.8 has a new method, $.parseHTML which lets the system turn strings into HTML and parse HTML into DOM fragments.

jQuery 1.8 beta also marks the removal or deprecation of a number of "trip hazards" including $.browser browser detection, $.sub which failed to be useful or robust enough and global ajax events which had become an inefficient special case. Full details of the changes in jQuery 1.8 beta 1 can be found at the end of the announcement. The MIT or GPLv2 licensed jQuery 1.8 beta 1 can be downloadedDirect download and the source is available from the project's Github repository.

(djwm)

Print Version | Send by email | Permalink: http://h-online.com/-1625305
 


  • July's Community Calendar





The H Open

The H Security

The H Developer

The H Internet Toolkit