Skip to content

perf(@angular/build): avoid invalidating Angular diagnostic cache on stylesheet change - #34225

Open
alan-agius4 wants to merge 1 commit into
angular:mainfrom
alan-agius4:perf/skip-diagnostic-invalidation-on-stylesheet-change
Open

alan-agius4 wants to merge 1 commit into
angular:mainfrom
alan-agius4:perf/skip-diagnostic-invalidation-on-stylesheet-change

Conversation

@alan-agius4

Copy link
Copy Markdown
Collaborator

PR Checklist

Please check to confirm your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Performance

What is the current behavior?

When any component resource is modified during incremental watch rebuilds, the component's cached Angular diagnostics are invalidated and the component source file is marked as affected for diagnostics collection, even if the modified resource is a stylesheet (.css, .scss, .sass, .less).

What is the new behavior?

Component stylesheets do not affect TypeScript semantic diagnostics or Angular template diagnostics. When a modified component resource is a stylesheet, avoid clearing the component's cached Angular diagnostics and avoid marking the component source file as affected for diagnostics re-collection.

Does this PR introduce a breaking change?

  • Yes
  • No

…stylesheet change

Component stylesheets (.css, .scss, .sass, .less) do not impact TypeScript semantic diagnostics or Angular template diagnostics.

When a stylesheet dependency changes during watch rebuilds, avoid deleting the component's cached Angular diagnostics or marking the component source file as affected for diagnostics re-collection.
@angular-robot angular-robot Bot added area: performance Issues related to performance area: @angular/build labels Oct 1, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request modifies the AotCompilation class in the Angular build tools to prevent style files (such as .css, .scss, .sass, and .less) from invalidating Angular diagnostics and marking source files as affected when component resources are modified. There are no review comments, and we have no additional feedback to provide.

@alan-agius4 alan-agius4 added action: review The PR is still awaiting reviews from at least one requested reviewer target: patch This PR is targeted for the next patch release labels Oct 1, 2026
@alan-agius4
alan-agius4 requested a review from clydin October 1, 2026 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: review The PR is still awaiting reviews from at least one requested reviewer area: @angular/build area: performance Issues related to performance target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant