Install-Package Blazor-Redux -Version 0.0.6
dotnet add package Blazor-Redux --version 0.0.6
<PackageReference Include="Blazor-Redux" Version="0.0.6" />
paket add Blazor-Redux --version 0.0.6
#r "nuget: Blazor-Redux, 0.0.6"
// Install Blazor-Redux as a Cake Addin #addin nuget:?package=Blazor-Redux&version=0.0.6 // Install Blazor-Redux as a Cake Tool #tool nuget:?package=Blazor-Redux&version=0.0.6
The combination of Blazor and Redux becomes an incredibly compelling platform for frontend development—more compelling than any other alternative, if you ask me:
- Blazor uses .NET, thus comes with a strong type-system built-in, like Elm, Purescript, OCaml, and to some degree Typescript.
- With ASP.NET already such a viable option for the backend, this opens up for a very strong isomorphic apps model with shared .NET code on the frontend and backend.
- The Razor view engine combines the power of a templating engine with the familiarity of HTML, like JSX. With Redux, the Blazor pages themselves become very simple, with just presentational content, references to state in the store, and dispatching of actions.
- When it comes to productivity, Blazor can feel like one of the specialized proprietary platforms such as Silverlight and Flash, but it does in fact produce web standard-compliant code compatible with all major browsers and devices without any plugins.
- Blazor is actual .NET assemblies running on Mono compiled for WebAssembly. While this may sound excessive in terms of download size, both Mono and the .NET library are less than a megabyte in size.
- Blazor comes with strong backing from a solid organization (Microsoft).
Advantages over vanilla Blazor
- Implements a one-way model-update-view architecture, by many considered to be more robust and easier to reason about than a two-way data binding as found in Angular.
- Application state is kept in a single state store, facilitating advanced features such as undo/redo, hydration of application state, and time-traveling debuggers.
- Any Blazor component upgraded to a Redux component will subscribe to changes in the state store and automatically update its view, so you don't have to worry about calling
- Blazor Redux supports F#, which means you can take advantage of some advanced language features when designing your types, actions and reducer logic. The discriminated union types are perfect for designing type-safe application messages, and the
withkeyword in record types makes it simple to work with immutable types in your reducer logic. Not to mention that a model with many small types can be created with much less ceremony. F# lends itself well to type driven development. However, the Blazor project itself and the Razor pages must be C#.
More documentation is available on GitHub.
Blazor Redux is at an experimental stage, and you should expect breaking changes. But I'd be very interested in discussing the design and potential features. Please open an issue if you have any particular topic in mind.
- Microsoft.AspNetCore.Blazor.Browser (>= 0.6.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Blazor-Redux:
Blazor rendering with F# and state management with BlazorRedux.
This package is not used by any popular GitHub repositories.
Updated for Blazor 0.6.0, with contributions from Sergey Solin.