Closed
Description
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