BlazorDelta 0.1.1

dotnet add package BlazorDelta --version 0.1.1
                    
NuGet\Install-Package BlazorDelta -Version 0.1.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="BlazorDelta" Version="0.1.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="BlazorDelta" Version="0.1.1" />
                    
Directory.Packages.props
<PackageReference Include="BlazorDelta" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add BlazorDelta --version 0.1.1
                    
#r "nuget: BlazorDelta, 0.1.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package BlazorDelta@0.1.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=BlazorDelta&version=0.1.1
                    
Install as a Cake Addin
#tool nuget:?package=BlazorDelta&version=0.1.1
                    
Install as a Cake Tool

BlazorDelta

High-performance Blazor components with source generation

NuGet Downloads

⚡ Performance Improvements

  • 3-4x faster parameter assignment than ComponentBase
  • Near-zero memory allocation (464B → 0B for attribute splatting)
  • Automatic CSS optimization with smart change detection
  • Parameter change handlers without reflection overhead

🚀 Benchmark Results

Scenario ComponentBase BlazorDelta Speedup
Simple Parameters 36.9 ns 8.6 ns 4.3x
Complex Parameters 75.7 ns 21.1 ns 3.6x
Incremental Updates 68.5 ns 16.4 ns 4.2x
Unmatched Attributes 136.1 ns 40.2 ns 3.4x

📦 Installation

dotnet add package BlazorDelta

Usage

  1. Create a component that inherits from DeltaBaseComponent:
public partial class MyComponent : DeltaBaseComponent
{
    [Parameter] public string Title { get; set; }
    [Parameter] public int Count { get; set; }
    
    // Your component logic here
}
  1. Build your project - the source generator will automatically create optimized partial methods for your component.

  2. Your component now has enhanced delta functionality with automatically generated methods!

How It Works

BlazorDelta uses source generators to analyze your components that inherit from DeltaBaseComponent and automatically generates:

  • Optimized state change detection methods
  • Delta comparison utilities
  • Performance-enhanced rendering logic

All generated code is created as partial class extensions, so your original component code remains clean and focused.

Features

  • ✅ Automatic source generation at compile time
  • ✅ Performance optimizations for Blazor components
  • ✅ Seamless integration with existing Blazor projects
  • ✅ Type-safe generated code
  • ✅ Zero runtime dependencies for the generator
  • ✅ Full IntelliSense support for generated methods

Requirements

  • .NET 9.0 or later
  • Blazor Server or Blazor WebAssembly project

Example

// Your component
public partial class CounterComponent : DeltaBaseComponent
{
    [Parameter] public int CurrentCount { get; set; }
    [Parameter] public string Label { get; set; } = "Counter";

    private void IncrementCount()
    {
        CurrentCount++;
        // Generated delta methods automatically handle optimized updates
    }
}

The source generator will create additional methods and optimizations automatically when you build.

Contributing

Contributions are welcome! Please feel free to submit issues and pull requests.

License

This project is licensed under the MIT License.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.1 11 8/3/2025
0.1.0 11 8/2/2025

v0.1.1:
- Initial pre-release of BlazorDelta source generator
- 3-4x faster parameter assignment than ComponentBase
- Automatic CSS optimization with [UpdatesCss] attribute
- Parameter change handlers with [OnParameterChanged] attribute
- Support for SetOnce parameters, NoRender parameters
- Full support for CaptureUnmatchedValues, CascadingParameters
- Zero allocation for most scenarios, 464B → 0B for attribute splatting
- Note: API may change before 1.0.0 release