microsoft / microsoft/TypeScript
A way to enforce `composite`'s rules without using `incremental`
Nessuno ha ancora preso questa issue.
- Lingua principale
- Go
- Stelle
- 111k
- Fork
- 14.3k
- Merge medio
- 2g 4h
- PR unite (30g)
- 132
Descrizione
🔍 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
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia tracciando come vengono convalidate le opzioni dei compilatori composite e incremental e dove vengono applicate le regole di composite. Confronta questo comportamento con isolatedDeclarations, quindi determina la semantica dell’opzione necessaria per applicare le regole di composite senza abilitare incremental. Il lavoro è completo quando il flag proposto funziona in CI e non introduce i problemi di caching descritti nell’issue.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- typescript
- Ambito
- build-system, compilers
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100