Skip to content

[release/9.0.1xx] [Blazor] Fix hot reload for components with collocated JS files #45120

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

Merged
merged 5 commits into from
Nov 27, 2024

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Nov 25, 2024

Backport of #43199 to release/9.0.1xx

Fix hot reload for components with collocated JS files

Fixes an issue where if any components in a Blazor project have collocated JS, CSS hot reload fails.

Description

"Collocated JS" refers to JavaScript files that end with .razor.js and are associated with a Razor component. These files participate in the hot reload experience, so edits will apply to already-running Blazor apps.

As part of applying hot reload updates to collocate JS files, the build pipeline attempts to match up .razor.js files with their corresponding Razor components. However, changes to build logic in .NET 9 caused the discovery of Razor components to get skipped in hot reload scenarios, causing a build error indicating that collocated JS files couldn't be correctly mapped to Razor components.

The fix is to execute the missing stages of the build pipeline when a hot reload edit occurs.

Fixes dotnet/aspnetcore#57599

Customer Impact

High. Collocated JS is a very common pattern found in Blazor projects, so this bug is expected to impact a large portion of developers. We've already seen feedback from multiple customers that this is an issue. There is no known workaround.

Regression?

  • Yes
  • No

Regressed from .NET 9 preview 6

Risk

  • High
  • Medium
  • Low

The change is straightforward and only impacts hot reload scenarios.

Verification

  • Manual (required)
  • Automated

Packaging changes reviewed?

  • Yes
  • No
  • N/A

@github-actions github-actions bot requested a review from a team as a code owner November 25, 2024 19:40
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-AspNetCore RazorSDK, BlazorWebAssemblySDK, dotnet-watch untriaged Request triage from a team member labels Nov 25, 2024
Copy link
Contributor

Thanks for your PR, @github-actions[bot].
To learn about the PR process and branching schedule of this repo, please take a look at the SDK PR Guide.

@mkArtakMSFT mkArtakMSFT added Servicing-approved and removed untriaged Request triage from a team member Servicing-consider labels Nov 27, 2024
@MackinnonBuck MackinnonBuck merged commit 18bb771 into release/9.0.1xx Nov 27, 2024
31 checks passed
@MackinnonBuck MackinnonBuck deleted the backport/pr-43199-to-release/9.0.1xx branch November 27, 2024 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-AspNetCore RazorSDK, BlazorWebAssemblySDK, dotnet-watch Servicing-approved
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants