You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Blazor Web App / Auto Mode / Counter button not responsive if switch to that page quickly #58860
We don't have a way to dynamically switch from server-interactivity to WebAssembly interactivity, and starting up the WebAssembly blocks the UI thread, which usually takes less than 0.5 second on the published app. This is something on our mind and hopefully sometime in the future we come up with a better solution here.
@mkArtakMSFT - You might be thinking about a different scenario than what I encountered.
It behaves correctly (counter button is responsive) if I wait longer before selecting counter page. This suggests that in the failed test, at the time Blazor went to counter page, WebAsm was not ready (still downloading perhaps?), but Blazor switched to WebAsm anyway.
To be clear: I am not asking for dynamic switching. I encountered a situation where (AFAIK) it would work better to not switch to WebAsm yet. Stay on Server Render until a SECOND page switch. Is there a downside to delaying that long?
When user switches page, is it easy to determine whether WebAssembly is ready to start up?
Currently, there does not appear to be such a check. Blazor simply assumes the first page switch, it can switch to WebAsm. Even if WebAssembly is still being downloaded. At least that is how I interpret the tests I did.
Is my understanding of what is happening incorrect? Is there logic in Blazor to check whether WebAsm is available / can be started now? Is that check done at the time user selects a different page?
Activity
mkArtakMSFT commentedon Nov 11, 2024
Thanks for contacting us.
We don't have a way to dynamically switch from server-interactivity to WebAssembly interactivity, and starting up the WebAssembly blocks the UI thread, which usually takes less than 0.5 second on the published app. This is something on our mind and hopefully sometime in the future we come up with a better solution here.
ToolmakerSteve commentedon Nov 22, 2024
@mkArtakMSFT - You might be thinking about a different scenario than what I encountered.
It behaves correctly (counter button is responsive) if I wait longer before selecting counter page. This suggests that in the failed test, at the time Blazor went to counter page, WebAsm was not ready (still downloading perhaps?), but Blazor switched to WebAsm anyway.
To be clear: I am not asking for dynamic switching. I encountered a situation where (AFAIK) it would work better to not switch to WebAsm yet. Stay on Server Render until a SECOND page switch. Is there a downside to delaying that long?
When user switches page, is it easy to determine whether WebAssembly is ready to start up?
Currently, there does not appear to be such a check. Blazor simply assumes the first page switch, it can switch to WebAsm. Even if WebAssembly is still being downloaded. At least that is how I interpret the tests I did.
Is my understanding of what is happening incorrect? Is there logic in Blazor to check whether WebAsm is available / can be started now? Is that check done at the time user selects a different page?