Revive discussion about bringing kivy to the web, technology favors it now.
Kivy is already a powerful tool that I've been using quite often for numerous projects. It already supports desktop and mobile platforms, and I think it will put a cherry on top when it introduces support for the web. For good reason, at least to setup some better competition for flutter which supports all platforms plus the web. Plus, it would also be good response to pyscript (not that this is a competition or anything, but in a way, it kinda is)
How to achieve this.
We don't have to rewrite kivy to support the web, kivy has a pretty flexible and abstract api that supports various kinds of render backends, we could perhaps introduce a new backend for webGL. cpython is also already starting to support web browsers through the wasm platform, and pyodide is also exists that provides better integration of python into the browser with access to the JS environment as well, so the python dependency is checked. Still on the same line of wasm, sdl2 has already been successfully compiled with wasm for the web,and kivy is built on sdl2, so this is proof that it can be done. So basically every major dependency kivy relies on favors kivy on the web.
I know I've not listed everything as precisely as possible, but I think this is worth a shot. I'll person be able to lend some help where I can so this can be done. I also know we've had this discussion before back in 2016 and below, but by then the technology wasn't yet mature or promising as it is current. With projects like pybeeware and pyscript bringing python UI to the browser, I think Kivy can now follow suite.
I have been interested in getting this to work with Kivy: SDL2CEF2
The main problem is how we can make a minimal .so file to be used with SDL2 through Kivy.
I got this SDL2CEF to work with newer tools and latest CEF builds. And I really hope someone can implement this for Kivy.
Thanks @kuzeyron for your effort in this. However, I think we need to workout a solution that is not only platform agnostic but also broswer agnostic. If we rely on CEF, we might risk having the project work for only chromium browsers, and yet there are many more broswers to support like Safari, firefox, Opera etc. So that's why I was wondering if it's possible to build something using webgl and webassembly alone. I think this would also be better for performance issues. I'm not really sure, but I'll try looking through it.
From having nothing, a CEF browser would at least be a good start.
Registering my interest, I have an embedded app that developed with Kivy that I want to bring to the web. In particular I did a lot of data visualisation with a hacked up version of garden.graph and would love to be able to drop the graphs into a canvas in the user's browser. This isn't exactly easy as Kivy uses the GPU to render everything.
Does SDL2CEF2 even do the right thing? It looks like it might be using SDL2 as a graphics backend for Chromium, we want the opposite.
Personally I was thinking of introducing a webgl backend for kivy
I would definitely vote for that 😄 in the meantime I'll probably end up scraping the framebuffer output of the embedded GPU and sending it to the web browser as an image file
Pyodide 0.23 comes with experimental support for SDL2. I think this is a step closer to bringing kivy to the web.
https://twitter.com/pyodide/status/1641805170345496577