How do I upgrade from SAFE v4 to v5?
F# tools and dependencies
- 
Get the latest dotnet tools such as Fable and Fantomas into your repository.
- Overwrite your 
dotnet-tools.jsonfile from here. - Ensure tools have been downloaded to your machine with 
dotnet tool restore. 
 - Overwrite your 
 - 
Use our preferred F# formatting style.
- Overwrite your 
.editorconfigfile from here. 
 - Overwrite your 
 - 
Migrate all dependencies to .NET 8.
- 
Overwrite your
global.jsonfile from here. - 
Update each of your project files to target .NET 8.
<PropertyGroup> <TargetFramework>net8.0</TargetFramework> </PropertyGroup> - 
Upgrade all .NET dependencies to the latest versions for SAFE v5:
- Run 
dotnet paket remove Fable.React -p Client. - Run 
dotnet paket remove Feliz.Bulma -p Client. - Overwrite your 
paket.dependenciesfile from here. - Overwrite your 
paket.lockfile from here. - Overwrite your Shared project's 
paket.referencesfile from here. - Run 
dotnet paket installto update the Shared project. - Manually re-add any custom dependencies that you previously had in any projects (Client, Server or Shared etc.):
cdinto the required project.dotnet paket add <package> --keep-minor. This will download the latest version of the package you required but will not update any associated dependencies outside of their existing major version.
 
 - Run 
 
 - 
 
Javascript tools and dependencies
- Update all dependencies.
 - Migrate from webpack to vite.
- Delete 
webpack.config.js - Add the 
src/Client/vite.config.mtsfile from here. 
 - Delete 
 
Styling configuration
- 
Install Tailwind.
 - 
Update HTML and F# code.
- Overwrite 
src/Client/index.htmlwith this file. - Add the following lines at the top of 
src/Client/App.fs, after the existing open declarationsopen Fable.Core.JsInterop importSideEffects "./index.css" 
 - Overwrite 
 
Automated tests
- Add the file 
tests/Client/vite.config.mtsfrom here. - Overwrite the 
tests/Client/index.htmlfile from here. - Add the file 
.fantomasignorefrom here. 
Automated build
- 
In the
Build.fsfile replace the following lines:Line 27:
- "client", dotnet [ "fable"; "-o"; "output"; "-s"; "--run"; "npm"; "run"; "build" ] clientPath ] + "client", dotnet [ "fable"; "-o"; "output"; "-s"; "--run"; "npx"; "vite"; "build" ] clientPath ]Line 35:
- operating_system OS.Windows - runtime_stack Runtime.DotNet60 + operating_system OS.Linux + runtime_stack (DotNet "8.0")Line 51:
- "client", dotnet [ "fable"; "watch"; "-o"; "output"; "-s"; "--run"; "npm"; "run"; "start" ] clientPath ] + "client", dotnet [ "fable"; "watch"; "-o"; "output"; "-s"; "--run"; "npx"; "vite" ] clientPath ]Line 58:
- "client", dotnet [ "fable"; "watch"; "-o"; "output"; "-s"; "--run"; "npm"; "run"; "test:live" ] clientTestsPath ] + "client", dotnet [ "fable"; "watch"; "-o"; "output"; "-s"; "--run"; "npx"; "vite" ] clientTestsPath ]Note: If you are using a template created prior to version v4.3, you may have the following string syntax for the
dotnetcommands and therefore the change you need to make will be slightly different.- "client", dotnet "fable -o output -s --run npm run build" clientPath + "client", dotnet "fable -o output -s --run npx vite build" clientPath 
Additional resources
- VSCode Tailwind intellisense.
- Install the 
Tailwind CSS Intellisenseextension. - Create the 
.vscode/settings.jsonfile from here. The regexes in this file are for Feliz style DSL, if you want to support Fable.React DSL you will need to adapt the regexes. 
 - Install the