This project is read-only.

How much emitted boilerplate code is too much?

Topics: General
May 30, 2013 at 1:24 AM
You guys emit extra helper functions for certain features like __extends, which is only 5 lines. Are the devs willing to emit a much larger number of lines of code? I fear that if the answer is no, we won't see features like function generators and async/await in environments Being able to use features like function generators (and classes and modules) in ES3 and ES5 environments is one of the biggest draws of TypeScript.
May 30, 2013 at 5:59 PM
Right - we generally want to keep the extra code we generate as isolated and as small as possible. If ES6 gets generators, I could imagine us supporting those in a future release and then polyfilling to ES5/ES3. Once we have generators, then the codegen for async/await can be simplified.
Jun 4, 2013 at 2:40 PM
On a related issue, would it be possible to have the option NOT to put this boiler code into every compiled .js file.

I'm new to TypeScript, and I'm currently trying to use TypeScript in my own module loading system, and it seems a waste that every unit would have to have the __extends boilder code attached to it, but rather having the __extends as a global would be better. There might already be a way to do this, but looking a the tsc --help I didn't see anything obvious.
Jun 4, 2013 at 5:20 PM
Edited Jun 4, 2013 at 5:21 PM
+ 1 for this. And since I overwrite _extends function a option to turn off will be very useful.