About Dave Methvin

CTO, PC Pitstop http://pcpitstop.com

Bad map file for jQuery 1.9.1 in the jQuery CDN

Posted on by

Quite a while back, Mike Taylor pointed out that the jQuery CDN has a minified copy of jQuery 1.9.1 with an incorrect map file reference. Basically, it refers to the map for jQuery 1.11.1, and that’s just wrong. If you are trying to debug a site that uses the minified jQuery 1.9.1 file, dev tools will get very confused and make a hard job even harder.

You might think that we could just edit the https://code.jquery.com/jquery-1.9.1.min.js file to point to the correct map file, which does exist as https://code.jquery.com/jquery-1.9.1.min.map. There are at least two problems with doing that. The first is that the file is heavily cached across the internet, since it’s been assumed for years that it will never change once the release occurs. Even if we edited the file, both the JavaScript and map file might never actually update at the point where they’re being used.

A second problem is even more serious. We’ve been advocating that developers use the script’s integrity attribute to ensure that the file you are including has not been modified since you originally wrote the script tag. If we modify the contents of the file this attribute will be wrong and the page will no longer include the file. This is likely to completely break the page! Given the age of jQuery 1.9.1 it is possible that many of the pages including this file are not being actively maintained. Thus, we can’t seriously consider changing the JavaScript file in any way, not even one byte.

The least disruptive option is to remove the jquery.min.map file that the jQuery 1.9.1 minified file references. It does not affect whether jQuery runs correctly for the visitors of a site. It only has the effect of disabling the source map. Because of these pitfalls of including the sourceMappingURL map reference in CDN JavaScript files that are often copied elsewhere, we no longer include it.

If you need to debug a site using one of these minified files, it is possible to manually associate a map file in Chrome. Open the minified source file, right click over the area of the minified source, and select “Add source map…”.

The incorrect jquery.min.map file has been removed from the jQuery CDN. We expect that there won’t be any observable change from removing this file, other than restoring sanity to debugging a site that uses jQuery 1.9.1. The jQuery 1.11.1 minified file does not reference its map, so it will continue to work fine and you can associate a map file as mentioned above.

Because caches are so aggressive on CDNs and across the internet, it’s possible that you may still see this map file for a while. If you see some unusual behavior that you think is related to the missing jquery.min.map file you can open a ticket on the CDN issue tracker.

jQuery Migrate 1.4.1 released, and the path to jQuery 3.0

Posted on by

Version 1.4.1 of the jQuery Migrate plugin has been released. It has only a few changes but the most important of them fixes a problem with unquoted selectors that seems to be very common in some WordPress themes. In most cases Migrate can automatically fix this problem when it is used with jQuery 1.12.x or 2.2.x, although it may not be able to repair some complex selectors. The good news is that all the cases of unquoted selectors reported in WordPress themes appear to be fixable by this version of Migrate!

You can get this new version at all the old familiar places:

jQuery CDN: https://code.jquery.com/jquery-migrate-1.4.1.js or https://code.jquery.com/jquery-migrate-1.4.1.min.js

npm: Just npm install jquery-migrate@1.4.1 which is listed at https://www.npmjs.com/package/jquery-migrate.

Bower: In your bower.json file, use the following in the dependencies section to copy the CDN file:

 "dependencies": {
    ...
    "jquery-migrate": "https://code.jquery.com/jquery-migrate-1.4.1.js"
  },

As always, we recommend that you use jQuery Migrate as a tool to find and fix issues when upgrading web sites to new versions of jQuery and associated plugins. The non-minified version provides extensive diagnostics on the console. Take advantage of them, we built them for you!

Migrate and jQuery 3.0

jQuery Migrate will be continuing its role of making jQuery upgrades easier. A release candidate for jQuery Migrate 3.0 will be coming soon.

With all the years of accumulated changes, it isn’t possible to have a single version of jQuery Migrate that can support all the changes from jQuery 1.6 (five years ago!) all the way to jQuery 3.0. So, with Migrate 3.0 we recommend this process to upgrade to jQuery 3.0:

  • If you haven’t already, upgrade to the latest 1.x or 2.x version of jQuery, and the latest 1.x version of jQuery Migrate. (As of today that is jQuery 1.12.3 or jQuery 2.2.3, combined with jQuery Migrate 1.4.1.)
  • Fix any problems identified in the Migrate 1.x warning messages you may see on the console.
  • Remove the Migrate 1.x plugin and ensure the page still works properly without it loaded.
  • Upgrade to the latest jQuery 3.x and latest jQuery Migrate 3.x.
  • Fix any problems identified in the Migrate 3.x warning messages you may see on the console.
  • Remove the Migrate 3.x plugin and ensure the page still works properly without it loaded.

Please do use jQuery Migrate 3.0 as you explore this latest release of jQuery, it will greatly simplify finding problems. We want this plugin to be a tool that makes your development life easier. If you find problems you can report them at the issue tracker.

Many thanks to the jQuery core team for their help, and to Github user ekonoval for a very helpful bug report!

Ten Years of jQuery and Beyond

Posted on by

On the 14th of January 2006, John Resig went to an event called BarCamp NYC to talk about some of the projects he was working on. One of those projects was a JavaScript Library called jQuery. It was the birth of what has become the most widely used JavaScript library ever written.

It’s hard to imagine now, but there were already about a dozen JavaScript libraries around on that day when John announced jQuery, trying to solve basically the same problem. There was no guarantee that yet another library was needed, or that jQuery would go anywhere. Yet slowly and surely over the past decade, jQuery has been widely adopted. It’s hard to find a web developer today who doesn’t know it, or a web page that doesn’t use it.

Code alone isn’t what made jQuery unique and drove its popularity. It took a strong community of users and contributors who pitched in to help newcomers master the library. John made a point of listening carefully to the community and incorporating feedback from those interactions which made both the code and documentation better. jQuery was shaped by the people who used it and appreciated the way it simplified development across multiple browsers. What makes this story even more remarkable is that it all began in an era before Github and StackOverflow!

Based on the experience and community insights that arose from jQuery development, the jQuery Foundation was formed in 2012. It included not only the jQuery projects but tools for other parts of the development lifecycle such as QUnit for testing and Globalize for internationalization. Last year, we joined with the Dojo Foundation and expanded the set of projects we support to include Dojo, Grunt, Lodash and more.

The Foundation continues to be guided by the principles that made jQuery a success and advocating for things like inclusiveness, diversity in teams and empowering contributors to lead within the open source community. As we move into 2016 and the number of projects we support grows, so do the ecosystems being built around those projects. An ecosystem thrives when its projects collaborate and share core principles. By enabling that collaboration, we hope to encourage new ideas and different points of view in open source JavaScript.

In Internet years, a decade is an eternity; web development has changed immensely in that time as has the web itself. Yet the basic formula for success in an open source project has been constant: start with a good idea, adapt it to the needs of users (even as those needs change), and get the community involved in all aspects of the project. Let’s measure our success not in the code that we write, but in what users create using our code and how it inspires them to push the web even further.

Here’s to another decade of awesome open source innovation in JavaScript!

jQuery Migrate 1.3.0 Released

Posted on by

With jQuery 1.12.0 and 2.2.0 out the door, this is a good time to freshen up the jQuery Migrate plugin as well. This plugin provides diagnostics that can simplify upgrading to new versions of jQuery, since it can root out any uses of deprecated APIs or other changes in jQuery that may affect your code.

The 1.3.0 version of jQuery Migrate adds a few more warnings for features that have been deprecated and will help you prepare for jQuery 3.0 which will be out soon. (The next version of jQuery Migrate with full support for jQuery 3.0 will have even more new features, but we’ll save that news for later.) A complete list of the changes made in jQuery Migrate 1.3.0 can be found in the issue tracker. That’s also where you can report a bug if you find one. Be sure to provide a test case that reproduces the problem. We like to use jsbin.com or jsfiddle.net.

In particular, there is an issue with the combination of jQuery 1.12.0, jQuery UI 1.11.4, and the older jQuery Migrate 1.2.1 that can cause an error with methods such as .outerWidth. If you’re experiencing this error after upgrading to the latest jQuery, please upgrade to this version of jQuery Migrate and the problem should be solved. This release also debuts the jQuery.migrateVersion property, which as you might expect is the string "1.3.0" this time around.

You can get this new version at all the old familiar places:

jQuery CDN: https://code.jquery.com/jquery-migrate-1.3.0.js or https://code.jquery.com/jquery-migrate-1.3.0.min.js

npm: Just npm install jquery-migrate@1.3.0 which is listed at https://www.npmjs.com/package/jquery-migrate.

Bower: In your bower.json file, you can use the following in the dependencies section to copy the CDN file:

 "dependencies": {
    ...
    "jquery-migrate": "https://code.jquery.com/jquery-migrate-1.3.0.js"
  },

As always, we recommend that you use jQuery Migrate as a tool to find and fix issues when upgrading web sites to new versions of jQuery and associated plugins. The non-minified version provides extensive diagnostics on the console. Take advantage of them, we built them for you!

Many thanks to all the people who reported bugs and provided code or other help, including c24w, g7015412-trbvm-com, gibson042, KingRial, markelog, mgol, Mottie, thbaymet, timmywil, ocean90, wbinnssmith, and wisec.

Invest in Yourself

Posted on by

You already know that jQuery Foundation projects power just about every JavaScript effort on the planet in one way or another. jQuery is the most popular library for web sites. Grunt builds the assets for thousands of projects. Lodash is used widely on both the client and server, making it the most-depended-upon package on npm. These and all the other Foundation projects could use your help.

Perhaps you hesitate to contribute to an open source project because you think, “I’m not smart, experienced, or skilled enough to do that.” Wrong! If you’re good enough to use open source, you’re good enough to contribute. What’s more, there are plenty of projects looking for a wide variety of skills. You have something to offer. As a new contributor, a new perspective alone can be incredibly valuable to those who have spent their time looking at a problem “from the inside.”

One of the biggest misconceptions about open source is that you have to be a guru-level programmer and understand how every line in the project works. That’s not true though. Many of the code-related things that need to be done involve the “code that builds the code” such as unit tests, build systems, and release scripts. If you use those tools in your work every day, you can bring that experience to help a project with those tasks, even if you’re not an expert in how it works internally.

Then there are the non-programming tasks that some programmers put off (or flat-out just can’t do), but make a huge difference in usability for developers. These are tasks like bug triage, documentation, web site design, and graphic designs. I’ve spent ten years now contributing to open source projects. The first five years were mostly spent triaging bugs, writing test cases and improving documentation. Doing these often-ignored tasks improved my understanding of the needs of project users.

Several Foundation projects have marked issues with the “help wanted” tag to make it easier for new contributors to find things the team thinks don’t require too much inside knowledge. Some projects have also tagged tasks they think are good “first contributions” for people new to the open source process. You’ll find direct links to their issues below. Take a look and grab a task, the projects will thank you for it!

QUnit
jQuery Mobile
Tessel CLI
Sizzle
Dojo 1.11
Dojo 2 core
Intern
lodash web site
lodash-cli
jQuery core
jQuery core documentation

If you don’t find a match with one of the jQuery Foundation projects, don’t let it stop you from contributing somewhere in the open source world. Sites like 24pullrequests.com can help with the search.

The jQuery Foundation would also be grateful for any contributions you’d like to make so we can continue to help open source projects grow and thrive.

Like many gifts that you can give, a contribution to open source can benefit the giver as much as the receiver. Open source software is about creating something together, where everyone contributes a bit and receives great benefits overall. In the process of helping a project you will improve your development skills, meet people with similar interests, and perhaps even hone your talents in preparation for a new job. It can take a bit of time to find the best project match for you, but the benefit to everyone will be much more than a drop in the bucket.

Grunt, Rebooted

Posted on by


Grunt is one of the best-known and most popular task runners in the web developer’s toolkit. Now that this project has joined the jQuery Foundation, we’re looking to get the project rolling again. Ben Alman, the creator of Grunt, is looking for contributors who can take over the reigns. The team could use some help with triaging a stack of issues and pull requests, then getting a new release out the door.

This is a great opportunity for you to get involved in open source. If you’ve used Grunt in your projects, this is also a chance to give back and help the web development community.

Interested? Post in this Grunt issue.

jQuery Foundation 2014 Annual Report

Posted on by

The jQuery Foundation exists to support web developers in creating web content built on open standards that is accessible to all users. We accomplish this through the development and support of open source software, and collaboration with the development community. The Foundation houses open source projects that are essential to this vision.

What we’ve accomplished

We’ve always been known for our namesake projects and their excellent documentation. In the past year, the jQuery Foundation has continued its quest to ensure that web developers have the tools and information they need to get their jobs done, beyond just jQuery, jQuery UI, and jQuery Mobile.

The past few months in particular have been incredibly productive. In October, we adopted the jQuery Mousewheel plugin. In December, Google transferred ownership of the Pointer Events Polyfill (PEP) to the jQuery Foundation. Finally, in January, we announced adoption of the Esprima project, a JavaScript parser that is used by dozens of developer tools. We’re working to foster the continued development of all of these projects, and welcome contributions from the community.

In 2014 we started work on the Chassis project to create an open standard for CSS libraries. We’ve had discussions with developers from Topcoat, Zurb Foundation, Filament Group, Cardinal, Famo.us, Yandex, WordPress, Automattic, 10up, 960grid, Unsemantic, jQuery Mobile, jQuery UI, Intel App Framework, Cascade CSS, Portland Webworks, Adobe, Hulu, and Bootstrap. We’re looking for additional contributors and input from the community about what you want in a CSS framework.

Our year by the numbers

Today, the jQuery Foundation hosts 45 open source repositories at GitHub. These include both code and documentation.

If you need evidence that jQuery Foundation projects are used everywhere, look no further than our Content Delivery Network (CDN) powered by MaxCDN. The 290 billion requests in 2014 transferred nearly 11 petabytes of data. That, of course, does not include the requests for locally hosted copies of jQuery and to other CDNs such as Google, Microsoft, or CDNJS. No doubt the overall number of requests is in the trillions.

Even the best code project can be unusable without good documentation. Web developers don’t just tell us our documentation is good, they tell us that it’s excellent. There were 149 million page views of jQuery Foundation documentation in 2014, coming from 230 countries. All of our documentation sites are available on GitHub so that developers can open issues and make pull requests to improve them. Open source isn’t just for code, it works equally well for documentation!

The jQuery Foundation also hosted, licensed, and participated in 10 events around the world during the past year, including jQuery Conferences in San Diego, Chicago, Vienna Austria, Toronto Canada, and Oxford England. These events always include a wide variety of subjects, and are not just about projects hosted by the jQuery Foundation. The common thread in all the conferences is that they cover topics that web developers should learn in order to do their jobs well.

Future plans

This year we will continue to drive standards forward based on the needs of web developers. Our participation in groups such as EcmaScript TC39 and the W3C has given web developers a say in this process that, until recently, was primarily controlled by large for-profit companies and browser makers. We also plan to increase our participation in the Unicode Consortium as we ramp up our investment in Globalize, so that developers can easily make their software usable worldwide.

Our recent adoption of Esprima highlights another area where web developers could use some more help: development tools. The tools landscape for processing JavaScript, CSS, and HTML is incredibly fragmented. There are multiple processes for authoring, creating, modularizing, and consuming JavaScript, none of which have established themselves as a standard. There are more than a dozen package managers, each with its own unique set of advantages and drawbacks. We’d like to work with developers to settle on a smaller set of options that impose fewer burdens on both the producers and consumers of JavaScript libraries.

2014 Financial Information

Thanks to generous contributions from members and sponsors, we were able to fund a variety of activities that gave back to the cause of open source. The majority of our investments were dedicated to fostering development of jQuery Foundation projects and furthering the use of those projects through events and educational opportunities.

2014 Revenue Chart2014 Expenses Chart

Acknowledgments

We’re proud of the accomplishments of the jQuery Foundation, all of which were realized by the continuing hard work of our team members. Many thanks also to the web developers who take the time to report issues, fix documentation, or contribute code patches. By improving jQuery Foundation projects, you’ve improved web development for everyone.

We’re also grateful for our jQuery Foundation members and their support. In the past year, companies such as IBM and Famo.us have joined and provided resources that allow us to accomplish our mission. Let’s all go out and do even more in 2015!

Esprima 2.0 Released

Posted on by

Last week, the jQuery Foundation announced our adoption of the Esprima project, the widely used JavaScript parser that powers many code analysis tools. Today we’re pleased to announce the release of version 2.0, now available on npm.

Up until now, the official releases of Esprima have only parsed ECMAScript 5 standard syntax. However, the experimental “harmony” branch has been adding ECMAScript 2015 (also popularly known as ES6) features for quite some time. A lot of the work there has been driven by Facebook. Now that the syntax for many ES6 features has stabilized and even shipped on some browsers, there is a need for tools that support the new syntax.

Esprima 2.0 introduces many stable ES6 features brought from the harmony branch, where they’ve been pretty reliable. This new baseline for Esprima makes it possible for tools such as code coverage analysis, style checkers, and linters to start to process the new ES6 syntax.

Since ES5 is likely to be with us for quite a while longer, Esprima 1.x will continue to be maintained for now in order to provide ES5-only parsing. Tools that currently use Esprima 1.x can continue to do so until they are ready and able to process ES6 constructs.

The 2.1 release of Esprima should follow relatively quickly, based on feedback on the stability of the 2.0 release. That means the Esprima team needs feedback from the makers of Esprima-based tools to know whether there are any problems. If you have built an Esprima-based tool and have problems with this release, please report them. (Note that the project is now using GitHub for issues rather than Google Code.)

We’re excited to see where Esprima goes next!

jQuery Foundation adopts Esprima

