microsoft / microsoft/TypeScript

Expose tracing module to public API

Aperta
#57,477 3 commenti 2 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Domain: API In Discussion Suggestion
Lingua principale
Go
Stelle
111k
Fork
14.3k
Merge medio
1g 19h
PR unite (30g)
117

Descrizione

🔍 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

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia leggendo src/compiler/tracing.ts intorno all’entry point di tracing indicato e alla superficie dell’API del compilatore. Determina come l’API pubblica dovrebbe esporre la funzionalità equivalente a --generateTrace per un CompilerHost personalizzato, senza modificare il comportamento JavaScript esistente. Il lavoro è completato quando gli utenti dell’API del compilatore possono accedere programmaticamente alle informazioni di tracing richieste.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
typescript
Ambito
api, compilers, performance
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
28/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.