go-blueprint icon indicating copy to clipboard operation
go-blueprint copied to clipboard

[Feature Request] Add wasm support to run command in browser

Open Zxilly opened this issue 1 year ago • 5 comments

Tell us about your feature request

Currently we have a web page https://go-blueprint.dev/, but it only provides a command line suggestion. We can compile the project to wasm then intergrate it to the web page, which allow user download a zip file or even directly write to the disk with File System API

Disclaimer

  • [X] I agree

Zxilly avatar Jun 18 '24 18:06 Zxilly

@Zxilly do you have experience doing this? I haven't really done it before but can look into it. Here is the repo for the web page. https://github.com/briancbarrow/go-blueprint-htmx

briancbarrow avatar Jun 18 '24 19:06 briancbarrow

Yes, I implemented a wasm based application on https://gsa.zxilly.dev/, which normally doesn't require much extra code for implementation. But in order to build wasm automatically, a much more complex build process is needed. The main code is at https://github.com/Zxilly/go-size-analyzer/blob/master/cmd/wasm/main_js_wasm.go

Zxilly avatar Jun 18 '24 19:06 Zxilly

Do you want to take a crack at it and make a PR into the htmx repo I linked?

briancbarrow avatar Jun 18 '24 23:06 briancbarrow

Because the code belongs to different repositories, it may be that I have to create two PRs to add support.

Zxilly avatar Jun 19 '24 05:06 Zxilly

I've read through some of the code and the current implementation requires a lot of code changes to implement wasm support. I don't have that much time at the moment, I'll come back and see if I can move forward with this when I have more free time.

Zxilly avatar Jun 19 '24 07:06 Zxilly