Summary
Migrate the library from constructor parameter injection to the inject() function, using Angular's schematic:
ng generate @angular/core:inject
This is deferred until after the 22.0.0 release — it's a purely internal/stylistic refactor with no consumer-facing behavior change, and folding it into the release would mix a large mechanical refactor with functional changes.
Scope in this codebase
- 23 directives extend the abstract
BaseDirective2, each calling super(elRef, styleBuilder, styler, marshal).
- 32
@Inject(TOKEN) sites across 5 secondary entry points: core, flex, extended, grid, server.
BaseDirective2 (core/base/base2.ts) has a protected constructor with parameter-property deps and is exported from the public API (core/public-api.ts), so it's a consumer extension point.
Risks / caveats (why this needs care, not fire-and-forget)
- Inheritance +
super(...) — when the base drops constructor params, all 23 super(...) calls must change in lockstep. The schematic can leave a partial migration across entry points that needs manual cleanup.
BaseDirective2 is public + abstract — removing its constructor params is a breaking change for any downstream app that subclasses it and calls super(...). If migrating it, run the schematic in backwards-compatibility mode so a compatible protected constructor is retained (or treat it as an intentional, documented breaking change for the next major).
Acceptance
🤖 Generated with Claude Code
Summary
Migrate the library from constructor parameter injection to the
inject()function, using Angular's schematic:This is deferred until after the 22.0.0 release — it's a purely internal/stylistic refactor with no consumer-facing behavior change, and folding it into the release would mix a large mechanical refactor with functional changes.
Scope in this codebase
BaseDirective2, each callingsuper(elRef, styleBuilder, styler, marshal).@Inject(TOKEN)sites across 5 secondary entry points:core,flex,extended,grid,server.BaseDirective2(core/base/base2.ts) has aprotected constructorwith parameter-property deps and is exported from the public API (core/public-api.ts), so it's a consumer extension point.Risks / caveats (why this needs care, not fire-and-forget)
super(...)— when the base drops constructor params, all 23super(...)calls must change in lockstep. The schematic can leave a partial migration across entry points that needs manual cleanup.BaseDirective2is public + abstract — removing its constructor params is a breaking change for any downstream app that subclasses it and callssuper(...). If migrating it, run the schematic in backwards-compatibility mode so a compatible protected constructor is retained (or treat it as an intentional, documented breaking change for the next major).Acceptance
ng generate @angular/core:injectin a dedicated PR (not the release PR)BaseDirective2hierarchy /super()calls🤖 Generated with Claude Code