microsoft / microsoft/TypeScript

Expose tracing module to public API

Offen
#57,477 3 Kommentare 2 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Domain: API In Discussion Suggestion
Vorherrschende Sprache
Go
Sterne
111k
Forks
14.4k
Ø Merge
1 T. 19 Std.
Gemergte PRs (30 T.)
117

Beschreibung

🔍 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

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne damit, src/compiler/tracing.ts rund um den referenzierten Tracing-Einstiegspunkt und die Compiler-API-Oberfläche zu lesen. Ermittle, wie die öffentliche API die Funktionalität gleichwertig zu --generateTrace für einen benutzerdefinierten CompilerHost bereitstellen sollte, ohne das bestehende JavaScript-Verhalten zu ändern. Erledigt ist dies, wenn Nutzer der Compiler-API programmgesteuert auf die angeforderten Tracing-Informationen zugreifen können.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
typescript
Bereich
api, compilers, performance
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
28/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.