microsoft / microsoft/TypeScript
A way to enforce `composite`'s rules without using `incremental`
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Go
- Estrellas
- 111k
- Forks
- 14.3k
- Merge medio
- 2 d 4 h
- PR fusionados (30 d)
- 132
Descripción
🔍 Search Terms
composite
incremental
composite without incremental
turborepo caching
✅ 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
Sometimes when debugging performance issues with badly specified includess globs, the composite flag can be really helpful because it will enumerate all the code that you are referencing and need to put in the includes, and then you can add paths incrementally instead of just having something like **/*.ts.
There are some reasons why I'm a little bit uneasy about enabling composite and incremental, mainly that we use Turborepo to cache package builds, and I'm a little bit worried about having two different caching mechanisms.
You can see this issue:
To get an idea of why it can be a problem.
Similar to how --isolatedDeclarations enforces certain rules without actually affecting build output, it'd be nice if there was a way to use composite's rules without being forced to set incremental too.
📃 Motivating Example
Maybe something like:
--enforceCompositeRules
💻 Use Cases
Right now there's no real workaround, composite and incremental have to go together. You can have incremental without composite but you run the risk of having caching bugs.
In CI one could probably just run a typecheck with the flags turned on manually I suppose, and not use it in other contexts
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 por rastrear cómo se validan las opciones de los compiladores composite e incremental y dónde se aplican las reglas de composite. Compara ese comportamiento con isolatedDeclarations y, a continuación, determina la semántica de opción necesaria para aplicar las reglas de composite sin habilitar incremental. Se considera completado cuando el flag propuesto funciona en CI y no introduce los problemas de caché descritos en el issue.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- typescript
- Área
- build-system, compilers
- 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
- 35/100