jQuery 1.4 Alpha 1 Released

Posted on by

Hot off the presses: jQuery 1.4 Alpha 1 is released! This is the first alpha release of jQuery 1.4. The code is stable (passing all tests in all browsers we support), feature-complete (we’re no longer accepting new features for the release), and needs to be tested in live applications.

Grab the code:

NOTE: If you’re using jQuery 1.4a1 and you run into an error please make sure that you’re using the regular version of the code, it’ll make it easier to spot where the error is occurring.

How can I help?

To start, try dropping the above un-minified version of jQuery 1.4a1 into a live application that you’re running. If you hit an exception or some weirdness occurs immediately login to the bug tracker and file a bug. Be sure to mention that you hit the bug in jQuery 1.4a1!

We’ll be closely monitoring the bug reports that come in and will work hard to fix any inconsistencies between jQuery 1.3.2 and jQuery 1.4.

What to Watch For

There are a few areas in jQuery that have seen extensive changes since 1.3.2 was released:

  • live was drastically overhauled and now supports submit, change, mouseenter, mouseleave, focus, and blur events in all browsers. Also now supports context and data.
  • append, prepend, etc. have been heavily optimized.
  • add has been adjusted to always return elements in document order.
  • find, empty, remove, addClass, removeClass, hasClass, attr, and css have been heavily optimized.

Full details concerning the release are forthcoming – for now we just need your help in catch regressions. Some more details can be found in John Resig’s keynote at the 2009 jQuery Conference.

Note: There are still a few open bugs that we will be reviewing before jQuery 1.4 final is released.

With your input we should be able to produce a solid release. Right now we’re looking to push out at least one more alpha before the holiday season and a final release candidate early in January. Thanks for your help in reviewing jQuery 1.4a1!

35 thoughts on “jQuery 1.4 Alpha 1 Released

  1. slowernet on said:

    Too late I guess, but I would love to see $.getJSON() upgraded to support error and beforeSend callbacks, as well as some of the other features of the rest of the $.ajax() methods. This plugin seems to have it right: http://code.google.com/p/jquery-jsonp/

    Thanks for the work on 1.4, all.

  2. Chris Papadopoulos on said:

    I’m most excited about the .live changes. That makes life a lot easier.

    :)

    Thanks to all the contributors.

  3. @slowernet: On the jquery-dev list Julian Aubourg (the author of that plugin in question) has been working on a larger rewrite of jQuery.ajax() that’ll make that possible (while making it much easier to extend jQuery.ajax as a whole). We slated this for post-1.4 because it’s going to be a lot of work and it may cause a lot of code to change – don’t want to break code this close to release. Definitely look for this to land pretty soon after 1.4 comes out, though!
    http://groups.google.com/group/jquery-dev/browse_thread/thread/314deb5ad4056621

  4. @Michael: No major backwards-incompatible changes. I mentioned some of the areas where there could be (unintentional) problems above but if you see anything breaking then we definitely want to fix it right away.

  5. Nosredna on said:

    @slowernet, I agree that jquery-jsonp is a great library for people to use while waiting for the new ajax stuff. I’m using it for a Twitter tool and it’s fantastic.

  6. csulok on said:

    Awesome!

    This new minified jquery 1.4a1 is 88kb, while 1.3.2 was 52kb. If they were minified with the same process, is this 70% size increase (dunno how many gzipped) going to stay for the final version? If not, what is the target size increase?

  7. I find it hard to get all the information I need from a bunch of slides that have limited information. Is there going to be a more detailed document about the changes?

    In the slides, I see mostly speed and code optimizations. 1.3 had a few new features. I personally love this as jQuery is very complete for me. I also like the reduction in size.

    Does this mean jQuery is feature complete? Are there new features planned for a future release?

  8. Excited about this release and your changes to Live. jQuery in general is just such a fantastic tool, has made my life as a web developer/designer so much easier (and quicker). Many thanks :)

  9. @csulok: I’ll quote a comment that I made over at Hacker News addressing the same issue:

    We’re checking out the Closure Compiler – it looks like with the simple compile options on it takes it back down to about 64KB minified, 21.6KB gzipped (a very modest increase over the last release, about 2-3KB).

    (Un)fortunately we’ve been doing a ton of refactoring in this release. The internal structure of jQuery was a bit convoluted and needed some serious love. Needless to say things are much better now: We have cleaner code, consistency in variable names, and a better internal structure. All of this is leading towards a two-prong goal: Cleaner, more readable, code and the ability to dynamically load portions of jQuery, targeted toward mobile development.

    jQuery 1.4 is the first step towards jQuery being the best possible JavaScript library for doing both desktop and mobile development – expect more details here soon.

    @Blaise: There will certainly be features for future editions. For example, for post-1.4 we’re already working on ways of making jQuery work better on mobile devices, making it easier to develop Firefox extensions, and making the core more extensible. There will always be room to grow but you can feel safe knowing that we’re working hard to keep the feature set lean and right.

  10. Devon Govett on said:

    @JohnResig In the code for the jQuery .empty() function, you loop through all of the child elements and remove them. Is there a reason for this? It seems like it would be a lot faster to just set the element’s innerHTML to “” since you are removing all of the children. Just wondering!

  11. @Devon: Mostly because innerHTML can be so buggy – and it doesn’t work across all document types. It’s definitely something that we can check out but it’ll be a bunch of additional logic.

  12. Clumsi on said:

    Thank you for the great work. We are currently testing the neu Version packed with Dean Edwards JS compressor.

  13. Thanks for that great update, specially new live events :)

    Info:
    The regular version has a missing semicolon in line 3691
    filter = style.filter || jQuery.curCSS( elem, ‘filter’ ) || “”;

  14. Devon Govett on said:

    Well you already have the .html() and .text() functions. Isn’t the logic already written in these functions?

  15. @Zanda: A fix for that has already landed in jQuery core – thanks!

    @Devon: That’s a good point – we do have logic for that in .html(), added in just this release. I’ll re-examine the issue to see if it provides any tangible benefits.

  16. pixelboy on said:

    @JohnResig : how can I trust this fresh new release to be used in production ? The ‘change’ cross-browser support is just what I need, but how to be sure it’s not going to make the rest of my dev fall down ? I know it’s alpha release, but changes don’t seem to be dramatically deep, no ?

  17. edouard on said:

    Thank you for the great work. We are currently testing the new version and some ‘parsererrors’ error occurs when loading our web templates via $.ajax in a json datatype, the code with version 1.3.2 works well.

  18. thomtom on said:

    Hello.
    Why do not you implemented the language settings of the browser and the browser Chrome in the object browser like that? :

    language: navigator.language? navigator.language : navigator.userLanguage,
    chrome : /chrome/.test(navigator.userAgent.toLowerCase())

    Thank you in advance

  19. Sean Catchpole on said:

    Congratulations! I look forward to this release and will be investigating the alpha shortly. Lots of good improvements this round.

  20. Vladimir Carrer on said:

    I love that JQuery introduced modularity in the version 1.3 can we see in the future auto compressor and packer for all the modules? So we can choose only the modules that we are using not all the library.

  21. Devon Govett on said:

    @JohnResig I have blogged about my findings with the jQuery.empty function. It turns out that innerHTML (through jQuery 1.4 .html()) is faster than .empty in all browsers except Firefox. But I did come up with a fast method of emptying – in some cases over 10 times faster than the current jQuery version. The fastest way to do this is by shallow cloning the parent and replacing it. Check out the post here: http://devongovett.wordpress.com/2009/12/12/how-to-make-jquery-empty-over-10x-faster/.

  22. Stephen J. Fuhry on said:

    @matt I have noticed no problems with jQuery UI thus far, but I haven’t tested anything extensively.

    if it doesn’t work for you anywhere 1.3.2 does, then it should be reported.

  23. Wow! I am happy about the “context” parameter of the closest()-method. Thank you for adding. This makes writing event handlers easier.

  24. Pingback: jQuery: » jQuery 1.4 Alpha 2 Released