Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support ES6 modules #161

Open
fbender opened this issue Feb 4, 2014 · 9 comments
Open

Support ES6 modules #161

fbender opened this issue Feb 4, 2014 · 9 comments

Comments

@fbender
Copy link

fbender commented Feb 4, 2014

Next JS version has a built-in module mechanism. Would be nice to have support for this.

(You may want to switch to Esprima that has (beta) support for ES6.)

@Munter
Copy link
Member

Munter commented Feb 4, 2014

I completely agree we should have ES6 module support. Anything standardized should work out of the box, no questions asked. The only thing I'm a bit vary about is the timing.

I see that there are already polyfills that allow using ES6 modules, which means we should probably have this pretty high on the priority list.

Switching to Esprima would be quite an undertaking, since quite a lot of the current ecosystem is using uglify2's AST, primarily chosen for the pairing with minification, thus reducing the dependency chain. I don't know about uglifys es6 capabilities. I'll have to check that.

@fbender
Copy link
Author

fbender commented Feb 4, 2014

The only thing I'm a bit vary about is the timing.

In April 2014, ES6 will be finalized. Full implementations will probably be available in Q3 2014. There's already implementations (not only polyfills) of ES6 modules available (though experimentally), so the timing is probably perfect now! ;-)

@Munter
Copy link
Member

Munter commented Jun 6, 2014

This might give us a leg up: https://www.npmjs.org/package/module-graph

@saulshanabrook
Copy link

Would it make any sense to just compile from es6 and then parse those files?

@Munter
Copy link
Member

Munter commented Apr 28, 2015

I think it would. The precompiler integration with assetgraph is not so nice at the moment though. I'd really like to pull it out and make it a separate concern. See #235

If the fusile project succeeds then a similar 'compile anything while populating' behavior should be easy to add as an option. An option that would not even be needed if you used fusile

@Munter
Copy link
Member

Munter commented Oct 11, 2015

A switch to esprima is on the way: https://github.com/assetgraph/assetgraph/tree/esprima

All tests are passing, but we're now working on other known Assetgraph consumers to get them compatible. This will me a breaking change.

ES6 module support will be within reach when Assetgraph 2.x is out

@Munter Munter added this to the v2.x milestone Oct 11, 2015
@fbender
Copy link
Author

fbender commented Oct 15, 2015 via email

@Munter Munter added the Model label Feb 2, 2017
@Munter
Copy link
Member

Munter commented Nov 9, 2017

@papandreou Did some work on this a few months ago: a5dc0e8

I think this is on the master branch only, and we haven't done anything to make bundling work. But the modeling is a prerequisite for all of that

@Munter Munter removed this from the v2.x milestone Mar 27, 2018
@Munter
Copy link
Member

Munter commented Mar 27, 2018

This should be out now in the assetgraph v4 release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants