You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
dts: Ivy members are matched to classes by name only (wrong component metadata, renamed X$1 left plain) #691
Found while reviewing #683. Older than it (the asset path has always done this), but #683 makes it reachable for rolldown-plugin-dts / tsdown, where bundling and renames happen.
The dts plugin (vite-plugin/index.ts, generateBundle, byClassName) keys the collected declarations by class name only (last one wins), and injects them into every.d.ts in the bundle by the name it finds there. The source module is never compared.
case 1: same name, two modules, one bundled .d.ts
src/b/card.component.ts class Card (b-card, input title)
src/c/card.component.ts class Card (c-card, input size)
second.ts: export { Card as BCard } from './b/…'; export { Card as CCard } from './c/…'
second.d.ts (rolldown-plugin-dts renames the clash):
declare class Card { title…; static ɵcmp: ComponentDeclaration<Card, "c-card", …{size}…> } <- wrong component
declare class Card$1 { size… } <- no members → NG2012
(which module wins changes between runs: wrong metadata in 8 of 12 identical builds)
case 2: same name in another entry
angular.ts → @Component({selector:'lib-button'}) class Button
utils.ts → plain class Button { label = 'x' }
utils.d.ts: import * as i0 from "@angular/core"; class Button { static ɵfac…; static ɵcmp<Button, "lib-button"…> }
Possible direction: match by source module (the chunk's module ids, the rolldown-plugin-dts $N renames), or at least skip and warn on names that come from more than one module rather than write another class's metadata.
Activity
fix: align host bindings, .d.ts injection and SSR/linker with ngtsc (v…