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

lib.es3.d.ts for DefinitelyTyped libraries with legacy support #46130

Closed
5 tasks done
ghost opened this issue Sep 29, 2021 · 1 comment
Closed
5 tasks done

lib.es3.d.ts for DefinitelyTyped libraries with legacy support #46130

ghost opened this issue Sep 29, 2021 · 1 comment
Labels
Declined The issue was declined as something which matches the TypeScript vision Suggestion An idea for TypeScript

Comments

@ghost
Copy link

ghost commented Sep 29, 2021

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.
@andrewbranch andrewbranch added Declined The issue was declined as something which matches the TypeScript vision Suggestion An idea for TypeScript labels Oct 1, 2021
@andrewbranch
Copy link
Member

You should be able to do this yourself with #45771. I don’t think we’re going to invest in targeting ES3 at this point πŸ˜•

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Declined The issue was declined as something which matches the TypeScript vision Suggestion An idea for TypeScript
Projects
None yet
Development

No branches or pull requests

1 participant