imServices.jsm should not export Services
Categories
(Chat Core :: General, task)
Tracking
(thunderbird_esr102 fixed, thunderbird102 wontfix)
People
(Reporter: mkmelin, Assigned: mkmelin)
Details
Attachments
(2 files)
48 bytes,
text/x-phabricator-request
|
rjl
:
approval-comm-esr102+
|
Details | Review |
48 bytes,
text/x-phabricator-request
|
Details | Review |
imServices.jsm builds on to the normal Services instead of only exporting an object with the IM specific services.
This is a bit of a mess, and the mess will grow further during the ESMification effort, like bug 1772313 and related linting...
imServices.jsm should instead export something like IMServices, and the callers that import imServices.jsm but use it for Services.jsm should be split out to call that instead.
Assignee | ||
Updated•2 years ago
|
Comment 1•2 years ago
|
||
There is some prior art calling the exported object imServices
:
https://searchfox.org/comm-central/source/mail/components/im/content/chat-messenger.js#16
https://searchfox.org/comm-central/source/mail/components/about-support/content/chat.js#7
Updated•2 years ago
|
Assignee | ||
Comment 2•2 years ago
|
||
Yeah, but modules are supposed to be Capitalized, so that it's clear what is a "normal" variable and what is not.
I'll take the opportunity to capitalize the file name as well. (IMServices.jsm)
Assignee | ||
Comment 3•2 years ago
|
||
- Make imServices.jsm export IMServices
- hg mv ./chat/modules/imServices.jsm ./chat/modules/IMServices.js
- global rewrite
grep --exclude-dir=.hg --exclude-dir=suite -rl '{ Services } = ChromeUtils.import("resource:///modules/imServices.jsm");' | xargs sed -i -E 's#(var|const) { Services } = ChromeUtils.import("resource:///modules/imServices.jsm");#\1 { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");\1 { IMServices } = ChromeUtils.import("resource:///modules/IMServices.jsm");#g' - Fix stray cases of imServices.jsm imported as something else
- rewrite callers
grep --exclude-dir=.hg --exclude-dir=suite -rEl "\b(Services.accounts.|Services.core.|Services.cmd.|Services.contacts|Services.conversations|Services.tags.|Services.logs.)" | xargs sed -i -E 's/\b(Services.accounts.|Services.core.|Services.cmd.|Services.contacts|Services.conversations|Services.tags.|Services.logs.)/IM\1/g' - linting
Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/4bbe7e059e02
imServices.jsm should not export Services. r=freaktechnik
Assignee | ||
Updated•2 years ago
|
Comment 5•2 years ago
|
||
Updated•2 years ago
|
Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/91c8e5227140
followup - Use correct accounts service in OTR. r=#thunderbird-reviewers,mkmelin
Updated•2 years ago
|
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Comment 7•2 years ago
•
|
||
Rob, if you're doing bug 1783250 this is likely needed as well.
Comment 8•2 years ago
|
||
Comment on attachment 9279592 [details]
Bug 1772390 - imServices.jsm should not export Services. r=freaktechnik
[Triage Comment]
Per Magnus this is needed to prevent future uplift issues.
Comment 9•2 years ago
|
||
bugherder uplift |
Updated•2 years ago
|
Description
•