2

I'd like to learn more about the differences between the following, with special attention to compatibility issues (different browsers, minification, etc), performance, and readability/maintainability.

  1. ES6: export and export default syntax, paired with import {module1, module2} from.

  2. AMD define() syntax.

  3. CommonJS require() syntax.

Are any more common, in wider adoption? Where will the convention go, and why? What is next for ES6, since it seems to be changing so quickly. Is there a historical reason/motivation for ES6's module loading syntax as-is, and what is next?

Sze-Hung Daniel Tsui
  • 2,282
  • 13
  • 20
  • 1
    *"Where will the convention go, and why?"* Since modules are part of the language now, every environment has to support this, so I'd go with ES6. *"What is next for ES6, since it seems to be changing so quickly."* The ES6 spec is finished. Any changes are only bug fixes. – Felix Kling May 26 '15 at 16:31
  • Possible duplicate of [Relation between CommonJS, AMD and RequireJS?](http://stackoverflow.com/questions/16521471/relation-between-commonjs-amd-and-requirejs) – Paul Sweatte Oct 11 '16 at 14:23

0 Answers0