Closed
Bug 996596
Opened 11 years ago
Closed 7 years ago
Convert devtools import blocks to use "require" instead of Cu.import
Categories
(DevTools :: General, defect)
DevTools
General
Tracking
(Not tracked)
RESOLVED
DUPLICATE
of bug 1182194
People
(Reporter: Paolo, Unassigned)
References
(Blocks 1 open bug)
Details
As a follow-up to bug 995170 comment 8, this bug is about converting existing devtools code to use "require" instead of Cu.import as far as possible.
This can also be a good opportunity to unify everything to use the same pattern, with a global "require" function instead of "devtools.require", and consistent spacing and styling.
Comment 1•11 years ago
|
||
Thanks for raising this bug Paolo.
Some related things - if I was hacking on this then I'd do these at the same time, but it's up to whoever does the work:
* Convert from jsm to js (that way no imports are needed for 'require' to exist)
* Add "use strict" were it doesn't break anything
* Remove emacs/vi modelines
* Remove Makefiles (they often disappear as a result of removing the last jsm in a directory)
When we complete the transition to *.js, then our developer tools will be dynamically reloadable.
Comment 2•11 years ago
|
||
(In reply to :Paolo Amadini from comment #0)
>
> This can also be a good opportunity to unify everything to use the same
> pattern, with a global "require" function instead of "devtools.require", and
> consistent spacing and styling.
Yes please!
See Also: → 1168338
Comment 3•10 years ago
|
||
We could do with a decent way to do this lazily:
const { x, y, z } = Cu.import("...");
Updated•8 years ago
|
Blocks: devtools-debtools
Comment 4•8 years ago
|
||
ES6 modules might be a better bet in the long run.
This bug could become a dependency to bug 1308512 for the devtools code.
Updated•7 years ago
|
Blocks: dt-polish-debt
Updated•7 years ago
|
No longer blocks: devtools-debtools
Comment 5•7 years ago
|
||
In order to get rid of Cu.import, we have to convert the few .jsm files we still have in devtools to .js.
Bug 1182194 already tracks this progress and the few jsm already converted.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → DUPLICATE
Updated•7 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•