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

Incremental compilation using new API #635

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

ivogabe
Copy link
Owner

@ivogabe ivogabe commented Nov 17, 2019

This PR introduces incremental compilation using the new API provided by TypeScript. This is still work in progress. TODO:

  • Switch to createIncrementalProgram
  • Trigger recompilations in watch mode: currently the compiler does not pick up any changes. I'm not sure how to properly signal the compiler that some files were changed.
  • Handle changes in file names: We may need to recreate the incremental program if this happens. This would trigger a full compilation instead of an incremental one.
  • Handle change in rootDir: similar to the previous issue. It may be less-risky to just force that the rootDir option is given
  • Parse & emit .tsbuildinfo file

@michaelaird
Copy link
Contributor

Is there any way I could help out with this?

@ivogabe
Copy link
Owner Author

ivogabe commented Jan 9, 2020

Thanks for asking, it's sadly more complex than I thought. We have to adapt to a new API, and that will require some more changes I'm afraid. You could take a look at microsoft/TypeScript#35159. If you don't want to dive into that you can definitely help testing when I made some more progress, but I'm busy at work currently. I hope I can find a weekend to work on this soon.

@michaelaird
Copy link
Contributor

Would you consider splitting this into 2 features? one to handle createIncrementalProgram + emitting .tsbuildinfo and a second one to improve watch mode?

@ivogabe
Copy link
Owner Author

ivogabe commented Jan 9, 2020

Yes I was already thinking to do that, but I was planning to do the second first actually. But given that we have to use a different API for watch mode, it is probably indeed better to do it in your order. We can probably do that without using the watcher API. Do you want to take a look at the first?

@promethyttrium
Copy link

promethyttrium commented Aug 1, 2020

It's now August, will this be merged soon?

@TotooriaHyperion
Copy link

I find that with incremental enabled, the original incremental compiler of typescript will emit a file that skip my custom transformer(it's not declared in tsconfig but in gulpfile). And after the gulp watcher and task, I get a new file that go through all transformer.
Hope this feature be released soon.

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

Successfully merging this pull request may close these issues.

4 participants