Will this run in the browser (WASM)? #458
-
Since the announcement does not mention WASM, will running typescript-go in the browser will be officially supported? I guess this will be a requirement for TypeScript Playground and other users of |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 14 replies
-
Yes! |
Beta Was this translation helpful? Give feedback.
-
It would be nice to see more details on the work~ |
Beta Was this translation helpful? Give feedback.
-
If WASM is yes, I just want to clarify: This allows us to compile TypeScript into Go source? This isn't just for optimizing the compiler/vscode, right? If so, are there any plans to allow Go packages to be imported into TypeScript? Perhaps by generating At our company we use both TypeScript and Go. We mostly use Go on the backend, but we have team members who are more comfortable with TypeScript. |
Beta Was this translation helpful? Give feedback.
-
I’m concerned about tree-shaking. Many projects, like ts-blank-space, use only part of the TypeScript compiler API, and with tree-shaking, the bundle size can be significantly reduced compared to including the full TypeScript bundle. I have developed an online TypeScript REPL that utilizes the TypeScript compiler API in the browser (repository here). After tree-shaking, it adds approximately 3MB to the bundle, which is acceptable in terms of load time since I use dynamic import along with a progress bar. I wonder if the Go port can maintain this size—if the bundle grows to around 15MB, it would be a bit large for such a simple use case. |
Beta Was this translation helpful? Give feedback.
Yes!