The philosophy and paradigm I have adopted is as follows.
I need software tools for the business that actually makes me money, i.e. pays my bills. In making these tools, I am willing to open source the code and allow others to use the software tools (apps). In doing so, I hope that others who want to build with F# will be helped (I have been trying F# as my hobby for more than 10 years and still just starting to get the hang of or actually build something useful). I am also tackling how to take an idea in my head and end up with an app that does what I need and is also documenting in a way that others can use it, modify it, and improve it. Also 'tested' so as changes are made, everything still works as expected. Same as every other dev and team out there.
I have this vision of how that might all work, just trying to get the bits and pieces worked up to see if what is in my head can become reality.
My opinion is that the UI should be functionally derived. Meaning, instead of state being held and passed back and forth to the control program, the UI will respond when updates are pushed to it. So given a particular snapshot of state, it renders the same every time. That is for a given set of environment conditions meaning the OS, browser, window size, etc. is the same.
I prefer to use HTML/CSS for the screens. This works well as I can use these screens/views on the web, phones, and even the desktop. I have been focused on WebAssembly (WASM) running on the dotnet stack. I have dug deep in to Bolero and using it in place of Razor is my choice. Or at least the idea. As Bolero is considered Elmish, I am really using the parts of Bolero that make F# spit out html into a base Blazor component in WASM.
A big part of my consideration is how to store state (data). It is awesome if others want to use my apps. I do not want to handle their data. I do not want to be responsible for other's data. I am not in a place to setup services properly to keep it safe, secure, available, etc, etc. Easiest place to store data, on your local hard drive. The problem is that WASM is not allowed to do that. So I need to access a cloud drive location from WASM and that would work. Still very much trying to get that all working.
In the mean time, Blazor Desktop based on MAUI appears. So this has be to the point of where I plan to build in F# Blazor sorta in MAUI desktop and can then progress to WASM from the same base code. By using the desktop app, I get quick access to saving data (local OS filesystem) plus multithreading. Once I have a bunch of the basics and program flow working, I can then apply that to working on the web through WASM. My architecture means so backend server. At least not one I am required to put up. So the user takes on all compute needed and drive space and costs for could storage, etc. My only need to static webhosting for a person to download the app executable or the WASM based files to run in browser. By adding in PWA options, I also can bypass the mobile app store gatekeepers and not have to deal with them (apple and google).
So I end up with a single set of files for the UI itself, a bit of dual code framework for WASM and Desktop, but then all logic and program guts are shared. Seems like minimal overlap to me and lets me get going and get something working that I can built out from.
Did you find this article valuable?
Support Ivan Rainbolt by becoming a sponsor. Any amount is appreciated!