Skip to content

createIncrementalProgram: trigger recompilation with new files #35159

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

Closed
ivogabe opened this issue Nov 17, 2019 · 6 comments
Closed

createIncrementalProgram: trigger recompilation with new files #35159

ivogabe opened this issue Nov 17, 2019 · 6 comments
Labels
Question An issue which isn't directly actionable in code

Comments

@ivogabe
Copy link
Contributor

ivogabe commented Nov 17, 2019

Search Terms

createIncrementalProgram API changes

Suggestion

I'm currently trying to use createIncrementalProgram in gulp-typescript to make use of the new incremental compilation functionalities. I have not yet found how to signal the compiler that some files have changed. The version field of all the files is still at the old version, whereas the Host does have files with the new version. So how can I signal the BuilderProgram that some file has changed?

Use Cases

I'm implementing this in gulp-typescript, the gulp plugin for TypeScript. See ivogabe/gulp-typescript#635

@andrewbranch
Copy link
Member

@sheetalkamat do you know of any examples that @ivogabe can look at?

@sheetalkamat
Copy link
Member

createIncrementalProgram is similar to createProgram but reads the old program from the .tsbuildinfo. For your scenario you wanto use createWatchProgram which handles changes in files.

@andrewbranch andrewbranch added the Question An issue which isn't directly actionable in code label Dec 18, 2019
@ivogabe
Copy link
Contributor Author

ivogabe commented Dec 19, 2019

Thanks for the info! I'll take a look, it'll probably require some more changes than I hoped. I'll let you know if I can get it working. Do you mind keeping this open in case we have further questions?

@andrewbranch
Copy link
Member

I think the bot will close it only after some period of inactivity, but if it gets closed and you come back with more questions, feel free to comment and I’ll reopen.

@typescript-bot
Copy link
Collaborator

This issue has been marked as 'Question' and has seen no recent activity. It has been automatically closed for house-keeping purposes. If you're still waiting on a response, questions are usually better suited to stackoverflow.

@AaroncoolPx
Copy link

AaroncoolPx commented Jan 6, 2022

I am facing a problem.

createIncrementalProgram emits and update output files, even though source remain unchanged.

import ts = require("typescript");

var options = {
    incremental: true,
    allowJs: true,
    sourceMap: true,
    tsBuildInfoFile: "buildInfoTestOutput",
};
let program = ts.createIncrementalProgram ({
    rootNames: ["./test1.ts"],
    options: options
});
let emitResult = program.emit();

[email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Question An issue which isn't directly actionable in code
Projects
None yet
Development

No branches or pull requests

5 participants