Hacktoberfest 2026 : les issues que les mainteneurs ont marquées pour octobre, ouvertes et accessibles aux débutants. Parcourir les issues Hacktoberfest

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

Ouverte
#654 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
48/100
Type d'issue
Bug
Clarté
Plutôt claire
Activité
Active
Stack technique
angular, rust
Domaine
compilers

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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?

Langage dominant
Rust
Étoiles
244
Forks
26
Merge moyen
23 h 41 min
PR mergées (30 j)
106

Préparer son environnement

Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de voidzero-dev/oxc-angular-compiler

Toutes les issues de voidzero-dev/oxc-angular-compiler

Issues similaires

Plus d'issues Rust

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.