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
fix: typescript createProgram doesn't support incremental mode #5346
Conversation
This pull request has been linked to and will mark 1 task as "Done" when merged:
This pull request has also been linked to 34 additional tasks:
|
Could you add a test case? |
@DeMoorJasper I added a test based on the minimal repro I linked in the issue. I also made sure the test fails without the fix and pass with it, see the latest commit;) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome, thanks
↪️ Pull Request
This PR solves #5344
transformer-typescript-types
uses the typescript API through thets.createProgram
function. But this function is not meant to be used with composite. Indeed, the typescript's team provide another API specifically for this case:createIncrementalProgram
.Incremental build is irrelevant for Parcel here, but on the other hand the user could have a
tsconfig.json
with composite enabled, for instance to enable somevscode
features (ie. project references). So we should make sure thatcomposite
is set to false.🚨 Test instructions
I provided an example repository to test the fix: https://github.com/paeolo/parcel-issue-5344. But the idea is juste to set
composite: true
in thecompilerOptions
and have a non-emptyindex.d.ts
when you build.✔️ PR Todo