Skip to content

Instantly share code, notes, and snippets.

@jonco3
jonco3 / migration.md
Last active September 29, 2016 08:18 — forked from Yoric/migration.md
Migrating from JSM to ES6 modules

This document shows a possible migration path from Cu.import() to ES modules for the code of Firefox.

Requirements:

  1. Preserve current JSM semantics where multiple imports of a single module from different globals results in a single module instance that lives in a separate global to the importer.
  2. Add-ons and Thunderbird should not be affected by the migration.
  3. Memory usage should not be adversly affected.

1. Allow Cu.import() to load ES6 modules with detction based on file extension