Skip to content
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

Closed
duncanmak opened this issue Sep 4, 2014 · 5 comments
Closed

Add ScriptTarget.ES6 #595

duncanmak opened this issue Sep 4, 2014 · 5 comments
Labels
ES6 Relates to the ES6 Spec

Comments

@duncanmak
Copy link

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.

@vvakame
Copy link
Contributor

vvakame commented Sep 5, 2014

#238

@duncanmak
Copy link
Author

@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
Copy link
Contributor

mhegazy commented Sep 13, 2014

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.

@seanhess
Copy link

👍 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
Copy link
Contributor

mhegazy commented 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

@mhegazy mhegazy closed this as completed Oct 25, 2014
@microsoft microsoft locked and limited conversation to collaborators Jun 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
ES6 Relates to the ES6 Spec
Projects
None yet
Development

No branches or pull requests

5 participants