Skip to content

fix: linker converts queries/viewQueries to contentQueries/viewQuery for directives#81

Merged
Brooooooklyn merged 1 commit intomainfrom
fix/linker-directive-queries
Mar 5, 2026
Merged

fix: linker converts queries/viewQueries to contentQueries/viewQuery for directives#81
Brooooooklyn merged 1 commit intomainfrom
fix/linker-directive-queries

Conversation

@Brooooooklyn
Copy link
Member

@Brooooooklyn Brooooooklyn commented Mar 5, 2026

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 ɵɵngDeclareDirective now translate queries into a generated contentQueries function and viewQueries into a generated viewQuery function (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.

…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>
Copy link
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@Brooooooklyn Brooooooklyn merged commit 65d09f9 into main Mar 5, 2026
4 checks passed
@Brooooooklyn Brooooooklyn deleted the fix/linker-directive-queries branch March 5, 2026 07:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Linker drops queries/viewQueries from ɵɵngDeclareDirective

1 participant