Expose Component.* symbols as globals to all DevTools modules
Categories
(DevTools :: General, task)
Tracking
(firefox107 fixed)
Tracking | Status | |
---|---|---|
firefox107 | --- | fixed |
People
(Reporter: ochameau, Assigned: ochameau)
References
(Blocks 1 open bug)
Details
Attachments
(4 files, 1 obsolete file)
In order to help the migration of the DevTools codebase to ES Modules (bug 1525652), we should be exposing Components, Cc, Ci, Cu and Cr to all modules.
This symbol is being made available to all privileged ES Modules.
For some, any of these symbols should be fetch from the require("chrome") module.
Assignee | ||
Comment 1•2 years ago
|
||
That, instead of involving the "debuggerSandbox", which is only meant
for exposing the "Debugger" symbol.
Assignee | ||
Comment 2•2 years ago
|
||
This will actually make commonjs module behave like JSM/ESM.
Where you have access to Components, Cc, Ci, Cu and Cr as globals.
This patch is based on the usage of Sandbox's wantComponents,
which will expose all these globals for us.
Then, I'm handling the special cases of Services and ChromeWorker,
which have nothing to do with Components.* APIs.
Assignee | ||
Comment 3•2 years ago
|
||
This will help transition to ES Modules as we won't be able to expose a magic "chrome" ESM.
Also, most of these symbols are exposed as global already.
All but:
components
which isComponents
,CC
which isComponents.Constructor
,Cm
which isComponents.manager
.
$ sed -ie "/require(.chrome.)/d" $(git grep -l 'require("chrome")' devtools/)
- manual edits for all three exceptions
Updated•2 years ago
|
Assignee | ||
Comment 4•2 years ago
|
||
This symbol is specific to documents and isn't available in JSM/ESM.
So it will be best to keep it manually crafter from the modules.
It appears that only async-storage depends on the overloaded indexedDB
object created by devtools/shared/indexed-db.
Assignee | ||
Comment 5•2 years ago
|
||
This symbol is specific to documents and isn't available in JSM/ESM.
So it will be best to keep it manually crafter from the modules.
It appears that only async-storage depends on the overloaded indexedDB
object created by devtools/shared/indexed-db.
Updated•2 years ago
|
Comment 7•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/81d9c294af32
https://hg.mozilla.org/mozilla-central/rev/05daf99babf4
https://hg.mozilla.org/mozilla-central/rev/ad401d087fa0
https://hg.mozilla.org/mozilla-central/rev/24bfc3b32e39
Description
•