-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Closed
Labels
✔️ Resolution: AnsweredResolved because the question asked by the original author has been answered.Resolved because the question asked by the original author has been answered.✔️ Resolution: By DesignResolved because the behavior in this issue is the intended design.Resolved because the behavior in this issue is the intended design.Status: Resolvedarea-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor Components
Description
Is there an existing issue for this?
- I have searched the existing issues
Is your feature request related to a problem? Please describe the problem.
Razor components defined in .razor
files are always generated as public classes. There is no supported way to declare a component as internal
(or another modifier like private
and file
). This results in polluted RCL projects because its components "helpers" are shipped as public
.
- Current workaround using
EditorBrowsable(Never)
do not enforce encapsulation. - Writing components with
BuildRenderTree
accepts modifiers, but lose Razor syntax.
Describe the solution you'd like
Add a Razor directive to control the generated component class accessibility. If not present, component is public
by default.
Example in .razor
file:
`@accessibility internal`
If using a backing .razor.cs
file, the developer must declare the class also with internal
.
Additional context
No response
Metadata
Metadata
Assignees
Labels
✔️ Resolution: AnsweredResolved because the question asked by the original author has been answered.Resolved because the question asked by the original author has been answered.✔️ Resolution: By DesignResolved because the behavior in this issue is the intended design.Resolved because the behavior in this issue is the intended design.Status: Resolvedarea-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor Components