Closed Bug 1836480 Opened 11 months ago Closed 3 months ago

Convert toolkit/mozapps/extensions/internal/XPI* to ES modules

Categories

(Toolkit :: Add-ons Manager, task, P2)

task

Tracking

()

RESOLVED FIXED
124 Branch
Tracking Status
firefox124 --- fixed

People

(Reporter: standard8, Assigned: arai)

References

(Blocks 2 open bugs)

Details

(Whiteboard: [esmification-timeline][addons-jira])

Attachments

(3 files)

Attempting to convert the toolkit/mozapps/extensions/internal/XPI* modules to ES modules causes tests to fail, because the tests are unloading the modules:

https://searchfox.org/mozilla-central/rev/87ba454e5c68ff77dff9acb9d7b0b51d6df12d11/toolkit/mozapps/extensions/internal/AddonTestUtils.jsm#873-875

ES modules cannot be unloaded, so there is no direct relationship here.

This will need someone from the team to investigate why this is needed and alternatives for it.

See Also: → 1836482
Whiteboard: [esmification-timeline] → [esmification-timeline][addons-jira]

I'm going to take this, and hopefully land in ESR 115 to make uplifting less painful later on.

Assignee: nobody → rob

I meant to self-assign bug 1836482. But this one is also important, but more involved...

Blocks: 1830399
Severity: -- → N/A
Priority: -- → P2

Instead of unloading and re-loading modules, add a testing functions that resets
the global state and call them in AddonTestUtils.sys.mjs.

Assignee: rob → arai.unmht
Attachment #9376778 - Attachment description: Bug 1836480 - Part 1: Make XPIProvider.jsm, XPIDatabase.jsm, and XPIInstall.jsm testable without unloading. r=robwu → Bug 1836480 - Part 1: Add XPIExports.sys.mjs module to wrap XPIDatabase.jsm, XPIInstall.jsm, and XPIProvider.jsm. r?robwu!
Attachment #9376779 - Attachment description: Bug 1836480 - Part 2: ESMify XPIProvider.jsm, XPIDatabase.jsm, and XPIInstall.jsm. r=robwu → Bug 1836480 - Part 2: ESMify XPIProvider.jsm, XPIDatabase.jsm, and XPIInstall.jsm. r=robwu!
Attachment #9376780 - Attachment description: Bug 1836480 - Part 3: Rewrite consumers of XPIProvider.jsm, XPIDatabase.jsm, and XPIInstall.jsm. r=robwu → Bug 1836480 - Part 3: Rewrite consumers of XPIProvider.jsm, XPIDatabase.jsm, and XPIInstall.jsm. r=robwu!

(In reply to Mark Banner (:standard8) from comment #0)

This will need someone from the team to investigate why this is needed and alternatives for it.

FYI my analysis and recommendations (which have been followed in the latest version of the patch (part 1) under review) are at https://phabricator.services.mozilla.com/D199791#6855899

Depends on: 1877304
Pushed by arai_a@mac.com:
https://hg.mozilla.org/integration/autoland/rev/a38ae2ba26f5
Part 1: Add XPIExports.sys.mjs module to wrap XPIDatabase.jsm, XPIInstall.jsm, and XPIProvider.jsm. r=robwu,application-update-reviewers,bytesized
https://hg.mozilla.org/integration/autoland/rev/68ba071ff6fb
Part 2: ESMify XPIProvider.jsm, XPIDatabase.jsm, and XPIInstall.jsm. r=robwu
https://hg.mozilla.org/integration/autoland/rev/648a4ccf47bf
Part 3: Rewrite consumers of XPIProvider.jsm, XPIDatabase.jsm, and XPIInstall.jsm. r=robwu,application-update-reviewers,nalexander
Status: NEW → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 124 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: