Visitar URL original
Remove older emit support over time Β· Issue #47573 Β· microsoft/TypeScript Β· GitHub
The Wayback Machine - https://web.archive.org/web/20220210214006/https://github.com/microsoft/TypeScript/issues/47573
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

Remove older emit support over time #47573

Open
5 tasks done
JoshuaKGoldberg opened this issue Jan 24, 2022 · 0 comments
Open
5 tasks done

Remove older emit support over time #47573

JoshuaKGoldberg opened this issue Jan 24, 2022 · 0 comments

Comments

@JoshuaKGoldberg
Copy link
Contributor

@JoshuaKGoldberg JoshuaKGoldberg commented Jan 24, 2022 •

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. #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 of src/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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants