Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change component parameter declaration programming model #16115

Closed
danroth27 opened this issue Apr 27, 2018 · 1 comment
Closed

Change component parameter declaration programming model #16115

danroth27 opened this issue Apr 27, 2018 · 1 comment
Assignees
Labels
area-blazor Includes: Blazor, Razor Components

Comments

@danroth27
Copy link
Member

@rynowak here filling in the details

In 0.3 we are changing how component parameters are defined to require the use of [Parameter] (ParameterAttribute). While we're introducing ref for capturing component references in this release, it makes sense to change the design of component parameters in a way that encourages encapsulation. We want to strongly encourage everyone to use markup to set the properties of components, rather than setting properties directly. This is more efficient, and will make sure that the correct rendering sequence takes place.

To that end, we've added an analyzer in 0.3 that will recommend that you make component properties private.

The requirement to add [Parameter] will also apply to things set by the framework such as ChildContent or Body (layouts) and parameters set by routing.

@rynowak
Copy link
Member

rynowak commented Apr 30, 2018

Self assigning this as I'm getting started on part of it.

@rynowak rynowak self-assigned this Apr 30, 2018
@mkArtakMSFT mkArtakMSFT transferred this issue from dotnet/blazor Oct 27, 2019
@mkArtakMSFT mkArtakMSFT added the area-blazor Includes: Blazor, Razor Components label Oct 27, 2019
@ghost ghost locked as resolved and limited conversation to collaborators Dec 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components
Projects
None yet
Development

No branches or pull requests

3 participants