Closed

Description
Suggestion
π Search Terms
es3 lib tsc
β 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
Adding a lib.es3.d.ts
and --lib es3
option for the tsc
compiler.
The file would provide every ES3 feature and TS utilities from lib.es5.d.ts
.
π Motivating Example
A large number of older libraries such as JQuery will target ES3 only.
You can find these on the DefinitelyTyped monorepo.
There should be the option to use these libraries without opting into ES5, for legacy support.
π» Use Cases
- What do you want to use this for?
I've been writing a DefinitelyTyped package that depends on JQuery and supports IE8. Horrible but go figure. - What shortcomings exist with current approaches?
Right now,lib
can be left empty but that misses all the TS core utils and ES3 types. - What workarounds are you using in the meantime?
--lib ES5
which is not ideal but will have to do.