go-wasm-http-server icon indicating copy to clipboard operation
go-wasm-http-server copied to clipboard

[FEATURE] Use wasmexport/wasmimport build tags

Open nlepage opened this issue 9 months ago • 5 comments

Go now supports directives to import and export functions to/from the compiled wasm binary, see documentation.

This directives could be used to simplify how go-wasm-http-server interacts with the browser.

wasmimport is available since Go 1.22 and wasmexport is available since Go 1.24.

It would be nice to keep backward compatibility with Go 1.22, hence be able to work without wasmexport.

nlepage avatar Feb 13 '25 09:02 nlepage

@nlepage hey i would like to work on this issue can i work on this?

KekmaTime avatar Feb 13 '25 12:02 KekmaTime

@nlepage hey i would like to work on this issue can i work on this?

Yes of course. Please ask me if you have any question.

nlepage avatar Feb 13 '25 13:02 nlepage

In go 1.24 the location of wasm -exec. No js changed btw.

So this breaks , and others in this repo.

@gedw99 The link used in https://github.com/nlepage/go-wasm-http-server/blob/master/docs/hello-sse/sw.js and other examples contains Go’s version (https://cdn.jsdelivr.net/gh/golang/[email protected]/misc/wasm/wasm_exec.js), so it should not break.

However your’re right, examples and documentation will need to be updated with the new location in order to comply with Go 1.24.

nlepage avatar Feb 17 '25 09:02 nlepage