Closed Bug 1519596 Opened 6 years ago Closed 4 years ago

Remove unused ChromeUtils.import calls

Categories

(Firefox :: General, enhancement, P3)

57 Branch
enhancement

Tracking

()

RESOLVED FIXED

People

(Reporter: kmag, Assigned: kmag)

References

Details

Attachments

(1 file)

Bug 1514594 requires that we rewrite existing ChromeUtils.import() callers to destructure a returned exports object, rather than rely on properties automatically being defined on the global scope. The rewrite script, in turn, needs to only destructure properties which are actually used by the script, in order to avoid triggering unused variable warnings in ESLint.

Actually running the script turns up a lot of imports where none of the exported symbols are actually used (and several where scripts attempt to destructure symbols from the module global which don't actually exist). It would be best if we can deal with these before we do the rewrite, partly to cut down on noise, and partly so we can add an ESLint rule to warn about ChromeUtils.import calls which ignore the return value, and therefore have no effect other than loading the module.

I'm going to do this in multiple parts. The first part will deal with the obvious cases, mainly JSMs and XPCOM components which run in their own scopes. Follow-ups will deal with most of the unit tests, and scripts which are loaded into shared scopes, where exports may be used in non-obvious ways.

Keywords: leave-open
Priority: -- → P3
https://hg.mozilla.org/integration/mozilla-inbound/rev/1e1580db8a5a9d5165da3bc28e7d09a11bff013a
Bug 1519596: Part 1 - Remove several unnecessary/unused ChromeUtils.import() calls. r=Gijs
Pushed by archaeopteryx@coole-files.de:
https://hg.mozilla.org/mozilla-central/rev/e3ba3ce79b84
Follow-up: Removes Services import because it's a redeclaration. a=merge
https://hg.mozilla.org/mozilla-central/rev/060d26e4a442
Follow-up: Update PerTestCoverageUtils import in executormarionette.py. a=merge
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/15155 for changes under testing/web-platform/tests

The leave-open keyword is there and there is no activity for 6 months.
:kmag, maybe it's time to close this bug?

Flags: needinfo?(kmaglione+bmo)

The leave-open keyword is there and there is no activity for 6 months.
:kmag, maybe it's time to close this bug?

Flags: needinfo?(kmaglione+bmo)

The leave-open keyword is there and there is no activity for 6 months.
:bwinton, maybe it's time to close this bug?

Flags: needinfo?(bwinton)

KMag, is there a part 2 coming? Is it still relevant? Should we close this bug?

Flags: needinfo?(bwinton)

Eh, I don't even remember anymore, but I probably am not going to have time to do more on this any time soon.

Status: NEW → RESOLVED
Closed: 4 years ago
Flags: needinfo?(kmaglione+bmo)
Keywords: leave-open
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: