Closed
Bug 1245462
Opened 9 years ago
Closed 9 years ago
Remove usages of gDevTools from /devtools/
Categories
(DevTools :: General, defect)
DevTools
General
Tracking
(firefox47 fixed)
RESOLVED
FIXED
Firefox 47
Tracking | Status | |
---|---|---|
firefox47 | --- | fixed |
People
(Reporter: ochameau, Assigned: ochameau)
References
(Blocks 1 open bug)
Details
Attachments
(5 files, 2 obsolete files)
944 bytes,
patch
|
jryans
:
review+
|
Details | Diff | Splinter Review |
50.43 KB,
patch
|
jryans
:
review+
|
Details | Diff | Splinter Review |
2.20 KB,
patch
|
jryans
:
review+
|
Details | Diff | Splinter Review |
4.76 KB,
patch
|
ochameau
:
review+
|
Details | Diff | Splinter Review |
8.04 KB,
patch
|
jryans
:
review+
|
Details | Diff | Splinter Review |
Bug 1188405 is about to split gDevTools.jsm into modules. This is going to help reloading them once the loader reloads.
gDevTools.jsm will stay to keep add-ons working, but we should remove usage of it in our codebase. Instead, we should require the relevant module:
- devtools/client/framework/devtools for gDevTools
- devtools/client/framework/devtools-browser for gDevToolsBrowser
Assignee | ||
Comment 1•9 years ago
|
||
Attachment #8717373 -
Flags: review?(jryans)
Assignee | ||
Comment 2•9 years ago
|
||
Main patch. Convert all Cu.import/require to just require(devtools) or require(devtools-browser).
I removed some lazy getter here and there as devtools is loaded anyway.
I included here only the more obvious replacements and kept more complex scenario for next patches.
Attachment #8717374 -
Flags: review?(jryans)
Assignee | ||
Comment 3•9 years ago
|
||
Here is the complex scenarios, similar to the browser toolbox issue I hit in previous bug.
Assignee | ||
Comment 4•9 years ago
|
||
While working on this, I couldn't resist cleaning up some require/import...
Attachment #8717376 -
Flags: review?(jryans)
Assignee | ||
Comment 5•9 years ago
|
||
toolbox.js was using Cu.import(gDevTools) without second argument
and ended up injecting gDevTools into all next modules being loaded.
Hopefully, fonts.js seems to be the only one relying on this!
Attachment #8717377 -
Flags: review?(jryans)
Assignee | ||
Comment 6•9 years ago
|
||
Try run:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=00c06dcd5628
Green except for bug 1246692's patch included in this run.
Assignee | ||
Updated•9 years ago
|
Attachment #8717375 -
Flags: review?(jryans)
Assignee | ||
Comment 7•9 years ago
|
||
Comment on attachment 8717374 [details] [diff] [review]
Replace usages of gDevTools.jsm by module imports - v1
Review of attachment 8717374 [details] [diff] [review]:
-----------------------------------------------------------------
::: devtools/client/debugger/debugger-commands.js
@@ +7,5 @@
> "use strict";
>
> const { Cc, Ci, Cu } = require("chrome");
> const l10n = require("gcli/l10n");
> +const { gDevTools } = require("devtools/client/framework/devtools");
Should it be lazy?
::: devtools/client/framework/toolbox-options.js
@@ +8,5 @@
> const Services = require("Services");
> const promise = require("promise");
> Cu.import("resource://gre/modules/XPCOMUtils.jsm");
> Cu.import("resource://gre/modules/Task.jsm");
> +const {gDevTools} = require("devtools/client/framework/devtools");
Should it be lazy?
::: devtools/client/inspector/rules/rules.js
@@ +23,5 @@
> const {RuleEditor} =
> require("devtools/client/inspector/rules/views/rule-editor");
> const {createChild, promiseWarn} =
> require("devtools/client/inspector/shared/utils");
> +const {gDevTools} = require("devtools/client/framework/devtools");
Should it be lazy?
::: devtools/client/shared/autocomplete-popup.js
@@ +8,5 @@
> const {Cc, Ci, Cu} = require("chrome");
> const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
>
> loader.lazyImporter(this, "Services", "resource://gre/modules/Services.jsm");
> +const {gDevTools} = require("devtools/client/framework/devtools");
Should it be lazy?
::: devtools/client/shared/theme.js
@@ +11,5 @@
>
> const { Ci, Cu } = require("chrome");
> const { NetUtil } = Cu.import("resource://gre/modules/NetUtil.jsm", {});
> loader.lazyRequireGetter(this, "Services");
> +const { gDevTools } = require("devtools/client/framework/devtools");
Should it be lazy?
::: devtools/client/shared/view-source.js
@@ +8,3 @@
> loader.lazyImporter(this, "Task", "resource://gre/modules/Task.jsm");
>
> +var {gDevTools} = require("devtools/client/framework/devtools");
Should it be lazy?
::: devtools/server/actors/csscoverage.js
@@ +11,5 @@
>
> const events = require("sdk/event/core");
> const protocol = require("devtools/server/protocol");
> const { method, custom, RetVal, Arg } = protocol;
> +const {gDevTools} = require("devtools/client/framework/devtools");
Should it be lazy?
::: devtools/shared/gcli/commands/calllog.js
@@ +6,5 @@
>
> const { Cc, Ci, Cu } = require("chrome");
> const l10n = require("gcli/l10n");
> const gcli = require("gcli/index");
> +const { gDevTools } = require("devtools/client/framework/devtools");
Should it be lazy?
::: devtools/shared/gcli/commands/csscoverage.js
@@ +5,5 @@
> "use strict";
>
> const { Cc, Ci } = require("chrome");
>
> +const { gDevTools } = require("devtools/client/framework/devtools");
Should it be lazy?
Attachment #8717374 -
Flags: review?(jryans) → review-
Attachment #8717373 -
Flags: review?(jryans) → review+
Comment on attachment 8717376 [details] [diff] [review]
Various require/import cleanups - v1
Review of attachment 8717376 [details] [diff] [review]:
-----------------------------------------------------------------
::: devtools/client/responsivedesign/responsivedesign.jsm
@@ -11,5 @@
> -Cu.import("resource://gre/modules/XPCOMUtils.jsm");
> -Cu.import("resource://devtools/client/framework/gDevTools.jsm");
> -Cu.import("resource://devtools/shared/event-emitter.js");
> -Cu.import("resource://devtools/client/shared/widgets/ViewHelpers.jsm");
> -XPCOMUtils.defineLazyModuleGetter(this, "SystemAppProxy",
This is still used in `buildPhoneUI`
::: devtools/client/webconsole/hudservice.js
@@ +20,4 @@
> loader.lazyRequireGetter(this, "gDevTools", "devtools/client/framework/devtools", true);
> loader.lazyRequireGetter(this, "DebuggerServer", "devtools/server/main", true);
> loader.lazyRequireGetter(this, "DebuggerClient", "devtools/shared/client/main", true);
> +loader.lazyRequireGetter(this, "showDoorhanger", "devtools/client/shared/doorhanger");
Needs `true` arg as well?
Attachment #8717376 -
Flags: review?(jryans) → review-
Attachment #8717377 -
Flags: review?(jryans) → review+
Comment on attachment 8717375 [details] [diff] [review]
Non naive replacements of gDevTools.jsm - v1
Review of attachment 8717375 [details] [diff] [review]:
-----------------------------------------------------------------
::: devtools/client/devtools-clhandler.js
@@ +54,5 @@
> + // Ensure loading main devtools module that hooks up into browser UI
> + // and initialize all devtools machinery.
> + // browser.xul or main top-level document used to load this module,
> + // but this code may be called without/before it.
> + require("devtools/client/framework/devtools-browser");
Mention bug 1247203 here as well.
Attachment #8717375 -
Flags: review?(jryans) → review+
Comment on attachment 8717374 [details] [diff] [review]
Replace usages of gDevTools.jsm by module imports - v1
Agreed on IRC laziness is overall, since the module should generally be loaded in every case anyway.
Attachment #8717374 -
Flags: review- → review+
Assignee | ||
Comment 12•9 years ago
|
||
Attachment #8717976 -
Flags: review+
Assignee | ||
Updated•9 years ago
|
Attachment #8717375 -
Attachment is obsolete: true
Assignee | ||
Comment 13•9 years ago
|
||
Good catch!
What do you think about merging all these patches before landing?
Attachment #8717977 -
Flags: review?(jryans)
Assignee | ||
Updated•9 years ago
|
Attachment #8717376 -
Attachment is obsolete: true
Comment on attachment 8717977 [details] [diff] [review]
Various require/import cleanups - v2
Review of attachment 8717977 [details] [diff] [review]:
-----------------------------------------------------------------
I am fine with landing small commits personally, but do what makes sense to you.
Attachment #8717977 -
Flags: review?(jryans) → review+
Assignee | ||
Comment 15•9 years ago
|
||
https://hg.mozilla.org/integration/fx-team/rev/6889447e1634ec55711e5ffec38fe8c74068fef2
Bug 1245462 - Replace usages of gDevTools.jsm by module imports. r=jryans
https://hg.mozilla.org/integration/fx-team/rev/03788fdd62056997891df07af06766a7ec3f1f52
Bug 1245462 - Cleanup various require/import in devtools. r=jryans
https://hg.mozilla.org/integration/fx-team/rev/94a25d092e44055eba9c830913d43b8a4f91d898
Bug 1245462 - DevTools is not longer exposed by gDevTools.jsm. r=jryans
https://hg.mozilla.org/integration/fx-team/rev/96951f405d9e7abb431aaeb72ffa25498a0b6ffb
Bug 1245462 - Explicitely import gDevTools r=jryans
Comment 16•9 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/6889447e1634
https://hg.mozilla.org/mozilla-central/rev/03788fdd6205
https://hg.mozilla.org/mozilla-central/rev/94a25d092e44
https://hg.mozilla.org/mozilla-central/rev/96951f405d9e
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox47:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 47
Updated•6 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•