[Blazor] Disable preloading for enhanced navigation#63544
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR disables resource preloading for enhanced navigation in Blazor to address issues with DOM merging and unnecessary WebAssembly runtime state initialization. Enhanced navigation doesn't need preloading elements since the WebAssembly runtime persists between page navigations.
- Removes special handling of preload elements during DOM synchronization
- Adds enhanced navigation detection to skip WebAssembly asset preloading
- Changes method visibility to enable reuse across components
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
DomSync.ts |
Removes preload element detection and special handling during DOM comparison |
SSRRenderModeBoundary.cs |
Adds enhanced navigation check to skip WebAssembly asset preloading |
EndpointHtmlRenderer.Streaming.cs |
Changes IsProgressivelyEnhancedNavigation method from private to internal |
ilonatommy
approved these changes
Sep 4, 2025
javiercn
approved these changes
Sep 4, 2025
Member
|
/backport to release/10.0 /cc: @maraf I imagine we want this in 10.0 |
Contributor
|
Started backporting to release/10.0: https://github.com/dotnet/aspnetcore/actions/runs/17470161322 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Enhanced navigation presents several challenges for preloading
This PR disables generating preloading elements from
ResourcePreloaderwhen the HTTP request is for enhanced navigation.It alsore removes previous attempt to solve the DOM merging problem from #63239