fsharp

Published

Tags

Say Hello to Fantomas 5

Introduction Fantomas 5 is here! The API of v5 is finalized! In this blogpost I will explain how you can migrate to v5 from v4. The latest preview versions are labelled as beta’s, meaning the API is stable. Please start using these latest versions, as the final product will be very close to what is out there today. Install Fantomas using dotnet tool install fantomas —prerelease What changed? Under the good, we achieve a massive performance boost. I explained this in a previous blogpost, Fantomas v5 is twice or more, as fast as v4. Achieving this required…

Published

Tags

World domination, part one

Intro Some time ago, I was able to merge in a huge refactoring effort into the next major version of Fantomas. The result of these changes make Fantomas at least twice as fast as the v4 release. Before After In this blogpost, I’ll elaborate a bit how we did this and what you can expect from the V5 release. F# eXchange 2021 Last October, I had the opportunity to speak at F# eXchange. There I announced that what the plan was for the next major of Fantomas and how to get there. A crucial part of that talk was about how improving the at dotnet/fsharp was…

Published

Tags

A word on triple-slash comments

Intro Yesterday, pretty much out of nowhere, FCS 41.0.3 was published on NuGet. I must say, I’m pretty hyped about this release. It contains a few PRs that improve the syntax tree and provide more information to work within Fantomas. It also contains some XML documentation improvements that Alex of the Rider team has been working on. You can read the details about this new XML collecting mechanism in this RFC. It is a nice improvement and I’ve decided to implement an enhancement in Fantomas due to these changes. There actually are comments in the syntax…

Published

Tags

Fantomas Daemon

Intro The F# advent calendar is a wonderful initiative that inspires the community to create new content in a short period of time. I’ve been fortunate enough to be part of this for some years now. This year, I had in mind to sit this one out actually. Sometimes, there are just no new tales to tell and it is better suited to give others an opportunity. When I noticed that Sergey still had some spots left to fill, I did happily volunteer, though didn’t think it through that much. My original thought for this post was to create some content around the F…

Published

Tags

Gitpod & Snowpack

Hey all, For my F# Advent calendar entry of 2020 I messed around with Gitpod, Snowpack & Fable. You can find the result in this video: Take care everyone! Cheers, nojaf Photo by Annie Spratt on Unsplash

Published

Tags

Fantomas configuration file

Hi all, The cat’s out of the bag: Fantomas now has support for configuration files. This means you can override the default settings using a JSON file. Check out the documentation for more information. In this post I wish to answer a couple of small questions about the Fantomas configuration files. JSON schema? We’ve added a JSON schema definition to http://schemastore.org. So to get intellisense in most editors, you can add to the configuration file. Ionide integration? When using the latest Ionide version (4.4.3 and higher), your configuration will…

Published

Tags

Using Create React App with Fable

Introduction 2019 has been a great year for me for all things F# related! I helped out with the organization of FableConf in Antwerp, gave a webinar at JetBrains and was able to release Fantomas 3.0. To wrap up the decade I’m writing this post as part of the F# Advent Calendar in English 2019. I had fun last year and I wish to continue this trend. To Feliz or not to Feliz Feliz has been receiving some traction in the community and at one-point Zaid asked me what I thought about it. My reply was, well it’s not for everybody 😅. In this blog post I’m going…

Published

Tags

Building Fable on Travis CI

Introduction Hi nojaf from the future, its you from the past. Today you created a build script for compiling Fable projects on Travis CI. Using a Docker image you maintain it is pretty easy to set up a Travis CI process. This blogpost is meant to capture what you knew then in case you sorta forgot. The good part Once you logged in to Travis, create a project by selecting a repository. Don’t worry you log in with your GitHub account and hit the add button. They know you are you and you get to choose a repository you have on GitHub. If you did that then…

Published

Tags

Writing a VSCode extension with Fable 2.1

Introduction This post is part of the F# Advent Calendar in English 2018. I’m very grateful to be a part of this and I hope you will enjoy this one as much as I have enjoyed the others. Today I would like to show you how you can create VS Code extension from scratch using Fable. Along the way we write some code that will extend the Markdown syntax. Project setup Code extension To get started we will follow the general approach of scaffolding a new extension. Using the yeoman generator we will scaffold a new JavaScript extension. Adding Fable In order to…

Published

Tags

React hooks preview with Fable

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 , and the api is not final yet. Use at your own risk. useState() A first example of a hook is useState(). When the hook is called, we receive a variable representing the state and a function to update the state. Example: Note that accepts a…

Published

Tags

Fantomas 2.8: global .NET Core cli tool!

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 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…

Published

Tags

Fantomas rejuvenated: .NET cli tool

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 we…

Published

Tags

Building Fable apps inside a Docker container

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 Docker compose…