Open
Description
π Search Terms
AST parse SourceFileObject
β 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
I'm following the suggestion at #3662 (comment) but the prototypes to patch aren't exposed (i.e. https://github.com/microsoft/TypeScript/blob/main/src/services/services.ts#L1003).
I'm happy to hack around this for my testing but wanted to see if there's a path to exposing this publicly.
Related Issues
#26871
#30235
#54256
π Motivating Example
Allowing external build tools that run tsc invocations in parallel to be faster by not repeating the source file parse.
π» Use Cases
- What do you want to use this for?
I'm working on a build system and would like to make parallel invocations of tsc faster by not having to reparse declarations coming from shared dependencies. - What shortcomings exist with current approaches?
Commonly used declaration files like @types/node get reparsed multiple time when splitting tsc compilation across multiple invocations.
Ideally we'd allow each of the invocations to live in their own sandbox. So we wouldn't rely on a shared language service to keep the parsed files in memory. - What workarounds are you using in the meantime?
Living with multiple calls to tsc repeating work (especially for the expensive node types)/relying on managing typescript services