All Articles

Let's write Fable bindings for a JS library

02 Feb 2022
Learn about writing Fable Bindings for a Javascript or Typescript library. See the article for a list of common scenarios and examples.
Writing fable bindings is easier than many people think it is, but still require a time investment depending on how much of the API of a Javascript/Typescript library you want to expose. Having a Typescript definitions file will give you a very big advantage as you can see exactly what types a function expects and returns, without implementation details getting in the way. Additionally, there is the ts2fable project, which attempts to automagically type out everything in the definitions file. This is usually a good starting point. The official fable documentation is a good resource, and one of the resources I used to learn how to write bindings.

Using Sutil to develop a real world application

31 Dec 2021
Testing out a new web framework is always difficult unless you spend some time with it building a real world application. This post explores doing just that by using Sutil to develop an application called Conduit as part of the Real World project to compare frontend and backend frameworks.
This is my entry for the F# Advent Calendar 2021. Thank you Sergey Tihon for organizing it. This post will explore building a small demo application using the Sutil framework. See the final result here.

Managing your client connections in SignalR, including with authentication

09 Jul 2021
When using SignalR, one of the most important things will be to manage the various connections made by the clients, as well as being able to send messages to specific clients. SignalR offers three different ways of specifying connections and clients, each with their distinct usages. The question comes down when to use what, and the advantages and disadvantages offered by each.
Although this post is written with a focus on using F# and Fable.SignalR, the concepts talked about are applicable to SignalR in general, including when used with C#

Improving Real-time communication using Fable.SignalR

31 Dec 2020
Learn to use Fable.SignalR for a more functional and type-safe approach to communication over websockets when using Fabulous.Xamarin as the client.
This is a continuation of my previous blog post about real-time communication with Giraffe and Fabulous. Reading the other article is not required for this one, as it aims to accomplish the same thing, but using a nice friendly F# wrapper around SignalR. This post is also my entry for the F# advent calendar organized by Sergey Tihon. Once again a huge thanks to Sergey for organizing these every year. Awkwardly, Mark Allibone has also written an article for the advent calendar, which is very similar to my first post. Well, here's hoping we can learn something from each other.

Fable React is nice. But what about Fable Preact

31 Dec 2018
Reducing final bundle size of a Fable-React application by using Preact instead.
This is my entry for the F# Advent Calendar 2018. I’ve been doing full-stack .Net web development for ~6 years now, and I learned F# ~3 years ago. In the second set of 3 years, I’ve also done more frontend web development than I did backend. In this time I’ve had the (mis)fortune of playing with countless JS SPA frameworks. This has given me the insight into what these various frameworks do, how they work, and how they differ from the other frameworks. I’ve also thought about what web developers should be paying more attention to, and what is nice and fun. In this post I want to explore a combination of what’s fun (Fable Elmish), and what I believe developers need to pay more attention to (bundle size). With that, I’d like to delve into two topics, namely, what I believe to be a big problem with the current state of web development, and a possible solution to this problem.

Power of Active Patterns

11 Nov 2018
Showcase about how one could refactor a large set of nested if/else statements by using F# Active Patterns
I’ve been working on a dotnet core global tool. One of the things that such a tool has, is many command line options. I found Argu to parse these command line options. However I ran into the problem that I was left with a very large amount of if/else statements. Perhaps I don’t know what the “proper” way is of handling this, but this was my naive approach.