Add sample for incremental compiling and solution builder#225
Add sample for incremental compiling and solution builder#225sheetalkamat wants to merge 3 commits intomainfrom
Conversation
57ab2a5 to
d3be118
Compare
4f5cab8 to
a912d4a
Compare
| ...program.getOptionsDiagnostics(), | ||
| ...program.getGlobalDiagnostics(), | ||
| ...program.getSemanticDiagnostics() // Get the diagnostics before emit to cache them in the buildInfo file. | ||
| ]; |
There was a problem hiding this comment.
We not ts.getPreEmitDiagnostics() instead of duplicating the get___Diagnostics() calls?
What about ts.sortAndDeduplicateDiagnostics(diagnostics)?
| } | ||
|
|
||
| const program = ts.createIncrementalProgram({ | ||
| rootName: config.fileNames, |
There was a problem hiding this comment.
Typo: this is rootNames and not rootName
| /*optionsToExtend*/ { incremental: true }, | ||
| /*host*/ { | ||
| ...ts.sys, | ||
| onUnRecoverableConfigFileDiagnostic: d => console.error(ts.flattenDiagnosticMessageText(d, "\n")); |
There was a problem hiding this comment.
I think this should be:
onUnRecoverableConfigFileDiagnostic: d => console.error(ts.flattenDiagnosticMessageText(d.messageText, "\n"));Now it throws a compile error:
Argument of type 'Diagnostic' is not assignable to parameter of type 'string | DiagnosticMessageChain | undefined'.
There was a problem hiding this comment.
There is an invalid semi colon at the end
onUnRecoverableConfigFileDiagnostic: d => console.error(ts.flattenDiagnosticMessageText(d.messageText, "\n"));
c888fbb to
9927788
Compare
5c070ad to
fbcbe2a
Compare
|
hi @sheetalkamat , is it possible to have an example of using |
|
This PR refers to If possible, it would be great to have an explanation of |
| ); | ||
|
|
||
| // Builds the solution and watches for changes | ||
| solution.clean(); |
There was a problem hiding this comment.
I think this should be: solution.build()
|
This PR is a goldmine - would be great to see it merged now one year after its creation |
|
@sheetalkamat is there something outdated about this API that is holding up this documentation? |
Fixes microsoft/TypeScript#31849