-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Explore using tinygo to shrink browser wasm? #1111
Comments
This has been brought up previously as well: #836 (comment). I don't think it'll work. From the TinyGo docs:
There are a few different places where esbuild relies on
So I suspect that even if you did get it working, performance would also be worse since esbuild relies a lot on map lookups. That said, I have not tried it myself, so feel free to try it if you'd like. Just saying that I have a strong suspicion that it's not a worthwhile exploration. |
Makes sense |
Assumed, TinyGo won't support it ( |
tinygo is a go compiler for embedded & wasm environments
It sounds like it could be interesting to shrink the wasm size and also maybe to improve runtime performance (but that is unclear, could be worse perf)
I spent about an hour trying to get esbuild to build & run via tinygo with little progress. I'm not very familiar with go's build system and I think its not correctly ignoring files that are supposed to be excluded by wasm (including when passing
--tags=js wasm
Lots of standard library functions aren't implemented. It seems extremely tedious to get this to work.
At one point, I got something to build and it produced a 110 KB esbuild.wasm file -- which is big enough to indicate it has stuff in it and small enough to show promise versus 6 MB. But
WebAssembly.instantiate
would error withWebAssembly Instantiation: Import #0 module="module" error: module is not an object or function
Feel free to close if doesn't seem worthwhile to explore
The text was updated successfully, but these errors were encountered: