@Injectable deps entries written as [new Optional(), new Self(), Dep] inject the array as the token
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 52/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- rust, typescript
- 領域
- compilers
調査の方向性
Start with injectable/decorator.rs and trace how extract_dependency handles each deps entry; compare it with ngtsc’s getDep in compiler-cli/src/ngtsc/annotations/src/injectable.ts. Run the named ngtsc_spec.ts case, including the array-literal token scenario. Done means flagged array entries produce the token and injection flags expected by ngc across the listed forms.
索引モデルが issue の本文から書いたものです。
説明
Summary
In @Injectable({ useFactory | useClass, deps }), a dep written as flags plus a token ([new Optional(), new Self(), Dep]) compiles as one token: the whole array goes to ɵɵinject, so injection fails at runtime. ngc reads it as the token Dep with the Optional and Self flags.
Found by running Angular's ngtsc spec ngtsc_spec.ts: "should compile Injectables with providedIn and factory with deps with array literal tokens" against oxc.
Reproduction
import {Injectable, Optional, Self} from '@angular/core';
@Injectable()
export class Dep {}
@Injectable({
providedIn: 'root',
useFactory: (dep: Dep) => new Service(dep),
deps: [[new Optional(), new Self(), Dep]],
})
export class Service {
constructor(dep: Dep) {}
}
Actual
__ngConditionalFactory__ = ((dep) => new Service(dep))(i0.ɵɵinject([new Optional(), new Self(), Dep]));
Expected (ngc)
__ngConditionalFactory__ = ((dep) => new Service(dep))(i0.ɵɵinject(Dep, 10));
useClass + deps, the bare form ([Optional, SkipSelf, Dep]) and new Inject(TOKEN) hit the same problem.
Cause
extract_dependency (injectable/decorator.rs) turns each deps element straight into a token. It has no port of ngtsc's getDep (compiler-cli/src/ngtsc/annotations/src/injectable.ts), which splits an array entry into a token and Inject/Optional/Self/SkipSelf flags.
- 主要言語
- Rust
- スター
- 244
- フォーク
- 26
- 平均マージ
- 23時間 41分
- マージ済み PR(30日)
- 106
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
voidzero-dev/oxc-angular-compiler のほかの issue
-
Partial mode: NgModule-declared components get no dependencies, so their directives never matchオープン
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
voidzero-dev/oxc-angular-compiler#655 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
voidzero-dev/oxc-angular-compiler#654 ·
メンテナーはふだん 1 日以内に返信
-
Constructor param typed by a same-file interface is injected as a token (ReferenceError at runtime)オープン
難易度 3/5 1〜2日 初心者へのやさしさ 73/100
voidzero-dev/oxc-angular-compiler#653 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 28/100
voidzero-dev/oxc-angular-compiler#623 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
Support useDefineForClassFields: false (Class Field Lowering)対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
voidzero-dev/oxc-angular-compiler#73 · コメント 11 件 ·
メンテナーはふだん 1 日以内に返信
voidzero-dev/oxc-angular-compiler の issue をすべて見る
似ている issue
-
ai_p2 bug comp-datalake
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
ClickHouse/ClickHouse#128306 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
documentation
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
bug triage
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
area: ui enhancement good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
JavenKazebee/capture-room#166 ·
メンテナーはふだん 1 日以内に返信