Google Closure Compiler support 99% of the ES6
Test Closure Compiler
Google Closure Compiler support 99% of the ES6 grammar, will be great to compare the results against the other transpilers.
- 点赞 评论 复制链接分享
interesting, cc'ing google folks.
Obviously the 35% score on compat-table is about ES6 features, not only about ES6 grammar, while six-speed is mostly about new grammar.
/cc ,点赞 评论 复制链接分享
- weixin_39742958 4月前
not sure what you mean by features vs. grammar but compat table includes syntax as well; unless we tested google closure incorrectly (not enabling new syntax or some such)点赞 评论 复制链接分享
by default, closure compiler will transpiler all new grammar (syntax) down to ES3, you could tweak that to target ES5 instead for the case of six-speed and compat-table.
I suspect compat-table is testing closure compiler with the default options, without using externs, which are equivalent to babel-polyfill, that's why you see all the built-ins and built-ins extensions not supported.
I'm not a expert in closure compiler, I will let and to chime in. I just want to make sure that we take closure compiler into consideration.点赞 评论 复制链接分享
Only ~35% of a
compat-tableES6 result is built-ins result. Anyway,
Closuresupports more ES6 features than
TypeScript;)点赞 评论 复制链接分享
- weixin_39575850 4月前
Here is the doc about ES6 support in the compiler: https://github.com/google/closure-compiler/wiki/ECMAScript6
Did you have a question about whether some specific feature is supported?点赞 评论 复制链接分享
I think that documentation is incomplete, it only talks about grammar, but not all other features in ES6, let's say
Promise, etc. Babel includes a section about the polyfill to support a full ES6 Environment (e.g.: https://babeljs.io/docs/usage/polyfill/), and even though closure compiler has a similar thing via
externs, it is hard for people to make sense of it, that's probably why 's compat-table didn't take that into consideration.
As for six-speed, it will be great is you guys can validate that closure can handle all the tests required to be added to the result table, that might help to add closure here, maybe a pull request?点赞 评论 复制链接分享
- weixin_39575850 4月前
- weixin_39603505 4月前
I don't have concrete plans to turn it on by default externally. We can't do that unless we add a flag to turn it off, at any rate.点赞 评论 复制链接分享
whether that's turn on by default or not, it is debatable, babel doesn't do that automatically (IIRC), but having a very simple and intuitive way to do so is what really matters.点赞 评论 复制链接分享
babelfeatures just will not work without it. BTW https://github.com/kangax/compat-table/pull/741#issuecomment-179923364点赞 评论 复制链接分享
- weixin_39727005 4月前
Glad to include this in the tests as long as they are automated and can run under OSX. I don't have time to wire this up, but glad to pull in a PR and include in my weekly test exec. Might be as simple as adding another permutation here, but this should be tested out.点赞 评论 复制链接分享