Overview:
The Fable-Elmish-Electron-Material-UI demo is an example of an F# Electron app that combines Fable 2 and Elmish. It serves as a guide for using Material-UI, including JSS/style-as-code, and implementing UX patterns in Elmish. The demo can be used as a scaffolding tool for developing Fable/Elmish/Electron apps.
Features:
- Hot module reloading for both code and styles
- Time-travel debugging using Redux DevTools, RemoteDev, and Fable.Elmish.Debugger
- Single-command development and packaging with FAKE
- Uses electron-webpack for most of the webpack configuration
- Uses electron-builder to package the app
- Uses electron-window-state for remembering window state between launches
- Uses Devtron for Electron-specific debugging and linting
Installation:
Ensure you have the following requirements installed:
- .NET Core SDK 3.0
- Node (for npm)
Clone the repository.
Restore the necessary CLI tools by running the command:
dotnet tool restoreTo run the app locally in “live mode”, execute the following command:
dotnet fake build -t DevNote:
Devis the default target, so you can also simply rundotnet fake build.After the app starts, make changes to the renderer project located in
/src/Renderer, and the changes will appear in real-time thanks to hot module reloading.Place static files in the root
/staticfolder as required by electron-webpack. Refer to the code for the “Static assets” page and the helpers inUtils.fsto learn how to use them.To build the app to an unpacked directory, run:
dotnet fake build -t DistDirTo build the app to a packed installer, run:
dotnet fake build -t Dist
Summary:
The Fable-Elmish-Electron-Material-UI demo showcases an F# Electron app built using Fable 2 and Elmish. It provides examples of how to use Material-UI and implements various UX patterns in Elmish. The demo offers features such as hot module reloading, time-travel debugging, and single-command development and packaging. The installation process involves cloning the repository, restoring CLI tools, and running commands to start the app in live mode. The demo also supports building the app to an unpacked directory or a packed installer. Improvement suggestions are welcome through issue or pull request submissions.