Introducing Flow throughout lodash sounds like a lot of work and aggressively dropping statements regardless of side effects seems incredibly brittle. I'll do a spike on it if I ever have time . I’ve done a fair amount of JavaScript, here and there, and have written some TypeScript, too. Anyway, the whole thing could have desugared into pretty straightforward ES6 minus modules. ES6 modules are automatically strict-mode code, even if you don’t write "use strict"; in them. (Of course, we already have destructuring for exactly this kind of thing, but for some reason the module destructuring has a subtly different syntax to the standard ES6 destructuring! (I really think adding features shouldn’t have to be a potentially breaking change!). esm. class A { } var ABound = A . It doesn’t seem particular agnostic, though. export var foo = 'bar' export var baz = 'ponyfoo' It’s important to keep in mind that we are exporting bindings. Contribute to jfmengels/eslint-plugin-lodash-fp development by creating an account on GitHub. */, seansfkelley/synology-download-manager#40. I'm going to see if I can get max() and sum() into wu. More ES6 Sponsorship. But the actual creation of the class isn’t hoisted. return foo; ES6 modules were designed to let you export multiple things, but for existing CommonJS modules, the default export is all you get. We’re done with syntax! 1 – Interoperability w/ es5. No DSLs required. Using npm: $ npm i -g npm $ npm i --save lodash The Lodash library exported as Node.js modules.. The ES6 module syntax is very static, and that’s good—it’s paying off in the form of powerful compile-time tools. Embed Embed this gist in your website. Can anybody explain will transpiling be required in the future, when browsers will support es modules natively? It’s a collection of CommonJS modules, like most packages on npm. It’s just not as nice as real import syntax. Processor. This fast, production ready, zero dependency loader is all you need to support ECMAScript modules in Node 6+. This has been a great series of articles. This leaves the issue: modules can access globals easily, but how do global scripts access modules? Sign in Rx.Oservable.fromArray(); import * from ‘rx’; What we critically needed was a simple in-built import() function that worked mostly like require(), maybe coupled with decorators (for exporting and/or privatising things) and destructuring to pick what we want to import. All exported identifiers must be explicitly exported by name in the source code. Once browsers get native support for modules, the entry point will be something like