perf(compiler): speed up watch mode (#19275)

- don’t regenerate code for .d.ts files when
  an oldProgram is passed to `createProgram`
- cache `fileExists` / `getSourceFile` / `readFile` in watch mode
- refactor tests to share common code in `test_support`
- support `—diagnostic` command line to print total time
  used per watch mode compilation.
PR Close #19275
This commit is contained in:
Tobias Bosch
2017-09-19 11:43:34 -07:00
committed by Igor Minar
parent ad7251c8bb
commit 6665d76fbb
11 changed files with 622 additions and 346 deletions

View File

@ -66,8 +66,9 @@ export interface CompilerHost extends ts.CompilerHost {
export enum EmitFlags {
DTS = 1 << 0,
JS = 1 << 1,
Codegen = 1 << 4,
Default = DTS | JS
Default = DTS | JS | Codegen
}
export interface CustomTransformers {
@ -106,6 +107,7 @@ export interface Program {
customTransformers?: CustomTransformers,
emitCallback?: TsEmitCallback
}): ts.EmitResult;
getLibrarySummaries(): {fileName: string, content: string}[];
}
// Wrapper for createProgram.