Quantcast
Channel: Position Absolute
Viewing all articles
Browse latest Browse all 42

The jQuery 1.9 & 2.0 upgrade awkwardness

$
0
0

In a recent study it has been said that about 50% of major websites use jQuery. It has become omnipresent and you can actually find job listings that does not list javascript as a skill but list jQuery.

You don’t have to search far to understand why. Using jQuery is the easiest way to add interactions to a website. The api is intuitive, easy to use, the documentation is solid, it works cross-browser & that api very rarely changes.

Or was.

2.0 will be a major rewrite removing support for ie8 and earlier releases, it also removes a bunch of deprecated methods. 1.9 already started the ball removing a lot of stuff in preparation of 2.0, including the live api, and that made a bit of drama. Of course they created tools to make it has painless has possible to migrate but the facts remains, jQuery will change a lot in 2013.

One of the heartbreaker for me is how they now handle HTML strings vs selectors in 1.9. I won’t go in details but here’s how I need to handle underscore templates now because some of my templates start with a space or tab:

$( $.parseHTML( _.template($(“#content”).html(),{})));

A small anecdote

Less than one year ago I had to take a skill test in a major firm in Montreal. In it, some jQuery tidbits, one of those asked me which of these methods I should use in certain conditions, between live(), delegate() and bind(). Nothing on the unified on() method. Trying not to be an ass I added some explications on the on() api instead of the choices I had.

But that made me think about decapreated jQuery methods and the users expectations of support from the jQuery team. Most web devs I know that are not passionate about front-end still have a very good knowledge of jQuery, and most of them expect two things. First is it’s not going to change and secondly it’s compatible cross-browser.

In the end..

The biggest reason why jQuery became popular was that it had an unified way to make work complex solutions on ie6, ie7 & firefox.

We are losing a bit of both those points that the average user expects from jQuery and that makes me feel awkward about the new releases. Not to say jQuery should not move forward, my feeling is probably wrong but it’s still the feeling I got right now.


Viewing all articles
Browse latest Browse all 42

Trending Articles