-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
In DiscussionNot yet reached consensusNot yet reached consensusSuggestionAn idea for TypeScriptAn idea for TypeScript
Description
Suggestion
π Search Terms
remove emit target es3 es5
β Viability Checklist
My suggestion meets these guidelines:
- This wouldn't be a breaking change in existing TypeScript/JavaScript code
- This wouldn't change the runtime behavior of existing JavaScript code
- This could be implemented without emitting different JS based on the types of the expressions
- This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
- This feature would agree with the rest of TypeScript's Design Goals.
β Suggestion
Following #47572, once the default target has been raised to a new value, can TypeScript remove emit support for the no-longer-default old version in either that same major version or the next one?
Using the example schedule in that issue:
- Remove es3 emit support for 5.0, making es5 the lowest supported emit target
- Remove es5 emit support for 6.0, making es2015 the lowest supported emit target
- ...and so on
π Motivating Example
Supporting emit to low emit targets such as ES3/5 worsens:
- Dev cost for some TypeScript features: e.g. Allowed non-this, non-super code before super call in derived classes with property initializersΒ #29374's changes were mostly in emit
- Output package size: e.g.
src/compiler/transformers/es2015.ts
has >4k lines today (about 10% the size ofsrc/compiler/checker.ts
)
π» Use Cases
It'd be nice to have a leaner TypeScript without the cost of supporting emit for syntax compatibility the vast majority of runtimes no longer need.
robpalme and marvinhagemeister
Metadata
Metadata
Assignees
Labels
In DiscussionNot yet reached consensusNot yet reached consensusSuggestionAn idea for TypeScriptAn idea for TypeScript