Skip to content

fix: linker converts providers/usesInheritance/usesOnChanges to features for directives#76

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

fix: linker converts providers/usesInheritance/usesOnChanges to features for directives#76
Brooooooklyn merged 1 commit intomainfrom
fix/linker-directive-features

Conversation

@Brooooooklyn
Copy link
Member

@Brooooooklyn Brooooooklyn commented Mar 5, 2026

The directive linker was passing through a raw features property that
doesn't exist on partial declarations. Replace with build_features()
(already used by the component linker) so providers, usesInheritance,
and usesOnChanges are correctly converted to their feature equivalents.

Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com


Note

Medium Risk
Changes directive codegen in the Angular partial declaration linker, which can affect runtime behavior if feature emission is incorrect, but the change is small and covered by new focused tests.

Overview
Fixes directive linking to compute the features array via build_features() (matching component linking) so directive partial declarations with providers, usesInheritance, and/or usesOnChanges emit the correct feature calls (e.g. ɵɵProvidersFeature, ɵɵInheritDefinitionFeature, ɵɵNgOnChangesFeature).

Adds regression tests covering each directive feature flag and the combined case to ensure provider references are preserved and the expected feature helpers appear in linked output.

Written by Cursor Bugbot for commit c946b5c. This will update automatically on new commits. Configure here.

…res for directives

The directive linker was passing through a raw `features` property that
doesn't exist on partial declarations. Replace with `build_features()`
(already used by the component linker) so `providers`, `usesInheritance`,
and `usesOnChanges` are correctly converted to their feature equivalents.

- Close #66

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 61a540b into main Mar 5, 2026
4 checks passed
@Brooooooklyn Brooooooklyn deleted the fix/linker-directive-features branch March 5, 2026 03:45
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 providers when linking ɵɵngDeclareDirective → ɵɵdefineDirective

1 participant