Are you a JS developer?
Welcome to Fable!
Hi!
We're happy you decided to try Fable. Since F# is a language originally created for the .NET environment, Fable uses some tools that come from there.
Don't panic! There is enough documentation to explain how the .NET tools integrate in your environment. And there are basically only two things you need to know:
- Fable uses F# project files (
.fsproj
) to list your F# code files and libraries. - Fable uses NuGet to load F# libraries, which is the equivalent of NPM for the .NET environment
Voilà. Nothing else. We'll come to explanations later in the docs. But we promise, there's nothing you won't understand right away. Apart from these facts, it's all JavaScript!
Welcome home!
- Fable transpiles F# to ES2015 JavaScript
- Fable integrates with your favorites bundler (Vite, Parcel, Webpack, ...)
- JS Dependencies are listed in your common
package.json
file. - Unit testing is available through Fable.Mocha (but you can use another test runner if you wish).
So since we're mainly using JavaScript tools, you won't be lost with Fable!
Fable workflow
The main differences when using Fable is instead of writing JavaScript file, you will write F# and then use the generated JavaScript files.
So if we consider the following JavaScript workflow:
- Write
*.js
files - Use JavaScript dependencies manager
- Use JavaScript build tools
- Run the app
Then when using Fable, the workflow become is:
- Write F# files
- Optional: Consume the generated files
*.fs.js
from your*.js
files - Use JavaScript dependencies manager
- Use JavaScript build tools
- Run the app