fix(dts): `ngAcceptInputType_*` types drop some comments ngtsc keeps
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 68/100
- Issue-Typ
- Bug
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- angular, rust, typescript
- Bereich
- compilers
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
#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.
- Vorherrschende Sprache
- Rust
- Sterne
- 232
- Forks
- 21
- Ø Merge
- 1 T. 18 Std.
- Gemergte PRs (30 T.)
- 59
Entwicklungsumgebung
Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus voidzero-dev/oxc-angular-compiler
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 55/100
voidzero-dev/oxc-angular-compiler#563 ·
Maintainer antworten meist innerhalb von 1 Tag
-
e2e compare: setClassMetadata extraction regex never matches (ɵɵ vs ɵ) — classMetadataDiffs is dead codeEvtl. vergeben @Brooooooklyn hat das heute übernommen. Offen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 38/100
voidzero-dev/oxc-angular-compiler#561 ·
Maintainer antworten meist innerhalb von 1 Tag
-
fix(directive): input names with lone surrogates are emitted in oxc's internal U+FFFD encodingOffenbug
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 68/100
voidzero-dev/oxc-angular-compiler#505 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug rust
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 56/100
voidzero-dev/oxc-angular-compiler#313 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Support useDefineForClassFields: false (Class Field Lowering)Evtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offen
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 35/100
voidzero-dev/oxc-angular-compiler#73 · 11 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in voidzero-dev/oxc-angular-compiler
Ähnliche Issues
-
[Feature] 设置里面的同步功能Offenenhancement user-priority/P2
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
Maintainer antworten meist innerhalb von 1 Tag
-
agent:triaged bug bughunt pm:npm priority:p1
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
SocketDev/socket-patch#1127 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
Maintainer antworten meist innerhalb von 1 Tag