Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TS 3.6 will come with api support for --build and --incremental #328

Closed
phryneas opened this issue Aug 17, 2019 · 4 comments
Closed

TS 3.6 will come with api support for --build and --incremental #328

phryneas opened this issue Aug 17, 2019 · 4 comments

Comments

@phryneas
Copy link
Contributor

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.

microsoft/TypeScript#31432

@johnnyreilly
Copy link
Member

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!

TypeStrong/ts-loader#935

@fabb
Copy link

fabb commented Aug 29, 2019

Typescript 3.6 has been released with API support for --incremental: microsoft/TypeScript#29978

@johnnyreilly
Copy link
Member

See sample example by @sheetalkamat here: microsoft/TypeScript-wiki#225

@piotr-oles
Copy link
Collaborator

@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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants