Javascript module standards

| Tag javascript 
  1. around 2009: CommonJS module standard pushed by NodeJS
var emailList = required('emailListModule');
var emailComposer = required('emailComposerModule');

module.exports.renderBase = function(){}
  1. around 2009: on the web the AMD module standard pushed by Dojo and RequireJS
define('emailBaseModule',
	  ['require', 'exports', 'emailListModule', 'emailComposerModule'],
	  function(require, exports, emailListModule, emailComposerModule){
		  exports.rnderBase = function(){}
	  }
)
  1. in 2011, Browserify makes CommonJS available on the frontend. CommonJS became the de facto standard for module bundling and import/export syntax
  2. ES2015 introduced a new standard for imports and exports that had a clean syntax and was statically analyzable:
import emailList from 'emailListModule'
import emailComposer from 'emailComposerModule'
export function renderBase() {}

This is the standard we use today.


Prev     Next