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

Support for --target ES2018 #20463

Closed
1 of 3 tasks
mhegazy opened this issue Dec 5, 2017 · 13 comments
Closed
1 of 3 tasks

Support for --target ES2018 #20463

mhegazy opened this issue Dec 5, 2017 · 13 comments
Assignees
Labels
Bug A bug in TypeScript ES2018 Relates to the ES2018 Spec Help Wanted You can do this

Comments

@mhegazy
Copy link
Contributor

mhegazy commented Dec 5, 2017

As TC39 gets ready to finalize ES2018, we should allow pass through for some transformation now only enabled under --target ESNext, here is the list:

Disable transforms for:

  • Rest/Spread Properties
  • async generators/for await ... of

We also need some new lib definitions:

The support for --target ES2018 was added in #20385

@mhegazy mhegazy added the Bug A bug in TypeScript label Dec 5, 2017
@mhegazy mhegazy added this to the TypeScript 2.7 milestone Dec 5, 2017
@mhegazy mhegazy self-assigned this Dec 5, 2017
@mhegazy mhegazy added Help Wanted You can do this ES2018 Relates to the ES2018 Spec labels Dec 5, 2017
@mhegazy
Copy link
Contributor Author

mhegazy commented Dec 5, 2017

// CC: @bterlson

@mhegazy
Copy link
Contributor Author

mhegazy commented Dec 5, 2017

// CC: @benbraou

@bterlson
Copy link
Member

bterlson commented Dec 5, 2017

Just keep in mind that until a proposal shows up here it's not on the train for 2018.

@dinoboff
Copy link

dinoboff commented Feb 19, 2018

Promise.prototype.finally, rest/spread properties and async iterable made it. Optional catch binding didn't.

@falsandtru
Copy link
Contributor

@mhegazy optional catch binding is still stage 3 (https://github.com/tc39/proposals) and browserify can't compile it. This transform should be kept with es2018.

@DanielRosenwasser
Copy link
Member

@falsandtru I've removed * [ ] optional catch binding

@falsandtru
Copy link
Contributor

Thanks!

@LinusU
Copy link
Contributor

LinusU commented May 29, 2018

Is there any progress on this?

Node.js 10.0.0 now supports 100% of ES2018, but only 8% of ESNEXT. So when targeting Node.js 10.x I would like to use e.g. native async iterators.

Using tsc --target es2018 --lib es2018 file.ts doesn't work for async iterators though. You need to add ,esnext.asynciterables to --lib, and target esnext instead, however doing this would then potentially enable and emit things that aren't supported on Node.js 10.x.

Would love to contribute PRs if there is a clear path forward 🙌

@mhegazy
Copy link
Contributor Author

mhegazy commented May 29, 2018

A PR would be appreciated. we need to split the transforms to their own file, and pipe the target flag through.

@LinusU
Copy link
Contributor

LinusU commented May 29, 2018

Haven't worked with the TS code base before, but would be happy to start!

If you have it in your head, some quick links to which files should be changed would be very much appreciated ❤️

@mhegazy
Copy link
Contributor Author

mhegazy commented May 29, 2018

here is the PR that added ES2017 target, you can use it as a reference: #11407

@Kingwl
Copy link
Contributor

Kingwl commented Jun 6, 2018

and another feature: #23801 could(maybe) split too

@mhegazy mhegazy removed this from the TypeScript 3.0 milestone Jul 2, 2018
@wolfy1339
Copy link

Now that ES2019 is around the corner, it would be a good time for this to be worked on, heck someone made a PR for ES2019 already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript ES2018 Relates to the ES2018 Spec Help Wanted You can do this
Projects
None yet
Development

No branches or pull requests

10 participants