

JQuery 1.7 Released - dmethvin
http://blog.jquery.com/2011/11/03/jquery-1-7-released/

======
vessenes
My favorite part of the release notes: "Despite jQuery.isNaN() being
undocumented, several projects on Github were using it. We have contacted them
and asked that they use jQuery.isNumeric() or some other solution."

This is an excellent reminder of how much things have changed in the last 10
years in our space; a popular tools vendor can go query a massive source code
repository and reach out proactively for transitioning deprecated functions.

Kudos to the jQuery team for the great attitude; and of course all hail
github, but they know I feel that way since they charge my card every month.
:)

~~~
luriel
This is one of the reasons why Google killing Code Search is so sad.

~~~
Flenser
_"To optimize the code for the most commonly used forms of selectors, we
examined a cross-section of code from Google Codesearch."_

I assume they found those github projects using code search. Code search may
not be used a lot, but the people and projects using it have a large impact.
Is there any way we can convince Google it's worth keeping it available?

------
untog
_There is one ambiguous case: If the data argument is a string, you must
provide either a selector string or null so that the data isn’t mistaken as a
selector. Pass an object for data and you’ll never have to worry about special
cases._

I'm being picky I know, but wouldn't it just be easier to use something like:

    
    
        $("#div").on("click", {
          selector: "span",
          data: "blahblah",
          handler: function()
        });
    

Perhaps it's far too verbose, now that I've typed it out. But it just seems
like it would do a good job of removing ambiguities like this.

~~~
dmethvin
The data feature isn't used that frequently, and when it is the best way to
use it is by passing an object anyway. So although it's mentioned it is likely
to be very uncommon.

~~~
robin_reala
I use event data a lot, but I didn’t even realise you could pass a string.

~~~
dmethvin
Haha, well it has always been documented to be an Object but turns out that
there are a lot of people who don't read the documentation and pass strings or
numbers. So rather than break their code in 1.7 we decided to document the
fact that plain types can be used if you're careful.

------
drewda
Can someone describe to me how these jQuery releases make their way into Rails
3.1 land? Does the maintainer of <https://github.com/rails/jquery-rails> do an
update and then it's up to us Rails users to execute a "bundle update"?

~~~
ByteMuse
It looks like jQuery versions get updated occasionally in that repo, but
you'll have to check and see when 1.7 gets put in.

My recommendation would be to maintain dependency versions yourself, i.e.
download the version of jQuery you want to use and _//= require jquery_ in
application.js - then grab a new version of jQuery whenever you want it
updated

~~~
evanwalsh
I submitted a pull request with the update to 1.7, so hopefully it'll get
released officially soon.

------
bad_user
One thing I don't like about jQuery's evolution is the size. This version
weights at 92K minified / 33K gzipped, which for mobile phones is a PITA.

~~~
alastair
Why isn't there a tool that analyzes which functions / features of jQuery your
project is using and generates a smaller library with only the stuff you need?

I'm not really a developer so ignore if that's not possible / makes no sense.

~~~
JoachimSchipper
Google's Closure compiler can apparently do that.

~~~
JonnieCache
Doesn't work on jquery. To use that functionality of the closure compiler
without breaking your code, the source has to be annotated in a special way,
or it has to be incredibly simple.

~~~
JoachimSchipper
I don't know much about this, but do you mean
[http://code.google.com/p/closure-
compiler/source/browse/trun...](http://code.google.com/p/closure-
compiler/source/browse/trunk/contrib/externs) ? That suggests that it will be
available at some point, at least...

------
kenjackson
Is there a good set of jQuery tutorials that uses 1.7 (so you don't learn non-
best practices)? I know it was just released, but these things are often built
along with the development.

~~~
dmethvin
The docs site has a "What's new in jQuery 1.7" section that might help. As far
as what is non-best practice, we'll be covering some of that in a blog post
next week so stay tuned.

------
huskyr
I'm really excited about being able to load jQuery as an AMD module. This
means you can load jQuery with RequireJS and write nice, modular code. I
highly recommend anyone doing large-scale web projects to use Require, it
changed the way how i write Javascript.

------
suyash
Very interesting, the chart show significant performance gain in IE 7, 8 etc
compared to the previous jQuery version. Congratulations.

------
clarkmoody
I can't wait for the Closure Compiler extern file for this new version!

------
brunnsbe
It's always nice with new features and enhancements but some bugs should first
be fixed, like e.g. this one (i cannot update my code to a version higher than
1.5.x due to customers still using IE7): <http://bugs.jquery.com/ticket/9646>

~~~
dmethvin
We closed a _huge_ number of bugs in 1.7, but yes there are about 100 open
bugs plus another roughly 100 more that are either feature requests or
unverified. For a project the size of jQuery and considering the installed
base, I think that is pretty good.

And the way these bugs get fixed is by someone spending a lot of time to track
them down. As the 1.7 blog post mentions, we definitely welcome any help we
can get. We are all volunteers so we don't have the time to quickly track down
and fix every bug.

In the triage process we put priority on fixing the worst bugs that affect the
most people. I personally triaged both #9646 and #8205 so we could mark them
as verified, but tracking down and solving older-IE problems can be torture
given the crude stone debugging tools available in those environments. If you
have a high threshold for pain, we could certainly use your help.

------
weixiyen
Anyone have the documentation on jQuery.Callbacks?

~~~
dmethvin
Sorry, they're the last thing to be done and there was a lot to document
because of its API surface. Addy Osmani did a writeup a few weeks ago:

[http://addyosmani.com/blog/jquery-1-7s-callbacks-feature-
dem...](http://addyosmani.com/blog/jquery-1-7s-callbacks-feature-demystified/)

------
ghc
This makes me so happy. Those of us developing on Chrome 16 have been
suffering through a storm of event.layerX/Y deprecation warnings.

This new release fixes the issue and I can confirm the fix works like a charm.

------
HeroNote
Free jQuery & jQuery UI eBook (Reference Manual) has been updated:

<http://www.heronote.com/files/jQuery.htm>

------
scarmig
The best thing is the new, unified event API.

They've also improved event delegation performance by a factor of 2.

------
vailripper
Love the delegate event performance improvements!

