Skip to content

Export SourceFileObject and friends Β #57073

Open
@kwasimensah

Description

@kwasimensah

πŸ” Search Terms

AST parse SourceFileObject

βœ… Viability Checklist

⭐ 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

  1. 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.
  2. 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.
  3. 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

Metadata

Metadata

Assignees

Labels

Needs InvestigationThis issue needs a team member to investigate its status.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions