This is related to closed issue #112
The advantage to Xamarin.Forms is that that it works client side. Fabulous works for so many platforms now (including WPF), if it worked in the browser, it would be almost the holy grail. I am not as interested in the server side web idea of ooui as I found the WebAssembly aspect awesome. A WA version of the XF app could use serverless (Azure Functions) as the backend the same as the other heads. ooui has not been active, but how feasible would it be to use the WebAssembly aspects to enable Fabulous to create a XF WA head?
Fabulous works for so many platforms now (including WPF), if it worked in the browser, it would be almost the holy grail.
Sorry, I might state the obvious but I just want to be extra clear in my response. 馃檪
We need to clearly separate Xamarin.Forms from Fabulous from Fabulous.XamarinForms.
So "Fabulous works for so many platforms" is both correct and not correct.
Fabulous is platform-agnostic, it can be executed on all platforms - whichever one that accepts .NET Standard 2.0 - but in itself it can't run anywhere because it has no UI implementation.
Fabulous.XamarinForms relies completely on Xamarin.Forms, and can be used everywhere Xamarin.Forms has an implementation available.
Using the explanation just above, Fabulous.XamarinForms won't provide a WASM head by itself.
This WASM implementation of Xamarin.Forms first needs to come from the XF team (or from the XF community).
Ooui.Forms tried to tackle the subject, but it's an immense work load to fully implement XF for a new platform and it seems it doesn't interest a lot of people unfortunately, hence the general inactivity of Ooui.
So to be able to use Fabulous.XamarinForms to write a WASM app powered by XF, one either needs to contribute to Ooui.Forms/Ooui.WASM or starts its own WASM implementation of XF.
If we set Fabulous.XamarinForms aside for a moment, we can think about other ways to write WASM apps with F#/MVU
For Bolero, we can imagine in the future to be able to use the same code base for both Fabulous apps and Bolero since they use the same MVU pattern (see #486 for explanation).
You will need to write 2 UIs (one Bolero, one Fabulous.XF) but the update logic/state will be 100% shareable.
The advantage of Uno would be to have only one codebase for all the platforms including WASM.
Writing apps using Fabulous running on WASM is currently quite a lot of work.
Fabulous.XamarinForms needs initiative like Ooui to bring WASM support to XF, but it doesn't seem to take off, and the Xamarin.Forms team doesn't seem to be interested in taking it further...
The most promising option would be to create Fabulous.Uno.
Uno is gathering a lot of people recently, so providing support for this framework with Fabulous would be highly beneficial for both Fabulous and Fabulous users.
The PR #530 will also greatly simplify creating new such framework by automating the most tedious parts.
Looks like there might be another way for Fabulous.XamarinForms to go WASM
https://platform.uno/announcing-uno-platform-2-0/
Couldn't get it to work for now.
Apparently there is some limitations between F# and WebAssembly.
FSharpEvent, printf and alike are crashing for various reasons (NullRef, List empty)
For those interested on using Fabulous to write WebAssembly apps, you can take a look at Uno.Fabulous from @jeromelaban.
It's an experimental framework built on both Fabulous and Uno Platform, currently only runnable for WASM.
Thanks @TimLariviere, yes this is a proof of support, really. There are a few things that need to be added to Uno directly, but overall, supporting Fabulous is within reach :)
iOS, Android can be supported easily though, though the codegen must be run for each of those as well.