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
I like a lot of the features in Earl Grey, but one feature that I feel is lacking is proper support for ES6 modules.
My intention is to write client-side browser applications. I know that I can use Webpack to bundle CommonJS files (and I do use Webpack), but ES6 modules have many advantages:
The basic gist of it is that ES6 modules are static, which means better compile-time error checking, faster code execution, dead code elimination (e.g. Rollup and Webpack2), support for macros, and better support for cyclic dependencies.
I'm not sure exactly what changes will need to be made in Earl Grey to support ES6 modules, but I think it's something that needs to be thought about at some point, because ES6 modules are the future.
The text was updated successfully, but these errors were encountered:
Well, I want to compile EG to a version of JavaScript that's natively supported by V8 in the latest version of node (so that no additional transpiling would be needed on the server side). As far as I can tell, ES6 modules are not yet supported in node (nor in any major browser it seems), so I'd rather wait until they are. Hopefully it is not be too long before then. Support should be easy: EG's require statement is closer in functionality to ES6's import statement than to node's require.
That's totally understandable. CommonJS is the right choice for Node (at least for now). But for web browsers, you already need to use bundlers like Webpack/Rollup/etc. and they support ES6 modules (which are compiled into a single optimized ES5 file).
I think an additional flag to determine whether to output to CommonJS or ES6 would be a good idea. But I can understand you wanting to wait until ES6 modules are natively supported. As long as you are at least considering the option, then I'm happy.
I like a lot of the features in Earl Grey, but one feature that I feel is lacking is proper support for ES6 modules.
My intention is to write client-side browser applications. I know that I can use Webpack to bundle CommonJS files (and I do use Webpack), but ES6 modules have many advantages:
http://www.2ality.com/2014/09/es6-modules-final.html
The basic gist of it is that ES6 modules are static, which means better compile-time error checking, faster code execution, dead code elimination (e.g. Rollup and Webpack2), support for macros, and better support for cyclic dependencies.
I'm not sure exactly what changes will need to be made in Earl Grey to support ES6 modules, but I think it's something that needs to be thought about at some point, because ES6 modules are the future.
The text was updated successfully, but these errors were encountered: