Constructor param typed `ns.Foo` (namespace-qualified) compiles to ɵɵinvalidFactoryDep
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- angular, rust, typescript
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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}).
- Ngôn ngữ chính
- Rust
- Star
- 244
- Fork
- 26
- Merge trung bình
- 1 ngày 16 phút
- Pull request đã merge (30 ngày)
- 87
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của voidzero-dev/oxc-angular-compiler
-
vite: async/await is not lowered for zone.js, so fakeAsync/tick cannot control awaitsCó thể đã có người làm @edbzn đã nhận 1 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
voidzero-dev/oxc-angular-compiler#641 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
@defer doesn't lazy-load an imports entry written as forwardRef(() => X)Có thể đã có người làm @edbzn đã nhận 1 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
voidzero-dev/oxc-angular-compiler#632 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Project-wide preserveWhitespaces option is ignoredCó thể đã có người làm @edbzn đã nhận 1 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
voidzero-dev/oxc-angular-compiler#631 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Constructor overloads: factory and metadata read the first overload, not the implementationCó thể đã có người làm @edbzn đã nhận 1 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
voidzero-dev/oxc-angular-compiler#630 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
@Injectable deps entries written as [new Optional(), new Self(), Dep] inject the array as the tokenCó thể đã có người làm @edbzn đã nhận 1 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
voidzero-dev/oxc-angular-compiler#629 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của voidzero-dev/oxc-angular-compiler
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
haowjy/mars-agents#228 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 68/100
redlib-org/redlib#604 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
dividebysandwich/rust-dos#240 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
A-UI C-Bug S-Needs-Triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
bevyengine/bevy#26330 ·
Maintainer thường phản hồi trong vòng 2 ngày