I suggest extracting the Parser component from typescript-go and publishing it as an independent Go library.
Currently, the Go ecosystem severely lacks a complete, standard-compliant JavaScript/TypeScript/JSX parser. typescript-go actually possesses what is likely the most comprehensive Parser in the current Go ecosystem. If this could be decoupled, it would become a foundational cornerstone for frontend tooling within the Go language.
Rationale
-
It fills a structural gap in the Go ecosystem.
In the JS ecosystem, TypeScript doesn't need a standalone Parser because tools like Babel are already very mature. However, in the Go ecosystem, there is currently no comparable infrastructure.
As frontend toolchains migrate toward high-performance native languages, Go is highly attractive to the vast community of JS/TS developers due to its ease of learning and concurrency advantages. By filling this void, Microsoft would allow external tools to reuse this core capability without needing to reinvent the wheel. -
An independent Parser will attract integration from numerous external tools.
This means massive amounts of real-world codebases will be used to test this Parser. Edge cases discovered and fixed by the community can be fed directly back intotypescript-go. This is far more efficient than relying solely on internal test cases and will significantly improve the robustness of the Parser. -
From an engineering perspective, decoupling the Parser helps define project boundaries and improves maintainability.
Implementation-wise, this does not require rewriting core logic; it only involves adjusting the project structure to support Go Module referencing, making the engineering effort manageable. -
TypeScript has, in a sense, become a de facto standard.
If Microsoft provides an official Go version of the Parser, it ensures that Go-based frontend toolchains maintain high consistency with the native TS compiler in parsing behavior. This prevents the community from creating various incompatible "dialect" parsers due to a lack of standards, thereby avoiding ecosystem fragmentation.