Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

Partial mode: NgModule-declared components get no dependencies, so their directives never match

Offen
#655 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

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

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus voidzero-dev/oxc-angular-compiler

Alle Issues in voidzero-dev/oxc-angular-compiler

Ähnliche Issues

Weitere Issues zu Rust

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.