node-compat-table icon indicating copy to clipboard operation
node-compat-table copied to clipboard

import / export

Open reggi opened this issue 9 years ago • 10 comments

One of the big things for me is support for import / export, which is in es2015, why isn't this in your list?

reggi avatar Apr 25 '16 13:04 reggi

Yeah, it is ES2015 and should be part of the list. Because this project uses Kangax's tests it will only display categories they include. Currently, they do not have a test for it. See: https://github.com/kangax/compat-table/issues/316

Node will be using a special file extension to load modules- so that requires any tests to be save to their own files- which will require some reworking of how my scripts run.

The answer for Node (currently) is: Not implemented.

williamkapke avatar Apr 25 '16 16:04 williamkapke

What's the point of using ES6 in a node environment if such a key feature is missing?

I did find a polyfill for it here, but it would be nice to run a node environment that doesn't require babel in some way, shape or form.

ericgrosse avatar Aug 07 '16 15:08 ericgrosse

@ericgrosse the loader spec isn't finished, so ES modules don't actually exist yet. import/export don't actually do anything per the ES6 spec.

ljharb avatar Aug 07 '16 16:08 ljharb

I'm a little confused. This compat table currently lists ES2015 Support for Node 6.10 and above as 99%. Without Modules support wouldn't that make the metrics inaccurate?

ghost avatar Mar 17 '17 09:03 ghost

No, because Modules do not yet exist.

ES6 only contains Module parsing goal semantics (which an engine does not have to implement if they don't provide a way to get there). That's only one piece of "ES Modules".

ljharb avatar Mar 17 '17 16:03 ljharb

I see. Thanks for clarifying. I believe what I'm looking for is Node support for ES2016, then.

ghost avatar Mar 17 '17 17:03 ghost

ES2016 over ES2015 only adds ** and Array.prototype.includes. ES2017 adds async function, and a number of new API methods. ES Modules, as a whole concept, won't ever be in the ES language spec - just the building blocks for them that ES2015 ships.

ljharb avatar Mar 17 '17 21:03 ljharb

as of 8.7 it's behind a flag. It's still behind a flag on 9.0

FossPrime avatar Nov 01 '17 21:11 FossPrime

Can we simply add it to the list for good measures? It's also in the docs

jaggli avatar Jan 19 '18 11:01 jaggli