Bug Tracker

Opened 6 years ago

Closed 6 years ago

Last modified 5 years ago

#8792 closed enhancement (wontfix)

Attach data objects directly to DOM elements

Reported by: dmethvin Owned by:
Priority: blocker Milestone: 1.7
Component: data Version: 1.5.2
Keywords: 1.7-discuss Cc:
Blocked by: Blocking:

Description (last modified by ajpiano)

Only IE6 and IE7 are unable to garbage-collect JavaScript objects, I think the other browsers can handle cleanup themselves.

Switch to direct attach for those cases. This means we don't need to clean up data and events when elements are removed from the DOM, should be a perf boost.

This will require a change to global events since there will jQuery.cache will no longer contain all data for all objects and jQuery.event.trigger can't sneak a peek into the cache to trigger them.

Need a feature detect I can use to determine whether it's safe to attach data to a DOM object.

Change History (15)

comment:1 Changed 6 years ago by timmywil

Component: unfiledevent
Milestone: 1.next1.6
Owner: set to dmethvin
Priority: undecidedhigh
Status: newassigned

comment:2 Changed 6 years ago by dmethvin

Milestone: 1.61.7
Priority: highlow

Deferred for discussion in 1.7; due to the remaining cases that need to be handled (i.e., removing special events and triggering global events) it may not offer enough benefits to be worthwhile.

comment:3 Changed 6 years ago by john

Milestone: 1.71.next
Owner: dmethvin deleted
Status: assignedopen

Let's discuss this in the roadmap meeting.

comment:4 Changed 6 years ago by john

Keywords: 1.7-discuss added

Nominating ticket for 1.7 discussion.

comment:6 Changed 6 years ago by Rick Waldron


comment:7 Changed 6 years ago by jaubourg

-1, I don't see any possible feature test, hence why I'll vote negatively

comment:8 Changed 6 years ago by Rick Waldron

I might be way off here but if we know that UAs that support deleting expandos are safe, then could we assume jQuery.support.deleteExpando is safe way to determine which browser to use internal cache (false) or attach directly (true)?

comment:9 Changed 6 years ago by Rick Waldron

Component: eventdata

comment:10 Changed 6 years ago by timmywil

Description: modified (diff)


comment:11 Changed 6 years ago by dmethvin

Description: modified (diff)

-1, Based on my previous exploration, I don't think this will have a payback until we eliminate global events and possibly until IE6/7 die.

comment:12 Changed 6 years ago by john

Description: modified (diff)

+1, I think this is fine to push for - global events can be tracked/handled separately (easily, even). And we can use deleteExpando to feature test it. I'm for it.

comment:13 Changed 6 years ago by scottgonzalez

+1, if we've got a good way to detect and we get a perf boost, why not?

comment:14 Changed 6 years ago by ajpiano

Description: modified (diff)

+0, This was Dave's idea, and he seems to have done the exploration proving that it seems unviable - but if we're willing to make the resulting architecture changes required, then it seems workable

comment:15 Changed 6 years ago by dmethvin

Milestone: 1.next1.7
Priority: lowblocker

comment:16 Changed 6 years ago by john

Resolution: wontfix
Status: openclosed

Closing until we remove global events.

Note: See TracTickets for help on using tickets.