Skip to main content

Bug Tracker

Side navigation

#10589 closed enhancement (fixed)

Opened October 26, 2011 08:53PM UTC

Closed June 11, 2012 09:21PM UTC

Remove $.fn.data("events")

Reported by: gnarf Owned by: dmethvin
Priority: high Milestone: 1.8
Component: data Version: git
Keywords: 1.8-discuss debug Cc:
Blocked by: Blocking:
Description

This was discussed when we talked about removing the

 .data("events") 
code. We would like to discourage/deprecate this usage, and perhaps release something like
 $.fn.events() 
to replace it in a "debugging extension".

I'd like to suggest that we deprecate the current usage as soon as possible.

Attachments (0)
Change History (14)

Changed October 26, 2011 08:53PM UTC by gnarf comment:1

component: unfileddata
keywords: → 1.8-discuss debug
milestone: None1.8
status: newopen

Changed October 26, 2011 09:00PM UTC by gnarf comment:2

description: This was discussed when we talked about removing the {{{ .data("events") }}} code. We would like to discourage/deprecate this usage, and perhaps release something like $.fn.events() to replace it in a "debugging extension". \ \ I'd like to suggest that we deprecate the current usage as soon as possible.This was discussed when we talked about removing the {{{ .data("events") }}} code. We would like to discourage/deprecate this usage, and perhaps release something like {{{ $.fn.events() }}} to replace it in a "debugging extension". \ \ I'd like to suggest that we deprecate the current usage as soon as possible.

Changed October 26, 2011 09:23PM UTC by dcherman comment:3

I use it for debugging, or at times for re-ordering already bound events if I need to bind something but have it fire first like this:

el.data( 'events' ).keydown.unshift( el.data( 'events' ).keydown.pop() );

Changed October 26, 2011 09:28PM UTC by dcherman comment:4

_comment0: Thought I just had - what about maintaining a list of bound handlers on the element's event fn? \ \ Something like el.keydown.handlers = [ function() { ... }, $.noop, somefunc ]1319664890139626

Thought I just had - what about maintaining a list of bound handlers on the element's event fn?

Something like el.keydown.getHandlers() returns [ function() { ... }, $.noop, somefunc ]

Changed October 26, 2011 10:49PM UTC by rwaldron comment:5

priority: undecidedhigh

Changed October 27, 2011 07:13PM UTC by dmethvin comment:6

Given that I changed some of the internal structure of the events object during 1.7, several of the plugins that dig into the information in detail don't work properly anyway. I didn't realize this until we started the discussion yesterday and some people joined that thread. However, I have yet to be convinced that the people using "events" that way should be using them.

https://github.com/jquery/jquery/commit/24e416dca36df4b182a612dba37f8b6cdaa25916

The data isn't being hidden, just moved to its rightful place in the internal data object so that user data named "events" won't clobber it. So we aren't preventing anyone from being able to inspect events for debugging purposes, which seems to be the most common need.

Once we come to a resolution on this and other 1.8 initiatives I'd suggest a blog post with the results so we can prepare people for the move from jQuery(elem, "events") to jQuery._data(elem, "events") with the warning that it is not a public interface and subject to change.

Changed December 13, 2011 02:57PM UTC by jzaefferer comment:7

description: This was discussed when we talked about removing the {{{ .data("events") }}} code. We would like to discourage/deprecate this usage, and perhaps release something like {{{ $.fn.events() }}} to replace it in a "debugging extension". \ \ I'd like to suggest that we deprecate the current usage as soon as possible.This was discussed when we talked about removing the {{{ .data("events") }}} code. We would like to discourage/deprecate this usage, and perhaps release something like {{{ $.fn.events() }}} to replace it in a "debugging extension".\ \ I'd like to suggest that we deprecate the current usage as soon as possible.

+1

Changed December 13, 2011 04:20PM UTC by jaubourg comment:8

+1

Changed December 13, 2011 06:10PM UTC by dmethvin comment:9

description: This was discussed when we talked about removing the {{{ .data("events") }}} code. We would like to discourage/deprecate this usage, and perhaps release something like {{{ $.fn.events() }}} to replace it in a "debugging extension".\ \ I'd like to suggest that we deprecate the current usage as soon as possible.This was discussed when we talked about removing the {{{ .data("events") }}} code. We would like to discourage/deprecate this usage, and perhaps release something like {{{ $.fn.events() }}} to replace it in a "debugging extension". \ \ I'd like to suggest that we deprecate the current usage as soon as possible.

+1, For access, let's stay with jQuery._data(elem, "events") so people understand it's not a documented interface.

Changed December 14, 2011 01:18PM UTC by mikesherov comment:10

description: This was discussed when we talked about removing the {{{ .data("events") }}} code. We would like to discourage/deprecate this usage, and perhaps release something like {{{ $.fn.events() }}} to replace it in a "debugging extension". \ \ I'd like to suggest that we deprecate the current usage as soon as possible.This was discussed when we talked about removing the {{{ .data("events") }}} code. We would like to discourage/deprecate this usage, and perhaps release something like {{{ $.fn.events() }}} to replace it in a "debugging extension".\ \ I'd like to suggest that we deprecate the current usage as soon as possible.

+1

Changed December 14, 2011 04:08PM UTC by timmywil comment:11

+1

Changed December 19, 2011 05:33PM UTC by rwaldron comment:12

description: This was discussed when we talked about removing the {{{ .data("events") }}} code. We would like to discourage/deprecate this usage, and perhaps release something like {{{ $.fn.events() }}} to replace it in a "debugging extension".\ \ I'd like to suggest that we deprecate the current usage as soon as possible.This was discussed when we talked about removing the {{{ .data("events") }}} code. We would like to discourage/deprecate this usage, and perhaps release something like {{{ $.fn.events() }}} to replace it in a "debugging extension". \ \ I'd like to suggest that we deprecate the current usage as soon as possible.

+1

Changed May 18, 2012 02:00AM UTC by dmethvin comment:13

owner: → dmethvin
status: openassigned
summary: Deprecate $.fn.data("events") - Replace with debugging extensionRemove $.fn.data("events")

Changed June 11, 2012 09:21PM UTC by Dave Methvin comment:14

resolution: → fixed
status: assignedclosed

Fix #10589. Remove deprecated $.fn.data("events") special case.

No unit tests were harmed in the removal of this hack.

Changeset: 9e0c056171d1a5cac407f8fedbf926be91eaba1a