1
votes

Imagine I have this component:

<input bind-value-oninput="@Name">
<p>Your name is @Name</p>
string _name;
string Name
{
    get => _name;
    set => _name = value.ToUpper();
}

When I type on the input, is the text is transforming directly to uppercase and showing in the paragraph.

I think (please, correct me if I'm wrong) that server-side Blazor runs the .NET MSIL code on the server and sends the DOM changes via SignalR connection.

The connection to the server can be delayed, specially with poor Internet connections.

In the case of this input, can be transformed to uppercase some seconds after the user input text? In afirmative case, how can I solve it? Only using client-side Blazor?

2
Do you ask whether execution can alternate between client-side and server-side depending on the availability and strength of the connection? - enet
@Issac No, I'm asking about the behavior of Blazor when using server-side hosting model and the connection is bad. - Ivan Montilla
Your question is actually more about SignalR, i've added the tag. - Henk Holterman

2 Answers

4
votes

Using server-side Blazor has a couple of drawbacks, which you must take into account, when you have to decide which flavor of Blazor to use. Server-side Blazor is mostly recommended to use on private Intranet network, a for instance, an enterprise network, with a few hundreds of users, accessing the network at the same time. In such a case, you'll experience no rendering delay at all.

Using server-side Blazor on the public Internet can be problematic in that respect (It has other downsides to seriously consider), and can result in unacceptable delay in rendering. But if its use is forced upon you, it's essential to search for ways that can mitigate this issue (rendering delay). As for instance, don't use input event. Use change event instead. An input event is triggered whenever you hit a keyboard button, which result in a call to the server to process the event. But if you use the change event, you may reduce the number of calls to the server.

Hope this helps...

3
votes

The rendering delay on a good/average connection is < 50 ms.

Even on a bad connection you ought to stay well below 1 sec.

When your connection gets so bad that you get above that then there is a reconnect dialog built-in.

But yes, if you want to be always available, also on a very bad connection (or no connection), it would be better to use Client side.