Skip to content

Xamarin.Forms on the Web

Frank A. Krueger edited this page Nov 14, 2017 · 4 revisions

TLDR: I implemented a web backend for Xamarin Forms so that it can run in any browser. It achieves this without javascript recompilation by turning the browser into a dumb terminal fully under the control of the server (through a library I call Ooui). This crazy model turns out to have a lot of advantages.

Why put Xamarin Forms on the Web?

The web is the best application distribution platform ever made. Anyone with an internet connection can use your app and you are welcome to monetize however you want. Unfortunately, the price of using this platform is acuquiecense to "web programming". In "web programming", the client (browser) and server (that Docker thing) execute independently. This means that you spend the majority of your time implementing ad-hoc and buggy synchronization systems between the two. The server is a dumb data store while the client executes UI logic - only communicating with the server at very strategic points (because synchronization is hard yo). This is and of itself is complex but is only made more complex when the server decides to get in on the UI game by rendering templates - now your UI is split along with your data.

Getting this right takes a lot of work. You will write two apps - one server and one client. You will draw diagrams and think about data state flows. You will argue about default API parameters. You will struggle with the DOM and CSS because of their richness in both features and history.

Clone this wiki locally