microsoft / microsoft/TypeScript
Expose tracing module to public API
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Go
- Estrellas
- 111k
- Forks
- 14.4k
- Merge medio
- 1 d 19 h
- PR fusionados (30 d)
- 117
Descripción
🔍 Search Terms
tracing API
✅ Viability Checklist
- This wouldn't be a breaking change in existing TypeScript/JavaScript code
- This wouldn't change the runtime behavior of existing JavaScript code
- This could be implemented without emitting different JS based on the types of the expressions
- This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
- This isn't a request to add a new utility type: https://github.com/microsoft/TypeScript/wiki/No-New-Utility-Types
- This feature would agree with the rest of our Design Goals: https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals
⭐ 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
- 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) - 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) - What workarounds are you using in the meantime?
I can locally edit typescript to expose these functions
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Empieza leyendo src/compiler/tracing.ts alrededor del punto de entrada de tracing mencionado y la superficie de la API del compilador. Determina cómo debería exponer la API pública la funcionalidad equivalente a --generateTrace para un CompilerHost personalizado, sin cambiar el comportamiento existente de JavaScript. Se considera terminado cuando los usuarios de la API del compilador pueden acceder mediante programación a la información de tracing solicitada.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- typescript
- Área
- api, compilers, performance
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 28/100