IssueRaiser

Partial hydration

Unsure if this should go here or in an RFC. I'll start here, but write a proper RFC if the scope is too big for a regular issue. With the somewhat recent feature of disabling JS completely on pages it would be nice to selectively add sprinkles of JS around the page for some progressive enhancement. **Describe the solution you'd like** Svelte's action directive could work very well for this as. I briefly mentioned the idea to @pngwn and he mentioned that the life cycle hooks/methods wouldn't be usable (as we don't know when something is updated or destroyed. I think for a first version this would be fine - we would simply ignore the update and destroy functions. I don't this would be a big loss since you would lose the context of the page if you navigate away from it anyway, I think (or can you disabled JS but have the router still be enabled?). **Describe alternatives you've considered** An alternative way of doing this would be how Elder.js does it - a preprocessor that looks through your pages and finds any that are marked with some prop (`sveltekit:partial`?) and bundles that separately, injects that in some intersectionObserver solution. This would allow the usage of full components. **How important is this feature to you?** I can live without it, but partial hydration is 👌 and would give us a nice and easy way to enhance our static pages with whimsy and excitement! 👏

Posted by kevmodrome on May 9, 2021, 4:55 PM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.3,000 issues0 comments

github (Other)

Partial hydration

kevmodromeMay 9, 2021, 4:55 PM

Unsure if this should go here or in an RFC. I'll start here, but write a proper RFC if the scope is too big for a regular issue. With the somewhat recent feature of disabling JS completely on pages it would be nice to selectively add sprinkles of JS around the page for some progressive enhancement. **Describe the solution you'd like** Svelte's action directive could work very well for this as. I briefly mentioned the idea to @pngwn and he mentioned that the life cycle hooks/methods wouldn't be usable (as we don't know when something is updated or destroyed. I think for a first version this would be fine - we would simply ignore the update and destroy functions. I don't this would be a big loss since you would lose the context of the page if you navigate away from it anyway, I think (or can you disabled JS but have the router still be enabled?). **Describe alternatives you've considered** An alternative way of doing this would be how Elder.js does it - a preprocessor that looks through your pages and finds any that are marked with some prop (`sveltekit:partial`?) and bundles that separately, injects that in some intersectionObserver solution. This would allow the usage of full components. **How important is this feature to you?** I can live without it, but partial hydration is 👌 and would give us a nice and easy way to enhance our static pages with whimsy and excitement! 👏

Comments (0)

No comments yet. Start the discussion.

Comment on this issue