Libraries we love with SAFE Stack
The SAFE Template provides a great starting point for getting going with SAFE Stack. The F# ecosystem provides plenty of additional libraries that you can use in combination with or instead of those provided by the template to enhance your experience. This blog post will be a whistle-stop tour through some of our favourites.
FsToolkit.ErrorHandling provides utility functions to make working with
Option types easier. It also has a few excellent computation expressions such as
asyncResult, which simplifies working with
Results in an asynchronous context. Ryan has a great post showing how easy it makes validation.
Recently, we've enjoyed using Feliz.DaisyUI because of the flexibility DaisyUI offers compared to Bulma, which the SAFE Template offers via Feliz.Bulma. I wrote a brief introduction in a previous blog post.
Facil is simply awesome. Given a connection to a SQL Server database, it can generate F# records representing the database object. Given the location of files containing SQL queries, it can generate F# functions for executing them. It can even generate F# functions for basic CRUD operations against tables without you having to write any SQL. Kash has a post on Facil as part of his series on working with SQL from F#.
We host our apps on Azure. The following SDKs are useful for interacting with Azure storage:
Polly is a great library for specifying how your app should handle faults and providing ways to make it more resilient. I have a blog post showing configuration of some basic Polly policies in F#
FsCheck is a property-based testing library for F#. That is, it is used to generate random test data and check that a specified property holds for all given inputs to a function. It's an approach that can enable radically different tests to what you might otherwise get. Our blog has a few examples of what you can do with it.
NBomber allows you to test how your application holds up under load. Isaac has another excellent post, demonstrating how to get started with NBomber
As promised, that overview was quick(!) — hopefully the links give you enough to get going if you want more information. Have fun experimenting and using these libraries to enhance your SAFE Stack experience!