Skip to content

Add convert-blazor-server-to-webapp skill#207

Closed
halter73 wants to merge 4 commits into
dotnet:mainfrom
halter73:blazor-modernization
Closed

Add convert-blazor-server-to-webapp skill#207
halter73 wants to merge 4 commits into
dotnet:mainfrom
halter73:blazor-modernization

Conversation

@halter73
Copy link
Copy Markdown
Member

@halter73 halter73 commented Mar 4, 2026

Add a new skill to guide agents through converting pre-.NET 8 (and later) Blazor Server apps to the .NET 8+ Blazor Web App model. The skill covers:

  • Replacing AddServerSideBlazor/MapBlazorHub with AddRazorComponents/MapRazorComponents
  • Converting _Host.cshtml to an App.razor root component
  • Creating Routes.razor from the old App.razor
  • Replacing blazor.server.js with blazor.web.js
  • Adding UseAntiforgery middleware
  • Migrating CascadingAuthenticationState to a service
  • Optional improvements like MapStaticAssets

Includes 4 eval scenarios: basic conversion, auth state migration, prerendering-disabled case, and a negative test for already-converted apps.

This was helpful when working on bartonjs/apireview.net#4

Add a new skill to guide agents through converting pre-.NET 8 Blazor Server
apps to the .NET 8+ Blazor Web App model. The skill covers:

- Replacing AddServerSideBlazor/MapBlazorHub with AddRazorComponents/MapRazorComponents
- Converting _Host.cshtml to an App.razor root component
- Creating Routes.razor from the old App.razor
- Replacing blazor.server.js with blazor.web.js
- Adding UseAntiforgery middleware
- Migrating CascadingAuthenticationState to a service
- Optional improvements like MapStaticAssets

Includes 4 eval scenarios: basic conversion, auth state migration,
prerendering-disabled case, and a negative test for already-converted apps.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new .NET skill and accompanying eval coverage to help agents migrate pre-.NET 8 Blazor Server apps to the .NET 8+ Blazor Web App hosting model (AddRazorComponents/MapRazorComponents, App.razor root, Routes.razor, blazor.web.js, antiforgery, auth state migration).

Changes:

  • Introduces the convert-blazor-server-to-webapp skill documentation with a step-by-step migration workflow and pitfalls.
  • Adds 4 eval scenarios covering: basic conversion, CascadingAuthenticationState migration, prerendering-disabled preservation, and an “already converted” case.
  • Updates CODEOWNERS to assign ownership for the new skill and tests (and fixes indentation on two existing entries).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
tests/dotnet/convert-blazor-server-to-webapp/eval.yaml Adds eval scenarios/assertions/rubrics for the new migration skill.
plugins/dotnet/skills/convert-blazor-server-to-webapp/SKILL.md Adds the skill guidance for performing the Blazor Server → Blazor Web App conversion.
.github/CODEOWNERS Adds owners for the new skill/test directories; normalizes two existing lines’ indentation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/dotnet-aspnet/convert-blazor-server-to-webapp/eval.yaml
Comment thread tests/dotnet/convert-blazor-server-to-webapp/eval.yaml Outdated
Comment thread tests/dotnet/convert-blazor-server-to-webapp/eval.yaml Outdated
Comment thread tests/dotnet/convert-blazor-server-to-webapp/eval.yaml Outdated
Comment thread plugins/dotnet/skills/convert-blazor-server-to-webapp/SKILL.md Outdated
@ViktorHofer
Copy link
Copy Markdown
Member

/evaluate

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 4, 2026

Skill Validation Results

Skill Scenario Baseline With Skill Δ Skills Loaded Overfit Verdict
convert-blazor-server-to-webapp Basic Blazor Server app conversion to Blazor Web App 3.0/5 5.0/5 +2.0 ✅ convert-blazor-server-to-webapp; tools: skill ✅ 0.04
convert-blazor-server-to-webapp Blazor Server app with CascadingAuthenticationState 3.0/5 5.0/5 +2.0 ✅ convert-blazor-server-to-webapp; tools: skill, bash, create ✅ 0.04
convert-blazor-server-to-webapp Blazor Server app with prerendering disabled 5.0/5 5.0/5 0.0 ✅ convert-blazor-server-to-webapp; tools: skill, bash ✅ 0.04
convert-blazor-server-to-webapp App already using Blazor Web App model — no migration needed 5.0/5 5.0/5 0.0 ℹ️ not activated (expected) ✅ 0.04

Model: claude-opus-4.6 | Judge: claude-opus-4.6

Full results

Comment thread plugins/dotnet/skills/convert-blazor-server-to-webapp/SKILL.md Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@halter73
Copy link
Copy Markdown
Member Author

halter73 commented Mar 4, 2026

/evaluate

@timheuer
Copy link
Copy Markdown
Member

timheuer commented Mar 4, 2026

@halter73 We should move this OUT of dotnet plugin and establish dotnet-aspnet plugin structure and root this there. (see MAUI PR for example)

@ViktorHofer
Copy link
Copy Markdown
Member

/evaluate

@mattleibow
Copy link
Copy Markdown
Member

Should this be in a aspnetcore plugin set vs plain dotnet?

@ViktorHofer
Copy link
Copy Markdown
Member

dotnet-aspnet plugin 👍

Move the Blazor Server migration skill out of the generic dotnet plugin
and into a dedicated dotnet-aspnet plugin, per review feedback.

- Create plugins/dotnet-aspnet/ with plugin.json
- Move SKILL.md and eval.yaml to the new plugin structure
- Register dotnet-aspnet in marketplace.json
- Update CODEOWNERS with dotnet-aspnet section
- Add dotnet-aspnet to README.md plugins table

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@halter73
Copy link
Copy Markdown
Member Author

halter73 commented Mar 6, 2026

I moved it into a new dotnet-aspnet plugin directory similar to #199. Should we call it dotnet-aspnetcore? ducks (I prefer the current dotnet-aspnet naming to be clear)

@ManishJayaswal
Copy link
Copy Markdown
Contributor

@adityamandaleeka @BrennanConroy - please review

@danmoseley
Copy link
Copy Markdown
Member

#357 creates a dotnet-blazor plugin. If there's going to be a blazor plugin presumably this should go in there. if not #357 should go in this dotnet-aspnet plugin.

@javiercn
Copy link
Copy Markdown
Member

I think it would be best if we combine this with #357

@halter73
Copy link
Copy Markdown
Member Author

@javiercn I'm going to close this with the idea that the content should be moved to #357 assuming we want to keep it. Let me know if you want any help with this.

@halter73 halter73 closed this May 21, 2026
javiercn added a commit that referenced this pull request May 22, 2026
Integrates the Blazor Server to Blazor Web App migration skill from PR #207.
Covers converting AddServerSideBlazor/MapBlazorHub to AddRazorComponents/
MapRazorComponents, _Host.cshtml to App.razor, and related migration steps.

Includes 4 eval scenarios: basic conversion, auth state migration,
prerendering-disabled case, and a negative test for already-converted apps.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
javiercn added a commit to javiercn/skills that referenced this pull request May 22, 2026
Integrates the Blazor Server to Blazor Web App migration skill from PR dotnet#207.
Covers converting AddServerSideBlazor/MapBlazorHub to AddRazorComponents/
MapRazorComponents, _Host.cshtml to App.razor, and related migration steps.

Includes 4 eval scenarios: basic conversion, auth state migration,
prerendering-disabled case, and a negative test for already-converted apps.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
javiercn added a commit to javiercn/skills that referenced this pull request May 22, 2026
Integrates the Blazor Server to Blazor Web App migration skill from PR dotnet#207.
Covers converting AddServerSideBlazor/MapBlazorHub to AddRazorComponents/
MapRazorComponents, _Host.cshtml to App.razor, and related migration steps.

Includes 4 eval scenarios: basic conversion, auth state migration,
prerendering-disabled case, and a negative test for already-converted apps.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
javiercn added a commit to javiercn/skills that referenced this pull request May 22, 2026
Integrates the Blazor Server to Blazor Web App migration skill from PR dotnet#207.
Covers converting AddServerSideBlazor/MapBlazorHub to AddRazorComponents/
MapRazorComponents, _Host.cshtml to App.razor, and related migration steps.

Includes 4 eval scenarios: basic conversion, auth state migration,
prerendering-disabled case, and a negative test for already-converted apps.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants