microsoft / microsoft/TypeScript
"design:paramnames" metadata key
まだ誰も着手していません。
- 主要言語
- Go
- スター
- 111k
- フォーク
- 14.4k
- 平均マージ
- 1日 19時間
- マージ済み PR(30日)
- 117
説明
From https://github.com/Microsoft/TypeScript/pull/2589
A few notes on metadata:
- Type metadata uses the metadata key "design:type".
- Parameter type metadata uses the metadata key "design:paramtypes".
- Return type metadata uses the metadata key "design:returntype".
Can you please add support for a "design:paramnames" metadata key? It would return the design-time names of the arguments of a function
I can convert a function to string at runtime using Function.prototype.toString() and then use a couple of Regex to get the parameter names:
STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg;
ARGUMENT_NAMES = /([^\s,]+)/g;
But when a minifier/compressor is used the param names become "a", "b" ...
I would like to have a way to access the design-time names of the arguments of a function at run-time even after compression.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
この issue ではファイルもテストも指定されていません。まず、コンパイラによるデコレータメタデータの出力箇所と、design:type、design:paramtypes、design:returntype の既存の処理を見つけます。次に、design:paramnames を追加する範囲を特定し、リクエストで説明されているミニファイに関する懸念を含め、出力される引数名のテストを定義します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript, typescript
- 領域
- compilers
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 25/100