Add support for @layout null in Blazor components#12691
Add support for @layout null in Blazor components#12691
Conversation
Co-authored-by: dbreshears <3432571+dbreshears@users.noreply.github.com>
Co-authored-by: dbreshears <3432571+dbreshears@users.noreply.github.com>
|
It occurs to me that we should proabably take this through LDM. Is |
The current implementation uses The implementation is flexible - if LDM decides on a different syntax (like
Happy to wait for LDM guidance on the preferred syntax. |
Summary of the changes
Blazor components can now use
@layout nullto disable layouts without compilation errors. Previously, this generated invalid C# code[LayoutAttribute(typeof(null))]causing build failures.Implementation:
ComponentLayoutDirectivePass.cs- Skip LayoutAttribute generation when token content is "null"DesignTimeDirectiveTargetExtension.cs- Skip type validation for "null" directive tokens to prevent invalid design-time codeGenerated code:
Components without a LayoutAttribute are treated as having no layout by the framework.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
bcnvsblobprodcus378.vsblob.vsassets.io/usr/share/dotnet/dotnet dotnet build src/Compiler/Microsoft.AspNetCore.Razor.Language/test/Microsoft.AspNetCore.Razor.Language.Test.csproj(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.