-
Notifications
You must be signed in to change notification settings - Fork 26
ES5 support #49
Comments
#61 will make this much easier |
One thing we probably want to do, is structure our current RTTI as high-level JS AST concepts (e.g. ES7 might get type annotations). Then how to emit types becomes a choice of further lowering. To ES6, types become data that is stored in properties. To Closure, they become comments? To TypeScript, we can keep most as type annotations? One difficulty w.r.t. Closure and TS is they don't keep type info as easily reflectable runtime info. Users that choose to export in those formats may wish for something akin to "production mode" that elides most runtime checks, in favor of only static checking from DDC. |
Closure compiler also lowers ES6: https://github.com/google/closure-compiler/wiki/ECMAScript6 but it doesn't support our computed getters pattern. |
yeah, let me edit the intro post. I think existing compilers like Closure Compiler is the way to go here. Especially since they have the ability to compose source maps. |
In fact, maybe just close this? Not sure there's any work on our end, besides integration into build systems where applicable. |
we could reuse https://babeljs.io/ or https://github.com/google/traceur-compiler but I suspect we'll have better luck doing lowering internally to ES5, and getting cleaner code that way while preserving source location maps. If we base on JS AST's (https://github.com/dart-lang/bleeding_edge/tree/master/dart/pkg/compiler/lib/src/js) it should be able to be factored cleanly (see existing async rewriter)
The text was updated successfully, but these errors were encountered: