Skip to content

Give every Razor component a type summary, and check it - #448

Merged
jeff377 merged 2 commits into
mainfrom
claude/p3-razor-docs
Nov 12, 2026
Merged

jeff377 merged 2 commits into
mainfrom
claude/p3-razor-docs

Conversation

@jeff377

@jeff377 jeff377 commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Part of #441

The Razor generator starts each generated file with #pragma warning disable 1591, so a public component without a type summary built cleanly and shipped with no IntelliSense text. Most components of the MudBlazor and Fluent UI packages had none.

  • Each public component of Polhem.Web.Blazor.Mud, Polhem.Web.Blazor.Fluent and Polhem.Web.Blazor gets a <Name>.razor.cs holding public partial class <Name> with its summary. A component that draws a shared base type points to that base with <see cref> rather than repeating its behavior.
  • TypeDocCoverage (tests/Polhem.Tests.Shared) compares an assembly's public types in its own namespace with the type entries of its built documentation file, leaving out the classes Razor generates for _Imports.razor. A *TypeDocGateTests in the unit test projects of Polhem.Web.Blazor, .Mud, .Fluent and .Server uses it; each anchors on a known component so it cannot pass with nothing checked.
  • check-xmldoc-refs.sh also reads .razor files: their /// lines for <c> in both directions, and the rest as part of the code corpus.
  • .claude/rules/blazor.md says where a component's summary goes and which tests enforce it.

Verified locally: the gates were red before the summaries and are green after, also under --collect:"XPlat Code Coverage"; the four Blazor unit test projects pass; check-xmldoc-refs.sh reports a planted <c> in a .razor file both ways; clean Release build. CI: lite.

The Razor generator turns CS1591 off in the code it generates, so a component
without a summary built cleanly and shipped with no IntelliSense text. Each
public component of the MudBlazor, Fluent UI and shared Blazor packages now has
a .razor.cs with its summary, pointing to the base type that holds its behavior.

TypeDocCoverage compares an assembly's public types with its built
documentation file; a gate in each Blazor package's unit test project uses it.
check-xmldoc-refs.sh also reads the /// lines of .razor files.
@jeff377
jeff377 enabled auto-merge (squash) November 12, 2026 14:53
@jeff377
jeff377 merged commit 84c2be0 into main Nov 12, 2026
3 checks passed
@jeff377
jeff377 deleted the claude/p3-razor-docs branch November 12, 2026 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant