This repository demonstrates how Turbolinks can be used with the F# SAFE web stack.
I have written a companion blog post that goes into more detail on the setup.
Turbolinks can be a good compromise when only a little interactivity is needed on the frontend, and you don't want to setup a full single page application. It gives the user the feel a single-page application, but most of the business logic can be kept server-side.
From the Turbolinks documentation:
Turbolinks® makes navigating your web application faster. Get the performance benefits of a single-page application without the added complexity of a client-side JavaScript framework. Use HTML to render your views on the server side and link to pages as usual. When you follow a link, Turbolinks automatically fetches the page, swaps in its <body>, and merges its <head>, all without incurring the cost of a full page load.
You'll need to install the following pre-requisites in order to build SAFE applications
- The .NET Core SDK
- The NPM package manager.
- Node LTS installed for the front end components.
- If you're running on OSX or Linux, you'll also need to install Mono.
Before you run the project for the first time only you should install its local tools with this command:
dotnet tool restore
To run the application in watch mode use the following command. (There is no hot module reloading, since we are not using webpack-dev-server. This is a server-side web application):
dotnet fake build -t run
You will find more documentation about the used components at the following places: