Skip to content

To handle d.ts emit errors that could affect other files, in incremental mode use d.ts emit text + diagnostics as signature of the file #49543

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

Merged
merged 7 commits into from
Jun 27, 2022

Conversation

sheetalkamat
Copy link
Member

We use to consider only d.ts emit text as file signature of file which meant if d.ts emit changed we would update other files that reference the file. But d.ts emit can have errors resulting in same .d.ts emit but impacting the other files. So now we consider d.ts file text + diagnostics as a signature of the file
Fixes #49527

… which results in incorrect incremental behaviour
…can be more accurate for detecting changes to file that could affect other files

Fixes #49527
@typescript-bot typescript-bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Jun 14, 2022
@sheetalkamat
Copy link
Member Author

Ping @andrewbranch @amcasey @weswigham

Copy link
Member

@amcasey amcasey left a comment

Choose a reason for hiding this comment

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

Seems sensible, but I have some questions about potential optimizations.

Do not serialize file name if error is in same file we are emitting. this should avoid having to do file path computation in most cases.
Locations are start and length instead of line and character.
Do not use any indents
@sheetalkamat
Copy link
Member Author

@amcasey 196d93d should simplify the diagnostics serialization per your suggestion

@sheetalkamat sheetalkamat merged commit df21926 into main Jun 27, 2022
@sheetalkamat sheetalkamat deleted the staleErrors branch June 27, 2022 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

More stale errors in tsbuildinfo file (with incremental:true)
4 participants