Open kjeske opened 11 months ago
Could add a property bool IsPersistent
to the HydroComponent
class, so that every persistent component will save its props marked with [Parameter]
attribute to cookies after every rendering, then upon a new Mount
(it is triggered upon HotReload right?) will restore values from cookies.
Could be totally done from code-behind without changing hydro.js
. Doesn't keep all the state though.. Well, just an idea. Can be interesting for not only HotReload, like navigating through pages and automatically having all previous parameters restored from last usage.
When using built-in ASP.NET Core mechanism for hot reloading pages after changing source code, the whole page is being reloaded, therefore all the components loose their state. It's inconvenient when working on some places deep down the component hierarchy that resets every time.
Possible solution would be to add a custom hot-reload mechanism that will send messages via web sockets stream. As a response, browser could send a request to the back-end for the new version of current page, but additionally all the state would be sent together with that request.
To do: