fix(dts): `ngAcceptInputType_*` types drop some comments ngtsc keeps
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 68/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- angular, rust, typescript
- Lĩnh vực
- compilers
Hướng nghiên cứu
Start in crates/oxc_angular_compiler/src/directive/dts_type.rs, focusing on leading_comments and same_line_comments. Compare the existing output for repro cases a–g with ngtsc 22.1.7, including U+2028/U+2029 line breaks. Done means the generated .d.ts preserves the same leading and trailing comments as ngtsc while leaving the type unchanged.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
#496 prints the transform's parameter type into .d.ts. It keeps a single-line block comment in front of a list element. ngtsc keeps more than that, and in some U+2028/U+2029 cases prints the comment twice. Only the comments in the .d.ts text differ. The type is the same.
Repro (each line is the parameter type of @Input({transform: (v: <TYPE>) => 1}) a)
| # | <TYPE> in source |
OXC (#504 tip) | ngtsc 22.1.7 |
|---|---|---|---|
| a | string /** doc */ |
string |
string /** doc */ |
| b | string | number /** doc */ |
string | number |
string | number /** doc */ |
| c | \n /** doc */\n string (comment on its own line) |
string |
\n /** doc */\n string |
| d | string | /* a\n b */ number |
string | number |
string | /* a\n b */ number |
| e | Array</* a\n b */ string> |
Array<string> |
Array</* a\n b */ string> |
| f | Array<
/* c */\nstring | number> |
Array<string | number> |
Array</* c */ /* c */ string | number> |
| g | Array<
/* c */\nstring | number> |
Array<string | number> |
Array</* c */ /* c */ string | number> |
Cases where they already match: Array</* c */ string>, string /* keep */ \| number, /* a\n b */ string (both drop it), string /* a\n b */ (both drop it), and { a: 1; // x
b: ... }.
Full source for case a:
import {Directive, Input} from '@angular/core';
@Directive({selector: '[d]'})
export class D {
@Input({transform: (v: string /** doc */) => 1}) a = 0;
}
Where
crates/oxc_angular_compiler/src/directive/dts_type.rs (added in #496): leading_comments / same_line_comments. Only the comments on the same line in front of a list element are kept. Trailing comments, comments on their own line and comments that span lines are dropped.
On main?
No. Main prints unknown for these fields. This gap comes with #496.
Direction
Copy the rules of TypeScript's emitter for leading and trailing comments on type nodes, including the U+2028/U+2029 line-break cases. Test against ngtsc output.
- Ngôn ngữ chính
- Rust
- Star
- 232
- Fork
- 21
- Merge trung bình
- 1 ngày 18 giờ
- Pull request đã merge (30 ngày)
- 59
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
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
voidzero-dev/oxc-angular-compiler#563 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
e2e compare: setClassMetadata extraction regex never matches (ɵɵ vs ɵ) — classMetadataDiffs is dead codeCó thể đã có người làm @Brooooooklyn đã nhận hôm nay. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 38/100
voidzero-dev/oxc-angular-compiler#561 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
fix(directive): input names with lone surrogates are emitted in oxc's internal U+FFFD encodingĐang mởbug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 68/100
voidzero-dev/oxc-angular-compiler#505 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug rust
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 56/100
voidzero-dev/oxc-angular-compiler#313 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Support useDefineForClassFields: false (Class Field Lowering)Có thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
voidzero-dev/oxc-angular-compiler#73 · 11 bình luận ·
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ự
-
documentation enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
adorsys/status-list-server#619 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
batch-backport only backports the first 30 matching PRsCó thể đã có người làm @DvirDukhan đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 5 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
equinor/septic-config-generator#481 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày