QUnit 1.11 Release: A Look Back (and Forth)

Posted on by

Earlier this week, we released a new version of QUnit, jQuery’s solution for unit testing JavaScript. Along with some details on the new release, I wanted to take this opportunity to tell you a bit more about QUnit, where it came from and where it is going. I’m also looking for your input, to help us shape the future of JavaScript testing.

New in 1.11

The most visible change (aside from our new purple logo) is a runtime display for individual tests. Before, QUnit would show you how long it took to run a full test suite. Now it’ll also show individual times for each test, making it easy to spot slow tests in your test suite. Since it’s useful to have unit tests finish within seconds, tuning tests now becomes a bit easier.

Other changes are mostly bug fixes to built-in features, and various improvements to add-ons. There’s a new theme, a overhaul of the PhantomJS add-on to use its callback system and more. Check out the changelog for a full list of changes.

QUnit’s Evolution

Unlike jQuery UI and jQuery Mobile, QUnit doesn’t have a code dependency on jQuery, it just happens to be developed as a jQuery Foundation project. How did that happen? It all started a long time ago, but in a galaxy pretty close by. Back in 2006, this guy named John was working on jQuery and wrote his own little unit test runner, since there wasn’t much to start with. Two years later, John and I figured that this test runner would be useful as a standalone tool, and it got the name QUnit, as a mashup of jQuery and JUnit. It lived in the same SVN repository as jQuery itself, along with a few pages on the jQuery wiki.

In 2009, we moved it to its own GitHub repository and rewrote QUnit to get rid of the dependency on jQuery. Until October 2011, QUnit was just updated in master, without versioned releases, which kind of worked, but also caused maintenance and dependency headaches. I finally tagged 1.0.0, along with regular releases since then. Recently, QUnit got its own website and API reference.

Moving Forward

Today QUnit is used not only to test jQuery Core, jQuery UI and jQuery Mobile, but many other other projects as well. One notable example is Ember.js. Those guys don’t get tired of telling me how great QUnit is, putting emphasis on the reliability. We’d like to find out more about how developers are using QUnit, so if you’re using QUnit (or planning to), please take a few minutes to complete this brief survey.

From the ~50 answers we’ve received so far, it’s clear that people use QUnit since it’s so easy to get started with, and we certainly intend to keep it that way. It’s also clear that a lot of people are looking for tools and guides on integrating QUnit in CI tools like Jenkins, which is also something we’re planning to work on. Along with that comes a heavy refactoring of the QUnit codebase, which currently lives in a single JS file (and a sister CSS file). We’re going to split the codebase into a few modules, which should help future maintenance and make it easier to integrate other libraries. This will allow us to improve our diff implementation, for instance.

If you’re interested in following future QUnit updates, follow @qunitjs on Twitter and watch the project on GitHub.

A Site To Behold: Open Content & Design Comes to jQuery

Posted on by

In the past few days and weeks, you’ve probably already noticed the new theme we’ve been rolling out across our websites. In fact, unless this is your very first time looking at the jQuery blog, this very post probably looks a lot different than what you’ve been used to seeing over the past few years. Today, as this new design finally reaches jquery.com, we are very excited to pull back the curtain and explain the work we’ve been doing and how it goes above and beyond the simple “facelift” it may appear to be at first glance.

As the jQuery ecosystem has grown, it’s become increasingly difficult for the jQuery Team to keep our arms wrapped around a burgeoning balloon of documentation, design, CMS installs and wikis. Community members who’ve wanted to report and fix documentation errors have been left with nowhere to take action, and the picture wasn’t much better even for those who did have access. With all this content and design locked away in production environments behind a slew of different user accounts, and nowhere to track bugs, visibility has been low and progress incremental at best. We knew we had to make a change.

Over the past year, we’ve undertaken a massive effort to consolidate and simplify our site infrastructure and open source all of our web site content, documentation, and design. We’ve done this because it has already done wonders for our own ability to collaborate and move forward, and because we hope it will open up new avenues of participation for all of you out there who have wanted to find a way to get involved with jQuery, but have been unsure you could contribute.

So, enough with the platitudes — on to the stack!

git + grunt + WordPress

We’ve moved nearly all of our documentation and site content into static content repositories on GitHub, where they are maintained in HTML, Markdown, or XML, depending on the type of content. Now, if you notice a typo or think something needs clarification, you can file an issue and even send a pull request with a fix. Everything from the source documentation for jQuery.ajax to the front page of jquery.com to the raw Markdown of this new page that includes the full list of content repositories is open source!

The content is brought to life on our websites using WordPress and our custom theme and multi-site configuration, jquery-wp-content. Using this single WordPress instance makes it exponentially easier and more manageable for us to keep the look and feel of all our different sites in sync, and preserves our ability to easily layer on dynamic features like site search and user accounts as we need them. jquery-wp-content also contains a custom installation script that makes it easy to stand up the entire jQuery sites network for local development, opening up the doors for much less conservative experimentation with fixes and new features. Again, all this means that if you notice bugs on any jQuery website, there’s somewhere to report them, and you can even work on the fix yourself if you want!

(We’ve received an incredible amount of help creating and maintaining jquery-wp-content from WordPress developers Andrew Nacin and Daryl Koopersmith, and we’d be remiss if we didn’t thank them right here for all their hard work!)

The link between WordPress and the static content repositories is a grunt build and deployment process that processes the content files and synchronizes them into a WordPress installation using XML-RPC. That means we don’t ever use the WordPress Administration pages; all authoring and editing just happens in your favorite text editor, then grunt does the hard work.

In order to deploy to our production and staging servers, we simply use git webhooks to respond to commits on the content repositories and jquery-wp-content. Whenever a commit lands on the master branch of these repositories, the content and design is reflected immediately in the staging environment, which is just the URL of the website with a stage. subdomain prefix, e.g., stage.jquery.com. To deploy to the production sites, all that’s necessary is tagging with a semver and pushing the tag.

New Sites

In addition to today’s new look for the blog and jquery.com, we’re happy to unveil some brand new sites that are all powered by this system, which you should find especially useful if you’re looking to find ways to get involved with with jQuery.

