ModuleImport
Kevin Smith
zenparsing at gmail.com
Thu Jun 26 05:55:40 PDT 2014
>
> Now the author can choose to export more things later without making
> breaking changes to the module. The only downside to this is the
> (apparently mandatory) curly braces around the imported object. If single
> export/import becomes the convention with ES6 modules then users will be
> forced to type an extra pair of {} several times in most of their files. Is
> the two extra characters something we can live with?
>
I have a good bit of experience coding ES modules, and I was worried about
that at first. But hasn't been a problem for me. Then again, I'm just one
person - it would be good to get more data from developers actually coding
with ES modules.
This syntax would make things completely obvious and simple though: if
there's curly braces, then you're reaching into the bag and pulling out
things, and if there's no curly braces, you're getting the bag itself.
There's even a visual analogy at play here: the curly braces themselves
resemble the sides of a bag.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140626/b97dcec2/attachment-0001.html>
More information about the es-discuss
mailing list