-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Handle seenEmittedFiles which was not being set when emit of a file was complete #33145
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
Conversation
…as complete. It was issue only when errors are reported before emitting (which puts the files into pendingEmit that needs to check only in seenEmittedFiles) If emit happens before semantic diagnostics query this issue is not repro, because the affected files come into play and those are being set correctly Fixes #31398
… is on (map files are emitted before d.ts)
…y it easily in baseline
@typescript-bot pack this |
Heya @sheetalkamat, I've started to run the tarball bundle task on this PR at 6587bd7. You can monitor the build here. It should now contribute to this PR's status checks. |
Hey @sheetalkamat, I've packed this into an installable tgz. You can install it for testing by referencing it in your
and then running |
@sheetalkamat I ran this branch on our production codebase test case (from #33061 (comment)) and it seems to fix the issue! Thanks so much for getting this resolved! |
@sheetalkamat Will this be in 3.6.x? |
b2cea62
to
83cac57
Compare
yes |
@@ -214,6 +215,10 @@ namespace ts { | |||
if (fileExtensionIs(inputFileName, Extension.Dts)) continue; | |||
const jsFilePath = getOutputJSFileName(inputFileName, configFile, ignoreCase); | |||
if (jsFilePath) return jsFilePath; | |||
if (fileExtensionIs(inputFileName, Extension.Json)) continue; | |||
if (getEmitDeclarations(configFile.options) && hasTSFileExtension(inputFileName)) { |
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.
quick note for @weswigham: this new line will probably need when bringing the js-to-dts PR up to date with master
@typescript-bot cherry-pick this to release-3.6 |
Hey @sheetalkamat, I couldn't open a PR with the cherry-pick. (You can check the log here). You may need to squash and pick this PR into release-3.6 manually. |
implement create Hash to be default hashing plus data so we can verify it easily in baseline
…as complete (microsoft#33145) * Add test that fails because file is written multiple times Reported from microsoft#33061 * Handle seenEmittedFiles which was not being set when emit of a file was complete. It was issue only when errors are reported before emitting (which puts the files into pendingEmit that needs to check only in seenEmittedFiles) If emit happens before semantic diagnostics query this issue is not repro, because the affected files come into play and those are being set correctly Fixes microsoft#31398 * make baselining source map optional * Handle emitDeclarationOnly in --build scenario * Ensure we are using d.ts emit as signature even when --declarationMap is on (map files are emitted before d.ts) * Move module specifiers to verifyTsBuildOutput * implement create Hash to be default hashing plus data so we can verify it easily in baseline * Remove failing baseline * Accept correct baseline name
It was issue only when errors are reported before emitting (which puts the files into pendingEmit that needs to check only in
seenEmittedFiles
and notseenAffectedFiles
)If emit happens before semantic diagnostics query this issue is not repro, because the affected files come into play and those are being set correctly.
Fixes #31398
Thanks to @ericanderson and @bjlaub for getting us the repro.
As part of this I also found out that when
--declarationMap
is on in project we were using.d.ts.map
instead of.d.ts
as signature which is not desirable (since the map can change without changing d.ts resulting in complete refresh even if it didn't affect .d.ts). I have fixed this in this PR along with ensuring that we have test case for that. Changed the createHash of SolutionBuilderHost for tests to emitsignature-content
so that its easily diagnosable.