BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News jQuery 3.0 Alpha Announced, Developers Need to Test

jQuery 3.0 Alpha Announced, Developers Need to Test

Leia em Português

This item in japanese

Lire ce contenu en français

The jQuery team announced the alpha release of version 3.0, prepping developers for what's to come. In the blog post, core team member Timmy Willison describes a lot of changes and asks the community for their help in testing.

There are a number of breaking changes in this release, and it's important for developers to test their code before upgrading to the latest version. Some of the major changes include:

  • Simpler logic for .show() and .hide()
  • Deferred objects are Promises/A+ compatible
  • requestAnimationFrame used for animations

The proposed changes to the way .show() and .hide() are implemented is sure to be a pain point for some web developers. According to the post, the logic behind those methods has grown in complexity over the years, covering more and more edge cases. As responsive design became the norm, even more logic was bolted on to deal with modern design needs.

Version 3.0 undoes all this complexity and reverts to the simple method of setting or clearing display: none. The jQuery team is well aware that this could break a lot of code so they offer the following piece of advice:

Don’t use a stylesheet to set the default of display: none and then try to use .show() – or any method that shows elements, such as .slideDown() and .fadeIn() – to make it visible.

In a discussion on Reddit, Larry Davis (lazd) offered the suggestion to just use the built-in HTML5 property hidden to show and hide elements. This feature is often used in modern browsers, but it has compatibility issues with older browsers. However, Dave Methvin says that using hidden in this common scenario goes against what the HTML5 spec recommends.

The alpha versions come in two flavors: 3.0 and 3.0 compat. As in previous versions the main release targets IE9 and above while the compat version is for developers who need to support IE8.

There is no announced release date for version 3.0

Developers can play with the new libraries either by using the CDN at:

https://code.jquery.com/jquery-3.0.0-alpha1.js https://code.jquery.com/jquery-compat-3.0.0-alpha1.js

or with npm:

npm install jquery@3.0.0-alpha1
npm install jquery-compat@3.0.0-alpha1

A full list of the changes in this alpha is available at the bottom of the announcement and developers are encouraged to participate in the discussion on GitHub.

Rate this Article

Adoption
Style

BT