Skip to content

RC2 Blazor Web App template nits and inconsistencies #51495

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

Closed
1 task done
rogihee opened this issue Oct 19, 2023 · 3 comments
Closed
1 task done

RC2 Blazor Web App template nits and inconsistencies #51495

rogihee opened this issue Oct 19, 2023 · 3 comments
Assignees
Labels
area-blazor Includes: Blazor, Razor Components bug This issue describes a behavior which is not expected - a bug. feature-templates

Comments

@rogihee
Copy link
Contributor

rogihee commented Oct 19, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

A few small nits / inconsistencies after creating a new "Blazor Web App" template with the following options
image

  1. ManageNavMenu.razor in Components\Layout has superfluous ; that can be omitted:
    image

  2. In the same file, the private component variable is prefixed with an underscore:
    image
    However, in the Weather.razor the underscore-less convention is used:
    image
    My personal coding style is: If it is used in the razor template, use a private property, else a private variable with underscore. That way I can distinct private vars only for the code section and vars used in the render template.
    RegisterConfirmation.razor is then inconsistent again with no explicit private modifier and no underscore. Same in ResetPassword.razor
    image

  3. StatusMessage.razor has logic in the razor template. I would avoid doing that and move the code block at the top into OnParametersSet override.
    image

  4. In a couple of places OnInitialized sets a Parameter, but OnParametersSet will always override that, I think.
    image
    Also in ExternalLoginPicker.razor, LoginWith2fa.razor, LoginWithRecoveryCode.

  5. Unused using and inject in Index.razor in Account/Manage and in PersonalData.razor, Register.razor:
    image
    As a side note, I usually move all the usings to the _Imports.razor file so the component files are short and concise.

  6. Two properties in the Error.razor can be made private:
    image

Expected Behavior

Running the template produces concise, correct code

Steps To Reproduce

Run the template as demonstrated above and inspect all the files

Exceptions (if any)

No response

.NET Version

8.0.100-rc.2.23502.2

Anything else?

17.8 Preview 3

@ghost ghost added the area-blazor Includes: Blazor, Razor Components label Oct 19, 2023
@rogihee rogihee changed the title RC2 Blazor Web App template nits and inconstencies RC2 Blazor Web App template nits and inconsistencies Oct 19, 2023
@mkArtakMSFT mkArtakMSFT added bug This issue describes a behavior which is not expected - a bug. feature-templates labels Oct 19, 2023
@mkArtakMSFT mkArtakMSFT added this to the .NET 9 Planning milestone Oct 19, 2023
@ghost
Copy link

ghost commented Oct 19, 2023

Thanks for contacting us.

We're moving this issue to the .NET 9 Planning milestone for future evaluation / consideration. We would like to keep this around to collect more feedback, which can help us with prioritizing this work. We will re-evaluate this issue, during our next planning meeting(s).
If we later determine, that the issue has no community involvement, or it's very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact issues.
To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

@halter73
Copy link
Member

halter73 commented Oct 19, 2023

Thank you for reporting these issues! It's all really good feedback. Between #51134 and #51497, all 6 issues you highlight should be addressed.

@rogihee
Copy link
Contributor Author

rogihee commented Oct 20, 2023

Thanks for listening en fixing!

@ghost ghost locked as resolved and limited conversation to collaborators Nov 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components bug This issue describes a behavior which is not expected - a bug. feature-templates
Projects
None yet
Development

No branches or pull requests

3 participants