Overview
Blazor in .NET 10 received significant improvements in performance, developer experience, and new capabilities. This article highlights the key features.
Performance Improvements
Blazor Script Optimization
The core blazor.web.js script is now served as a static asset with:
- 76% size reduction - from 183 KB to ~43 KB
- Automatic compression
- Fingerprinting for cache busting
- Faster load times
Hot Reload for WebAssembly
.NET 10 migrated to a general-purpose Hot Reload implementation:
- Edit
.razorfiles and see changes instantly - No rebuild required
- No browser refresh needed
- Works automatically - no configuration
New State Management
[PersistentState] Attribute
Declaratively persist component state during prerendering:
@code {
[PersistentState]
public string UserPreference { get; set; }
}
State is automatically persisted and retrieved when components render interactively.
Pause and Resume
New methods for Blazor Server state persistence:
Blazor.pause()- Pause the circuitBlazor.resume()- Resume the circuit- Users can resume where they left off after disconnection
Validation Enhancements
Source Generator Validation
.NET 10 replaces reflection-based validation with Source Generators:
- Faster validation at runtime
- AOT (Ahead-of-Time) compilation safe
- Better performance in WebAssembly
Nested Form Validation
New validation support for complex forms:
AddValidation()method[ValidatableType]attribute (experimental)- Validate nested objects and collections
Authentication - Passkeys Support
ASP.NET Core Identity now supports passkeys (WebAuthn/FIDO2):
- Passwordless authentication
- Biometric login (Windows Hello, Touch ID, Face ID)
- Security key support
- Phishing-resistant authentication
See our dedicated article on Blazor Authentication with Passkeys.
JavaScript Interop Improvements
- More efficient byte-array transfers in WASM
- Real JS object manipulation (similar to working directly with JavaScript)
- Better performance for JS-heavy applications
Developer Experience
Required Parameters
Required component parameters now trigger compile-time errors:
[Parameter, EditorRequired]
public string Title { get; set; }
Missing parameters are caught before runtime.
Build-Time Service Validation
WebAssembly builds now validate configured services at build time:
- Catch DI configuration errors early
- Fewer runtime surprises
Built-in ReconnectModal
Blazor Web App templates include a built-in reconnection UI:
- Developer-friendly reconnection modal
- Respects Content Security Policy (CSP)
- Customizable appearance
Navigation Improvements
NavigateTono longer forces scroll to top when navigating to same page- Better handling of same-page navigation
- Improved anchor link behavior
Enhanced Debugging & Tracing
- OpenTelemetry integration for Blazor Server
- Performance profiling via
.nettracefiles for WebAssembly - Better diagnostic capabilities
Migration Tips
- Update target framework to
net10.0 - Update NuGet packages to .NET 10 versions
- Review
blazor.web.jsreferences (now a static asset) - Test Hot Reload functionality
- Consider implementing passkeys for authentication