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

fix: typescript createProgram doesn't support incremental mode #5346

Merged
merged 4 commits into from Nov 14, 2020

Conversation

paeolo
Copy link
Contributor

@paeolo paeolo commented Nov 12, 2020

↪️ Pull Request

This PR solves #5344

transformer-typescript-types uses the typescript API through the ts.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 some vscode features (ie. project references). So we should make sure that composite 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 the compilerOptions and have a non-empty index.d.ts when you build.

✔️ PR Todo

  • Filled out test instructions (In case there aren't any unit tests)
  • Included links to related issues/PRs

@height
Copy link

height bot commented Nov 12, 2020

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:

@DeMoorJasper
Copy link
Member

Could you add a test case?

@paeolo
Copy link
Contributor Author

paeolo commented Nov 13, 2020

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

Copy link
Member

@DeMoorJasper DeMoorJasper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome, thanks

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.

Parcel v2: Setting composite to true breaks transformer-typescript-types
2 participants