Bug Tracker

Ticket #8792 (closed enhancement: wontfix)

Opened 4 years ago

Last modified 3 years ago

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:
Blocking: Blocked by:

Description (last modified by ajpiano) (diff)

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

comment:1 Changed 4 years ago by timmywil

  • Owner set to dmethvin
  • Priority changed from undecided to high
  • Status changed from new to assigned
  • Component changed from unfiled to event
  • Milestone changed from 1.next to 1.6

comment:2 Changed 4 years ago by dmethvin

  • Priority changed from high to low
  • Milestone changed from 1.6 to 1.7

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 4 years ago by john

  • Owner dmethvin deleted
  • Status changed from assigned to open
  • Milestone changed from 1.7 to 1.next

Let's discuss this in the roadmap meeting.

comment:4 Changed 3 years ago by john

  • Keywords 1.7-discuss added

Nominating ticket for 1.7 discussion.

comment:6 Changed 3 years ago by rwaldron

+1,

comment:7 Changed 3 years ago by jaubourg

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

comment:8 Changed 3 years ago by rwaldron

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 3 years ago by rwaldron

  • Component changed from event to data

comment:10 Changed 3 years ago by timmywil

  • Description modified (diff)

+0,

comment:11 Changed 3 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 3 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 3 years ago by scott.gonzalez

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

comment:14 Changed 3 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 3 years ago by dmethvin

  • Priority changed from low to blocker
  • Milestone changed from 1.next to 1.7

comment:16 Changed 3 years ago by john

  • Status changed from open to closed
  • Resolution set to wontfix

Closing until we remove global events.

Note: See TracTickets for help on using tickets.