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

Angular-cli witch es6 #3895

Closed
andrzepakula opened this issue Jan 7, 2017 · 2 comments
Closed

Angular-cli witch es6 #3895

andrzepakula opened this issue Jan 7, 2017 · 2 comments

Comments

@andrzepakula
Copy link

andrzepakula commented Jan 7, 2017

Hi. At the beginning I want to apologize for my bad English. I have a question. Builds advanced applications rest. I use your great angular-cli and I wanted to use the new features of ECMAScript6, for example http://es6-features.org/#GeneratorFunctionDirectUse . My WebStorm showed errors js version. So I set versions of java script on ECMAScript 6. Then also there were errors in the compilation of typescript. So I set file tsconfig target to ES6, and now everything works as it should, the new function ES6 are supported, and so far I do not have any errors. But I doubt whether it's certainly good to use ES6 and why at this moment is set by default ES5? Can you explain this to me?

Best Regards

Andrew

@Meligy
Copy link
Contributor

Meligy commented Jan 8, 2017

Hi @andrzejpakula
I'm afraid proper support for generators needs to come to TypeScript first. There's nothing CLI specific to be expected other than testing the newer version when it comes out, and officially use it by default.

We are talking several months here most likely.

Allow me to explain why, and feel free to ask if there's anything not obvious:

TypeScript

Angular CLI supports TypeScript only.

TypeScript supports most features of ES6, but not in every target output. It does support generators but only when targeting ES6, not ES5. The support for generators when targetting ES5 is planned but not yet implemented. Ref: microsoft/TypeScript#3975 (comment)

ES6

You cannot change the output of TypeScript to ES6 unless you only target a browser that fully supports ES6 (latest Chrome maybe?) Because Angular CLI does not apply any further compilation to the output of TypeScript.

What To Expect

So, most likely you'll need to wait until:

  • TypeScript releases a new version that supports generators when targeting ES5
  • Angular CLI supports that new TypeScript version
    (At the moment TypeScript latest version is 2.1.x, but Angular itself has an issue with that, which is why Angular CLI only supports TypeScript 2.0.x)

As mentioned above, I'm afraid we are probably talking several months here, and nothing specific for the issue from the CLI side.

Sorry.

@hansl hansl closed this as completed Jan 8, 2017
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants