Visitar URL original
fix(core): correctly inherit component metadata in JIT undecorated base classes by JeanMeche · Pull Request #71243 · angular/angular · GitHub
Skip to content

fix(core): correctly inherit component metadata in JIT undecorated base classes - #71243

Open
JeanMeche wants to merge 1 commit into
angular:mainfrom
JeanMeche:fix/jit-inheritance
Open

JeanMeche wants to merge 1 commit into
angular:mainfrom
JeanMeche:fix/jit-inheritance

Conversation

@JeanMeche

Copy link
Copy Markdown
Member

When a bare class extends a component, the JIT compiler compiles it as an abstract directive. Previously, this caused the compiler to skip inheriting the component's metadata into the bare class due to an incorrect throw, or the bare class was skipped completely because getDirectiveDef looked up the prototype chain.

This PR updates the addDirectiveDefToUndecoratedParents helper to use Object.hasOwn to ensure bare classes receive their own ɵdir containing their inputs/outputs, and updates ɵɵInheritDefinitionFeature to permit these abstract directives to inherit from components.

…se classes

When a bare class extends a component, the JIT compiler compiles it as an abstract directive. Previously, this caused the compiler to skip inheriting the component's metadata into the bare class due to an incorrect throw, or the bare class was skipped completely because `getDirectiveDef` looked up the prototype chain.

This commit updates the `addDirectiveDefToUndecoratedParents` helper to use `Object.hasOwn` to ensure bare classes receive their own `ɵdir` containing their inputs/outputs, and updates `ɵɵInheritDefinitionFeature` to permit these abstract directives to inherit from components.
@angular-robot angular-robot Bot added the area: core Issues related to the framework runtime label Oct 8, 2026
@ngbot ngbot Bot added this to the Backlog milestone Oct 8, 2026
@JeanMeche
JeanMeche requested a review from JoostK October 8, 2026 02:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: core Issues related to the framework runtime

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant