Skip to content
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

How to persist data on Blazor SSR + WASM Client in .NET 8 preview 6 #49448

Closed
Markz878 opened this issue Jul 16, 2023 · 5 comments
Closed

How to persist data on Blazor SSR + WASM Client in .NET 8 preview 6 #49448

Markz878 opened this issue Jul 16, 2023 · 5 comments
Labels
area-blazor Includes: Blazor, Razor Components enhancement This issue represents an ask for new feature or an enhancement to an existing one ✔️ Resolution: Duplicate Resolved as a duplicate of another issue Status: Resolved
Milestone

Comments

@Markz878
Copy link

Markz878 commented Jul 16, 2023

Trying to reproduce .NET 7 WASM hosted + prerendering template on .NET 8 preview 6.
Is there a possibility yet to persist the data fetched from the server side in Blazor WASM components?

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-blazor Includes: Blazor, Razor Components label Jul 16, 2023
@Markz878 Markz878 changed the title HttpClient registering not working as expected on Blazor 8 WASM in preview 6 How to persist data on Blazor SSR + WASM Client in .NET 8 preview 6 Jul 16, 2023
@marinasundstrom
Copy link

I think you will (still) need to use PersistentComponentState for that. To my knowledge there is currently nothing that will automatically transfer component state to the client app.

https://learn.microsoft.com/en-us/aspnet/core/blazor/components/prerendering-and-integration?view=aspnetcore-7.0&pivots=webassembly

@danroth27
Copy link
Member

We have a tag helper for this when using a .cshtml file. We'll need a component for when using a .razor file. We also need to think about how this will work with streaming rendering.

@danroth27 danroth27 added this to the 8.0-rc1 milestone Jul 17, 2023
@danroth27 danroth27 added the enhancement This issue represents an ask for new feature or an enhancement to an existing one label Jul 17, 2023
@Markz878
Copy link
Author

Markz878 commented Jul 18, 2023

@danroth27 Thanks Dan, this is crucial for us to be able to move to the new SSR style in our apps.

Could it be possible to also somehow make it easier to do the data persisting part?
Currently the PersistentComponentState with PersistingComponentStateSubscription with disposing is a bit much.
Javier showed some [Persist] attribute in one of the stand-ups, hopefully something like that would also be possible.

@danroth27
Copy link
Member

danroth27 commented Jul 18, 2023

@danroth27 Thanks Dan, this is crucial for us to be able to move to the new SSR style in our apps.

Agreed! We're going to try to get this addressed for .NET 8.

Could it be possible to also somehow make it easier to do the data persisting part? Currently the PersistentComponentState with PersistingComponentStateSubscription with disposing is a bit much. Javier showed some [Persist] attribute in one of the stand-ups, hopefully something like that would also be possible.

Yup, we're tracking having a declarative model with #26794. Give the issue a 👍 to show your interest and support.

@mkArtakMSFT
Copy link
Member

Closing as a dupe of #49733

@mkArtakMSFT mkArtakMSFT added the ✔️ Resolution: Duplicate Resolved as a duplicate of another issue label Jul 31, 2023
@ghost ghost added the Status: Resolved label Jul 31, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Aug 30, 2023
@mkArtakMSFT mkArtakMSFT reopened this Sep 2, 2023
@mkArtakMSFT mkArtakMSFT closed this as not planned Won't fix, can't repro, duplicate, stale Sep 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components enhancement This issue represents an ask for new feature or an enhancement to an existing one ✔️ Resolution: Duplicate Resolved as a duplicate of another issue Status: Resolved
Projects
None yet
Development

No branches or pull requests

5 participants
@marinasundstrom @danroth27 @mkArtakMSFT @Markz878 and others