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
Comments
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. |
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! ;-) |
This might give us a leg up: https://www.npmjs.org/package/module-graph |
Would it make any sense to just compile from es6 and then parse those files? |
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 |
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 |
Sounds good, thanks for the info!
|
@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 |
This should be out now in the assetgraph v4 release |
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.)
The text was updated successfully, but these errors were encountered: