Discussion:
Import default syntax
Ian MacLeod
2014-10-14 00:23:32 UTC
Permalink
(I would have expected this to have been bikeshedded to death already; but
search is failing me?)

For me, the import syntax is very readable, *except* for importing default
exports. I.e. import name from "module"

My main beef is that it just doesn't make sense from an English standpoint: I'm
not importing name *from* "module" - I'm importing the default export from
"module" *as* name.

Couple alternative ideas (even if it's too late to propose anything...):

- import "module" as name; Seems better. Though, it isn't entirely clear
that you're getting the default export (as opposed to being sugar for import
* as name from "module";)


- import . as name from "module"; where . is just sugar for default.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20141014/a33038fd/attachment.html>
Loading...