Contribute to jQuery

URL: contribute.jquery.org | Repo: github.com/jquery/contribute.jquery.org
Our new hub for information on how to actually get started with contributing to jQuery and open source in general. It’s also full of useful resources for contributors, like our CLA form and style guides used across all of our projects.

jQuery IRC Center

URL: irc.jquery.org | Repo: github.com/jquery/irc.jquery.org
The jQuery Foundation uses Internet Relay Chat extensively for support and project communication. This is where we host the logs from our channels and keep documentation about how you can get connected and what to expect when you get there.

jQuery Brand Guidelines

URL: brand.jquery.org | Repo: github.com/jquery/brand.jquery.org
As we’ve recently freshened up a lot of the conventions we’re using for representing jQuery, we’ve also published these guidelines so that the community can have a better understanding of how they can — and can’t — use the names and marks of jQuery Foundation projects.

Sunrise, Sunset

We’ll also be saying goodbye to some subdomains in the next few weeks, and we wanted to give you a heads up, so you can prepare if necessary.

docs.jquery.com

Our original MediaWiki documentation-and-catch-all site has served admirably over the years, but it is time to put it out to pasture. We’ll continue to redirect the popular URLs on this site to their more modern counterparts.

meetups.jquery.com

Hosting our own meetup network was an interesting experiment, but the site gets almost no usage and is cumbersome for us to continue to manage, so we will be shutting it down. We recommend organizers use other, more established platforms such as meetup.com.


In addition to the new sites we’ve just launched, we’ll be continuing to roll out other new sites and integrate more of our existing sites into with the new theme over the coming days and weeks. We’re really happy with how it’s working so far, and look forward to continuing to improve the sites — perhaps with your help! As always, if you have trouble with any of this, please file issues, join us in the #jquery-content channel on freenode, or send an e-mail to content at jquery dot com.

Announcing the jQuery Plugin Registry

Posted on by

They say good things come to those who wait, and today we’re happy to end the waiting and unveil the jQuery Plugin Registry. We’ve worked long and hard to put together a brand new site that will serve to reduce the fragmentation and distribution problems that can be obstacles for plugin developers and consumers. We’ve also put an emphasis on remedying a number of the issues that plagued the old jQuery plugins site, especially with respect to workflows for contribution of both plugins and enhancements to the repository itself. The goal is to make sharing and browsing quality jQuery plugins a pleasant experience for everyone!

jQuery Plugin Registry: plugins.jquery.com
Source/Documentation/Issues: github.com/jquery/plugins.jquery.com

Downloading and Using Plugins

If you’re looking to just browse and use jQuery plugins in your application or site, not a lot has changed. Plugins each have basic pages that provide a link to the plugin download, as well as past versions, documentation, issue tracker, and source code repository. Download links may serve you a zip file with the plugin assets, or link to the best resource to download the build of the plugin you’re looking for.

Registering Your Plugin

Registering your plugin and having it listed on the site is not a complicated process; however, it assumes a number of aspects of the plugin development process, including using version control (git) and providing documentation on how to use it. You also have to include a plugin.jquery.json package manifest file, which provides all the information used to describe your plugin on the registry, including the version number, as well as the locations of the files and the documenation.

