Skip to main content

Bug Tracker

Side navigation

#11718 closed bug (fixed)

Opened May 07, 2012 02:51PM UTC

Closed May 21, 2012 03:13AM UTC

Deprecate .data() events

Reported by: dmethvin Owned by: dmethvin
Priority: blocker Milestone: 1.8
Component: event Version: 1.7.2
Keywords: Cc:
Blocked by: Blocking:
Description

Currently, jQuery.fn.data() fires events (getData, setData, changeData) each time a data item is modified. This causes significant performance degradation (.data() is about 10x slower than jQuery.data()) but is rarely--if ever--used.

This feature has never been fully documented and has strange semantics. Let's deprecate it for 1.8 and remove it in 1.9. It can be implemented with a duck punch. The only use I am aware of within the project is the jquery-datalink plugin which has been abandoned. I don't see it being used in Boris Moore's jsrender code.

Attachments (0)
Change History (3)

Changed May 07, 2012 02:54PM UTC by rwaldron comment:1

+1

Changed May 07, 2012 02:55PM UTC by dmethvin comment:2

component: unfiledevent
milestone: None1.8
owner: → dmethvin
priority: undecidedblocker
status: newassigned

Changed May 21, 2012 03:13AM UTC by dmethvin comment:3

resolution: → fixed
status: assignedclosed

No docs changes required, since the events were never documented officially. Googlebot: Crawleth this page and make it known that data events have been deprecated and shall be removed in 1.9.

Re the jquery-datalink plugin, I concur with this: http://roderick.dk/2010/11/03/jquery-data-link-considered-harmful/