[release/8.0-rc1] [Blazor] Add APIs for "enhanced refresh"#50124
Merged
wtgodbe merged 3 commits intorelease/8.0-rc1from Aug 17, 2023
Merged
[release/8.0-rc1] [Blazor] Add APIs for "enhanced refresh"#50124wtgodbe merged 3 commits intorelease/8.0-rc1from
wtgodbe merged 3 commits intorelease/8.0-rc1from
Conversation
Member
|
@danmoseley Would you please take a look at this? It's a new Blazor API we're trying to bring into RC1. Thanks 🙂 |
|
Hi @github-actions[bot]. This PR was just approved to be included in the upcoming servicing release. Somebody from the @dotnet/aspnet-build team will get it merged when the branches are open. Until then, please make sure all the CI checks pass and the PR is reviewed. |
Member
|
Looks good. Go ahead |
wtgodbe
pushed a commit
that referenced
this pull request
Aug 17, 2023
* Update dependencies from https://github.com/dotnet/arcade build 20230815.4 (#50113) Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.RemoteExecutor From Version 8.0.0-beta.23411.1 -> To Version 8.0.0-beta.23415.4 Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com> * [release/8.0-rc1] [Blazor] Add APIs for "enhanced refresh" (#50124) * Add NavigationManager.Refresh() + tests * PR feedback * Add `forceReload` parameter --------- Co-authored-by: Mackinnon Buck <mackinnon.buck@gmail.com> * Support resolving keyed services from DI in RDF and RDG (#50095) * Support resolving keyed services from DI in RDF and RDG * Address feedback from peer review * Support keyed services with different keys but same arg name --------- Co-authored-by: dotnet-maestro[bot] <42748379+dotnet-maestro[bot]@users.noreply.github.com> Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Mackinnon Buck <mackinnon.buck@gmail.com> Co-authored-by: Safia Abdalla <safia@microsoft.com>
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.
Backport of #50068 to release/8.0-rc1
/cc @MackinnonBuck
[Blazor] Add APIs for "enhanced refresh"
Adds
NavigationManager.Refresh(bool forceReload = false). This allows developers to refresh statically rendered content by forcing an SSR update.Description
If
forceReloadistrue, a full page reload will always be performed. Otherwise, the response HTML may be merged with the document's existing HTML to preserve client-side state, falling back on a full page reload if necessary.Fixes #49414
Customer Impact
Unlike Blazor Server or WebAssembly components, statically rendered Blazor components don't update their content after being added to the page. However, the developer might want to manually trigger a refresh of static page content without performing a full page reload, which would destroy all client-side state.
An example of when this is useful might be if the user's authentication state changes, so the statically rendered layout needs to updated accordingly.
The alternative to using this method would be to call
NavigationManager.NavigateTo(NavigationManager.Uri, replace: true). However, this has its downsides:The new
Refreshmethod overcomes both these downsides.Regression?
Risk
This is an additive feature and won't affect existing app functionality.
Verification
Packaging changes reviewed?