[wx-dev]: Emscripten port proposal

27 views
Skip to first unread message

Hugo Castellanos

unread,
Aug 30, 2026, 3:07:19 PM (3 days ago) Aug 30
to wx-...@googlegroups.com
Hello,

I have worked for a few years in a web assembly-emscripten port of
wxWidgets, the approach is to use pure html and javascript to render
the controls in the browser. And I have the goal to allow the change
of styles via CSS, currently a GTK-like CSS style is built as part of
the code. The C++ code uses emscripten to generate that html, I think
is a big difference compared with QT or even flutter for example, that
draws everything on a canvas.

You can see the code at
https://github.com/phantomhugo/wxWidgets/tree/feat/wasmPort and a few
screen shots at https://logotexo.com/demos/wx/

I know small incremental changes are better for review but I did not
want to request a merge over something that was not close to work, in
this moment at least most examples are kind of functional, with some
very obvious problems (like some events failures depending on how
complex the layout is) but good enough to play with it. I was even
able to compile and launch a full application (with a huge amount of
bugs but well shown on the browser). The branch is updated with the
latest master so should be "easily" mergeable.

Let me know if you agree, if you would like to discuss the approach
even further and how to proceed with the creation of a pull request.

Thanks,

Hugo

Vadim Zeitlin

unread,
Aug 30, 2026, 3:37:27 PM (3 days ago) Aug 30
to wx-...@googlegroups.com
On Sun, 30 Aug 2026 14:07:03 -0500 Hugo Castellanos wrote:

HC> I have worked for a few years in a web assembly-emscripten port of
HC> wxWidgets, the approach is to use pure html and javascript to render
HC> the controls in the browser. And I have the goal to allow the change
HC> of styles via CSS, currently a GTK-like CSS style is built as part of
HC> the code. The C++ code uses emscripten to generate that html, I think
HC> is a big difference compared with QT or even flutter for example, that
HC> draws everything on a canvas.
HC>
HC> You can see the code at
HC> https://github.com/phantomhugo/wxWidgets/tree/feat/wasmPort and a few
HC> screen shots at https://logotexo.com/demos/wx/

Hello,

It seems incredible to get *3* new wx ports in the space of a couple of
weeks, but we're not going to complain about the abundance of riches.

HC> I know small incremental changes are better for review but I did not
HC> want to request a merge over something that was not close to work, in
HC> this moment at least most examples are kind of functional, with some
HC> very obvious problems (like some events failures depending on how
HC> complex the layout is) but good enough to play with it. I was even
HC> able to compile and launch a full application (with a huge amount of
HC> bugs but well shown on the browser). The branch is updated with the
HC> latest master so should be "easily" mergeable.
HC>
HC> Let me know if you agree, if you would like to discuss the approach
HC> even further and how to proceed with the creation of a pull request.

It looks like this port is mostly pure additions, so it should be indeed
quite simple to merge. Things that we really must have for the merge:

1. Documentation, including instructions for building, which I expect might
be non-trivial with emscripten, as well as the list of current
limitations.

2. At least some tests to make sure the port is not completely broken.

3. A CI job (or two, one with autoconf and another with CMake) checking
that it doesn't get broken by building it and running the above tests.

Do you think you could add this?

Thanks!
VZ

Hugo Castellanos

unread,
Aug 30, 2026, 4:04:59 PM (3 days ago) Aug 30
to wx-...@googlegroups.com
Hello,

VC> 1. Documentation, including instructions for building, which I expect might
VC> be non-trivial with emscripten, as well as the list of current limitations.

Yes I can add the documentation, I actually have one for myself so I
think I can just clean it up.

VC> 2. At least some tests to make sure the port is not completely broken.

I have been using puppeteer and chrome headless for testing, not sure
if it is a viable option here.

VC> 3. A CI job (or two, one with autoconf and another with CMake) checking
VC> that it doesn't get broken by building it and running the above tests.

I think I can do it. I think it would require cloning emscripten repo
as part of the process, but I think it would be ok.

I will work on that and in some time next week I will let you know.

Hugo
Reply all
Reply to author
Forward
0 new messages