Repository navigation
.NET 11 support - #1407
Merged
Merged
.NET 11 support#1407
Conversation
Adds net11.0 to the library targets with Microsoft.AspNetCore.Components.Web 11.0.0 for that target, keeping net8.0, net9.0 and net10.0. Sets the package version to 4.1.0.
The .NET 11 analyzers flag 12 unguarded interop calls (BL0016). Button tooltips, Ribbon tabs and Sidebar/Sidebar2 init use SafeInvokeVoidAsync. AutoComplete, CurrencyInput and the sidebar width use a new private protected SafeInvokeAsync<T> that returns a fallback when the call is cancelled or the circuit has disconnected. JsInteropBase marks the runtime unavailable when the module import hits a disconnect.
The .NET 11 analyzers flag five calls as unnecessary (BL0012). DragAndDropFileInput's drag handlers drop them. Sidebar and Sidebar2 give the brand link its own handler; HideNavMenuOnMobile keeps its re-render because SidebarItem and Sidebar2Item call it from their own click handlers. The library now builds with no warnings on every target.
Every job that builds a project referencing the library now installs SDK 11.0.x, because restore evaluates the library's new net11.0 target (NETSDK1045 with SDK 10). sonar.yml gains a setup-dotnet step; web-app.yml and static-web-app.yml move to 11.0.x, and the WebAssembly demo is built and published for net11.0. Secrets and the prod_release gate are unchanged.
The demo RCL, Server and WebAssembly projects target net11.0 with the 11.0.0 Microsoft packages and BlazorExpress.ChartJS 2.0.0. The navbar's displayed versions move to v4.1.0 and .NET 11.0.0.
EditContext.Validate() is obsolete in .NET 11. The Showcase sites now await ValidateAsync() at all 125 call sites. The handlers that call it become async Task (38 were void; 10 returned Task.CompletedTask), and ValidPostmortem becomes ValidPostmortemAsync. The four callers that fired them without awaiting now await them; the maintenance page's pending action becomes a Func<Task>.
The TextInput, TextAreaInput, PasswordInput and Switch demos and the matching docs samples now await EditContext.ValidateAsync(), with a '.NET 10 and earlier: use editContext.Validate()' note in the shown code. The Switch demo's field-changed handler becomes async and re-renders after validating.
The .NET 11 analyzers flag 117 StateHasChanged calls in Showcase event handlers as unnecessary (BL0012). Each handler is private and bound only through an EventCallback (OnHidden, OnSubmit, OnValidSubmit, OnClosed) or @OnClick, so Blazor re-renders after it anyway; focus targets set in those handlers still apply on that render.
The .NET 11 analyzers flag six unguarded interop calls (BL0016). Section's heading navigation and WebsiteNavbar's theme calls use the base SafeInvokeVoidAsync. Grid demo 16 wraps its localStorage save and load in a try/catch for disconnects and cancellation, loading default settings when the read fails.
README.md and the NuGet readme list the supported .NET versions (8, 9, 10 and 11) and install Blazor.Bootstrap.Templates 1.11.0. The draft 4.1.0 upgrade post gains a .NET 11 section, covering the new net11.0 build and ValidateAsync on .NET 11, and a 'Coming from 3.x?' note pointing chart users to BlazorExpress.ChartJS.
Replaces the six .NET 8 getting-started pages with eight pages: .NET 11 first, then .NET 10, each for WebAssembly standalone, Web App Server (global), Web App Auto (global) and MAUI Blazor Hybrid. Each page uses version 4.1.0, links its starter project, and shows that project's own files as sample code. Removed and legacy getting-started URLs redirect to the matching .NET 11 page; the navbar, footer, home page, layout pages, readmes and the demo's Getting Started table point to the new pages.
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.