Closed Bug 593737 Opened 11 years ago Closed 11 years ago

change event-generating high-level modules to use EventEmitter event registration model

Categories

(Add-on SDK Graveyard :: General, defect, P1)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: myk, Assigned: irakli)

References

Details

Attachments

(1 file, 1 obsolete file)

Bug 588732 implements the EventEmitter model for event registration.  There should be one good way to register events in the SDK, so all event-generating high-level modules should be changed to use the EventEmitter model.

The implementation in bug 588732 relies on Traits, and it's unclear how usable it is with modules that use lexical scoping to hide private properties.  Nevertheless, I highly recommend that whoever takes responsibility for this bug implement the minimal changes necessary to switch modules to the EventEmitter model.

In other words, if there's a way to make the changes that doesn't require switching all those modules from lexical scope implementations to Traits implementations, we should use that way.  Even if we eventually change to using Traits everywhere, now is not the time to be doing so, as we have more than enough work to do already to get 0.8 released as our first beta.

Irakli: do you have a sense of what minimal changes are required to switch existing high-level modules using lexical scoping to the EventEmitter model?
gist containing diff with changes: http://gist.github.com/566773

While changes here are pretty trivial here there are cases like 'tabs' where it will be more complicated, but that's a different issue, caused by the fact that code calling listeners is relying on a fact that listeners can be enumerated outside of the constructors lexical scope, which I believe had to be addressed by bug 588250 anyway.

Please also keep in mind that code is just for demo and it was not tested, it may be missing.
please ignore my last comment I meant to attach patch to the different bug.
Attachment #472693 - Flags: review?(myk)
Irakli: is this something you could take on after finishing the ContentSymbiont work?  It's necessary in order for us to declare a beta, which makes it a high priority (more important than Sidebar).

Note: the key here is to make the minimal changes required to get high-level modules using EventEmitter-style event listener registration.  This is not the time to be rewriting all those modules to work as Traits.
Priority: P2 → P1
Assignee: nobody → rFobic
All my patches are submitted for review so I can work on this before I'll get feedback on ContentSymbiont or PageMod. Can you plese list all the modules that will need to change.
No longer depends on: 598909
See Also: → 598987
The Add-on SDK is no longer a Mozilla Labs experiment and has become a big enough project to warrant its own Bugzilla product, so the "Add-on SDK" product has been created for it, and I am moving its bugs to that product.

To filter bugmail related to this change, filter on the word "looptid".
Component: Jetpack SDK → General
Product: Mozilla Labs → Add-on SDK
QA Contact: jetpack-sdk → general
Version: Trunk → unspecified
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.