Closed Bug 1276341 Opened 5 years ago Closed 5 years ago

replace uses of Cu.import


(DevTools :: Framework, enhancement, P1)



(firefox50 fixed)

Firefox 50
50.4 - Aug 1
Tracking Status
firefox50 --- fixed


(Reporter: tromey, Assigned: tromey)



(Whiteboard: [devtools-html])


(2 files)

The uses of Cu.import in the inspector and its dependencies will have to
be replaced (probably with "require") as part of the de-chrome-ification project.
Probably this should be broken down by import target.
There are a lot of imports, even excluding tests and the server:

pokyo. git grep Cu.import -- devtools/|grep -v /server |grep -v /test |wc -l

On irc :jryans pointed out that event-emitter.js imports are readily done:
Whiteboard: [devtools-html] → [devtools-html] [triage]
Comment on attachment 8758724 [details]
Bug 1276341 - remove some misleading import comments;

Wrong bug.
Attachment #8758724 - Attachment is obsolete: true
Attachment #8758724 - Flags: review?(jryans)
Priority: -- → P2
Whiteboard: [devtools-html] [triage] → [devtools-html]
Flags: qe-verify-
Let's not forget lazyImporter as well.
Assignee: nobody → ttromey
Iteration: --- → 50.3 - Jul 18
Priority: P2 → P1
Iteration: 50.3 - Jul 18 → 50.4 - Aug 1
It turns out that there are only a few imports that are directly addressable.
The others have to be part of some other bug; for example actor-registry.js is
using Cu.import, but I think that one (IIUC, which I'm not sure I do) probably
has to be address with some other transport changes.

I'll upload a patch for the few I found.
Review commit:
See other reviews:
Attachment #8758724 - Attachment description: MozReview Request: Bug 1276341 - rename promise_defer.js to defer.js; r?jryans → Bug 1276341 - remove some misleading import comments;
Attachment #8758724 - Attachment is obsolete: false
Attachment #8773013 - Flags: review?(jryans)
Attachment #8758724 - Flags: review?(jryans)
Comment on attachment 8758724 [details]
Bug 1276341 - remove some misleading import comments;

Review request updated; see interdiff:
Comment on attachment 8773013 [details]
Bug 1276341 - don't use Cu.import for event-emitter.js;

Looks good!  I was thinking there would be more to do here, but I guess the others are in test files or they are imports of JSMs which probably need a focus of their own, since they either don't work in content or at least contain more imports.
Attachment #8773013 - Flags: review?(jryans) → review+
Pushed by
remove some misleading import comments; r=jryans
don't use Cu.import for event-emitter.js; r=jryans
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 50
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.