microsoft / microsoft/TypeScript
Idea: Can declaration emit synthesize type aliases?
オープン
まだ誰も着手していません。
Domain: Performance
Experimentation Needed
Suggestion
- 主要言語
- Go
- スター
- 111k
- フォーク
- 14.3k
- 平均マージ
- 1日 19時間
- マージ済み PR(30日)
- 117
説明
Object types can be very large and in (e.g.) a react project that makes heavy use of type inference, it's not uncommon to have to refer to a type that is either not imported or is simply anonymous (e.g. a props type). When these appear in multiple places in a declaration file, they tend to expand it considerably. Perhaps we could just synthesize type aliases for them?
- We'd have to be careful not to change the exported API shape
- We could use a heuristic to skip the work for small types (e.g. < 20 characters)
- Even if we didn't wait until the second use of a type to decide to extract it, we'd be adding ~4 tokens per type (
type id =andidat the use site)
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
この issue では、繰り返し現れる大きな匿名オブジェクト型に対して、宣言の出力時に型エイリアスを合成することを提案しています。ファイル、テスト、エントリーポイントは指定されていないため、まず宣言出力の実装を把握し、提示されたサイズヒューリスティックを評価してください。完了条件は、エクスポートされる API の形状を変更せずに、宣言ファイルの展開を削減することです。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- typescript
- 領域
- compilers
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 30/100