Module Default Export Syntax

Claude Pache claude.pache at gmail.com
Wed Jun 25 03:25:35 PDT 2014


Le 25 juin 2014 à 11:16, Calvin Metcalf <calvin.metcalf at gmail.com> a écrit :

> The place where the current syntax shines is when dealing with anonymous values, 
> 
For that case, the same sugar as named exports could work:

	export let default = ...

at the condition to allow "default" as an identifier in that position.

BTW, I agree with Kevin that the sugar for default export is not worth the obfuscation of the design.

—Claude



> On Jun 25, 2014 1:29 AM, "Barronville, Jonathan" <jonathan at belairlabs.com> wrote:
> Kevin, you're not alone :) . I like that last form, too.
> 
> - Jonathan
>> Sent from Mailbox
> 
> 
> On Wed, Jun 25, 2014 at 1:21 AM, Axel Rauschmayer <axel at rauschma.de> wrote:
> 
> I do like the conciseness of the last form. The other forms do indeed not seem very useful.
> 
> 
> On Jun 25, 2014, at 5:45 , Kevin Smith <zenparsing at gmail.com> wrote:
> 
>> 
>>     ExportDeclaration:
>>         ...
>>         export default ClassDeclaration
>>         export default FunctionDeclaration
>>         export default GeneratorDeclaration
>>         export default = AssignmentExpression
>> 
>> 
>> To reply to myself (since no one else appears to be interested), I think it might even be best to drop these special forms altogether.  The non-sugared form of:
>> 
>>     export { someVar as default };
>> 
>> is already very concise, and will help developers understand what this whole "default" thing is about.  The sugar appears to be obfuscating the design, and is doing more harm than good.
>> 
>> Again, thoughts?
>> 
>> _______________________________________________
>> es-discuss mailing list
>> es-discuss at mozilla.org
>> https://mail.mozilla.org/listinfo/es-discuss
> 
> -- 
> Dr. Axel Rauschmayer
> axel at rauschma.de
> rauschma.de
> 
> 
> 
> 
> 
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
> 
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140625/9e22118d/attachment.html>


More information about the es-discuss mailing list