Proposal: Extract the Parser of TypeScript Native into a standalone Go Module to fill a gap in the Go ecosystem and benefit this project #2442
Closed
narukeu
started this conversation in
Design Discussion
Replies: 1 comment
-
|
See #481 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I suggest extracting the Parser component from
typescript-goand publishing it as an independent Go library.Currently, the Go ecosystem severely lacks a complete, standard-compliant JavaScript/TypeScript/JSX parser.
typescript-goactually 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 into
typescript-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.
Beta Was this translation helpful? Give feedback.
All reactions