QUnit 1.16 Release and Roadmap

Posted on by

We’ve just released QUnit 1.16, an important milestone for the project. This release introduces several new APIs that will become the default in QUnit 2.0. To help migrate to these APIs, you can start using them today in 1.16. Our 2.x upgrade guide provides all the details you need to change your existing test suite to the new APIs.

Here’s a quick overview of the new APIs:

QUnit.test( "assert.async() test", function( assert ) {
  var done = assert.async();
  var input = $( "#test-input" ).focus();
  setTimeout(function() {
    assert.equal( document.activeElement, input[0], "Input was focused" );
    done();
  });
});

You still define tests by calling QUnit.test and passing a name and a callback. The callback receives a assert argument that contains all assertion methods. The assert.async() method is brand new, replacing the old stop() method. The returned callback, here named done is later called when the test is finished, replacing the old start() method.

In addition, QUnit 1.16 contains several improvements and new features:

  • Promise support: As an enhancement for the async control, test blocks are now Promise aware, meaning QUnit will wait for the test to resolve with the pass or fail statement.
  • QUnit asynchronous tests can also now be defined using the new var done = assert.async() method instead of the old stop()/start(), making them specific to the test block.
  • QUnit.skip: This method can be used to define tests that aren’t executed, as placeholders or to temporarily disable an existing test (instead of commenting it out). The skipped test is still displayed in the HTML reporter, marked prominently as “SKIPPED”.
  • testId URL parameter: When clicking the “Rerun” link for a single test, a hash of the test name is now used to reference the test, called testId, instead of the previous testNumber. Using a hash makes sure that the order of tests can change, and QUnit will still rerun the same test you’ve selected before.
  • CommonJS exports: QUnit now also looks for a exports object and uses that to export itself, making QUnit usable on Rhino with the -require option.
  • There are a few more minor changes. For a full list, check out the changelog.

Roadmap

For future releases, we have several improvements planned as well:

Standardized reporter interface

Currently integration of any unit testing library into other tools like PhantomJS or browserstack-runner or Karma requires custom integration code, a combination of library and tools. We’ve started an effort to create a standard reporter interface that all testing libraries could implement, called js-reporters, to be consumed by those tools. Coordinating between the various projects and getting them to agree on and implement a common API takes time, but will yield better testing infrastructure for everyone.

Better diff output

When writing unit tests that compare objects with deep structures or many properties, like Ember models or Moment instances, the current diff output is slow and inefficient. There are also comparisons where the diff is hard to read. Replacing the diff library and implementing custom optimizations, like only showing diffs for leafs in big objects, will make QUnit’s HTML reporter even more developer friendly. We have a list of all diff-related issues.

Better support for writing custom assertions

Custom assertions are a powerful method of abstraction in test suites. They are currently underused. We want to investigate better APIs for writing custom assertions, along with better documentation of existing and new APIs.

Support for nested modules

Nesting modules, like Jasmine and Mocha support it, gives more flexibility in structuring test suites. There is existing discussion and prototypes, but no consensus on the API, yet.

For any breaking changes, we’ll apply the same migration model that we’re currently using. All backwards compatible changes will make it into the next minor release, any incompatible changes will be introduced with a migration layer in a minor release, removing the migration layer in the next major release.

The QUnit Team

The QUnit team also would like to use this opportunity to introduce itself:

At the jQuery Conference in Chicago, September 2014, from left to right: Jörn Zaefferer, Timo “Krinkle” Tijhof, James M. Greene, and Leonardo Balter

 

jQuery Foundation Adopts Mousewheel Plugin

Posted on by

The jQuery Foundation is pleased to announce that Brandon Aaron has donated his jquery-mousewheel plugin to the jQuery Foundation. Brandon is a jQuery team alumnus and he leaves the plugin in great shape with very few open issues. It’s a very popular plugin, one that’s often used along with jQuery UI and other widgets.

Adopting the mousewheel plugin is part of the jQuery Foundation’s mission to make a web developer’s work easier. We want to ensure that web developers can use this plugin and be confident it will be supported into the future. We can’t do this alone, of course, and encourage the community to pitch in with pull requests and by providing support to the jQuery Foundation. You can find it at https://github.com/jquery/jquery-mousewheel/.

Abandoned or neglected open source projects can be a thorn in the side of web developers. When a developer’s personal project becomes wildly popular, it often exceeds that person’s ability to maintain and support it. More developers should take the step that Brandon did, seeking out someone who can take over the reins when they no longer have the time. As Eric Raymond says in The Cathedral and the Bazaar, “When you lose interest in a program, your last duty to it is to hand it off to a competent successor.”

jQuery.com September 2014 Security Retrospective

Posted on by

During the last two weeks of September, we found our way into the headlines due to a series of attacks on our web servers. Today, we wanted to give everyone a brief update on the status of our websites and a recap of what happened over the last two weeks.

jQuery Under Siege

Early on the morning of September 18th we were hit with a DDoS and went offline. We were down for a couple of hours. The sites were brought back up later that day on September 18th and all seemed well.

Later, during the afternoon of September 18th, we were contacted by a security company named RiskIQ reporting that their crawler had reported malware being served by our content sites. There were never any reports that the jQuery libraries nor the CDN were ever compromised. Immediately upon receiving that report, we completely destroyed and reimaged all of those machines, revoked and reissued all associated SSL certificates, and confirmed that there was no suspicious content being served at that point. Since then, our own team and security folks from Mozilla and MaxCDN have worked to analyze logs and attempt to confirm the impact of this attack.

On September 23rd, RiskIQ went public with their report which picked up steam throughout the day on various media outlets and Twitter. The next morning, September 24th, as DDoS attacks on our properties continued to increase both in frequency and magnitude, CVE-2014-6271, otherwise known as the ShellShock vulnerability, was issued. As we continued to respond to the media discussion and communicate to the community what had happened on September 18th, we were victimized again in a series of much more public attacks involving the repeated defacing of jquery.com.

Investigations into our systems have yet to find the initial attack vector. However, we did take some steps to make ourselves more secure. For instance, some of our WordPress installs were out of date, all of our servers were vulnerable to the recent shell vulnerabilities, NGINX was slightly out of date as well as maybe a few other patches etc. that needed to be made. The infrastructure team dove in and began making those changes and started building new, fully patched and secured servers to host our sites. It appears these changes were effective as the defacing stopped and we have not seen any evidence of intrusion since.

Later on September 24th, a massive and unrelenting DDoS attack began. It seemed as though it would come in waves, but did not stop until late on September 28th. Most of the time on September 26th and 27th was spent trying to implement various products and solutions in order to keep the servers alive. We fought day and night to try to keep the sites up. We have to commend Corey Frang, Adam Ulvi, the rest of the infrastructure team, and others; they worked through the nights and in alternating shifts to try to keep us on the internet. Without their efforts, we would not have had the short amounts of uptime we did. One significantly important step that we took was to reach out to CloudFlare, who generously and rapidly gave us access to their Enterprise service which has helped tremendously in mitigating these attacks.

Moving Forward

jQuery and the jQuery Foundation are important to the web ecosystem, as is evident from the amount of press and the number of concerned individuals and organizations that have reached out to ask questions about this attack. The jQuery Foundation works on a daily basis to maintain and improve our projects and the infrastructure around those projects. The goal of this work is to continue to make web developers’ jobs easier and make sure they have a voice in the world of standards and browsers. However, these objectives take a large quantity of resources. Whether those resources are provided by access to expertise of a company’s employees or services, or through financial support, we would be unable to continue this important work without the support of the open source community and our supporting members.

We have been asked several times throughout this ordeal about why we didn’t have XYZ service in place or why we didn’t have our security team keeping a closer eye on these types of risks. The simple answer is that our budgets are tight and resources are limited. Our infrastructure team, and most of our teams for that matter, are made up of volunteers who give their time for free to make sure things keep running. The Heartbleed and ShellShock vulnerabilities are recent examples of how badly things can go when open source projects are taken for granted and just assumed to be OK. Eventually something is going to fall through the cracks and those cracks become larger and more frequent when people are doing what they can in their spare time.

So how can you help? As an individual, get involved in one of our projects. We can always use help writing code, designing, maintaining servers, working on events and the list goes on. Take a look at contribute.jquery.org or come say hi on IRC in one of our many channels listed on irc.jquery.org. As an organization, we would love to hear about any service you may be willing to donate, any developers or other skilled professionals that you could spare for a few hours a week or if you can help financially. Send us a message at [email protected] and let us know how you can help.

We haven’t wanted to say too much about these attacks as they have been happening because we remain a juicy target in the eyes of hackers who are continuing to attempt to infiltrate our servers even as of this writing. In sharing all of this information with the community now, we’ve tried to balance the need to explain what’s been happening with the potential backlash that could happen as a result of coming out publicly and saying that we believe we have the situation under control.

That said, we do at this point believe that we have the situation under control. For this, a huge thanks is due to the entire jQuery infrastructure team, who rolled up their sleeves and worked tirelessly on these issues to get us back to a good place. We will continue to be vigilant in ensuring the reliability and safety of all of our resources for our community of users.

Update on jQuery.com Compromises

Posted on by

Today at 11:15AM EDT, the jQuery Infrastructure team received widespread reports and confirmed a compromise of jquery.com. This attack was aimed at defacing our sites, and did not inject malware like the attack that was reported on September 18th by RiskIQ. We believe that these are separate incidents that may have used the same attack vector.

We took the site down as soon as we realized there was a compromise and cleaned the infected files. We are taking steps to re-secure our servers, upgrade dependencies, and address vulnerabilities.

At no point today have there been reports of malware being distributed from any of our sites, nor has the code of any jQuery libraries on our website or CDN been affected or modified today or during last week’s reported attack. Some of this confusion stems from last week’s attackers having set up a domain name intended to dupe users into thinking it was the official jQuery CDN. Please note that the official domain for jQuery files hosted from our official CDN is code.jquery.com.

There has also been concern that the user accounts of developers and administrators who use jquery.com and the rest of our WordPress sites have somehow been compromised by this attack. However, the only people who have a user account for the WordPress sites affected by these attacks are members of the jQuery team; we do not have any public user registration for any sort of account on any of the affected sites.

We are continuing to actively work on and monitor this situation and will update you as we learn more.

Updates

We have moved http://jquery.com to a new server only running code we trust and are continuing to monitor the situation closely. – September 24, 2014 at 5:07 PM EDT via Twitter

Was jquery.com Compromised?

Posted on by

Lastest update on the compromise: Update on jQuery.com Compromises

Earlier today, RiskIQ published a blog post stating that the jQuery.com web servers were compromised and serving the RIG exploit kit for a short period of time on the afternoon of September 18th. Our internal investigation into our servers and logs have not yet found the RIG exploit kit or evidence that there was in fact a compromise.

RiskIQ was able to make contact with the jQuery Infrastructure team on September 18th, at which point with members of the RiskIQ team tried to find evidence of compromise. So far the investigation has been unable to reproduce or confirm that our servers were compromised. We have not been notified by any other security firm or users of jquery.com confirming a compromise. Normally, when we have issues with jQuery infrastructure, we hear reports within minutes on Twitter, via IRC, etc.

At no time have the hosted jQuery libraries been compromised.

Currently the only potential system compromised is the web software or server that runs jquery.com. We have asked RiskIQ to help us look through our server logs and systems to help identify when and how a compromise happened. Please check this blog post for updates on the situation.

Even though we don’t have immediate evidence of compromise, we have taken the proper precautions to ensure our servers are secure and clean. If you happened to visit any of the our sites on September 18th and are afraid of your system being compromised you can follow the advice RiskIQ recommends:

  • Immediately re-image system
  • Reset passwords for user accounts that have been used on the system
  • See if any suspicious activity has originated from the offending system

jQuery Chicago Roundup!

Posted on by
jQuery Conference Chicago logo

With just over a month until we set forth for the Windy City for the first jQuery Conference in Chicago, the moment’s opportune to bring you up to speed on what we’ve got in store for you this September!

Whatchu Talkin’ Bout?

Our speakers and talks are the highlight of any jQuery conference; our lineup in Chicago is no exception. We aim to cover a broad selection of subjects from across the realm of web development, from our jQuery Foundation projects like jQuery, jQuery UI, and jQuery Mobile (so we’ll be having talks from project leads Dave Methvin, Scott González, and Alex Schmitz) to the new frontiers where JavaScript now treads (so we’ve got Lisa Deluca talking about using Arduino and Cordova together, and Micah Ransdell talking about Netflix’s adoption of Node.js). We know you want to know more about the future of the open web platform, and that’s why we’re happy to have folks like John K. Paul to go over coming changes to the language in ECMAScript 6, and TJ VanToll and Kevin Hakanson to discuss new browser APIs for form validation and cryptography.

