On Jun 19, 2014, at 16:17 , John Barton <[email protected]> wrote:

> Sorry to be dense, but I would appreciate more elaboration of this sentence:
> 
> 
> On Thu, Jun 19, 2014 at 3:40 AM, Axel Rauschmayer <[email protected]> wrote:
> This is a key sentence in David’s proposal: “ES6 favors the single/default 
> export style,
> 
> What is the "single/default" export style?  If I understand this claim, it 
> says that a module will typically contain a single export statement, either 
> named 'default' or not. Is there any evidence to support this? Everything 
> I've seen contradicts this claim, assuming I understand it.

The syntax is ( 
https://people.mozilla.org/~jorendorff/es6-draft.html#sec-exports ):

    export default AssignmentExpression

> and gives the sweetest syntax to importing the default. Importing named 
> exports can and even should be slightly less concise.”
> 
> Could you please give an example? In my experience, "export default" is rare 
> or at least divisive since it seems stylistically incompatible with named 
> exports. 

I’m surprised, too. But that seems to be the feedback from people working with 
large module-based client-side projects and from the Node.js community: single 
exports are most common. I think in client-side projects, one class per module 
was reported as a frequent use case:

```js
// MyClass.js
export default class {
    ...
};

// main.js
import MyClass from "MyClass";
```

-- 
Dr. Axel Rauschmayer
[email protected]
rauschma.de



_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to