ESMification: Out-of-tree migration

269 views
Skip to first unread message

Tooru Fujisawa

unread,
Apr 18, 2024, 8:57:26 AMApr 18
to dev-pl...@mozilla.org, Firefox Dev

Hi, all.


As announced in https://groups.google.com/a/mozilla.org/g/dev-platform/c/GDAs-WJiiu8 , ESMification for the Firefox and Thunderbird codebase is completed, and now it’s time to prepare for out-of-tree migration.


If you’re a developer of Firefox privileged extensions, Thunderbird privileged extensions, or if you’re using unsandboxed AutoConfig scripts, this email is for you.


Firefox and Thunderbird have been using JSM, the mozilla-specific JavaScript module system, and it has been available to privileged extensions and unsandboxed AutoConfig scripts, via Cu.import or ChromeUtils.import APIs and wrapper around them.


As of version 126, all internal JSMs are migrated to the standard ECMAScript module (ESM) system, using new APIs ChromeUtils.importESModule and wrappers around it.  The old APIs keep working by internally redirecting the call to the new APIs and corresponding ESMs.


The migration period is planned to be until Firefox 136, which will be released Mar 2025.  During the migration period, both the old APIs and new APIs keep working, and after the migration period, the support for the old APIs will be dropped. The next ESR, Firefox ESR 128 is compatible both with old and new APIs, and the next-next ESR will be compatible only with ESMs.


Here’s the document that describes the affected cases and how to migrate each case:

https://docs.google.com/document/d/14FqYX749nJkCSL_GknCDZyQnuqkXNc9KoTuXSV3HtMg/edit?usp=sharing


Thank you for reading.

If you have questions, feel free to ask in the #esmification matrix room!

Reply all
Reply to author
Forward
0 new messages