Use TypeScript project references
There are no commits yet
Push commits to the source branch or add previously merged commits to review them.
Created by: felixfbecker
We have many TS projects that partly reference each other. Currently, TS has to double-compile the common files for every project. This is noticeable when:
yarn all:typecheck
tsc
compilers running concurrentlylsif
or extrunner
cannot easily share code with shared
After this PR, we only run one tsc
in VS Code and yarn all:typecheck
. For each project, compilation results are written to disk (out
directories). If nothing changed in a project, it does not get rebuilt.
Code intelligence still jumps directly to the source as of TS 3.7.
Node projects like lsif
or extrunner
can easily share functions from shared
with this by referencing the project (it's not referenced yet as there are no references yet).
It also enforces that we don't use circular references between projects.
This also changes our webpack configs and gulpfiles to be written in JS with @ts-check
instead of TS. This saves multiple seconds of gulp tasks (which is run on every build and on yarn install
) and makes it easier to use project references as those files don't have to be in a project. @ts-check
provides a sufficient level of in-editor checking and editor experience, and these files are rarely changed, with mistakes usually resulting in build misconfiguration that wouldn't be caught by TS anyway.
Push commits to the source branch or add previously merged commits to review them.