Skip to content

Normalize our lib files by compiler settings #4168

Closed
@RyanCavanaugh

Description

@RyanCavanaugh

Right now the compiler depends on a monolithic lib.d.ts file that is resolved according to the script target (ES5 or ES6). We have to build several different lib.d.ts files out of smaller parts.

We should refactor this so that the different aspects of the compiler settings can map to smaller sub-parts of the libraries.

Language target:

  • ES3
  • ES5
  • ES6
  • Latest

Host:

  • Browser with DOM
  • WebWorker
  • NodeJS
  • Windows Script Host 😷

Module system:

  • CommonJS
  • AMD
  • None

The idea is that we a function that takes a CompilerSettings and produces a list of filenames. These files might reference each other, e.g. lib.es5.d.ts would probably reference lib.es6.d.ts and just provide interface augmentations.

This provides several benefits:

  • It will be easier for us to edit these files because they are smaller
  • It will be easier for users to patch in only specific versions if they decide they need to fork certain things
  • It will be possible for users to have a custom version of one file while still getting bug fixes for the other files
  • Provides a more natural way to shim in specific things based on compiler settings without having a combinatorial explosion of concatenated lib.d.ts files

Metadata

Metadata

Assignees

No one assigned

    Labels

    ExternalRelates to another program, environment, or user action which we cannot control.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions