Skip to content

Follow firefox ESMify for Bug 1308512

Firefox is currently working through converting its JSM modules to ESM

According to the docs under "Compatibility Layer":

we’ve made it possible to only convert a JSM to ESM, without converting its consumers. Concretely, you can convert a file from a JSM to an ESM, without touching any of its consumers. In this case, ChromeUtils.import for *.jsm or *.js or *.jsm.js URI is automatically redirected to ChromeUtils.importESModule for *.sys.mjs, and the conversion of the importers can happen later.

[...]

This compatibility layer will be kept until all in-tree and out-of-tree code is migrated to new APIs.

So we should be ok with changes from upstream :) for the time being.

There's also a new tool ./mach esmify (under "JSM-to-ESM conversion Walkthrough" in the docs) which we might be able to use on our own files. Although I know thunderbird had to adapt it so we may have to do a similar thing https://bugzilla.mozilla.org/show_bug.cgi?id=1779047

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information