Skip to content

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

Closed
@ghost

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DeclinedThe issue was declined as something which matches the TypeScript visionSuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions