Cache Declarations Directory #60905
Labels
Needs Proposal
This issue needs a plan that clarifies the finer details of how it could be implemented.
Suggestion
An idea for TypeScript
π Search Terms
cache declarations cached tsserver tsc
β Viability Checklist
β 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
trpc/trpc#2448 (comment)
π» 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.
Faster inference in large projects with tooling with complex, nested types.
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.
Have a parallel config to generate types and change a critical entrypoint to use the generated types instead of the normally inferred one.
The text was updated successfully, but these errors were encountered: