ModuleImport

Axel Rauschmayer axel at rauschma.de
Thu Jun 19 11:43:20 PDT 2014


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

> On Thu, Jun 19, 2014 at 12:40 PM, Axel Rauschmayer <axel at rauschma.de> wrote:
> 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.”
> 
> There are a lot of large modules that will not disappear overnight. I assume ES6's recommendation for such things (Node's fs module, Lo-Dash) is to make those container objects default exports?

What are you saying? That you find this syntax too verbose?

```js
import * as fs from "fs";
```

There is a little more clutter, but it’s only 2 characters longer than:

```js
var fs = require('fs');
```

This design decision does make sense if single-export modules are indeed much more common. It’s not what I expected, but it does seem to be the case.

-- 
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/45025598/attachment.html>


More information about the es-discuss mailing list