Skip to content
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

[FEATURE] Use wasmexport/wasmimport build tags #26

Open
nlepage opened this issue Feb 13, 2025 · 4 comments
Open

[FEATURE] Use wasmexport/wasmimport build tags #26

nlepage opened this issue Feb 13, 2025 · 4 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@nlepage
Copy link
Owner

nlepage commented Feb 13, 2025

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 nlepage added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels Feb 13, 2025
@KekmaTime
Copy link

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

@nlepage
Copy link
Owner Author

nlepage commented Feb 13, 2025

@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.

@gedw99
Copy link

gedw99 commented Feb 17, 2025

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

So this breaks , and others in this repo.

https://github.com/nlepage/go-wasm-http-server/blob/master/docs/hello-sse/sw.js

I am still refactoring my golang for the brave new world of go 1.24 WASM but it’s looking nice. Smaller binaries. Yet to bench it !

Tinygo team are rushing to get a fix on their side too .

@nlepage
Copy link
Owner Author

nlepage commented Feb 17, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants