-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Fix tsc watch and watch API for a project that has project references #27082
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
src/compiler/program.ts
Outdated
if (oldRefs) { | ||
return oldProgram.structureIsReused = StructureIsReused.Not; | ||
} | ||
Debug.assert(!oldRefs); |
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.
For future readers it'd be nice to comment why this can't be the case (because getResolvedProjectReferences shouldn't return anything unless getProjectReferences did)
@@ -1257,10 +1268,14 @@ namespace ts { | |||
}; | |||
} | |||
|
|||
function getProjectReferences() { | |||
function getResolvedProjectReferences() { |
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.
IMO this is a good change, but still it's a breaking API change and should be documented somewhere
src/compiler/utilities.ts
Outdated
@@ -249,6 +249,12 @@ namespace ts { | |||
sourceFile.resolvedTypeReferenceDirectiveNames.set(typeReferenceDirectiveName, resolvedTypeReferenceDirective); | |||
} | |||
|
|||
export function projectReferencesIsEqualTo(oldRef: ProjectReference, newRef: ProjectReference) { |
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.
Consider renaming to projectReferenceIsEqualTo
since it only handles one reference at a time there's no need for plural in the same
@ajafff had a good point - we should reshuffle the names so we don't break any existing consumers of that function |
@RyanCavanaugh I looked though github and I didn't find any use for existing |
@sheetalkamat As I said, I think this is a good change as I wrote that line you linked to. I think this is pretty easy to feature-detect if you change the purpose of the existing method. Besides that there is TypeStrong/ts-loader#817 which also uses the method, but could also feature-detect which one to use. |
Let's just go ahead and change it then |
No description provided.