-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Adding partial namespaces in Blazor's razor markup #22194
Copy link
Copy link
Closed as not planned
Labels
affected-fewThis issue impacts only small number of customersThis issue impacts only small number of customersarea-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor ComponentsenhancementThis issue represents an ask for new feature or an enhancement to an existing oneThis issue represents an ask for new feature or an enhancement to an existing onefeature-razor.languageseverity-majorThis label is used by an internal toolThis label is used by an internal tool
Milestone
Metadata
Metadata
Assignees
Labels
affected-fewThis issue impacts only small number of customersThis issue impacts only small number of customersarea-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor ComponentsenhancementThis issue represents an ask for new feature or an enhancement to an existing oneThis issue represents an ask for new feature or an enhancement to an existing onefeature-razor.languageseverity-majorThis label is used by an internal toolThis label is used by an internal tool
Type
Fields
Give feedbackNo fields configured for issues without a type.
Is your feature request related to a problem? Please describe.
Not a problem, but this would improve maintainability for a moderate to large project composed from multiple libraries (both regular C# netstandard and razor libraries).
Describe the solution you'd like
Blazor's Razor markup doesn't support partial namespaces. I am building a suite of libraries and would like all of them to share a single top level namespace, say
foo. The libraries would then apply namespaces:namespace foo.bar1with components Bish.razor, Bash.razor and Bosh.razor.namespace foo.bar2namespace foo.bar3The app consuming the libraries would then place
@using fooand use the remainder of the namespace in a component tag. So for instance using the component Bish from library 1, the markup would be<bar1.Bish ... />.This is geared towards maintainability and clarity of usage.
Additional context
https://docs.microsoft.com/en-us/aspnet/core/blazor/components?view=aspnetcore-3.1#import-components.