Bolero Documentation

repository·master·Indexed 22 days ago

https://github.com/fsbolero/bolero

A toolkit and set of libraries for building WebAssembly applications with F# using the Blazor framework. Bolero provides an HTML DSL, type provider-based templating, Elmish integration, routing, remoting, and assembly optimizations to bridge F# paradigms with the Blazor ecosystem.

Tokens
424
Snippets
2
Records
3
Agent score
28%

What's inside Bolero

  1. What is Bolero?

    master

    Bolero is a toolkit for running F# applications in WebAssembly via Blazor. It provides a suite of features designed to make F# web development more ergonomic and efficient, including:

    • HTML DSL: Functions for writing HTML using a syntax similar to WebSharper.UI or Elmish.React.
    • Templating: A type provider-based approach to bind HTML written in separate files to F# code.
    • Elmish Integration: The ability to run Elmish programs as Blazor components and use Blazor components as views within Elmish.
    • Routing: Integration with Elmish where the URL is mapped to a field in the model (typically a discriminated union), allowing for direct definition of path parameters.
    • Remoting: A mechanism to define asynchronous functions on the server and invoke them directly from the client.
    • Optimizations: Automatic stripping of F# signature data from assemblies to minimize the size of the WebAssembly payload.
  2. Create and run a Bolero application

    master

    To create a new Bolero application and run it, follow these steps. Ensure you have the .NET SDK 6.0 or later installed.

    # 1. Create a new project named MyBoleroApp
    dotnet new bolero-app -o MyBoleroApp
    
    # 2. Navigate to the project directory
    cd MyBoleroApp
    
    # 3. Run the server project
    dotnet run --project src/MyBoleroApp.Server