Posted on by

The jQuery Foundation is excited to announce that we are now hosting the Esprima project! The Abstract Syntax Tree generated by this JavaScript parser is used by many important developer tools such as ESLint, Istanbul, JSDoc and JSCS.

Ariya Hidayat has decided to transfer ownership of the Esprima project and its repo to the jQuery Foundation. We’re glad that Ariya has taken this step, since Esprima is such an important part of so many projects and is downloaded more than 2.5 million times every month from npm. Many thanks to Ariya for entrusting this project to us.

The adoption of the Esprima project, following the recent adoption of the Pointer Events polyfill, are the initial steps in a big shift toward realizing our mission to improve the open web and make it accessible to everyone. The jQuery Foundation looks to ensure that other important tools and emerging standards are also given the chance to grow and shape the open web.

The jQuery Foundation is committed to providing support to Esprima and opening it up for contributions. If you’ve been a contributor to this project already, we want you to continue that work and are always open to new contributors. Please stay tuned, we’ll be making more announcements soon.

jQuery 1.11.2 and 2.1.3 Released – Safari Fail-Safe Edition

Posted on by

Season’s greetings! After a thoughtful review of the Naughty and Nice lists, we have decided to leave a small present under the tree to finish 2014: jQuery 1.11.2 and 2.1.3! These releases include several bug fixes to make your cross-browser development experience better.

The most significant fix in this release is a workaround for a serious querySelector bug in Safari 8.0 and 7.1. When this bug popped up we were hopeful that it would be fixed in patch releases but that did not happen. Apple is by far the least transparent browser maker, and we have very little information about when the Webkit patch for this bug might be pulled into Safari. As a result, we have decided to patch this in Sizzle, the selector engine used by jQuery.

A bug like this one emphasizes the benefit of using a library like jQuery rather than going directly to the DOM APIs. Even modern browsers can suffer from bugs that aren’t fixed for a long time, and there are still cross-browser feature differences with several browsers in wide use such as Android 2.3. Special-case code for obscure browser issues can seem unnecessary until you spend a day trying to debug a problem in your own code caused by one. Or worse, lose a paying customer because they couldn’t use your site from their old phone.

Another bug that makes it difficult for us to test jQuery on iOS 8 is that the user agent of the simulator is incorrect so the iOS 8 simulator is not recognized by our unit test infrastructure. The fix for that issue is very simple but Apple won’t tell us if we can count on it being done. For now we’re doing our iOS 8 testing manually.

In addition, this release includes several changes inside jQuery to avoid holding onto DOM elements unnecessarily. Although the old code generally wouldn’t cause things to run incorrectly, web pages might run slowly and use more memory than necessary.

You may notice that we skipped a patch release number in the 2.x branch. We didn’t actually skip it, we built it and found a problem that caused problems when jQuery was used with node. (Many thanks to Denis Sokolov for letting us know immediately and prodding us to fix it!) Rather than shipping those files to the other CDNs, we decided to create new releases.

As far as the potential for compatibility or regression issues, we believe this is a very low-risk upgrade for anyone currently using 1.11.1 or 2.1.1. We are making this release ahead of jQuery 3.0 to ensure that you can use a Safari-safe version of jQuery without the need to review your code for compatibility with changes being anticipated in jQuery 3.0. If you do encounter bugs, in upgrading from the previous version, please let us know.

You can include these files directly from the jQuery CDN if you like, or copy them to your own local server. The 1.x branch includes support for IE 6/7/8 and the 2.x branch does not.

https://code.jquery.com/jquery-1.11.2.js

https://code.jquery.com/jquery-2.1.3.js

These updates are already available as the current versions on npm and Bower. Information on all the ways to get jQuery is available at https://jquery.com/download/. Public CDNs receive their copies today, please give them a few days to post the files and don’t be impatient. If you’re anxious to get a quick start, just use the files on our CDN until they have a chance to update.

Many thanks to all of you who participated in this release by testing, reporting bugs, or submitting patches, including Chris Antaki, Denis Sokolov, Jason Bedard, Julian Aubourg, Liang Peng, Michał Gołębiowski, Oleg Gaidarenko, PashaG, Richard Gibson, Rodrigo Rosenfeld Rosas, Timmy Willison, and TJ VanToll.

Since the last release of jQuery we have moved from a Trac installation to GitHub issues, so there are currently tickets for this release in both bug trackers. References to the Trac tickets have been migrated to GitHub issues, however, so you can use this GitHub Issues query to review all the tickets.

Thanks for all your support, and see you at jQuery 3.0!