Adding partial namespaces in Blazor's razor markup #22194
Labels
affected-few
This issue impacts only small number of customers
area-blazor
Includes: Blazor, Razor Components
enhancement
This issue represents an ask for new feature or an enhancement to an existing one
feature-razor.language
severity-major
This label is used by an internal tool
Milestone
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.bar1
with components Bish.razor, Bash.razor and Bosh.razor.namespace foo.bar2
namespace foo.bar3
The app consuming the libraries would then place
@using foo
and 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.
The text was updated successfully, but these errors were encountered: