jQuery.live / jQuery.fn.live Discussion

jQuery.live / jQuery.fn.live Discussion

Update (02/01):

Given the amount of attention that this post has received, it is probably beneficial to provide some sort of a general synopsis before I mark it as answered.  This is definitely a polarizing topic, and the discussion really took on a life of its own.

The developers have all been very responsive to this issue, and have listened to the feedback posted here and in various other locations.  I don't want to extend any promises that haven't been made by the core devs, so I won't expand any more than to say that relevant API changes are under consideration.  For now, I think that this particular topic has served its purpose - thanks for the great feedback everyone.




Update(02/02):

Oops - spoke too soon.  John has landed $().delegate: http://forum.jquery.com/topic/jquery-live-jquery-fn-live-discussion#14737000000680478




Original Post:

This is somewhat of a long-running discussion, but I just wanted to create a fresh "home" for a conversation about a jQuery.live implementation (in addition to jQuery.fn.live).  I specifically want to see what the majority opinion of the developers and community are, since this discussion has previously been spread out all over the place.


For those not familiar with the topic, the general issue is whether or not querying for unnecessary elements when registering live events is an anti-pattern of sorts, and whether or not it is severe enough to warrant an addition to the API.


For a more detailed description, feel free to check out my feature enhancement ticket here:
http://dev.jquery.com/ticket/5877

...or this post by Zach Leatherman:
http://www.zachleat.com/web/2009/05/08/performance-caveat-with-jquery-selectors-and-live-events/


Pardon the following link-flooding, but I would like to demonstrate what I percieve to be a growing awareness, and potential concern, regarding the topic:
http://forum.jquery.com/topic/live-events
http://forum.jquery.com/topic/will-the-live-method-be-improved-in-1-4
http://forum.jquery.com/topic/selectors-in-live-method
http://forum.jquery.com/topic/live-types-of-events-number-of-events-and-more
http://dev.jquery.com/ticket/5425
http://github.com/furf/jquery-live






I have created a sample jQuery.live implementation that can be found here (including unit tests): http://github.com/jmar777/jquery/commit/4c5380066a7dcb893e07358ac4f04b591400dd01


Edit: For a good look at the other side of this discussion, see this well articulated post by Paul Irish: http://paulirish.com/2010/on-jquery-live/