To register and publish your plugin, you’ll need to push your code to a public repository on GitHub, and add our post-recieve webhook URL (http://plugins.jquery.com/postreceive-hook) to your repository. The next time you push a semver tag, we’ll take care of registering the plugin name and updating its page on the site. When you’re ready to release the next version of your plugin, just tag and push again!

Users can download your plugin however you’d like them to. You can link directly to a JavaScript file for your users to save into their project, take advantage of the GitHub’s built-in zip file distribution, or even link to a custom build tool you may have online for further configuration.

That’s it — no uploading files to us, no wading through forms, and no manual updates for new versions.

(We plan to support other sites in the future! However, we’ve only been able to implement integration with GitHub at this point. If you’d like to assist with adding services, read on!)

Contributing to the Plugin Registry

Our work building the registry has informed and overlapped with a major initiative we’ve taken to open-source all of the content and design of all jQuery web sites. You’ve already seen part of this launch with the new api.jquery.com and jqueryui.com, and we’ll be talking more about this initiative later this week. As it relates to the Plugin Registry, it means that everything from the site documentation to the styles and templates to the post-receive hook itself is open source. So if you notice bugs or have ideas, you can raise and track issues and file your fixes as pull requests. You can even run a local instance of the site to iterate and test your changes.

Of course, if you’re a plugin author, you can also contribute by publishing your plugins to the registry. Even if you haven’t written plugins of your own, you can help out the authors of your favorite plugins by submitting pull requests that add a plugin.jquery.json manifest to their plugin’s repository.

Be Excellent To Each Other

We know this site has been long in the making, and we’re excited to finally be able to open it up for you to use, whether you’re looking for plugins to use in your app or you want to share your work with other developers. We’re looking forward to seeing lots of new plugins and old favorites make their way into the registry, so if you’re a plugin developer, we encourage you to get started as soon as you can with the registration process.

Name registration is on a first-come, first-served basis, and you can’t reserve a name prior to releasing a plugin. However, we recognize there is a huge ecosystem of jQuery plugins already out there, so especially in these early days of the registry’s existence, we do ask that authors reserve judgment and respect for other popular, widely-adopted plugins that may already have a reasonable historical claim to a particular name, even if it has not yet been registered. By and large, we hope that this will discourage “land grab” registrations, but we may step in to manually resolve a situation, should a particularly egregious case arise. “Squatting” on a plugin name is similarly disallowed, and may result in removal without warning!

(Translation: Ben Alman’s BBQ (Back Button & Query) plugin has long been a popular tool for working with the location.hash for navigation. Now is NOT a good time to create and register a sweet plugin for marking up quotations and call it the jQuery BBQ (<bold>,<blockquote>, & <q> plugin!)

That’s All, Folks

Thanks for your patience. Now go forth and publish! Should you encounter any trouble, please file issues, join us in the #jquery-content channel on freenode, or send an e-mail to plugins at jquery dot com

jQuery 1.9 final, jQuery 2.0 beta, Migrate final released

Posted on by

Are you sitting down? Well sit down, in front of your computer, and start downloading. We have several new jQuery releases for you to test. For your convenience, jQuery can even be downloaded while standing.

First up are the final versions of jQuery 1.9 and jQuery Migrate 1.0. We think these releases are pretty solid, because very few of you reported any problems in the beta versions. Just be sure to read the information in the jQuery 1.9 upgrade guide so that your transition will be smoother.

Next, take out your sunglasses. Today you get a glimpse at the future, and it’s bright. jQuery 2.0 is in beta test! We know it’s a lot to take in, so let’s recap the positioning for jQuery 1.9 and 2.0:

  • jQuery 1.9 and 2.0 have the same API. Several deprecated features such as $.browser have been removed from both versions. It’s all laid out in the jQuery 1.9 upgrade guide.
  • jQuery 1.9 runs on Internet Explorer 6, 7, and 8 (“oldIE”), just like previous versions. Consider it a cleaner, slimmer, modern-API upgrade from jQuery 1.8.
  • jQuery 2.0 will not run on oldIE. As a result of removing several layers of barnacle-encrusted code, it will be both faster and smaller than jQuery 1.9.
  • The team is supporting both jQuery 1.9 and 2.0 into the future. You choose which version you want to use based on your needs.

The jQuery Migrate plugin can be used with either 1.9 or 2.0 to detect deprecated and removed features, or to restore old features for those sticky situations where you need old code to run with new jQuery. The plugin and the messages it generates are documented in the project README.

If you’re on a recent version of jQuery core and have been avoiding deprecated features, these new jQuery releases may work for your code right out of the box. (Just remember, jQuery 2.0 doesn’t work on IE 6, 7, or 8!) Still, we recommend that you always start by including the jQuery Migrate plugin to see if it gives you any warnings.

The jQuery 1.9 final files are available on jQuery’s CDN, and should be available on the Google and Microsoft CDNs within a few days:

<script src="http://code.jquery.com/jquery-1.9.0.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.0.0.js"></script>

Or, for testing jQuery 2.0 beta 1, use the jQuery CDN:

<script src="http://code.jquery.com/jquery-2.0.0b1.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.0.0.js"></script>

For diagnostic purposes, you can also include the jQuery Migrate plugin with versions of jQuery all the way back to 1.6.4 to see what changes may cause issues with your code when you finally upgrade.

No matter which version of jQuery you use with the plugin, be sure to open the browser’s console to see what warnings or errors are being generated. Warnings given by the plugin start with the word “JQMIGRATE” and are listed in the plugin’s documentation. The description explains why the warning was given and how it can be fixed.

What’s New in 1.9

It may be a few weeks before the complete documentation for this release lands at api.jquery.com, especially since the API and other documentation sites are in the process of their own upgrade. For now, here’s a summary of what’s new and changed.

Streamlined API: Many deprecated and dubious features have been removed, as documented in the upgrade guide.

New .css() multi-property getter: Now you can pass .css() an array of CSS property names and it will return an object with the current values of all those CSS properties:

var dims = $("#box").css([ "width", "height", "backgroundColor" ]);
//  { width: "10px", height: "20px", backgroundColor: "#D00DAD" }

Enhanced cross-browser CSS3 support: jQuery 1.9 now supports the following CSS3 selectors across all browsers, all the way back to IE6: :nth-last-child, :nth-of-type, :nth-last-of-type, :first-of-type, :last-of-type, :only-of-type, :target, :root, and :lang.

New .finish() method: This method can be used to immediately complete all the animations queued on an element. The jQuery 1.9 RC1 blog post has more information and an example.

Source map support: You can now run the minified version of jQuery but use source maps for debugging. This can be extremely valuable for tracking down problems on a production web site. See the jQuery 1.9 RC1 blog post for a full description.

Many, many bug fixes: We’re especially proud of what we hope will be the final set of fixes for obscure issues in IE 6, 7, and 8. See the changelog below for a complete inventory.

Getting started with 2.0

Since jQuery 2.0 has its foundation in the work for jQuery 1.9, all the discussion in the upgrade guide also applies to 2.0. The Migrate plugin will identify many of these issues for you automatically.

If you’re using jQuery in non-web-site HTML situations such as an Android, iOS, or Windows 8 app, or a Chrome/Firefox add-on, jQuery 2.0 is an awesome choice. You can even use jQuery 2.0 on web sites if you don’t support oldIE or don’t mind using conditional comments:

<!--[if lt IE 9]>
    <script src="jquery-1.9.0.js"></script>
<![endif]-->
<!--[if gte IE 9]><!-->
    <script src="jquery-2.0.0.js"></script>
<!--[endif]-->

With this first beta of jQuery 2.0 we’ve made a huge down payment on major cleanup, cutting the size of the library by more than 10 percent. But we’re nowhere near done. There is more refactoring possible now that we can consistently depend on modern JavaScript, CSS, HTML, and DOM features being there. We’ll continue to tighten and clean up the code before 2.0 ships, and extend our work to make more functionality optional to shrink the size of custom builds.

They Built This For You

Many thanks to the people who have contributed to these two releases since 1.8.3 was shipped: Akintayo Akinwunmi, Alexander Farkas, Allen J Schmidt Jr, Ben Truyman, Bennett Sorbo, Callum Macrae, Carl Danley, Corey Frang, Daniel Gálvez, Dan Morgan, David Bonner, David Fox, Devin Cooper, Elijah Manor, Erick Ruiz de Chavez, Greg Lavallee, Ismail Khair, James Huston, Jay Merrifield, Jonathan Sampson, Julian Aubourg, Marcel Greter, Matt Farmer, Matthias Jäggli, Mike Petrovich, Mike Sherov, Oleg Gaidarenko, Paul Ramos, Richard Gibson, Rick Waldron, Rod Vagg, Roland Eckl, Sai Wong, Scott González, Sebi Burkhard, Timmy Willison, Timo Tijhof, Tom Fuertes, Toyama Nao, and Yi Ming He. Good work guys!

jQuery 1.9.0 final and 2.0.0 beta Changelog

Any tickets listed here that are not related to IE 6/7/8 support are also in the jQuery 2.0 beta.

Ajax

Attributes

Build

Core

Css

Data

Deferred

Effects

Event

Manipulation

Misc

Offset

Selector

Support

Traversing

The State of jQuery 2013

Posted on by

My fellow web developers, the state of jQuery is strong.

On January 14, 2006, John Resig attended BarCampNYC and made a presentation about his new project called jQuery. In a contemporary blog post John said, “This code revolutionizes the way you can get JavaScript to interact with HTML.” It was a bold statement, but in retrospect we know it was an understatement.

Seven years after John introduced jQuery to the world, the JavaScript library he created has continued to evolve. Today, jQuery is used by more than half of the top 100,000 sites and is the most popular JavaScript library by far.

Last year, jQuery projects moved from under the wing of the Software Freedom Conservancy to our own non-profit organization: The jQuery Foundation. This new Foundation was created not just to foster jQuery code projects, but to advocate for the needs of web developers everywhere. We’re starting to see the fruits of that labor.

To serve the evolving needs of web developers, jQuery has grown far beyond the core library. jQuery UI provides a rich set of user interface widgets that share a consistent and common set of events, programming conventions, and visual styles. jQuery Mobile offers a framework designed to simplify web site and HTML app development on mobile devices. Additional jQuery Foundation projects such as Sizzle, QUnit, and TestSwarm provide valuable components and tools for web development.

Anniversary Announcements

During the coming two weeks you’ll hear more about each of these jQuery Foundation initiatives:

jQuery 1.9 final: This latest version of jQuery core provides support for a full spectrum of browsers, from IE6 all the way to the most recent releases of every major browser.

jQuery 2.0 beta: Here is your taste of the future, a jQuery that can be faster and smaller without the need to support IE 6, 7, or 8. It’s a great choice for platform-specific HTML applications.

jQuery Migrate 1.0 final: Use this plugin to find things that may cause upgrade issues when you move up from older jQuery versions, and to allow older code to work with either jQuery 1.9 or 2.0.

jQuery UI 1.10 final: This version of jQuery UI includes API redesigns for both the Dialog and Progressbar components, in addition to a healthy set of fixes to other components.

New and remodeled web sites: All jQuery sites are being updated with a new look, and we’re encouraging contributions via Github. The most exciting news of all? The Plugin site returns!

Conferences: Our next conference is being held in Portland Oregon on June 12-14, so save the date! Ticket sales and a call for speakers will open on January 25th at noon Eastern time. Details of future conferences are coming soon; they include Austin Texas in September 2013, San Diego California in February 2014, and Chicago Illinois in July 2014.

Membership: Our new program lets you or your company show support by donating to the jQuery Foundation; you’ll get benefits such as t-shirts, hoodies, and discounts on conference tickets.

jQuery’s Mission

With the impending arrival of jQuery 2.0 some people have been asking, “If jQuery doesn’t have to worry about IE 6, 7 or 8 anymore, where does it go now? Aren’t cross-browser issues the whole reason for jQuery’s existence?”

First of all, let’s be very clear: The jQuery team does “worry about” IE 6/7/8, with jQuery 1.9. We’ve created a legacy-free jQuery 2.0 in order to address the many situations where older versions of IE aren’t needed. Some glorious day in the future, jQuery 2.0 will be the only version you’ll need; until then we’ll continue to maintain jQuery 1.9.

Second, jQuery wasn’t just created to iron out browser differences. It introduced a concise, powerful, and expressive API for managing HTML documents that is far better than the original W3C DOM APIs. Using the jQuery API, developers have created reusable jQuery plugins that make the process of building a web site or HTML application much easier. jQuery is a great choice even for an iPhone HTML app that will never see a different web platform.

But to the point about cross-browser issues, it’s a complete myth that today’s modern browsers have no differences. Look through the jQuery source code and you’ll see plenty of places where it has to fix, patch, and mask issues in modern browsers; those problems didn’t end with IE8. jQuery 2.0 now has more patches and shims for Chrome, Safari, and Firefox than for Internet Explorer!

In fixing and patching these differences, we often act as an advocate for web developers to the browser makers and standards organizations. We want jQuery APIs to be consistent and return useful results, even when browser bugs or ill-conceived standards dictate otherwise. It’s not always easy to do that.

Sometimes, doing the right thing requires changes to the standards, or new standards altogether. For some examples of that, see the work Mike Sherov has done to fix getComputedStyle(), or the efforts of Mat Marquis and others to create a responsive image tag. Team members Yehuda Katz and Rick Waldron are participating in the W3C and ECMA standards groups that define the technologies we all use.

Let’s Work Together

All of these benefits to the web development community are delivered by a dedicated group of jQuery team members. We’re proud to have developers like these working on behalf of the jQuery Foundation to advocate for the needs of the community. The majority of the team volunteers their time, or has their time subsidized through the generous donation of their employer. But there is always more work to do than the team can possibly tackle. Here are ways you can help:

Join the jQuery Foundation. As a member, you’ll get an awesome annual membership gift such as a t-shirt, hoodie, or bag, depending on your level of contribution. Your cash donations can help to keep our operations going. We’ll be announcing a memebership program in a few days as part of our anniversary celebration.

Test beta versions of jQuery projects as soon as they arrive. We want to find and fix problems before the final release. Beta versions are announced on the jQuery blogs, and bug reporting procedures are given in the blog posts as well. Read through the documentation and let us know when information is incorrect or missing. As Linus’ Law says, “Given enough eyeballs, all bugs are shallow.”

Write code, documentation, or web sites for a jQuery project. It’s not just the libraries themselves that need volunteers. The jQuery Foundation has many, many web sites at this point, and those sites always need contributions of code, documentation, or design. Watch for a blog post soon about a new site for contributors.

Get your company involved. If your company encourages employees to do open source work, consider doing that work on jQuery Foundation projects. Companies that wish to provide services and/or financial support can become corporate members of the jQuery Foundation.

Share your knowledge with the jQuery community. Join the discussion on our jQuery forum, on Stack Overflow, at user-group gatherings and conferences, or anywhere else you find jQuery being the hot topic.

Thank You!

As you can tell, the jQuery Foundation was very busy in 2012, and we’re determined to continue that pace in 2013.

We couldn’t have made such incredible progress without support from members and sponsors. jQuery Foundation member companies include WordPress, Media Temple, Adobe, RIM, Apigee, Intel, Gentics, BNOTIONS, White October, Bitovi, Davinci, Application Craft, GitHub, Go Daddy and MJG International. Significant support has also been provided by Bocoup, Filament Group, and their staff.

jQuery’s success isn’t ours alone; the web development community around the world deserves much of the credit. The breadth and scope of the jQuery ecosystem shows that it is thriving, and it continues to grow thanks to your support. Let’s make 2013 another great year for web developers!

Dave Methvin
President, jQuery Foundation

jQuery 1.9 RC1 and Migrate RC1 Released

Posted on by

Drop everything and start testing, jQuery 1.9 Release Candidate 1 is now available! Today we’re also releasing RC1 of the jQuery Migrate plugin, to help in migrating and upgrading your older jQuery code and plugins. We really need your help to make sure this code is free of bugs and ready to release.

The jQuery 1.9RC1 files are available on jQuery’s CDN. We recommend that you start by including the jQuery Migrate plugin. Be sure to check the browser’s console for warnings, which all start with JQMIGRATE and are described in the plugin’s documentation. Just replace your current jQuery include with this:

<script src="http://code.jquery.com/jquery-1.9.0rc1.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.0.0rc1.js"></script>

For diagnostic purposes, you can also include the jQuery Migrate plugin with versions of jQuery all the way back to 1.6.4 to see what changes may cause issues with your code when you do upgrade. At minimum, please test your site with your existing jQuery version and the jQuery Migrate plugin to see what it reports. Our goal is to make the jQuery Migrate plugin into a tool that can smooth out any bumps in your upgrade road.

If you haven’t looked at the previous 1.9 beta, check out the jQuery 1.9 Upgrade Guide for information about what has changed in this go-round. There’s been quite a bit of API cleanup in 1.9, and the jQuery Migrate plugin is your friend when it comes to finding issues.

In the last beta we introduced a powerful CSS array getter that simplifies and optimizes getting multiple properties. But then we looked, and oh, I dunno, it seemed like this release just needed to “pop” more. So we added more features to make your development life easier.

New! Sizzle Selectors

Sizzle now supports the following additional CSS3 selectors: :nth-last-child, :nth-of-type, :nth-last-of-type, :first-of-type, :last-of-type, :only-of-type, :target, :root, and :lang. That means all those selectors are usable in every browser jQuery supports all the way back to IE6, regardless of native browser support for the selector. There are only three remaining selectors unsupported by Sizzle/jQuery (:link, :visited, and :hover) which we won’t implement due to the overhead of events that would be required to track active elements.

New! .finish() Method

jQuery animations have gotten even better, and our API improved in the process. It all started with a suggestion to eliminate the Boolean trap posed by the .stop(Boolean, Boolean) signature. During that discussion it became clear that we didn’t have a way to handle one of the most useful cases: running all queued animations to their final value. So we added one, .finish(). The best way to show its benefits is with an example.

As you can see from the example, most uses of the .stop() API requiring Boolean arguments can be replaced with some combination of .stop() (with no arguments), .clearQueue() and/or .finish() and be less cryptic. We’re not removing the old behavior though, so any existing code should work fine. We’d prefer that you use .finish() when appropriate, since it reads better and avoids confusing Boolean parameters. And, when you need to go to the end of a whole series of animations, .finish() will do that in 1.9 when nothing would before.

New! Source Maps

jQuery 1.9RC1 has added the ability to use source maps in browsers that support them. At the moment that’s just Google Chrome, but Mozilla Firefox is planning support as well.

What’s all this about? Well imagine that you are using compressed versions of your files on your production site, including a compressed version of jQuery. You get a report that an important customer is running into a problem. You could debug it a lot easier if you had the uncompressed source, but using that on your high-traffic production site isn’t an option. With source maps, you can let the browser’s debugger “map” the lines in the compressed file into the uncompressed source. That makes it so much easier to set breakpoints, inspect or change values, and see meaningful variable names. This video gives you a taste of what it can do.

The jQuery CDN has the map files for this beta version; the jQuery, Google, and Microsoft CDN versions of jQuery final releases will also get matching source maps from now on. If you are using jQuery 1.9 or 2.0 from the CDN, just check the “Use source maps” option in the debugger and you will be set. Open the uncompressed version of jQuery in the Chrome debugger and you can set breakpoints or inspect variable values there, even though the compressed version is being used!

When hosting your own copy of jQuery, copy the map to your server and use it from there. For simplicity we assume that the compressed and uncompressed copy of jQuery is in the same folder as the map file; this is the case for CDN versions and you should follow the same rule if you make local copies. The map file name is the same as the compressed version, with .map replacing .js. Do not rename the files when you copy them. So, if you were to use a local copy of jquery-1.9.0.min.js the corresponding map file would be jquery-1.9.0.min.map and the uncompressed file would be jquery-1.9.0.js in the same folder.

Congrats, Contributors!

Many thanks to the people who have contributed to the 1.9 release: Akintayo Akinwunmi, Alexander Farkas, Allen J Schmidt Jr, Ben Truyman, Bennett Sorbo, Callum Macrae, Carl Danley, Corey Frang, Daniel Gálvez, Dan Morgan, David Bonner, David Fox, Devin Cooper, Elijah Manor, Erick Ruiz de Chavez, Greg Lavallee, Ismail Khair, James Huston, Jay Merrifield, Jonathan Sampson, Julian Aubourg, Marcel Greter, Matt Farmer, Matthias Jäggli, Mike Petrovich, Mike Sherov, Oleg Gaidarenko, Paul Ramos, Richard Gibson, Rick Waldron, Rod Vagg, Roland Eckl, Sai Wong, Scott González, Sebi Burkhard, Timmy Willison, Timo Tijhof, Tom Fuertes, Toyama Nao, and Yi Ming He.

jQuery 1.9.0RC1 Changelog

Ajax

  • #12004: Rename ajax.type to ajax.method
  • #12550: jQuery Ajax cache=false doesn't always work

Attributes

  • #9905: .removeAttr( "id" ) sometimes crashes IE 7
  • #10299: hrefNormalized === false also needs a propHook
  • #12048: [IE6/7/8] xml set attribute
  • #12584: jQuery wrongly serializes &lt;select&gt; with one disabled &lt;option&gt;
  • #12600: jQuery('select').is('[value="value"]') works inconsistently depending on number of elements returned
  • #12945: attr throws exception in IE9 on Flash &lt;object&gt;s
  • #13011: Setting type attribute on an input doesn't work as intended

Build

  • #12254: Reflected XSS
  • #12490: Move submodule update process to grunt
  • #12725: Avoid localized UTF-8 characters in intro.js @DATE
  • #12741: inconsistent line endings in official jquery-1.8.2.js download
  • #12886: Add source map support for build
  • #13044: Execute all QUnit modules in TestSwarm
  • #13064: Improve test suite fixture cleanup

Core

  • #9469: Remove semi-functional .selector calculation from .pushStack()
  • #9904: Move deprecated functionality to compatibility plugin
  • #10417: jQuery.later
  • #11290: selector interpreted as HTML
  • #11737: Remove jQuery.sub
  • #12107: Change proxy to allow arguments currying without overwriting context
  • #12134: implement HTML5 compilant form data construction into $.fn.serialzeArray
  • #12191: jQuery.type() should return "error" for native ECMAScript Error objects
  • #12519: Public API methods should not have private arguments
  • #12840: Remove (private) parameter "pass" from jQuery.attr and jQuery.access
  • #13021: each() cannot work well with a literal object who has a length member
  • #13075: Performance optimization for $.type
  • #13076: Performance optimization (10-30%) for $("some-selector")

Css

  • #11938: jQuery.css should accept an array to get multiple properties
  • #12990: 'px' automatically added to column-count css property
  • #13088: under IE8, $(selector).attr('style') always return lowercase string

Data

  • #10544: Remove ALL special meanings of "." in keys for $.fn.data

Deferred

  • #11405: deferred.notify() invokes progressCallbacks with deferred as context
  • #13160: Deferred.then doesn't propagete custom context

Effects

  • #12803: Smarter hook point for jQuery.timer

Event

  • #3827: Checkbox state inconsistent in click event handler
  • #12061: $(window).beforeunload() clobbers previous handler and return values
  • #12518: Don't use offsetWidth in jQuery.event.trigger()
  • #12610: jQuery.event.dispatch should remove window.event
  • #12736: Move pseudo:hover to jquery-compat / deprecated.js
  • #12739: Name: Passing in an Event to trigger strips namespace
  • #12827: Remove "exclusive" events
  • #12828: Remove event properties: attrChange attrName relatedNode srcElement

Manipulation

  • #4087: insertAfter, insertBefore, etc do not work when destination is original element
  • #9646: IE7: Cloning of form-elements and changing their names also changes the name of the elements that are cloned.
  • #10470: wrap() evaluates scripts
  • #11226: .after and .before returns incorrect data for $('not_existing_element')
  • #11230: .appendTo .prependTo .insertAfter .insertBefore returns incorrect data for $('not_existing_element')
  • #11280: appending elements to an object element fails in IE &lt; 9
  • #11795: Resolve script manipulation/execution inconsistencies
  • #12120: Inconsistency of .end() with respect to .after()
  • #12336: Calling $('#select').empty() should set options length to 0
  • #12392: Elements created from HTML strings have a parentNode
  • #12449: replaceWith() doesn't clone elements where required
  • #12503: before/after will choke if collection has not first disconnected node
  • #12777: Applets don't work when appended on IE
  • #12863: behavior:url(#default#savehistory) causes event error on oldIE
  • #12957: Improve wrapMap
  • #13019: New pre-1.9 .replaceWith() behavior leaks data and events
  • #13094: If to jQuery#before passed function argument it should receive index of the current element in the set

Misc

  • #12758: Make sure Summit new authors are credited

Offset

  • #6446: Mobile Safari 4.0.4: $.offset.top() reports wrong position after scroll

Selector

  • #11115: ".is()" and ".filter()" disagree on attribute selector "[checked]"
  • #12856: Syntax error, unrecognized expression in jquery 1.8+
  • #13070: filter()/is() does not work correctly with attribute equals selector which contains special characters

Support

  • #12569: Improve feature detect for oldIE event bubbling
  • #12869: Support tests affect page layout in IE8/9/10 running in IE7 mode

Traversing

  • #12009: jQueryObject.find(element) corrupts the stack
  • #12816: .find can return elements in the wrong order

jQuery 1.9 Beta 1 Released

Posted on by

You’ve been good boys and girls this year, so look what Santa left under the source tree: jQuery 1.9 Beta 1! We’ve made a lot of changes this time, so we need your help in testing more than ever. Please don’t leave us feeling awkward at the holiday party with that punch bowl full of warm eggnog and the creepy guy from accounting. Just take a few minutes out of your holiday schedule and try this with your code. It’s a gift we will definitely appreciate.

jQuery 1.9 has removed many of the items we deprecated during the last few versions of jQuery. For that reason, we’re introducing the jQuery Migrate plugin. This plugin restores several of the deprecated and removed features so that existing code can run, without changing the code. However, it’s intended as a short-term stopgap and shouldn’t be used for new work. To make migration easier, the development version (linked below) also provides browser console warnings to let you know which obsolete features the code is still using. See the plugin documentation for a list of messages you may see.

To test, we recommend that you start with the jQuery Migrate plugin since it will warn you about any deprecated features the code may depend on. Just include these two script tags in your code, replacing your existing jQuery script include:

<script src="http://code.jquery.com/jquery-1.9.0b1.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.0.0b1.js"></script>

Be sure to update to the most recent versions of jQuery UI and jQuery Mobile if you are also using them.

If the browser’s console does not show any “JQMIGRATE” warning messages generated by the jQuery Migrate plugin, try removing the jquery-migrate include and try jQuery 1.9 in all its squeaky-clean glory. If you have questions, feedback, or complaints about the beta that aren’t specifically bugs, let us know in the jQuery Forum.

Issues regarding the migration plugin not discussed below or in the upgrade guide can be reported at the jQuery Migrate Issue tracker; include a test case that we can use to diagnose the problem. The best way to do that is create a simple test at jsFiddle.net or jsbin.com. You can this jsFiddle tempate or jsbin template as a starting point; they already contain links to the work-in-progress versions of both jQuery and the jQuery Migrate plugin. Add your code there and post a link to it with your bug report.

If you’re seeing problems after fixing any migration issues, removing jQuery Migrate, and using the 1.9 beta by itself, you can report them at the main jQuery core bug tracker. A test case is essential here as well so that we can analyze the problem. Again, if you have questions, feedback, or complaints about the beta that aren’t specifically bug reports, use the jQuery Forum.

What’s New

The majority of work in 1.9 has revolved around API cleanup. Changes most likely to affect existing code are listed in the jQuery 1.9 Upgrade Guide, and these changes will also carry over to 2.0. The jQuery Migrate plugin will identify many of these issues for you automatically, so it’s good to use the plugin in your initial testing to see if it identifies anything that needs to be changed.

We couldn’t let a version like this escape without adding at least one new feature; it’s a good one.

$(element).css([ name1, name2 … ]): This is a new getter that retrieves multiple CSS properties for the first element in a collection and returns them as an object with properties. In addition to the shorter code, this signature provides up to 25 percent better performance because it can use the same return value from the browser’s `.getComputedStyle()` method rather calling the method for each css property. Typical use might be like this:

var dims = $("#box").css([ "width", "height", "backgroundColor" ]);
//  { width: "10px", height: "20px", backgroundColor: "#D00DAD" }

Finally, no major version would be complete without fixes for a variety of bugs and peculiar edge cases that you’ve discovered and reported on the bug tracker. Those, along with all the other modifications, are all cataloged in the changelog below.

How It’s Made

Possibly the most exciting news of this beta is that so many contributors — new and veteran — worked to make jQuery better. Our first jQuery Developer Summit in October brought in some incredibly skilled developers that we hope will continue to stay with us, and several new contributors dared to tackle bugs that have been open for more than a year! If you’re interested, you can help out too.

Let’s give a round of applause to the people who contributed their code gifts to this 1.9 beta: Akintayo Akinwunmi, Alexander Farkas, Allen J Schmidt Jr, Ben Truyman, Bennett Sorbo, Callum Macrae, Carl Danley, Corey Frang, Daniel Gálvez, Dan Morgan, David Bonner, David Fox, Devin Cooper, Elijah Manor, Erick Ruiz de Chavez, Greg Lavallee, Ismail Khair, James Huston, Jay Merrifield, Jonathan Sampson, Julian Aubourg, Marcel Greter, Matt Farmer, Matthias Jäggli, Mike Petrovich, Mike Sherov, Oleg Gaidarenko, Paul Ramos, Richard Gibson, Rick Waldron, Rod Vagg, Roland Eckl, Sai Wong, Scott González, Timmy Willison, Timo Tijhof, Tom Fuertes, and Yi Ming He. If you happen to see them under the mistletoe … well, you know what to do.

jQuery 1.9 Beta 1 Change Log

Ajax

  • #12004: Rename ajax.type to ajax.method
  • #12550: jQuery Ajax cache=false doesn't always work

Attributes

  • #10299: hrefNormalized === false also needs a propHook
  • #12048: [IE6/7/8] xml set attribute
  • #12584: jQuery wrongly serializes select with one disabled option
  • #12600: jQuery('select').is('[value="value"]') works inconsistently depending on number of elements returned
  • #13011: Setting type attribute on an input doesn't work as intended

Build

  • #12254: Reflected XSS
  • #12490: Move submodule update process to grunt
  • #12725: Avoid localized UTF-8 characters in intro.js @DATE
  • #13044: Execute all QUnit modules in TestSwarm
  • #13064: Improve test suite fixture cleanup

Core

  • #9469: Remove semi-functional .selector calculation from .pushStack()
  • #9904: Move deprecated functionality to compatibility plugin
  • #10417: jQuery.later
  • #11290: selector interpreted as HTML
  • #11737: Remove jQuery.sub
  • #12107: Change proxy to allow arguments currying without overwriting context
  • #12134: implement HTML5 compilant form data construction into $.fn.serialzeArray
  • #12191: jQuery.type() should return "error" for native ECMAScript Error objects
  • #12519: Public API methods should not have private arguments
  • #12840: Remove (private) parameter "pass" from jQuery.attr and jQuery.access
  • #13021: each() cannot work well with a literal object who has a length member

Css

  • #11938: jQuery.css should accept an array to get multiple properties
  • #12990: 'px' automatically added to column-count css property

Data

  • #10544: Remove ALL special meanings of "." in keys for $.fn.data

Deferred

  • #11405: deferred.notify() invokes progressCallbacks with deferred as context

Effects

  • #12803: Smarter hook point for jQuery.timer

Event

  • #3827: Checkbox state inconsistent in click event handler
  • #12061: $(window).beforeunload() clobbers previous handler and return values
  • #12518: Don't use offsetWidth in jQuery.event.trigger()
  • #12610: jQuery.event.dispatch should remove window.event
  • #12736: Move pseudo:hover to jquery-compat / deprecated.js
  • #12739: Name: Passing in an Event to trigger strips namespace
  • #12827: Remove "exclusive" events
  • #12828: Remove event properties: attrChange attrName relatedNode srcElement

Manipulation

  • #4087: insertAfter, insertBefore, etc do not work when destination is original element
  • #9646: IE7: Cloning of form-elements and changing their names also changes the name of the elements that are cloned.
  • #10470: wrap() evaluates scripts
  • #11226: .after and .before returns incorrect data for $('not_existing_element')
  • #11230: .appendTo .prependTo .insertAfter .insertBefore returns incorrect data for $('not_existing_element')
  • #11280: appending elements to an object element fails in IE &lt; 9
  • #11795: Resolve script manipulation/execution inconsistencies
  • #12120: Inconsistency of .end() with respect to .after()
  • #12392: Elements created from HTML strings have a parentNode
  • #12449: replaceWith() doesn't clone elements where required
  • #12503: before/after will choke if collection has not first disconnected node
  • #12777: Applets don't work when appended on IE
  • #12957: Improve wrapMap
  • #13013: Move jQuery.buildFragment() to compat plugin
  • #13019: New pre-1.9 .replaceWith() behavior leaks data and events

Misc

  • #12758: Make sure Summit new authors are credited

Offset

  • #6446: Mobile Safari 4.0.4: $.offset.top() reports wrong position after scroll

Selector

  • #11115: ".is()" and ".filter()" disagree on attribute selector "[checked]"
  • #12856: Syntax error, unrecognized expression in jquery 1.8+

Support

  • #12869: Support tests affect page layout in IE8/9/10 running in IE7 mode

Traversing

  • #12009: jQueryObject.find(element) corrupts the stack
  • #12816: .find can return elements in the wrong order

NOTE: Please do not report bugs or other problems via blog comments!

jQuery Color 2.1.1 Released

Posted on by

Just a quick announcement: jQuery Color 2.1.1 is now released! This adds a few bug fixes to the 2.1.0 release and I would suggest upgrading as soon as possible to avoid encountering these bugs.

Changelog

  • Ensure white and black both have a saturation of 0 to keep them in greyscale color space.
  • Add support for ‘.25’ instead of ‘0.25’ for alpha string parsing

Download

Thanks!

Special thanks going out to Mike Sherov, Ben Olson, Dmitry, and antoniojrod for helping with this release!

Issues

As always, if you encounter any issues, please do not post replys on this blog post, instead visit jquery-color issues on github.

jQuery 1.8.3 Released

Posted on by

Woo hoo, Thanksgiving arrived early this year! jQuery 1.8.3 is available for download. You can get it here:

We’ve notified the Google and Microsoft CDNs as well; we trust they will endeavor to post these files tout de suite. The complete change log for jQuery 1.8.3 is below. It’s a rather modest list, but we did nail a few important bugs and regressions.

The team is already hard at work on jQuery 1.9 and would like to squash as many bugs as possible. To report a problem, please post a bug report and be sure to include a test case from jsfiddle.net or jsbin.com. Also try our work-in-progress build at http://code.jquery.com/jquery-git.js to see if it’s already fixed.

Many thanks to the patch contributors for this version; ye shall know them by their GitHub handles: gnarf37, timmywil, gibson042, rwldrn, joyvuu-dave, jaubourg, staabm, and sindresorhus. In addition, we thank all the community members who took the time to contribute quality bug reports with test cases. Your initial groundwork makes it possible for us to find and fix bugs.

jQuery 1.8.3 Change Log

Ajax

  • #12583: IE8 HTML bug (Chinese translation)
  • #12635: jquery 1.8.2 fails ajax calls in IE9 because it assumes cross domain when default port is in ajax url

Attributes

  • #10943: JQuery 1.7.1 does not properly set tabindex property on cloned element in IE7

Core

  • #12690: Minimum JS File Contains non-ASCII Character

Css

  • #10227: $('body').show() does'nt work if body style is set to display:none
  • #12537: element.css('filter') returns undefined in IE9

Deferred

  • #12665: Callbacks objects with "unique" flag will iterate over a function's methods when it is added a second time

Effects

  • #8685: Animations should keep track of animation state in order to properly address stacked animations
  • #12497: jQuery 1.8.1 transitions crashing android 2.3.4 browser
  • #12837: All animations break after zooming a lightbox on the iPad

Selector

  • #12643: Upgrade from 1.3.2 to 1.8.2 gives an Uncaught TypeError
  • #12648: Can not correctly detect focus for DIVs with contenteditable in Chrome and Safari

Support

  • #12357: jQuery 1.8.0 Not parseable by XUL Runner Applications

jQuery Developer Summit Recap

Posted on by

With much of the East Coast bracing for the impact of Hurricane Sandy, now’s certainly a good time to take a look back on some sunnier times. Two weeks ago today, the jQuery Foundation held the first-ever jQuery Developer Summit at the Aol Campus in Dulles, Va. After a brief morning overview of our major tools and processes, over 120 team and community members set to work on nearly every aspect of our projects. We divided into 18 teams and focused on everything from triaging and fixing bugs and documentation for jQuery Core, UI, and Mobile, to working on design, implementation and deployment of our entire network of sites, to improving our automated testing and gathering and analysis of metrics on how people use our libraries and websites.

In addition to closing (and opening) hundreds of issues and tickets, and making hundreds of commits to repositories across our entire organization, it seemed that everyone in attendance, from grizzled old hands to greenhorn contributors, learned a lot. We were happy to celebrate a lot of firsts, whether it was somebody’s first commit on a jQuery repository, or their first git commit, period. Of course, not everything went off without a hitch, and we’ve been gathering feedback and figuring out how we can do even better next time.

What that means, of course, is that there will be a next time!  With such an incredible energy in the room for the two days, and a new group of contributors digging in on all of our projects, we’re certainly looking forward to another go-round. Watch this space and follow @jqcon for updates on the Developer Summit and all our other events. In the meantime, check out these recaps from Andy Couch and Carl Danley, and photos from Bowling for jQuery!

And finally, we’d like to extend a hearty thanks to each and every one of you who joined us for two days to help out and participate, we could not have done it without you! Thank you!