A lot of you come to conferences to learn practical things you can take home with you, and that’s why we’re excited about sessions from (among others) Brian Arnold and Cory Gackenheimer on debugging techniques and Phil Dutson on the process of building a jQuery plugin.  We know, however, that there’s a lot more to releasing code than, well, writing code, and we’re happy to have Kassandra Perch, Alex Sexton, and Kelly Andrews joining us to talk about how to choose and use tools to ship and support the projects we work on. And we know some of you travel to conferences for the fun and games, and we’re thrilled to have Sara Gorecki and Bodil Stokke on hand to talk about building games with web technology.

This is just a handful of the speakers and subjects that’ll be on our Chicago stage(s), and we invite you to take a few minutes to check out our entire program to see what else is on the docket!

Can You Hack It At #jqcon?

Of course you can! In Chicago, however, we’re partnering with MaxCDN, DigitalOcean, and MediaTemple to officially encourage you to do so! We’ve got a wealth of data about how folks use the jQuery CDN at code.jquery.com, and it’s up to you to help us understand it. The hackathon starts the night before the conference on September 11th, and you’re free to use any medium you see fit to play with the data, whether it’s a web application or a robot. Our sponsors have stepped up to reward three participants with bountiful rewards, so we hope you join us to team up, explore, and build!

Coming Home to Roost

We’re partnering with Bocoup for the second time this year to extend our trip to Chicago with Roost, a two-day intensive class on building modern web applications taught by Ashley Williams, Ben Alman, Irene Ros, and Mike Pennisi. Roost is targeted at developers who already know JavaScript, jQuery, HTML, and CSS, and are looking to understand how to develop a better workflow for building, testing, and maintaining their applications and incorporate technologies like Backbone, RequireJS, Stylus, and more. You can check out the full training curriculum and schedule to find out exactly what’s planned.

Accommodations

Both jQuery Conference and Roost are taking place at the Sheraton Chicago in the heart of the city, so the hotel’s a convenient place to stay for the purposes of both your edification and your vacation. We’re only able to offer a discounted rate of $269 per night until August 15th, so make sure to make your reservation in our room block as soon as you can! Staying in our room block is a really helpful way you can help the jQuery Foundation fulfill some of the large financial commitment we’ve made by setting up shop in Chicago.

Brought To You By

Our sponsors and foundation members make a huge difference in our ability to host an awesome jQuery Conference for the community, and we’re happy to take a moment to thank them right here! So here’s a big THANKS to Diamond sponsors WordPress and IBM, Platinum sponsor MediaTemple, Gold sponsors MaxCDN, Bocoup, BrowserStack, Mandrill & DigitalOcean, and Silver sponsors Pebble & Accenture. (We’re still welcoming sponsors – if you’d like to have your company be a part of #jqcon, please reach out!)

Student Discount

We’re glad to be able to offer a discount to current students interested in attending jQuery Conference or Roost. Please get in touch with us for more information on how you can save $150 on tickets to one event, or $200 on a combination ticket. We know the discount is modest, but this is only the second time we’ve been able to offer a student discount of any kind, and we hope it helps. Please be advised that if you use this discount, you’ll need to show a valid student ID at registration.

Join Us

The summer’s been flying by and we can’t believe we’re only five weeks out, and we hope you’ll consider joining us on our trip (or that you’ve already booked your ticket!). Check out the conference site for more on our program and speakers, lodging, and to buy your tickets. If you have any questions, always feel free to get in touch with us on Twitter or via e-mail.

Supporting the Cause, Improving the Web

Posted on by

To help the jQuery Foundation accomplish its mission to improve the open web and make it accessible to everyone, we established a membership program where organizations and individuals could join the foundation to help us support our goals. In return, members are recognized both on our websites and at conferences. Since that time, a number of companies, large and small, as well as individuals, have stepped up to support the foundation and continued success of the jQuery projects. A full listing of our members is available on the member page on jquery.org.

Corporate Memberships

Corporate memberships are available in several levels based on support, ranging from Bronze to Platinum. Beyond those levels is our top level membership called our Founding members. Currently, WordPress is our single Founding member at this time and they are a huge part of the jQuery Foundation mission and we would like to say a special thank you to them. We would not be here if it wasn’t for the support of WordPress and our many corporate members at every level.

So what does a member get in return for their support of the Foundation? Depending on the level of support, there are a number of ways we recognize and thank our members. Every member is recognized on the member page. As you progress up through the different levels of membership, more benefits such as conference recognition, free and reduced price conference sponsorship packages, invitations to team meetings to discuss the development and direction of the jQuery projects, and even the ability to host jQuery licensed events of your own. For more information about the corporate membership program, e-mail us at [email protected].

I’m not a Corporation, how can I help?

We’re glad you asked. The jQuery Foundation also has an individual membership program where people can donate smaller amounts to help support the Foundation and in return, we send out some cool jQuery branded gear. When the program started, we offered three levels of membership for individuals. That just got too complicated for both the members joining as well as the folks managing the payment and gift fulfillment. There is now only one level of individual membership at the $400 per year level. If you think about it, that’s really only a little more than $1/day to help keep the jQuery Foundation running. You can see all of our individual members listed on the member page. As new members are added, they will be listed as Heroes until the transition from a 3-tier to 1-tier program is complete and everyone has merged into a single list of Individual Members. If all of this has got you itching to become part of the next wave of individual members, head on over to https://jquery.org/join/ and join our ranks.

Membership may not be an option for everyone, but there are still ways you can support the Foundation’s work. The first way is through donations. The jQuery Foundation accepts donations, both large and small, through PayPal. If that’s an option that interests you, check out our donate page. Another way to help the foundation is by grabbing yourself a nice shirt or some stickers over at DevSwag. We have partnered with DevSwag, as many other open source projects have, to license the sale of official jQuery branded clothing and other items and a portion of the proceeds from those items are donated to the jQuery Foundation.

No matter if you’re a company or an individual, we hope you’ll take the time to consider supporting the jQuery Foundation to keep us working toward making the web accessible to everyone.

One Last Thing …

We thought we would let you know one more time about the upcoming jQuery Conference in San Diego. The conference is February 12-13 and is preceded by Bocoup’s 2 day training conference Roost on February 10-11. Don’t forget to take $50 off your ticket to one or both of these events using discount code jqblog50 at checkout!

Hosting and Configuring the jQuery Servers

Posted on by

The other day, we posted about our new content workflow, but we didn’t get into how all that content is actually served. Believe it or not, jQuery doesn’t just run on jQuery.

The servers

The servers themselves are hosted at Media Temple. We have been using their VPS services for many years to host all the things we need to host, of which there are a surprising number. We use over a dozen different servers (of various sizes) hosting everything in the jQuery network including many different web sites, applications and services vital to the community and development team. The reliability of the Media Temple VPS services and network for our infrastructure has been fantastic.

The setup

We couldn’t manage all of the servers without Puppet. Puppet is a configuration management tool that makes it really easy to express server configuration in a simple scripting language. Tasks like adding a domain to the Nginx configuration can be annoying, and hard to track changes using conventional methods. Using Puppet lets us store all the server configuration needed in a git repository, and deploy new machines very easily.

Another product that really shines in our setup is Nginx. Nginx is an open source web server focused on delivering the best performance possible. On our busiest Media Temple Dedicated Virtual server around peak times, Nginx handles about 300 HTTP requests per second, of which about 30 are serving pages from WordPress via php-fpm. Nginx’s built in fastcgi_cache handles a lot of that load, and more like 2 or 3 requests per second actually make it to PHP.

Thanks for the support!

Keeping a network of servers running to support a community as large as jQuery’s is a big job. To help ensure everything runs smoothly, we rely on jQuery Infrastructure team members Adam Ulvi and Ryan Neufeld, and for server and network-related issues we count on prompt and helpful support from the Media Temple team.

To celebrate their 7 years of serving the jQuery community, Media Temple is extending a special offer on their VPS and Grid Hosting. For the next 5 days, get 50% off an annual purchase of a Grid or VPS (up to level 3) service with the code LovejQuery50.

Speaking of support, if you need any support with jQuery, or the related web sites and services, check out one of our IRC channels on freenode.

Getting from GitHub to WordPress

Posted on by

Maintaining an open source project as big as jQuery requires the use of various software and services. Two of the products we rely on and enjoy the most are GitHub and WordPress.

We’ve been using and loving Git and GitHub for years now. The community collaboration has been phenomenal. We’ve seen a massive uptick in community-provided bug fixes, refactors, new features, etc. Even within the team, the services provided by GitHub have provided a huge productivity boost. Forks and pull requests provide a great mechanism for sharing code and peer code reviews. The interface renders almost every file exactly how we want it to, especially Markdown. The API and service hooks provide a great way to automate various tasks.

Even longer than we’ve been using GitHub, we’ve been using WordPress to manage our various web sites. We have a surprisingly large number of them. Between project sites, API documentation, tutorials, contribution guides, events, and organization sites, the number of web sites we maintain rivals the number of code projects we maintain. WordPress provides tools which make managing this many sites with a common brand almost as simple as maintaining just one site with shared users, theme inheritance, and a great plugin architecture, providing even more hooks than GitHub.

The missing pieces

Unfortunately, our WordPress experience lacked all the collaboration tools and workflow we love. Only a few people had access to edit content, and collaboration without pull requests is painful. Managing content on api.jquery.com was an even bigger hassle because of our XML based workflow, which the WordPress editor clearly wasn’t designed for.

While GitHub has tons of tools that we love, and they even have GitHub Pages, it lacked the infrastructure we need for managing our site content. GitHub Pages have no built-in features and can’t have any server-side processing. Features like search and commenting either need to be added per site via client-side JavaScript or can’t be implemented at all.

Bringing it all together

In order to resolve these issues, we decided to find a way to bring these two products together and get the best of both worlds. It started off pretty bumpy, but we managed to do just that! Things started to really pick up when we got the support of WordPress’ Lead Developer Andrew Nacin. Nacin played a key role in getting our new infrastructure set up and ensuring we were using WordPress as efficiently as possible. With his help, and the help of a few new projects – such as node-wordpress, grunt-wordpress, and grunt-jquery-content – we were able to build exactly what we wanted.

We now manage our WordPress theme in jquery-wp-content, and the content for all of our sites are stored and managed in individual repositories on GitHub. Storing the content of each site on GitHub gives us all the benefits of tracking tasks in issues, discussions on pull requests, visual diffs for changes, etc. The content of each page is generated by grunt-jquery-content from HTML, XML or Markdown source depending on the repository. This content is then synced to WordPress using grunt-wordpress. Just like our code, all of our site content is open source and released under the terms of the MIT license, with the exception of our branding which is not licensed for use by others.

We’re now powering a dozen and a half sites with this new process, averaging 20 contributors per site. Our most popular sites for community contribution are learn.jquery.com which is nearing triple digits and api.jquery.com which currently has 50 contributors. We’re averaging 40 pull requests per site as well, showing just how beneficial this new workflow has been for the team and the community. If you’d like to join in on this community effort, you can read more about our process and how to get involved on our contribution site and help make jQuery better for everyone.

jQuery 1.11.0 RC1 and 2.1.0 RC1 Released

Posted on by

We’re just about ready for the final release of jQuery 1.11 and 2.1! Before we release, we’d like you to sanity-check our work. It will save us both a bunch of work if you check things out now, rather than waiting for a release. If something’s not right, we can fix it before millions of people have to deal with it!

Testing is easy, just use one of these files on the jQuery CDN:

We’ve also published the files on npm for those of you using that for dependency management. This version should work properly with browserify.

This version is mainly about fixing bugs and supporting more dependency managers, so you shouldn’t expect to see compatibility issues if you’ve already migrated to 1.9 or higher. But that’s why we’re putting out a release candidate, we want this to be as stable as possible. If you do see problems, please report them at bugs.jquery.com.

Go forth and test!

Changelog

Common to both jQuery 1.11 RC1 and jQuery 2.1 RC1

Ajax

Attributes

Build

Core

Css

Data

Effects

Event

Misc

Selector

Support

jQuery 1.11 RC1

Ajax

Core

Effects

Support

jQuery 2.1 RC1

Ajax

Build

Core

Event