Skip to content

feat: support .NET 11 preview - #8406

Open
ArgoZhang wants to merge 16 commits into
mainfrom
dev-net11
Open

feat: support .NET 11 preview#8406
ArgoZhang wants to merge 16 commits into
mainfrom
dev-net11

Conversation

@ArgoZhang

@ArgoZhang ArgoZhang commented Sep 2, 2026

Copy link
Copy Markdown
Member

Link issues

fixes #8405

Summary By Copilot

  • Add net11.0 to the supported target frameworks and pin the .NET 11 preview SDK in global.json.
  • Update GitHub Actions and Docker images to use the .NET 11 preview SDK and runtime.
  • Use the native .NET 11 EditContext.ValidateAsync API while retaining the existing validation path for earlier frameworks.
  • Update component tests to await asynchronous form and context-menu event helpers.

Regression?

  • Yes
  • No

The existing net6.0 through net10.0 target frameworks remain configured.

Risk

  • High
  • Medium
  • Low

The default development target, CI SDK, container images, and validation API path move to a preview framework. Earlier target frameworks keep their existing conditional implementation.

Verification

  • Manual (required)
  • Automated

dotnet test test\UnitTest\UnitTest.csproj -f net11.0 --nologo --verbosity quiet

All 2570 tests passed.

Packaging changes reviewed?

  • Yes
  • No
  • N/A

The package project adds net11.0 and the corresponding .NET 11 preview package references while retaining all existing target frameworks.

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • Merge the latest code from the main branch

Summary by Sourcery

Add .NET 11 preview support across targeting, validation, CI, packaging, and container environments while preserving compatibility with earlier frameworks.

New Features:

  • Add .NET 11 preview as a supported target framework while retaining existing framework targets.
  • Use the native asynchronous validation API when targeting .NET 11.

Enhancements:

  • Align development and CI builds with a pinned .NET 11 preview SDK.
  • Update server container images to the .NET 11 preview SDK and runtime.
  • Update component tests for asynchronous form and context-menu event handling.

Build:

  • Pin the project SDK to .NET 11 preview through global.json and add the corresponding framework/package configuration.

CI:

  • Configure GitHub Actions workflows to install the SDK specified by global.json.

Deployment:

  • Update server Docker builds and runtime images to .NET 11 preview.

Tests:

  • Adapt component tests to await asynchronous event helpers.

@bb-auto bb-auto Bot added the enhancement New feature or request label Sep 2, 2026
@bb-auto bb-auto Bot added this to the v10.10.0 milestone Sep 2, 2026
@sourcery-ai

sourcery-ai Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

The PR adds net11.0 support and makes the .NET 11 preview SDK the pinned development, CI, packaging, and container baseline, while conditionally adopting EditContext.ValidateAsync for .NET 11 and updating affected component tests to await asynchronous helpers; earlier target frameworks remain supported.

Sequence diagram for framework-specific asynchronous form validation

sequenceDiagram
    participant Caller
    participant ValidateForm
    participant Validator
    participant EditContext

    Caller->>ValidateForm: ValidateAsync(cancellationToken)
    ValidateForm->>Validator: ValidateAsync(cancellationToken)
    alt .NET 11 or later
        Validator->>EditContext: ValidateAsync(cancellationToken)
        EditContext-->>Validator: Task<bool>
    else Earlier target frameworks
        Validator->>EditContext: validation event path
        EditContext-->>Validator: validation result
    end
    Validator-->>ValidateForm: Task<bool>
    ValidateForm-->>Caller: Task<bool>
Loading

File-Level Changes

Change Details Files
Adds .NET 11 preview as the default SDK and supported build target across local development, CI, packaging, and containerization.
  • Pins the .NET 11 preview SDK in global.json with prerelease support and patch roll-forward.
  • Updates GitHub Actions to provision the SDK from global.json.
  • Adds net11.0 targeting and matching preview framework/package configuration while retaining net6.0–net10.0.
  • Moves server Docker build and runtime images to .NET 11 preview.
global.json
.github/workflows/auto-pull-request-checks.yml
.github/workflows/build.yml
.github/workflows/pack.yml
.github/workflows/publish.yml
Version.props
src/BootstrapBlazor/Directory.Build.props
src/BootstrapBlazor.Server/Dockerfile
Adapts form validation to the native .NET 11 asynchronous EditContext API while preserving conditional compatibility for earlier target frameworks.
  • Delegates net11.0 validation to EditContext.ValidateAsync with cancellation-token support.
  • Retains the existing task-completion-source validation flow for pre-.NET 11 targets.
  • Removes the obsolete synchronous public Validate API and updates ValidateAsync signatures conditionally.
  • Avoids completing the legacy validation task on the .NET 11 path.
src/BootstrapBlazor/Components/ValidateForm/BootstrapBlazorDataAnnotationsValidator.cs
src/BootstrapBlazor/Components/ValidateForm/ValidateForm.razor.cs
Updates component tests to use asynchronous event and validation helpers compatible with the new framework behavior.
  • Awaits ContextMenuAsync and SubmitAsync event helpers.
  • Invokes component ValidateAsync methods through async lambdas.
  • Preserves and verifies context-menu, validation, and asynchronous-rule test coverage.
test/UnitTest/Components/ContextMenuTest.cs
test/UnitTest/Components/DateTimePickerTest.cs
test/UnitTest/Components/DateTimeRangeTest.cs
test/UnitTest/Components/InputNumberTest.cs
test/UnitTest/Components/LayoutTest.cs
test/UnitTest/Components/TabTest.cs
test/UnitTest/Components/ValidateTest.cs

Assessment against linked issues

Issue Objective Addressed Explanation
#8405 Add net11.0 as a supported target framework while retaining support for net6.0 through net10.0, including the required .NET 11 preview package references.
#8405 Configure development, CI, packaging, and container builds to use the .NET 11 preview SDK and runtime.
#8405 Adapt form validation and affected component tests for .NET 11 asynchronous APIs, using EditContext.ValidateAsync on .NET 11 while preserving the earlier validation implementation for older target frameworks.

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@bb-auto bb-auto Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto approved by bb-auto

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Needs a human reviewer. This changes the production container from the .NET 10 runtime to a .NET 11 preview runtime and changes the application target framework and validation behavior, so an incompatibility could prevent deployment or cause an outage. Reverting restores the prior images and target, but any failed deployment or outage would already have occurred.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@codecov

codecov Bot commented Sep 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (797ed9f) to head (41517f9).

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #8406   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          771       771           
  Lines        34616     34616           
=========================================
  Hits         34616     34616           
Flag Coverage Δ
BB 100.00% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

This reverts commit e6130f1.

# Conflicts:
#	src/BootstrapBlazor/Components/ValidateForm/BootstrapBlazorDataAnnotationsValidator.cs

@bb-auto bb-auto Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto approved by bb-auto

@bb-auto bb-auto Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto approved by bb-auto

@bb-auto bb-auto Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto approved by bb-auto

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: support .NET 11 preview

1 participant