-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Description
Describe the bug
Currently the way components are hydrated gets in the way of progressive enhancement.
Even if a component works in both js or non-js scenarios, the user experience can't benefit from it: when js kicks in the state is restored which can be frustrating with menus closing etc.
This means progressive enhancement is limited to js vs no-js (for a good experience). However there is a huge territory between, and it would be great to be able to have great experiences for slow networks too (most people in the world).
Example: here's a disclosure component. It works with or without js. But when js kicks in it closes, so even though it's immediately interactive, it's not great. And trying something like "onMount read the state from the checkbox" doesn't work
Enregistrement.de.l.ecran.2024-10-14.a.19.05.33.mov
Maybe something like a hydration hook or a marker would allow to say something like "this is enhanced, don't wipe out this element" and "pick up the state from this checkbox instead of the props"?
Reproduction
Logs
No response
System Info
noneSeverity
blocking all usage of svelte