microsoft / microsoft/TypeScript

Expose tracing module to public API

オープン
#57,477 コメント 3 件 リアクション 2 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

Domain: API In Discussion Suggestion
主要言語
Go
スター
111k
フォーク
14.4k
平均マージ
1日 19時間
マージ済み PR(30日)
117

説明

🔍 Search Terms

tracing API

✅ Viability Checklist
⭐ Suggestion

Expose https://github.com/microsoft/TypeScript/blob/main/src/compiler/tracing.ts#L368 so that people using the compilerAPI can use the equivalent of --generateTrace to profile where typescript is spending it's time.

I wanted to see if this is something the Typescript team is interested in supporting. Happy to try and submit the PR myself if amenable to this.

📃 Motivating Example

When using the compiler API, we can't use the equivalent of --generateTrace to get in-depth information about where typescript is spending it's time

💻 Use Cases
  1. What do you want to use this for?
    Using the compiler API programmatically with a custom CompilerHost that's trying to cache SourcefFiles between invocations (i.e. confirming some work I've been doing around https://github.com/microsoft/TypeScript/issues/57073)
  2. What shortcomings exist with current approaches?
    Typescript already has an internal mechanism to collect these performance metrics and it would be great if programmatic access to this was allowed. In general it'd be great if we could do the equivalent of executeCommandLine with custom CompilerHost (including all the command line only options)
  3. What workarounds are you using in the meantime?
    I can locally edit typescript to expose these functions

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、参照されているトレーシングのエントリポイント周辺にある src/compiler/tracing.ts と、compiler API のサーフェスを読みます。既存の JavaScript の動作を変更せずに、カスタム CompilerHost に対して --generateTrace と同等の機能を public API からどのように公開すべきかを判断します。compiler API のユーザーが要求されたトレーシング情報にプログラムからアクセスできれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
typescript
領域
api, compilers, performance
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
28/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。