Fix tsc watch and watch API for a project that has project references#27082
Fix tsc watch and watch API for a project that has project references#27082sheetalkamat merged 4 commits intomasterfrom
Conversation
| if (oldRefs) { | ||
| return oldProgram.structureIsReused = StructureIsReused.Not; | ||
| } | ||
| Debug.assert(!oldRefs); |
There was a problem hiding this comment.
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)
| } | ||
|
|
||
| function getProjectReferences() { | ||
| function getResolvedProjectReferences() { |
There was a problem hiding this comment.
IMO this is a good change, but still it's a breaking API change and should be documented somewhere
| sourceFile.resolvedTypeReferenceDirectiveNames.set(typeReferenceDirectiveName, resolvedTypeReferenceDirective); | ||
| } | ||
|
|
||
| export function projectReferencesIsEqualTo(oldRef: ProjectReference, newRef: ProjectReference) { |
There was a problem hiding this comment.
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.