Skip to content

Commit a1440ae

Browse files
authored
[RC1] Enhanced nav with persistent component state (#36139)
1 parent c4302e3 commit a1440ae

4 files changed

Lines changed: 11 additions & 26 deletions

File tree

aspnetcore/blazor/call-web-api.md

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -623,24 +623,20 @@ For more information, see the [Client-side services fail to resolve during prere
623623
624624
When prerendering, components render twice: first statically, then interactively. State doesn't automatically flow from the prerendered component to the interactive one. If a component performs asynchronous initialization operations and renders different content for different states during initialization, such as a "Loading..." progress indicator, you may see a flicker when the component renders twice.
625625
626-
You can address this by flowing prerendered state using the Persistent Component State API, which the `BlazorWebAppCallWebApi` and `BlazorWebAppCallWebApi_Weather` [sample apps](#sample-apps) demonstrate. When the component renders interactively, it can render the same way using the same state. However, the API doesn't currently work with enhanced navigation, which you can work around by disabling enhanced navigation on links to the page (`data-enhanced-nav=false`). For more information, see the following resources:
627-
628-
<!-- UPDATE 10.0 The enhanced nav update is in for Preview 7.
629-
The preceding paragraph will be updated/
630-
versioned on the upcoming docs Preview 7 PR.
631-
I'll go ahead and remove the PU issue
632-
cross-link on PR #35873.
633-
634-
Note that the README of the "weather" call web API
635-
sample has a cross-link and remark on this, and the
636-
sample app disabled enhanced nav on the weather
637-
component link. -->
626+
You can address this by flowing prerendered state using the Persistent Component State API, which the `BlazorWebAppCallWebApi` and `BlazorWebAppCallWebApi_Weather` [sample apps](#sample-apps) demonstrate. When the component renders interactively, it can render the same way using the same state. For more information, see the following resources:
638627
639628
* <xref:blazor/state-management/prerendered-state-persistence>
640629
* <xref:blazor/fundamentals/routing#enhanced-navigation-and-form-handling>
641630
642631
:::moniker-end
643632
633+
:::moniker range="< aspnetcore-10.0"
634+
635+
> [!NOTE]
636+
> The Persistent Component State API only supports enhanced navigation in .NET 10 or later. For apps that target .NET 8 or .NET 9, you can disable enhanced navigation on links to the page with the `data-enhance-nav` attribute set to `false`. For more information, see <xref:blazor/fundamentals/routing#enhanced-navigation-and-form-handling>.
637+
638+
:::moniker-end
639+
644640
:::moniker range=">= aspnetcore-9.0"
645641
646642
## Client-side request streaming

aspnetcore/blazor/fundamentals/routing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1072,7 +1072,7 @@ Enhanced navigation is available when:
10721072

10731073
* The Blazor Web App script (`blazor.web.js`) is used, not the Blazor Server script (`blazor.server.js`) or Blazor WebAssembly script (`blazor.webassembly.js`).
10741074
* The feature isn't [explicitly disabled](xref:blazor/fundamentals/startup#disable-enhanced-navigation-and-form-handling).
1075-
* The destination URL is within the internal base URI space (the app's base path).
1075+
* The destination URL is within the internal base URI space (the app's base path) and the link to the page doesn't have the `data-enhance-nav` attribute set to `false`.
10761076

10771077
If server-side routing and enhanced navigation are enabled, [location changing handlers](#location-changes) are only invoked for programmatic navigation initiated from an interactive runtime. In future releases, additional types of navigation, such as following a link, may also invoke location changing handlers.
10781078

aspnetcore/blazor/state-management/server.md

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,7 @@ During server-side rendering, Blazor Web Apps can persist a user's session (circ
5757
* Mobile device users switching apps
5858
* Network interruptions
5959
* Proactive resource management (pausing inactive circuits)
60-
61-
<!-- UPDATE 10.0 - Arriving for RC1 ...
62-
63-
Guidance changes for persistent component state with enhanced nav
64-
will be on the upcoming docs PR for RC1.
65-
66-
API review for support persistent component state on enhanced navigation
67-
https://github.com/dotnet/aspnetcore/issues/62773
68-
-->
69-
70-
*[Enhanced navigation](xref:blazor/fundamentals/routing#enhanced-navigation-and-form-handling) with circuit state persistence isn't currently supported but planned for a future release.*
60+
* [Enhanced navigation](xref:blazor/fundamentals/routing#enhanced-navigation-and-form-handling)
7161

7262
Server resources can be freed up if the circuit state can be persisted and then resumed later:
7363

aspnetcore/release-notes/aspnetcore-10/includes/blazor.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -633,8 +633,7 @@ During server-side rendering, Blazor Web Apps can now persist a user's session (
633633
* Mobile device users switching apps
634634
* Network interruptions
635635
* Proactive resource management (pausing inactive circuits)
636-
637-
*[Enhanced navigation](xref:blazor/fundamentals/routing?view=aspnetcore-10.0#enhanced-navigation-and-form-handling) with circuit state persistence isn't currently supported but planned for a future release.*
636+
* [Enhanced navigation](xref:blazor/fundamentals/routing?view=aspnetcore-10.0#enhanced-navigation-and-form-handling)
638637

639638
For more information, see <xref:blazor/state-management/server?view=aspnetcore-10.0#circuit-state-and-prerendering-state-preservation>.
640639

0 commit comments

Comments
 (0)