microsoft / microsoft/TypeScript
Cache Declarations Directory
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Go
- Sterne
- 111k
- Forks
- 14.3k
- Ø Merge
- 2 T. 4 Std.
- Gemergte PRs (30 T.)
- 132
Beschreibung
🔍 Search Terms
cache declarations cached tsserver tsc
✅ 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
A cache directory for declaration files that can be used both for normal type declaration and for tsserver.
This would be a shared folder to use for type definitions in development and possibly for build steps.
A separate folder could mean you have one service that could have it's own optimizations running in parallel or for some part of the project and emitting the declaration files, while the rest is worked normally or even tsserver rely only those declarations.
📃 Motivating Example
https://github.com/trpc/trpc/discussions/2448#discussioncomment-11151754
💻 Use Cases
With tools that relies heavily on TS, some projects see inference times of seconds and have to rely on splitting code into a monorepo or some indirect compilation step and then depending on those types.
- What do you want to use this for?
Faster inference in large projects with tooling with complex, nested types.
- What shortcomings exist with current approaches?
Some relies on splitting code into a monorepo, others you need multiple tsconfigs so you can generate the types in one place and then reference them in the actual code, making indirections on the type system to keep the inference speed.
- What workarounds are you using in the meantime?
Have a parallel config to generate types and change a critical entrypoint to use the generated types instead of the normally inferred one.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit der Durchsicht des Vorschlags, der Anwendungsfälle und der verknüpften trpc-Diskussion, um das erforderliche Verhalten des declaration-cache zu klären. Die Aufgabe wäre abgeschlossen, wenn ein definiertes gemeinsames Cache-Verzeichnis vorhanden ist, das die normale Verwendung von Deklarationen, tsserver und möglicherweise Build-Schritte unterstützt und dessen Umfang und Integrationspunkte spezifiziert sind.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- typescript
- Bereich
- compilers
- Issue-Typ
- Feature
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 25/100