fix(@angular/build): skip semantic diagnostics for declaration files#33400
fix(@angular/build): skip semantic diagnostics for declaration files#33400arturovt wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Code Review
This pull request optimizes the AOT compilation process by moving the check for declaration files (sourceFile.isDeclarationFile) to occur before retrieving semantic diagnostics. This avoids unnecessary processing and profiling for declaration files, which do not contain semantic or template diagnostics. There are no review comments, so I have no feedback to provide.
|
I don't think this holds for |
Declaration files don't produce semantic or template diagnostics, so calling getSemanticDiagnostics() on them was just wasted work. Move the isDeclarationFile guard to before that call so .d.ts files are skipped entirely.
2be4035 to
2eef0c7
Compare
|
@JoostK does update make sense? |
|
Since getSemanticDiagnostics(sourceFile) already appears to fast-return for .d.ts files under skipLibCheck, this change looks like an extra short-circuit in front of an existing short-circuit. I’m not seeing evidence of any win here, but we do take on extra code paths and another embedded assumption about TS diagnostic behavior. Unless there’s profiling showing this matters, I’d wouldn’t recommend moving forward with this change. |
Declaration files don't produce semantic or template diagnostics, so calling getSemanticDiagnostics() on them was just wasted work. Move the isDeclarationFile guard to before that call so .d.ts files are skipped entirely.