<div dir="ltr">Hey guys,<div><br></div><div>as you may know, for AeroGear.js 2.1 we are in the middle of refactoring into ES6 module syntax, so finally we will be able to use following in ES6 based projects:</div><div><br></div><div>import Authorization from &#39;aerogear.authorization;</div><div><br></div><div><br></div><div>I&#39;ve finished a prototype of how ES6 (JavaScript.tomorrow) module transpilation to ES5 (JavaScript.today) could work., the code and sample lives here:</div><div><br></div><div><a href="https://github.com/aerogear/aerogear-js/pull/154">https://github.com/aerogear/aerogear-js/pull/154</a><br></div><div><br></div><div><br></div><div>It basically takes ES6 classes and compiles them to AMD module syntax (which is a browser-oriented module system, implemented e.g. in RequireJS module loader).</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div>These AMD modules can already be consumed by end-user who uses AMD in his project:</div><div><br></div><div>require([&#39;aerogear.authorization&#39;], function( Authorization ) {</div><div>   ...</div><div>});</div><div><br></div><div>(Note that similarly we could compile to CommonJS module syntax, that could be leveraged in Browserify projects today, but we agree with Luke to do not dive into that atm).</div><div> </div><div><br></div><div><br></div><div><br></div><div><br></div><div>We take it even further by allowing to leverage globally accessible API AeroGear.Authorization without any module loader in your project. This way you will be able to use AeroGear.js 1.3/2.0-like API as it is with no code modifications.</div><div><br></div><div>AeroGear.Authorization</div><div><br></div><div>This is made to work by taking all the AMD modules, concatenating them and wrapping them into minimal loader (&quot;microlib&quot;) that exposes all the modules on global AeroGear object.</div><div><br></div><div><br></div><div>Cheers,</div><div><br></div><div>~ Lukas</div></div>