microsoft / microsoft/TypeScript

Expose tracing module to public API

Ouverte
#57,477 3 commentaires 2 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Domain: API In Discussion Suggestion
Langage dominant
Go
Étoiles
111k
Forks
14.4k
Merge moyen
1 j 19 h
PR mergées (30 j)
117

Description

🔍 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

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Commencez par lire src/compiler/tracing.ts autour du point d’entrée de tracing référencé et de la surface de l’API du compilateur. Déterminez comment l’API publique devrait exposer la fonctionnalité équivalente à --generateTrace pour un CompilerHost personnalisé, sans modifier le comportement JavaScript existant. Le travail est terminé lorsque les utilisateurs de l’API du compilateur peuvent accéder par programmation aux informations de tracing demandées.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
typescript
Domaine
api, compilers, performance
Type d'issue
Fonctionnalité
Difficulté
5/5
Temps estimé
Plus d'une semaine
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
28/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.