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:
for await ... ofWe also need some new lib definitions:
The support for --target ES2018 was added in https://github.com/Microsoft/TypeScript/pull/20385
// CC: @bterlson
// CC: @benbraou
Just keep in mind that until a proposal shows up here it's not on the train for 2018.
Promise.prototype.finally, rest/spread properties and async iterable made it. Optional catch binding didn't.
@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.
@falsandtru I've removed * [ ] optional catch binding
Thanks!
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 馃檶
A PR would be appreciated. we need to split the transforms to their own file, and pipe the target flag through.
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 鉂わ笍
here is the PR that added ES2017 target, you can use it as a reference: https://github.com/Microsoft/TypeScript/pull/11407
and another feature: https://github.com/Microsoft/TypeScript/issues/23801 could(maybe) split too
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.
Most helpful comment
Is there any progress on this?
Node.js 10.0.0 now supports 100% of
ES2018, but only 8% ofESNEXT. So when targeting Node.js 10.x I would like to use e.g. native async iterators.Using
tsc --target es2018 --lib es2018 file.tsdoesn't work for async iterators though. You need to add,esnext.asynciterablesto--lib, and targetesnextinstead, 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 馃檶