You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This PR provides api for tooling to use build and incremental options: TypeStrong/ts-loader#935 shows use of --build api
Solution Builder
Two functions createSolutionBuilder and createSolutionBuilderWithWatch provide a way to create SolutionBuilder for given root projects, and build options. The only difference in later is that it also watches the projects for changes to be able to build.
build and clean provide a compact way of building/cleaning all root projects provided or project mentioned (including their references). getNextInvalidatedProject is the API for more granular level operations on each project. This function will give you a project that needs to be either built or needs to update output because prepend changed or just needs update timestamps. When done method of the returned project is called, it ensures all actions are taken place and its ready to move to next project so that next call to getNextInvalidatedProject will return you next project that's invalid or undefined if the build is complete.
Incremental Builder Program
createIncrementalProgram and createIncrementalCompilerHost are methods similar to createProgram and createCompilerHost to build the incremental builder program.
This also exposes readBuilderProgram provides a way to be able to create the EmitAndSemanticDiagnosticsBuilder from the .tsbuildinfo for the compiler options. Note that this is special program that is readonly version and it can only be used as oldProgram to create new builder program.
@manucorporat Sorry I missed your question earlier. I am not sure what you mean by createLanguageService. This is the api for compiling the programs like tsc --b or tsc --incremental.
It looks like these APIs either allow fine-granular acccess with getNextInvalidatedProject, or support watching.
In order to trigger the watching behaviour one needs to call solutionBuilder.build() which does not support custom transformers.
However, not all is lost. It is possible to sneak transformers in by using createProgram callback, inside which you can patch program.emit() method with your own code, calling the original emit(...) with extra transformers added.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR provides api for tooling to use build and incremental options:
TypeStrong/ts-loader#935 shows use of --build api
Solution Builder
Two functions
createSolutionBuilder
andcreateSolutionBuilderWithWatch
provide a way to createSolutionBuilder
for given root projects, and build options. The only difference in later is that it also watches the projects for changes to be able to build.build
andclean
provide a compact way of building/cleaning all root projects provided or project mentioned (including their references).getNextInvalidatedProject
is the API for more granular level operations on each project. This function will give you a project that needs to be either built or needs to update output because prepend changed or just needs update timestamps. Whendone
method of the returned project is called, it ensures all actions are taken place and its ready to move to next project so that next call togetNextInvalidatedProject
will return you next project that's invalid or undefined if the build is complete.Incremental Builder Program
createIncrementalProgram
andcreateIncrementalCompilerHost
are methods similar tocreateProgram
andcreateCompilerHost
to build the incremental builder program.This also exposes
readBuilderProgram
provides a way to be able to create theEmitAndSemanticDiagnosticsBuilder
from the.tsbuildinfo
for the compiler options. Note that this is special program that is readonly version and it can only be used asoldProgram
to create new builder program.