-
Notifications
You must be signed in to change notification settings - Fork 12.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ScriptTarget.ES6 #595
Comments
@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? |
thanks @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. |
👍 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 |
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
.The text was updated successfully, but these errors were encountered: