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

deferredImports: partial output never loads the block, and the Angular 22.2 named form does not compile

Offen
#654 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
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
48/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
angular, rust
Bereich
compilers

Rechercherichtung

Start with component/decorator.rs, transform/control_flow.rs, and partial/component.rs, which the issue identifies as the parsing, trigger, and partial emit paths. Compare the array and named forms against the reproduction and the ngtsc 22.2 behavior described in the issue. The work is done when the intended array-form behavior is decided and both forms compile and emit deferred dependencies correctly in full and partial modes.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Summary

Two problems with @Component.deferredImports:

  1. With the array form, partial compilation emits no deferBlockDependencies and no dependencies. After linking, the block is ɵɵdefer(1, 0), and the deferred component never loads or renders.
  2. The Angular 22.2 named form (deferredImports: {blk: [ChildCmp]} with @defer (name blk)) does not compile at all. It fails with Unrecognized trigger.

Found while re-checking #623.

Reproduction

// (i) array form. ngtsc 22.2 rejects it in full and partial mode.
@Component({
  selector: 'app',
  // @ts-ignore
  deferredImports: [ChildCmp],
  template: '@defer { <child-cmp /> }',
})
export class App {}

// (ii) named form, Angular 22.2
@Component({
  selector: 'app',
  deferredImports: {blk: [ChildCmp]},
  template: '@defer (name blk) { <child-cmp /> }',
})
export class App {}

ChildCmp is imported from ./child.

ngtsc 22.2.3 oxc (main 5780233)
(i) full error: 'deferredImports' must be an object mapping block names to dependency arrays. accepted. The deps fn is inline, but import {ChildCmp} is kept, so the code is not split
(i) partial same error no deferBlockDependencies. After linking: ɵɵdefer(1, 0), and <child-cmp> never renders
(ii) full const App_Defer_1_DepsFn = () => [import("./child").then(m => m.ChildCmp)], and the import is removed Unrecognized trigger. The source is returned untouched
(ii) partial deferBlockDependencies: [() => [import("./child")…]] and ngDeclareClassMetadataAsync Unrecognized trigger

Where

  • The object form is not parsed: component/decorator.rs (extract_identifier_array).
  • name is rejected as a trigger: transform/control_flow.rs.
  • Partial emit skips deferBlockDependencies: partial/component.rs.

One question is a product call: should oxc keep accepting the array form, which ngtsc 22.2 rejects?

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.