Partial mode: NgModule-declared components get no dependencies, so their directives never match
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 35/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- angular, rust, typescript
- Bereich
- compilers
Rechercherichtung
Start by comparing partial and full component compilation in the compiler entry points, then trace how NgModule scope information reaches ɵɵngDeclareComponent and how the Angular linker handles its dependencies. The issue identifies no files or tests; use the reproduction with DepModule and App as the starting case. Done means linked partial output includes the NgModule-scoped directive so D matches in App's template, with an approach compatible with the linker.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Summary
In partial compilation, a component declared in an NgModule (standalone: false) gets no dependencies in ɵɵngDeclareComponent. After linking, App.ɵcmp.directiveDefs is null, so no directive from the NgModule scope matches in its template. Full mode works, because there dependencies is ɵɵgetComponentDepsFactory(App), which is resolved at runtime.
Found while re-checking #623.
Reproduction
// dep.ts
@Directive({selector: '[d]', standalone: false}) export class D {}
@NgModule({declarations: [D], exports: [D]}) export class DepModule {}
// main.ts
import {DepModule} from './dep';
@Component({selector: 'app', template: '<div d></div>', standalone: false}) export class App {}
@NgModule({declarations: [App], imports: [DepModule]}) export class AModule {}
Compiled with compilationMode: 'partial', linked with linkAngularPackageSync, and run with @angular/core 22.2:
App.ɵcmp.directiveDefs |
|
|---|---|
| oxc full | [D, App] |
| oxc partial + link | null, so D never matches |
| ngtsc partial | dependencies: [{kind: "directive", type: i1.D, selector: "[d]"}] |
Notes
ngtsc builds this list from the NgModule scope, which comes from the whole program. One way to do it one file at a time is to emit something in partial mode that resolves at runtime, as full mode does with ɵɵgetComponentDepsFactory. Angular's linker would also have to accept that output, so this needs a design decision.
- Vorherrschende Sprache
- Rust
- Sterne
- 244
- Forks
- 26
- Ø Merge
- 23 Std. 41 Min.
- Gemergte PRs (30 T.)
- 106
Entwicklungsumgebung
Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus voidzero-dev/oxc-angular-compiler
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
voidzero-dev/oxc-angular-compiler#654 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Constructor param typed by a same-file interface is injected as a token (ReferenceError at runtime)Offen
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 73/100
voidzero-dev/oxc-angular-compiler#653 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 28/100
voidzero-dev/oxc-angular-compiler#623 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Support useDefineForClassFields: false (Class Field Lowering)Evtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offen
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 35/100
voidzero-dev/oxc-angular-compiler#73 · 11 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Angular 21.2.0 + @oxc-angular/vite 0.0.7 SSR runtime parity regressions (RouterLinkActive, Forms DI, Apollo DI) require app-level shimsEvtl. wieder frei @Brooooooklyn hat das vor 240 Tagen übernommen, und es ist kein Pull Request offen. Offen
voidzero-dev/oxc-angular-compiler#61 · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in voidzero-dev/oxc-angular-compiler
Ähnliche Issues
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
dekobon/big-code-analysis#1729 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug help wanted
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 3 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
akitaonrails/ai-memory#1888 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
peteonrails/voxtype#941 ·
Maintainer antworten meist innerhalb von 4 Tagen
-
bug priority:medium triage:maintainable
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
ccusage/ccusage#2000 · 3 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag