About
This is a project aimed at making it easier for F# developers to write Blazor applications.
Features include:
- Allows F# for Blazor development
- Use computation expression (CE) style DSL for internal and third-party Blazor libraries
- Use dependency injection (html.inject/html.comp)
- Leverages the Adaptive model (adaptiview/AdaptiveForm) (highly recommended), or the elmish model (html.elmish)
- Implements Giraffe-style routing (html.route)
- Provides type-safe stylesheet creation using Fun.Css
- Converts HTML to CE style with Fun.Dev.Tools
Benchmarks
Method | Mean | Error | StdDev | Gen 0 | Allocated |
---|---|---|---|---|---|
RenderWithRazorCSharp | 400.3 ns | 6.99 ns | 6.20 ns | 0.0610 | 384 B |
RenderWithBolero | 926.1 ns | 17.49 ns | 17.96 ns | 0.2546 | 1,600 B |
RenderWithFunBlazorCE | 731.1 ns | 14.07 ns | 21.49 ns | 0.1173 | 736 B |
RenderWithFunBlazorTemplate | 2,569.9 ns | 42.22 ns | 39.50 ns | 0.6752 | 4,240 B |
Simple demo
Here is a basic counter that uses an adaptive model: