Description
This is a request to make "target": "es2017"
a valid compiler option. There is a list of finished features for ES2017 (all stage 4) that can be found on the TC39 Finished Proposals page.
Note that TypeScript already supports "lib": ["es2017"]
and includes lib.2017.d.ts
, which declares the standard library features coming in ES2017, such as Object.values
and Object.entries
.
TypeScript also supports the two new syntactic features (async functions and trailing function commas), but with the current highest target (es6
), these features are unconditionally downlevelled.
With an ES2017
target, async functions and trailing commas would be preserved in the transpiled JavaScript output, without downlevelling.
Async/await runtime support
Async functions are already implemented in both the V8 and ChakraCore runtimes. Node.js will support async/await natively (initially in v7.x with --harmony
) when it updates to V8 5.4, expected by next month (i.e. October 2016).
Related issues
- #5361 Add ES2016 target discussion in that issue is largely about adding an evergreen
ESNext
target, which is a separate idea to this issue. - #8838 There are no option to no transform async/await closed as duplicate of Add ES2016 target #5361. Would be solved by this issue, regardless of what happens with Add ES2016 target #5361.
- #9691 Allow Emitting Async Await Directly closed as duplicate of Add ES2016 target #5361. Would be solved by this issue, regardless of what happens with Add ES2016 target #5361.