Skip to content

Add [RenderModeStatic] attribute #51102

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
MCGPPeters opened this issue Oct 3, 2023 · 5 comments
Closed
1 task done

Add [RenderModeStatic] attribute #51102

MCGPPeters opened this issue Oct 3, 2023 · 5 comments
Labels
area-blazor Includes: Blazor, Razor Components ✔️ Resolution: Duplicate Resolved as a duplicate of another issue Status: Resolved

Comments

@MCGPPeters
Copy link

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.

When I set a RenderMode attribute on the root component (or any parent component for that matter), all child components will inherit that render mode. If I want to make one of those child components to have a static render mode, I am not able to express that. For other render modes, an attribute does exist.

Describe the solution you'd like

Add [RenderModeStatic] attribute so I can express a specific component should be statically rendered on the server side, even if a parent component has an interactive render mode.

Additional context

No response

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-blazor Includes: Blazor, Razor Components label Oct 3, 2023
@mkArtakMSFT
Copy link
Member

Thanks for contacting us.
Can you please provide a realistic example where this will be useful?
Specifically, if the parent is already rendering in an interactive mode, what would be the benefit of switching to a statically render mode for a child component.

@mkArtakMSFT mkArtakMSFT added the Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. label Oct 3, 2023
@ghost
Copy link

ghost commented Oct 3, 2023

Hi @MCGPPeters. We have added the "Needs: Author Feedback" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@MCGPPeters
Copy link
Author

MCGPPeters commented Oct 4, 2023

@mkArtakMSFT Thanks for your quick reply. A realistic example would be something more general than a specific case. As I understand it, and I could be wrong of course, the point of static rendering is reduced resource utilization. In one of the ASP.NET community standups (September 12th) it was advised to only use interactivity when needed for this reason, which makes sense to me. So if it were possible to mix and match interactive with static components on the same page, wouldn't that reduce resource utilization?

Tnx!

@ghost ghost added Needs: Attention 👋 This issue needs the attention of a contributor, typically because the OP has provided an update. and removed Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. labels Oct 4, 2023
@marinasundstrom
Copy link

@MCGPPeters So you think that if you were able to mark a child component within an interactive hierarchy as static, then it would use less resources as it would not have interactivity attached to it?

I understand that reasoning.

But then we have the problem of someone putting an interactive component in that component. That would not work. It would also be confusing to a lot of devs.

Is there any possible needs for this complexity - other than reducing resources used?

@mkArtakMSFT
Copy link
Member

This seems to be a similar to #51046.

@mkArtakMSFT mkArtakMSFT closed this as not planned Won't fix, can't repro, duplicate, stale Oct 4, 2023
@mkArtakMSFT mkArtakMSFT added ✔️ Resolution: Duplicate Resolved as a duplicate of another issue and removed Needs: Attention 👋 This issue needs the attention of a contributor, typically because the OP has provided an update. labels Oct 4, 2023
@ghost ghost added the Status: Resolved label Oct 4, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Nov 3, 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 ✔️ Resolution: Duplicate Resolved as a duplicate of another issue Status: Resolved
Projects
None yet
Development

No branches or pull requests

3 participants