andrew.hedges.name / blog

jQuery 1.3: Sweet upgrade, but can we use it?

January 14, 2009, 2:14 pm · 5 comments · Filed under: JavaScript, jQuery, Web Development

The jQuery team has outdone themselves in many ways with version 1.3 of the world’s best JavaScript library. But are they leaving real-world web development behind?

3 features have me most excited about the latest release of jQuery: massive speed increases (e.g., 6x faster element insertion, wow!), live events, and Sizzle, the new, standalone CSS selector engine which I expect to be a big win for the entire web development community.

I am concerned, though. I am concerned that some design decisions made by the jQuery team have made it a little harder to sell the use of the library to decision makers, the people who care less about sweet features and more about whether their software works for as many users as possible.

When building software, you have to choose your trade-offs carefully. There are major benefits to leaving behind legacy software. The biggest is that you can keep a leaner, cleaner code base, which makes maintenance and upgrades less costly. The trade-off is that you leave some percentage of users behind. As your code progresses, you necessarily introduce incompatibilities with older software. This isn’t evil, it’s just how it goes.

My specific concerns around jQuery 1.3 have to do with inconsistencies in the documented browser compatibility. The official line is that jQuery supports Firefox 1.5+, Internet Explorer 6+, Safari 2.0.2+, and Opera 9+. To quote:

Any problem with them should be considered and reported as a bug in jQuery.

Wow, that sounds great! Web developers the world over should have no problem selling their bosses and clients on that! How about known issues? While that same page states there are “known problems” with several older browsers, a look a the known issues page lists only 2.

The jQuery team does a lot of things right. One of them is to cover their code base with tests.

What I found puzzling in the release announcements for jQuery 1.3 was that the published test results did not match up with the purportedly supported browsers. Where are the test results for Firefox 2? Where are the test results for Safari 2?

I ran the tests myself on those two browsers. (You should, too, here.) On Firefox 2, 1 test did not pass (#137: ajax module: jQuery.post(String, Hash, Function) - simple with xml (1, 2, 3)). Out of 1271 tests, that’s pretty much awesome. Still, it would be good to see that non-passing test discussed on the known issues page.

More troubling was the result of running the test suite in Safari 2.0.4. On my test system, the test suite crashed Safari every time. That’s the kind of thing that can turn off management types in a hurry. Maybe it’s a little thing, easily worked around. Maybe it’s not. Without some official discussion of the bug, it’s tough to sort out. Sure, Safari 2 browser share is pretty small, but it’s not zero and while it’s possible for users on older versions of Mac OS X to upgrade, many simply won’t.

To quote John Resig, inventor of jQuery, “It’s safe to say that the biggest tax on a web developer is spending so much time dealing with browser bugs and incompatibilities.” This is true in my experience as well. The temptation to leave those old browsers behind is like a tiny devil on my shoulder. It’s one of the reasons I’m so excited about recent developments around HTML5.

Unfortunately, we web developers live in a world where users don’t upgrade as quickly as we’d like. On some projects, you can say “screw ’em!” but on most you have to cater to them as best you can. jQuery is now the most high visibility, widest used JavaScript library. This means it reaches more people’s browsers than any other. With great power comes great responsibility. I understand the need to cut off legacy software at some point. I think the jQuery team is erring on the aggressive side at the moment and that leaves web developers trying to sell their managers on it in a tough spot.

Update: After a little more research, it looks like the issue of the test suite crashing Safari 2.0.4 is a known one that has been around for a long time. It’s marked “wontfix” I presume because of the low browser share for that browser.

I don’t mean to step on any toes with my post here. I love jQuery and advocate for it constantly. As I say above, there are trade-offs for any software team in where to expend resources. jQuery 1.3 appears to be a major step forward in almost every way. With this release out the door, hopefully the jQuery team will have time to catch the documentation up to the state of the library.


Short URL to this article:

5 comments


A couple points:

  • As you noted the test suite is crashing Safari 2 - and has done so for a very long time (as long as I can remember testing against Safari 2). Safari 2 was/is a horribly buggy browser - especially when it came to memory management. Our testing solution has always been pretty ragged there.
  • We have dropped Safari 2 support in jQuery 1.3 - we didn’t mention it in the release notes, probably should have.
  • http://jquery.com/test/ is not current (still pointing to 1.2.6, it seems), I’ll see if I can find a way to get it updated.
  • The test suite completely passes in Firefox 2 and we still test in it actively (I don’t, personally, but Ariel Flesler, another core developer, does).

I’d like to compliment you on your blog/page design, very nice layout.

jQuery 1.3, in my humble opinion, has not left any real world developers behind. Quite the contrary, it has streamlined it’s performance (under the hood) but the end user experience remains much the same albeit much faster. The addition of a few new features, which are quit intuitive, are quite welcome and not game breaking in the least. Personally, I feel the release of 1.3 is a landmark in jQuery history, the “sizzle” engine is very impressive. Also of note, the documentation and new API were both released at the same time as jQuery 1.3.

John,

It’s good to hear that at least some of the jQuery devs are actively testing against Firefox 2. I think that browser will be around for a while.

I can understand dropping support for Safari 2 because that’s not a browser anyone is stuck with (users on Mac OS X 10.4+ can upgrade to Safari 3). It’s a similar situation to weighing IE6 support (buggy, horrible browser), but IE6 of course gets a pass because it’s so ubiquitous.

Taking a step back, I think my main point is that jQuery as a project could benefit from just a little tighter coordination of things like documentation, test suite demos, etc. around new releases. It can detract from an otherwise awesome upgrade if some of the bits fall through the cracks.

Nikola,

I agree that jQuery 1.3 is a major step forward for the library. In this post, I was trying to constructively point out that — contrary to what you say — the new library was not rolled out with all of the appropriate pieces of upgraded documentation in place. It’s a minor point, and one that — looking back on it — probably could have been said in a less alarmist way with equal or greater effect.

In any case, thanks for your comments.

-Andrew

I recently scoped and prototyped a new app using jQuery 1.2.6. It’s a niche app and a minimum browser spec is required to use the app. It’s not a step I took lightly but when the development team is two people, having to test the client-side in many and older browsers takes a ridiculous amount of time away from delivering actual functionality. The app’s target users should have few issues upgrading to a supported browser version. The bonus is that all those users that upgrade each add a tiny amount of weight to the argument that old browsers should no longer be supported.

I’ve also worked where the opposite is true and supporting those older browsers is not only no fun, the UI/UX tends to lowest common denominator. I think the more opportunities to encourage users to upgrade their browser the better and using jQuery (where appropriate) to help provide a compelling user experience is part of that process.

Something we’re excited about is today’s release of jQuery 1.3, which includes the wicked-fast new selector engine, Sizzle.

We’re looking forward to integrating jQuery 1.3 into Domainr, particularly the new live event delegation feature—allowing us to dump cumbersome post-AJAX fixup code.

Congrats to John Resig and the rest of the jQuery team!

Comments close automatically after 15 days.
Still have something to say? Drop me a line!