You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey guys,
it seems that I am the only one who wanted to fiddle around with es6 modules recently which are -yes I know- work in progress, but still. Since the docs aren't entirely clear about the current state of the es6-modules-implementation and the actual implementation proposal doesn't work I was wondering what the current state of the --harmony_modules flag is? Other than that you guys did an awesome job pushing node.js to its best. Thanks!
Afaik, --harmony_modules is a very much in progress feature on V8. While it is currently listed as "in progress", I find very little references to it on the source code. I think we are still a long way off having ES6 module support on io.js. There are some interesting shims though if you want to experiment a bit.
There was a very interesting discussion on 6to5 regarding modules interop (babel/babel#95), which is something that will be a concern to every module author in the future.
var it = Iterator(lang);
^
ReferenceError: Iterator is not defined
at Object.<anonymous> (F:\Study\node.js\netspider\test.js:2:14)
at Module._compile (module.js:446:26)
at Object.Module._extensions..js (module.js:464:10)
at Module.load (module.js:341:32)
at Function.Module._load (module.js:296:12)
at Function.Module.runMain (module.js:487:10)
at startup (node.js:111:16)
at node.js:809:3
It seems like the key word "Iterator" is not supported in iojs.
Activity
ruimarinho commentedon Jan 19, 2015
Afaik,
--harmony_modulesis a very much in progress feature on V8. While it is currently listed as "in progress", I find very little references to it on the source code. I think we are still a long way off having ES6 module support on io.js. There are some interesting shims though if you want to experiment a bit.krnlde commentedon Jan 19, 2015
Thanks for the fast response. Yes traceur and 6to5 et al do their job, but I was hoping to finally remove that transpile-step.
Well then. Thank you anyways! :)
For everyone interested in the current state of es6-modules, follow this link.
ruimarinho commentedon Jan 19, 2015
There was a very interesting discussion on 6to5 regarding modules interop (babel/babel#95), which is something that will be a concern to every module author in the future.
krnlde commentedon Jan 19, 2015
Interesting indeed! Nice follow up. Thanks for ruining my night while reading the complete discussion :)
speedneeder commentedon Jan 20, 2015
I found a page listed a compatibility table.
http://kangax.github.io/compat-table/es6/
I'm not sure how credible is it in this table about iojs.
In my test code I found I can use yield key word in iojs, but iterator are not supported in iojs.
ruimarinho commentedon Jan 20, 2015
@speedneeder I was the one submitting the results for io.js. Iterators are supported by io.js. Example from MDN:
yosuke-furukawa commentedon Jan 20, 2015
I would like to request this issue to tc-agenda.
If harmony_module is implemented by v8, How npm will resolve module names.
npm/npm#4323
https://gist.github.com/domenic/4748675
speedneeder commentedon Jan 20, 2015
@ruimarinho
I have read some tutorial about iterator of javascript, it gives some code like below, and I test it in firefox, it works:
but when I run it with iojs, it says:
It seems like the key word "Iterator" is not supported in iojs.
krnlde commentedon Jan 20, 2015
Don't you think this is a bit off-topic here?
domenic commentedon Jan 21, 2015
V8 has not started implementing modules at all.
vkurchatkin commentedon Jan 21, 2015
@domenic well, this works:
Whatever it is
domenic commentedon Jan 21, 2015
Yes, that is not ES6, that is from a few years ago before ES6.
Fishrock123 commentedon Jan 22, 2015
What @domenic said. (This is not implemented in v8 yet.)
krnlde commentedon Jan 22, 2015
Thanks guys!
vkurchatkin commentedon Jan 28, 2015
something is happening: v8/v8@aeb3a71
krnlde commentedon Feb 2, 2015
For further import and export syntax reference: