Closed Bug 1384546 Opened 3 years ago Closed 2 years ago

[meta] Remove the legacy EventEmitter from DevTools


(DevTools :: Framework, enhancement, P2)



(Not tracked)



(Reporter: zer0, Unassigned)



(Keywords: meta)

In bug 1381542 we introduced a new Event Emitter, while we're keeping the previous one for a smoother transition.

This bug is intended for replacing the old EventEmitter with the new one.
Keywords: meta
Priority: -- → P2
The old event emitter is widely used in devtools, and we need to replace with the new ones.

However, that could result in a huge patch, since we can't change the event emitter per file / component. Assuming we have two objects, FOO and BAR. They're different component in different modules. They both use the old event emitter:

   // from FOO.js

   // from BAR.js
   const { FOO } = require("Foo");
   FOO.on("foo", doSomething);

So far so good. But if we change FOO for example (or BAR) with the new event emitter, nothing will works anymore, since the storage for the listeners for FOO won't be the same of its consumers, like BAR.

And in some cases the ramification could be not this obvious. And searching for them across the entire codebase could be time-consuming.

We have to keep in mind that when we're working on replacing the old event emitter.

One approach could be also refactoring the old event emitter, to keep the same API it has at the moment, but actually wrap internally the new event emitter; or maybe expose temporary the new event emitter's symbol for listeners, to the old event emitter.
In that way, the storage for listeners for both objects, would be the same, and we can change component by component. Even with the new event emitter differences, it might be a path worth to investigate, this one.
Summary: Remove the legacy EventEmitter from DevTools → [meta] Remove the legacy EventEmitter from DevTools
Depends on: 1444073
Depends on: 1446941
Depends on: 1447666
Depends on: 1447672
Depends on: 1447702
Depends on: 1447709
Depends on: 1447715
Depends on: 1449170
Depends on: 1449931
Depends on: 1449993
Depends on: 1450193
Depends on: 1450195
Depends on: 1450982
Duplicate of this bug: 1382575
Duplicate of this bug: 1382578
This is done!
Closed: 2 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1382580
Duplicate of this bug: 1402840
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.