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 hot reloading for Blazor inside an iframe #54416

Open
jsakamoto opened this issue Mar 1, 2024 · 2 comments
Open

[Hot Reload] Enable hot reloading for Blazor inside an iframe #54416

jsakamoto opened this issue Mar 1, 2024 · 2 comments
Labels
area-blazor Includes: Blazor, Razor Components enhancement This issue represents an ask for new feature or an enhancement to an existing one feature-hot-reload This issue is related to the Hot Reload feaature

Comments

@jsakamoto
Copy link

Description

Hot Reload on a Blazor app doesn't work inside an iframe. See the attached video and sample code.

2024-02-29_08h08_22.mp4

Sample code: 📦BlazorWasmApp1.zip

The solution I'd like

I know this is intentional by design, as mentioned in the pull request: dotnet/sdk#21954. However, some edge cases exist where hot reloading support inside an iframe is essential. For instance, the clone of Storybook for Blazor, "Blazing Story" (https://github.com/jsakamoto/BlazingStory), requires such ability because it has to host a preview of the story using an iframe.

image

Therefore, I hope we have a public "escape hatch" API allowing developers to explicitly enable hot reloading inside an iframe for such a particular scenario.

@jsakamoto
Copy link
Author

Related Feature Requests

See also: #39153 [Hot Reload] Enable Blazor hot reloading for multiple browser windows at the same time

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
@MackinnonBuck
Copy link
Member

We might be able to address this in one of two ways:

  1. Update this line to include the "frame" and "iframe" values for the Sec-Fetch-Dest header.
  2. Address this as part of Revisit hot reload browser refresh script injection #45213

@mkArtakMSFT mkArtakMSFT added enhancement This issue represents an ask for new feature or an enhancement to an existing one feature-hot-reload This issue is related to the Hot Reload feaature and removed untriaged labels Mar 12, 2024
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 enhancement This issue represents an ask for new feature or an enhancement to an existing one feature-hot-reload This issue is related to the Hot Reload feaature
Projects
None yet
Development

No branches or pull requests

3 participants