[meta] Add library support to visual events: jQuery, Prototype, YUI, Mootools, React, Ember and Angular

RESOLVED WONTFIX

Status

defect
RESOLVED WONTFIX
5 years ago
11 months ago

People

(Reporter: miker, Assigned: miker)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Comment hidden (obsolete)
Comment hidden (obsolete)
Comment hidden (obsolete)
Comment hidden (obsolete)
Re-purposing this as a meta bug.

We have decided to implement the following:
1. jQuery: bug 1044932
2. Prototype: bug 1044933
3. YUI: bug 1044935
4. Mootools: bug 1044936
5. React: bug 1044939
6. Ember: bug 1044942
7. Angular: bug 1044944
Summary: Add library support to visual events: Eventi, ExtJs, Glow, jQuery, jsBase, Mootools, Prototype and YUI → [meta] Add library support to visual events: jQuery, Prototype, YUI, Mootools, React, Ember and Angular

Comment 5

5 years ago
In case it's helpful, a description of we do this in Firebug:

jQuery listeners are special-cased - we limit support to jQuery 1.4+ and use `jq._data(target, "events")`, where `jq` is taken from the event listener function's closure. To support pages that register all their listeners with `$(document).on(..., <selector>, ...)` we also show selectors for all listeners that have them (and strike out non-applying listeners, but that doesn't carry over well to a popup-based UI).

For all other libraries, we pattern-match the functions against "<fn>.(call|apply)" and show <fn>. This has the advantages of working almost everywhere (sometimes even on non-library code) and being easy to maintain, and the disadvantages of being harder to explain and sometimes coming out wrong.

(Implementation at https://github.com/firebug/firebug/blob/fae96c0d86713324ec94883766abc25a5060459e/extension/content/firebug/html/eventsPanel.js#L214-L343, feel free to steal from it if you want to.)

Comment 6

5 years ago
What about backbone?
Flags: needinfo?(mratcliffe)
(In reply to Al Cud from comment #6)
> What about backbone?

I think the correct approach from here on out is to encourage people to implement support in extensions for more niche libraries ( and let's be honest - every library is niche compared to jQuery )
(In reply to Al Cud from comment #6)
> What about backbone?

Doesn't backbone use jQuery by default for event binding?  As such, I would expect it to be supported already.
Flags: needinfo?(mratcliffe)

Comment 9

5 years ago
(In reply to Brian Grinstead [:bgrins] from comment #8)
> (In reply to Al Cud from comment #6)
> > What about backbone?
> 
> Doesn't backbone use jQuery by default for event binding?  As such, I would
> expect it to be supported already.

https://github.com/jashkenas/backbone/wiki/Using-Backbone-without-jQuery
(In reply to Al Cud from comment #9)
> (In reply to Brian Grinstead [:bgrins] from comment #8)
> > (In reply to Al Cud from comment #6)
> > > What about backbone?
> > 
> > Doesn't backbone use jQuery by default for event binding?  As such, I would
> > expect it to be supported already.
> 
> https://github.com/jashkenas/backbone/wiki/Using-Backbone-without-jQuery

So looks like you can swap jQuery out with another library for event binding, etc.  But since Backbone doesn't provide any event binding itself, we would need extension support for whichever libraries were popular replacements (it looks like the only browser based libraries mentioned in that doc are D3 and a reference "NativeView" that just calls addEventListener, etc).
Filter on 1ff0543e-b501-4893-a72b-e4773c01e655

We decided to only support jQuery for now.
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → WONTFIX

Updated

11 months ago
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.