-
Notifications
You must be signed in to change notification settings - Fork 10k
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
The Client project of the Blazor Web App template should also have a Components folder #50645
Comments
I looked into doing this, but after looking closely at the templates, I don't think it should have an extra level in the folder hierarchy for The reason the server project has this extra level is because it's not a Blazor-specific project - it's an "anything from the whole space of ASP.NET Core", so the If you feel strongly, let me know, but I think things are arranged as well as they can be without making this change. |
@SteveSandersonMS I generally have components that are helpers for pages that would live in the main project. For example, I would break a page into multiple parts and pass the model. I usually have these in a Would it not be better to rename This change would meet current folder naming conventions. For example:
So for Blazor, IMHO, we should have a Sample structure with the change:
|
I think we still want to add the Components folder. While the client project is Blazor specific it will contain more than just components. It will also contain services, data models, etc. Note that we already update the Blazor WebAssembly project template to have the Components folder, which is similar in many ways to the client project. Also, once we do #46398 the browser build will presumably get the Components folder anyway. |
@gragra33 It actually sounds like the new template folder structure aligns with your current practices. The Components folder that you've been adding is now setup and ready for you in the project templates. It's intended that users will put helper components directly in the Components folder. It sounds like the main difference for you will be that the Pages folder is now also a child of Components instead of a sibling. But note that pages in a Blazor app are components too. If you're unconvinced and you prefer to use your existing folder structure, you can still switch back to the earlier folder structure if you want. There's no requirement to use the folder structure setup in the templates. The Components folder isn't special - it's just a template convention. Regarding the proposal to add a Blazor folder, we try to avoid putting the name "Blazor" in APIs and artifacts we ship because names are determined by marketing, and you never know when they are going to want to do a rebranding. So, at least on the Blazor team, we try to insulate ourselves and our users as much as possible from the whims of marketing and use descriptive names instead. |
When people add more stuff, they can add whatever folder structure they want. I would strongly recommend organizing by functional area rather than by file type. For example, adding a We're always free to change this later, but it seems nonsensical to put in an unnecessary extra level in the directory hierarchy that doesn't communicate anything and suggests that people are required to organize by file type when they are not. |
That is true. It's usually the case. I answer lots of questions on programming websites and was just thinking about new developers more so than more experienced ones. |
This issue has been resolved and has not had any activity for 1 day. It will be closed for housekeeping purposes. See our Issue Management Policies for more information. |
The Client project of the Blazor Web App template still has a root level Pages folder. For consistency, it should have a root level Components folder that contains any components in the project.
The text was updated successfully, but these errors were encountered: