fix: linker converts queries/viewQueries to contentQueries/viewQuery for directives#81
Merged
Brooooooklyn merged 1 commit intomainfrom Mar 5, 2026
Merged
Conversation
…for directives The linker's link_directive() was missing calls to build_queries(), causing directives with @ContentChild/@ContentChildren/@ViewChild/@ViewChildren to silently lose those queries during linking. This mirrors what link_component() already does correctly. - Close #70 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Member
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

The linker's link_directive() was missing calls to build_queries(), causing
directives with @ContentChild/@ContentChildren/@ViewChild/@ViewChildren to
silently lose those queries during linking. This mirrors what link_component()
already does correctly.
Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com
Note
Medium Risk
Changes directive code generation for query metadata, which can affect runtime behavior of linked Angular libraries if the emitted query functions differ from Angular’s expectations; scope is limited to directive linking and covered by new tests.
Overview
Directives linked from
ɵɵngDeclareDirectivenow translatequeriesinto a generatedcontentQueriesfunction andviewQueriesinto a generatedviewQueryfunction (mirroring component linking), preventing query metadata from being dropped during linking.Adds regression tests covering directives with
queries,viewQueries, and both, asserting the output contains the expected query functions/instructions.Written by Cursor Bugbot for commit 2324974. This will update automatically on new commits. Configure here.