BlazorDelta 0.1.1
dotnet add package BlazorDelta --version 0.1.1
NuGet\Install-Package BlazorDelta -Version 0.1.1
<PackageReference Include="BlazorDelta" Version="0.1.1" />
<PackageVersion Include="BlazorDelta" Version="0.1.1" />
<PackageReference Include="BlazorDelta" />
paket add BlazorDelta --version 0.1.1
#r "nuget: BlazorDelta, 0.1.1"
#:package BlazorDelta@0.1.1
#addin nuget:?package=BlazorDelta&version=0.1.1
#tool nuget:?package=BlazorDelta&version=0.1.1
BlazorDelta
High-performance Blazor components with source generation
⚡ 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
- 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
}
Build your project - the source generator will automatically create optimized partial methods for your component.
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 | Versions 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. |
-
net9.0
- Microsoft.AspNetCore.Components (>= 9.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
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