Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

ES5 support #49

Closed
jmesserly opened this issue Feb 17, 2015 · 5 comments
Closed

ES5 support #49

jmesserly opened this issue Feb 17, 2015 · 5 comments

Comments

@jmesserly
Copy link
Contributor

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)

@jmesserly
Copy link
Contributor Author

#61 will make this much easier

@jmesserly
Copy link
Contributor Author

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.

@vsmenon
Copy link
Contributor

vsmenon commented Aug 12, 2015

Closure compiler also lowers ES6:

https://github.com/google/closure-compiler/wiki/ECMAScript6

but it doesn't support our computed getters pattern.

@ochafik

@jmesserly
Copy link
Contributor Author

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.

@jmesserly
Copy link
Contributor Author

In fact, maybe just close this? Not sure there's any work on our end, besides integration into build systems where applicable.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

2 participants