Skip to content
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

[Hot Reload] Enable Blazor hot reloading for multiple browser windows at the same time #54415

Closed
jsakamoto opened this issue Mar 2, 2024 · 6 comments
Labels
area-blazor Includes: Blazor, Razor Components External This is an issue in a component not contained in this repository. It is open for tracking purposes. feature-hot-reload This issue is related to the Hot Reload feaature

Comments

@jsakamoto
Copy link

jsakamoto commented Mar 2, 2024

Description

Hot Reload on a Blazor WebAssembly app doesn't work stability for multiple browser windows simultaneously. Apparently, it works fine at first. However, if you open the app with a new window once after any hot reloading is applied, the hot reloading won't be applied to that new window. Moreover, once that happens, opening the app in another new window shows the appearance before the hot reloading was applied. Please see also the video I attached.

2024-03-01_22h23_49.mp4

The solution I'd like

It would be great if the hot reloading worked well for multiple windows simultaneously in some edge cases. For instance, the clone of Storybook for Blazor, "Blazing Story" (https://github.com/jsakamoto/BlazingStory), requires such ability because it has to host multiple preview frames for the stories using an iframe on the same page.

image

Remarks

I'm unsure whether the same problem will occur on a Blazor Srever app.

Related Feature Requests

See also: #39137 [Hot Reload] Enable hot reloading for Blazor inside an iframe

The ability above is also required for the hot reloading on the "Blazing Story".

@danroth27 danroth27 transferred this issue from dotnet/sdk Mar 7, 2024
@dotnet-issue-labeler dotnet-issue-labeler bot added the area-blazor Includes: Blazor, Razor Components label Mar 7, 2024
@mkArtakMSFT
Copy link
Member

@BillHiebert do you know if VS keeps track only of a single WebSocket connection to the Browser instance, and that's maybe why it doesn't send the updates to all the open windows?

@mkArtakMSFT mkArtakMSFT added feature-hot-reload This issue is related to the Hot Reload feaature and removed untriaged labels Mar 12, 2024
@mkArtakMSFT
Copy link
Member

I just confirmed with @BillHiebert that only a single WebSocket connection is support for Hot Reload at the moment. That's something controlled on the VS side. @jsakamoto please file a VS Feedback ticket with this ask so that it gets routed to the right team. I'm going to close this issue now, given that there is no pending action for our team.

@mkArtakMSFT mkArtakMSFT closed this as not planned Won't fix, can't repro, duplicate, stale Mar 14, 2024
@mkArtakMSFT mkArtakMSFT added the External This is an issue in a component not contained in this repository. It is open for tracking purposes. label Mar 14, 2024
@jsakamoto
Copy link
Author

@mkArtakMSFT Thank you for paying attention to this issue and taking your time. I'll log a ticket on the VS Feedback site. However, the problem I posted about is not related to Visual Studio. As you can see in the video above I attached, it is happening on the dotnet watch command.

On the dotnet watch command, hot reloading on multiple browsers or windows worked correctly at first. However, the app didn't show its UI correctly once the browser windows were reloaded.

On Visual Studio, hot reloading works only on one browser window. It is also a problem, and I'll log it to the VS Feedback site, but it differs from this.

I'm really sorry for bothering you; I'd be happy if you told me what I should do. Thanks!

@jsakamoto
Copy link
Author

P.S. I logged a feedback ticket for Visual Studio as below.
https://developercommunity.visualstudio.com/t/Enable-Blazor-hot-reloading-for-multiple/10617384

@jsakamoto
Copy link
Author

@mkArtakMSFT Sorry for bothering you, but could you please reopen this issue since this issue is a matter of dotnet SDK, not a matter of Visual Studio? Thank you for taking the time in advance.

@jsakamoto
Copy link
Author

@mkArtakMSFT (CC: @danroth27, @MackinnonBuck) Sorry for bothering you, but could you please reopen this issue since this issue is a matter of dotnet SDK, not a matter of Visual Studio? This happens with the dotnet watch command.

Thank you for taking the time in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-blazor Includes: Blazor, Razor Components External This is an issue in a component not contained in this repository. It is open for tracking purposes. feature-hot-reload This issue is related to the Hot Reload feaature
Projects
None yet
Development

No branches or pull requests

2 participants