Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン
#654 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
angular, rust
領域
compilers

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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?

主要言語
Rust
スター
244
フォーク
26
平均マージ
23時間 41分
マージ済み PR(30日)
106

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

voidzero-dev/oxc-angular-compiler のほかの issue

voidzero-dev/oxc-angular-compiler の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。