F#

Introduction A couple of weeks ago Facebook presented React hooks, a new way of accessing React features inside functional components. In this blogpost I would like to show that the new hooks can easily be used in combination with Fable. Disclaimer: Hooks are an experimental proposal to React, currently available in 16.7 alpha, and the api is not final yet. Use at your own risk. useState() A first example of a hook is useState(). type SetState<'t> = 't -> unit let useState<'t> (t: 't) : ('t * SetState<'t>) = import "useState" "react" When…

Hi all, A quick update regarding the new release of the Fantomas project. There is a new and shiny global .NET Core cli tool. Install: dotnet tool install -g fantomas-tool The fantomas executable will be added to your path. Another new feature is the --preserveEOL option. This will respect additional newlines after formatting. You can check the release notes for all changes in the 2.8 version. Last but not least there is a rumor that the project might move to the fsprojects organization. This could lead to more people being involved in the project. Many thanks for everyone that…

Introduction As part of the F# mentorship program my mentor Anthony Lloyd and I have been working on the Fantomas project. Fantomas is like prettier or elm-format but for F#. It was originally created by Anh-Dung Phan and people have suggested that it could be a part of the F# Compiler Service. Fantomas is like prettier or elm-format but for F#. .NET Core The source code of Fantomas is quite advanced so our approach is to focus first on improving the project in general. We noticed it was a bit old in terms of Visual Studio version and dependencies, so…

Introduction Want to use Docker to develop Fable applications? What if I told you it isn't all that difficult? TLDR; How to user Docker with Fable. Docker So the first step with Docker images is that you check whether a suiting image that fits your needs already exists. When I checked Docker Hub for any recent images with the Fable tool chain I didn't really find anything that works with Fable 1.x. I accepted the fact that I would have to create the image myself. If you check the docs for requirements, we'll need: .NET Core Node js Mono…