Fork-ts-checker-webpack-plugin: TS 3.6 will come with api support for --build and --incremental

Created on 17 Aug 2019  ·  4Comments  ·  Source: TypeStrong/fork-ts-checker-webpack-plugin

I'm still on vacation so I won't get to play around with this too early, but I just wanted to copy-paste this over here:
https://devblogs.microsoft.com/typescript/announcing-typescript-3-6-rc/

Might also be interesting for ts-loader.

APIs to Support --build and --incremental

TypeScript 3.0 introduced support for referencing other and building them incrementally using the --build flag. Additionally, TypeScript 3.4 introduced the --incremental flag for saving information about previous compilations to only rebuild certain files. These flags were incredibly useful for structuring projects more flexibly and speeding builds up. Unfortunately, using these flags didn’t work with 3rd party build tools like Gulp and Webpack. TypeScript 3.6 now exposes two sets of APIs to operate on project references and incremental program building.

For creating --incremental builds, users can leverage the createIncrementalProgram and createIncrementalCompilerHost APIs. Users can also re-hydrate old program instances from .tsbuildinfo files generated by this API using the newly exposed readBuilderProgram function, which is only meant to be used as for creating new programs (i.e. you can’t modify the returned instance – it’s only meant to be used for the oldProgram parameter in other create*Program functions).

For leveraging project references, a new createSolutionBuilder function has been exposed, which returns an instance of the new type SolutionBuilder.

For more details on these APIs, you can see the original pull request.

https://github.com/microsoft/TypeScript/pull/31432

enhancement

Most helpful comment

@phryneas , @fabb
Please try fork-ts-checker-webpack-plugin@alpha - I've published a new version which supports build mode 🚀
I will close this issue to clean-up the backlog :)

All 4 comments

Agreed - could be interesting! I am also on holiday right now. 🚢🏕️😄

There's a WIP PR for ts-loader related to these APIs by @sheetalkamat and @andrewbranch of the TypeScript team. Exciting times ahead!

https://github.com/TypeStrong/ts-loader/pull/935

Typescript 3.6 has been released with API support for --incremental: https://github.com/microsoft/TypeScript/issues/29978

See sample example by @sheetalkamat here: https://github.com/microsoft/TypeScript-wiki/pull/225

@phryneas , @fabb
Please try fork-ts-checker-webpack-plugin@alpha - I've published a new version which supports build mode 🚀
I will close this issue to clean-up the backlog :)

Was this page helpful?
0 / 5 - 0 ratings