-
Notifications
You must be signed in to change notification settings - Fork 10.3k
[Blazor] Auto render mode improvements #53159
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
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
954794f
Throttle wasm resource download
MackinnonBuck 0cb83c5
Update tests
MackinnonBuck f1fecf4
Fix tests
MackinnonBuck 7608b3e
Fix another flaky test
MackinnonBuck 53f6bc5
Merge branch 'main' into mbuck/auto-improvements
MackinnonBuck 1f456f9
Add tests
MackinnonBuck 1187e3c
Merge remote-tracking branch 'origin/main' into mbuck/auto-improvements
MackinnonBuck File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
8 changes: 8 additions & 0 deletions
8
...s.TestServer/RazorComponents/Pages/PersistentState/PageWithWebAssemblyInteractivity.razor
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
@page "/persistent-state/page-with-webassembly-interactivity" | ||
|
||
<p> | ||
This page is used to ensure that the WebAssembly runtime is downloaded and available | ||
so that WebAssembly interactivity will get used for components with the Auto render mode | ||
</p> | ||
|
||
<TestContentPackage.Counter @rendermode="RenderMode.InteractiveWebAssembly" IncrementAmount="1" IdSuffix="counter" /> |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean if there's a combination of WebAssembly and Auto components on the page, the maxParallelDownloadsOverride value will end up being determined by which of them appeared first in the DOM?
If so that's slightly quirky but most likely not a problem in real life, as people will almost never mix both of those modes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree with Steve here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might be able to partially mitigate this by changing this method to accept the full set of discovered
ComponentDescriptor
s all at once. Then if any descriptors have type'webassembly'
, download WebAssembly resources with full (or user-specified) parallelism. Otherwise, if there are any'auto'
descriptors, download WebAssembly resources with no parallelism. But considering that mixing 'auto' and 'webassembly' is an uncommon use case, and that it's preferable to keep servicing changes minimal, I would propose that we make any further adjustments in .NET 9.Long-term, it might be preferable to be able to dynamically change the throttling amount so that if a WebAssembly component appears on the page after an Auto component already initiated the downloading of WebAssembly resources, we would switch to downloading with full parallelism, so the WebAssembly component becomes interactive as quickly as possible.
I'll open an issue to track this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#53284