ModuleImport

Axel Rauschmayer axel at rauschma.de
Thu Jun 19 03:40:33 PDT 2014


This is a key sentence in David’s proposal: “ES6 favors the single/default export style, and gives the sweetest syntax to importing the default. Importing named exports can and even should be slightly less concise.”


On Jun 19, 2014, at 12:31 , Michał Gołębiowski <m.goleb at gmail.com> wrote:

> Thanks, Dave, for bringing that up, it shows you're open for feedback. That said (bikeshed begins), what's wrong with:
> ```js
> import "fs" as fs;
> ```
> ? I feel that a lot of effort went in ES6 into reducing boilerplate via e.g. arrow functions, classes etc. but if you start with Node's require, this adds clutter. Compare these 3 forms of importing all the module "lodash" bindings to an object _:
> ```js
> var _ = require("lodash"); // Node
> import * as _ from "lodash"; // Dave's syntax
> import "lodash" as _;
> ```

-- 
Dr. Axel Rauschmayer
axel at rauschma.de
rauschma.de



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140619/21d34d77/attachment.html>


More information about the es-discuss mailing list