Constructor param typed `ns.Foo` (namespace-qualified) compiles to ɵɵinvalidFactoryDep
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 25/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- angular, rust, typescript
調査の方向性
Start with the ngtsc spec cases named in the issue and trace how extract_param_token handles constructor parameter types, comparing TSQualifiedName handling with the resolution used by setClassMetadata. The expected result is generated ɵɵinject calls for namespace-qualified types; verify both namespace and named imports against the reported cases. Pull request #634 is already open for this issue.
索引モデルが issue の本文から書いたものです。
説明
Summary
A constructor parameter typed with a qualified name on an import (ns.Zero, ns.one.One) compiles to ɵɵinvalidFactoryDep, so instantiating the class throws at runtime. ngc treats the qualified name as a value reference, the same as a plain imported name. Applies to @Injectable, @Component, @Directive, @Pipe and @NgModule factories.
Found by running Angular's ngtsc spec ngtsc_spec.ts: "should generate correct imports for type references to namespaced symbols using a namespace import" (and "... using named imports") against oxc.
Reproduction
import {Injectable} from '@angular/core';
import * as ns from './ns'; // export class Zero {}; export namespace one { export class One {} }
@Injectable()
export class MyService {
constructor(zero: ns.Zero, one: ns.one.One) {}
}
Actual
return new (__ngFactoryType__ || MyService)(i0.ɵɵinvalidFactoryDep(0), i0.ɵɵinvalidFactoryDep(1));
Expected (ngc)
import * as i1 from "./ns";
return new (__ngFactoryType__ || MyService)(i0.ɵɵinject(i1.Zero), i0.ɵɵinject(i1.one.One));
With a named import (import {ns} from './ns'), ngc emits i0.ɵɵinject(i1.ns.Zero).
Cause
The DI token extraction (extract_param_token) returns no token for a TSQualifiedName, while setClassMetadata already resolves the same type ({type: i1.one.One}).
- 主要言語
- 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
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
memory_patch_page drops the `#` of headings like `## Notes on C#`対応中かも @viniciusdsandrade が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
akitaonrails/ai-memory#1859 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
wealthfolio/wealthfolio#2376 ·
メンテナーはふだん 1 日以内に返信
-
kind/bug kind/security
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
spiceai/spiceai#15826 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
area:cli bug dotnet good first issue priority:medium
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信