RenderModeSSR #50206
Labels
area-blazor
Includes: Blazor, Razor Components
✔️ Resolution: Answered
Resolved because the question asked by the original author has been answered.
Status: Resolved
Is there an existing issue for this?
Is your feature request related to a problem? Please describe the problem.
It's not really a problem as much as a seeming inconsistency. Currently (or rather, there will be in .Net 8) there are 3 ways (4 if you count the possibility to statically render them) to render Blazor Components: SSR, WebAssembly, Server.
However, only 2 of those options have their own RenderMode (WebAssembly and Server respectively). I've been looking to figure out why there's none for SSR as well, so this is an issue mostly just to understand your reasoning and clear up my confusion. Is it because SSR is the default unless you manually add either one of those attributes, so it'd kinda be like specifying
= default
on a variable? That seems to be the case when I tested it.Describe the solution you'd like
Add a
RenderModeSSR
(andRenderModeStatic
? IIRC you mentioned adding built-in support for Static rendering in a future version, so I imagine this would come in .Net 9+ (RenderModeStreaming
? Nested questions here..)) alongsideRenderModeWebAssembly
andRenderModeServer
... Or simply explain to me why you haven't done it.
Additional context
I have not actually used Blazor despite following it for years, so I don't really understand how it works, but I've been trying it for the last few hours and I couldn't for the life of me understand why my form posted (and validation triggered), but the input data itself was always the default value.
After like an hour or so I figured out it was due to me rendering it using SSR (which is what I want; I was testing SSR using Blazor components). Adding
AddServerComponents()
inProgram.cs
and@attribute [RenderModeServer]
to the form file "fixed it", but that converts my app into WebSocket-mode, which is not what I want; I just want to create a simple SSR page with a form:This issue might seem very incoherent - it is - and most of the content is seemingly not about what the issue title implies, but I just wanted to add some context into why I asked the question.
Also, if there's a bug with inputs not working in SSR, pretend like I didn't come up with that example -- It's entirely tangential to the question at hand, and I assume #50078 rectifies it in some way.
As a closing statement(albeit added in like the 15th edit.. lol); If this is all the code I need to write to get all of this functionality, that's really nice compared to the ugly MVC syntax we had to use previously. 🚀
The text was updated successfully, but these errors were encountered: