It seems to me that GLFW has support for WebGL and WebAssembly. I'm curious to see why Fyne doesn't support this as well.
I think this would require some changes to the build tags, but otherwise initial support should be easy? It might be useful to add some emscripten specific functions, though. I found these helpful: Building WebAssembly with Go, small example project, and Emscripten installation instructions.
Are you sure GLFW has that support? Could you point us to some documentation of how it is used?
It looks like GLFW has been compiled with limited support for Emscripten, see here
It looks more like the other way round - emscripten has found a way to control GLFW?
Emscripten is more like an operating system built on WebAssembly. So, GLFW is compiled to run within Emscripten and then Emscripten runs within a virtual machine AKA the web browser.
If you could find any documentation for us we could look into this further.
Apart from a compile flag in GLFW I cannot find any information on how it is supposed to work, sorry.
It's actually pretty easy to do without GLFW, you just make an html canvas equal to the dimensions of the window and get the render target and everything from that. The GLFW/Emscripten stuff would be awesome, since it would have just one Go-side API to do everything, but I haven't really seen any go libraries do that.
There is some fundamental difference between WebGL and how we use GLFW at the moment. Also the bridge is not a trivial things. There are go library that provide a GLFW API on top of WebGL, but we still need to update our use of GLFW to make this work (Basically WebGL doesn't allow multiple windows and we have no control over the only window being created, it is closer to the mobile logic). GLFW would have to explicitly support WebGL to have it working like they explicitly support Linux, Windows and Mac as it is a difference environment. Compiling GLFW with emscripten is just a first step in that direction and I do not know if the GLFW is going to continue the necessary work to get this working.
Most helpful comment
There is some fundamental difference between WebGL and how we use GLFW at the moment. Also the bridge is not a trivial things. There are go library that provide a GLFW API on top of WebGL, but we still need to update our use of GLFW to make this work (Basically WebGL doesn't allow multiple windows and we have no control over the only window being created, it is closer to the mobile logic). GLFW would have to explicitly support WebGL to have it working like they explicitly support Linux, Windows and Mac as it is a difference environment. Compiling GLFW with emscripten is just a first step in that direction and I do not know if the GLFW is going to continue the necessary work to get this working.