Description
In https://github.com/hajimehoshi/gopherwasm, @hajimehoshi created an experimental wrapper that implements the syscall/js
API using the github.com/gopherjs/gopherjs/js
package in GopherJS, and using the syscall/js
package itself in Wasm.
This gives me an idea for something that might be possible for the github.com/gopherjs/gopherjs/js
package: to add an alternative implementation of the same API, but using the syscall/js
package.
The GopherJS compiler would never use it, only the Go compiler would. It would help by making all packages that currently import github.com/gopherjs/gopherjs/js
buildable for Wasm (with overhead, of course), until they can be updated to use syscall/js
directly. This can be especially helpful for browser API bindings (e.g., see dominikh/go-js-dom#57).
At this point this is just an idea. It needs investigation to see if it'd be viable. I wanted to create the issue so we can track it.
@hajimehoshi Have you already thought about this?