From 4bfa5b88918b975dd98120608126ec5ec1d36061 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 7 Feb 2026 08:08:11 +0000 Subject: [PATCH 1/2] Initial plan From e810a721e6091ae64d3c4d59560b6f472723907b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 7 Feb 2026 08:10:42 +0000 Subject: [PATCH 2/2] Add release notes for unified Blazor startup options format (PR #64629) Co-authored-by: danroth27 <1874516+danroth27@users.noreply.github.com> --- .../11.0/preview/preview1/aspnetcore.md | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/release-notes/11.0/preview/preview1/aspnetcore.md b/release-notes/11.0/preview/preview1/aspnetcore.md index 620a7c8994..ac3a81aca9 100644 --- a/release-notes/11.0/preview/preview1/aspnetcore.md +++ b/release-notes/11.0/preview/preview1/aspnetcore.md @@ -14,6 +14,7 @@ Here's a summary of what's new in ASP.NET Core in this preview release: - [`IComponentPropertyActivator` for custom property injection](#icomponentpropertyactivator-for-custom-property-injection) - [SignalR `ConfigureConnection` for Interactive Server components](#signalr-configureconnection-for-interactive-server-components) - [Improved Blazor reconnection experience](#improved-blazor-reconnection-experience) +- [Unified startup options format for Blazor scripts](#unified-startup-options-format-for-blazor-scripts) - [`IHostedService` support in Blazor WebAssembly](#ihostedservice-support-in-blazor-webassembly) - [Environment variables in Blazor WebAssembly configuration](#environment-variables-in-blazor-webassembly-configuration) - [Opt-in metrics and tracing for Blazor WebAssembly](#opt-in-metrics-and-tracing-for-blazor-webassembly) @@ -383,6 +384,56 @@ The enhanced reconnection logic provides: These improvements make Blazor applications more resilient to temporary network interruptions and provide a smoother user experience during connectivity issues. +## Unified startup options format for Blazor scripts + +The `blazor.server.js` and `blazor.webassembly.js` scripts now accept the same nested options format used by `blazor.web.js`. This provides consistency across all Blazor hosting models and eliminates a potential source of confusion when working with different Blazor templates or migrating between hosting models. + +Previously, `blazor.web.js` used a nested structure with `circuit` and `webAssembly` properties, while `blazor.server.js` and `blazor.webassembly.js` expected options at the top level. Now all three scripts support both formats. + +**For Blazor Server (`blazor.server.js`):** + +```javascript +// Both formats now work +Blazor.start({ + circuit: { + reconnectionOptions: { + retryIntervalMilliseconds: [0, 2000, 10000, 30000] + } + } +}); + +// Original format still supported +Blazor.start({ + reconnectionOptions: { + retryIntervalMilliseconds: [0, 2000, 10000, 30000] + } +}); +``` + +**For Blazor WebAssembly (`blazor.webassembly.js`):** + +```javascript +// Both formats now work +Blazor.start({ + webAssembly: { + loadBootResource: function(type, name, defaultUri, integrity) { + // Custom resource loading logic + return defaultUri; + } + } +}); + +// Original format still supported +Blazor.start({ + loadBootResource: function(type, name, defaultUri, integrity) { + // Custom resource loading logic + return defaultUri; + } +}); +``` + +This change makes it easier to share code examples and documentation across different Blazor hosting models, and reduces friction when developers work with multiple Blazor application types or reference documentation intended for `blazor.web.js`. + ## `IHostedService` support in Blazor WebAssembly Blazor WebAssembly now supports `IHostedService` for running background services in the browser. This brings feature parity with Blazor Server and enables scenarios like periodic data refresh, real-time updates, or background processing.