Skip to content

Conversation

@mattlewis92
Copy link
Contributor

PR Checklist

Please check if 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
  • angular.dev application / infrastructure changes
  • Other... Please describe:

What is the current behavior?

Issue Number: #64467

What is the new behavior?

Fixes a bug in the missingStructuralDirective diagnostic where structural directives with missing imports were not reported when the element using the structural directive contained other directives

Does this PR introduce a breaking change?

  • Yes
  • No

I guess if this reports new issues then it would be counted as a breaking change? Maybe it should only be landed on v21 to be safe?

Other information

@pullapprove pullapprove bot requested a review from devversion October 16, 2025 15:34
@angular-robot angular-robot bot added the area: compiler Issues related to `ngc`, Angular's template compiler label Oct 16, 2025
@ngbot ngbot bot added this to the Backlog milestone Oct 16, 2025
expect(diags.length).toBe(0);
});

it('should *not* produce a warning for ngIf with template references using then/else', () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Found this fix was needed while testing this patch on our repo

type: 'directive',
name: 'BarDirective',
selector: '[bar]',
inputs: {bar: 'bar'},
Copy link
Member

Choose a reason for hiding this comment

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

Have you looked into why the test was passing when this specific input was removed ? (without the fix in).

Copy link
Contributor Author

@mattlewis92 mattlewis92 Oct 16, 2025

Choose a reason for hiding this comment

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

The diagnostic doesn't even run without it - I presume it results in a template compilation error which prevents the diagnostic from running (which we don't check for in the test)

{
type: 'directive',
name: 'BarDirective',
selector: 'ng-template[bar]',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was another issue found while testing - *cdkDragPreview matches on ng-template[cdkDragPreview]

https://github.com/angular/components/blob/e66f1ca081fa548269849f3af69bf9738adf61fe/src/cdk/drag-drop/directives/drag-preview.ts#L32

Copy link
Contributor

@thePunderWoman thePunderWoman left a comment

Choose a reason for hiding this comment

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

LGTM

@thePunderWoman thePunderWoman removed the request for review from devversion October 17, 2025 18:30
@thePunderWoman thePunderWoman added action: merge The PR is ready for merge by the caretaker target: patch This PR is targeted for the next patch release labels Oct 17, 2025
@thePunderWoman
Copy link
Contributor

This PR was merged into the repository. The changes were merged into the following branches:

thePunderWoman pushed a commit that referenced this pull request Oct 17, 2025
…se negatives (#64470)

Fixes a bug in the missingStructuralDirective diagnostic where structural directives with missing imports were not reported when the element using the structural directive contained other directives

Fixes #64467

PR Close #64470
thePunderWoman added a commit to thePunderWoman/angular that referenced this pull request Oct 20, 2025
thePunderWoman added a commit to thePunderWoman/angular that referenced this pull request Oct 20, 2025
@JeanMeche JeanMeche removed the action: merge The PR is ready for merge by the caretaker label Oct 20, 2025
@JeanMeche
Copy link
Member

We had to revert it, it was breaking some projects inside G3.

@JeanMeche JeanMeche added the state: blocked on G3 cleanup This change requires a G3 cleanup label Oct 20, 2025
thePunderWoman added a commit that referenced this pull request Oct 20, 2025
thePunderWoman added a commit that referenced this pull request Oct 20, 2025
@JeanMeche JeanMeche closed this Oct 22, 2025
@JeanMeche
Copy link
Member

We had a rebase issue due to the revert, the change is now at #64579

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Nov 22, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area: compiler Issues related to `ngc`, Angular's template compiler state: blocked on G3 cleanup This change requires a G3 cleanup target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants