Bug 1766761 Comment 0 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

There are still not-in-tree consumer of `Cu.import` for JSM in AutoConfig (see 1766114),
and to make the transition easier, it's better providing a shim that makes `Cu.import(".../foo.jsm")` keeps working even after `foo.jsm` is converted to ESM (`foo.mjs`), until all modules are converted.
So that people can rewrite their AutoConfig script at once.

The shim may also help the in-tree transition itself, given the transition can be done per file, not subtree.

Possible solutions are:
  * (a) Once `foo.jsm` is converted to `foo.mjs`, add `foo.jsm` that imports `foo.mjs` and export the same symbols with existing JSM semantics
  * (b) Modify `Cu.import` internal (somewhere around `mozJSComponentLoader`) to automatically redirect to `foo.mjs` when called with `foo.jsm`, for already converted modules
There are still not-in-tree consumer of `Cu.import` for JSM in AutoConfig (see bug 1766114),
and to make the transition easier, it's better providing a shim that makes `Cu.import(".../foo.jsm")` keeps working even after `foo.jsm` is converted to ESM (`foo.mjs`), until all modules are converted.
So that people can rewrite their AutoConfig script at once.

The shim may also help the in-tree transition itself, given the transition can be done per file, not subtree.

Possible solutions are:
  * (a) Once `foo.jsm` is converted to `foo.mjs`, add `foo.jsm` that imports `foo.mjs` and export the same symbols with existing JSM semantics
  * (b) Modify `Cu.import` internal (somewhere around `mozJSComponentLoader`) to automatically redirect to `foo.mjs` when called with `foo.jsm`, for already converted modules

Back to Bug 1766761 Comment 0