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
There's been multiple issues raised regarding having more ES6 features in Typescript (#7, #13, #19, #232, #237, #240, #389, etc). I'm personally interested in implementing #13.
Would it help to add ES6 to the ScriptTarget enum and begin implementing parser changes to allow the new syntax under the new language level?
Once we allow the new syntax, we can first begin by passing through the code directly (since the generated code is ES6). Later on, we can handle code generation for other targets.
This could also affect existing features in Typescript that have ES6 equivalents - for example, rest parameters in function declarations can be emitted as is in ES6 using the spread operator, without generating the code to splice out arguments.
We will want to support this for down-level first, translating the template into regular strings with plus between parts. later on when we support emitting in ES6, the translation would be trivial.
As for contributing, PR's would be the best approach. Since this is a bigger change than normal bug fixes, please share your changes early and incrementally so that we can provide feedback.
I would start by parsing, and adding tests for these cases, then add emit, and finally wire the type checking in.
Feel free to tag me, or email me directly if you have any questions.
👍 It will take much more time to support fancy ES6 features in ES5 than it will to just pass them through and make sure type checking works. I'm super conflicted because node supports generators but TS doesn't.
Target added in #904, along withn Let and Const support. emitting other ES6 compliant structures (e.g. classes, arrow functions, rest args, etc..) to ES6 will occur incrementally as we go
Activity
vvakame commentedon Sep 5, 2014
#238
duncanmak commentedon Sep 12, 2014
jonathandturner - I saw that you mentioned in #670 that there are plans for adding ES6 to Typescript.
I'm interested in working on template strings, what's the best way for me to contribute?
mhegazy commentedon Sep 13, 2014
thanks Duncan Mak (@duncanmak), we have a separate bug tracking this (#13).
We will want to support this for down-level first, translating the template into regular strings with plus between parts. later on when we support emitting in ES6, the translation would be trivial.
As for contributing, PR's would be the best approach. Since this is a bigger change than normal bug fixes, please share your changes early and incrementally so that we can provide feedback.
I would start by parsing, and adding tests for these cases, then add emit, and finally wire the type checking in.
Feel free to tag me, or email me directly if you have any questions.
seanhess commentedon Sep 16, 2014
👍 It will take much more time to support fancy ES6 features in ES5 than it will to just pass them through and make sure type checking works. I'm super conflicted because node supports generators but TS doesn't.
mhegazy commentedon Oct 25, 2014
Target added in #904, along withn Let and Const support. emitting other ES6 compliant structures (e.g. classes, arrow functions, rest args, etc..) to ES6 will occur incrementally as we go