Implement different hydration techniques#14
Conversation
|
Do you think we should include media-query-based hydration? Astro does, but you have to specify If the component is already hidden and shown by a media query in your CSS, then it can be easier to just use client:visible and not pass that same media query into the directive. In this case, if we don't include the option and just rely in CSS and its visible property, we would be skipping some use cases. |
michalczaplinski
left a comment
There was a problem hiding this comment.
This looks great!
I think we can merge it as is and continue the conversation about the further details.
|
Just a small note here if/when we propose this in Gutenberg: the intersection observer should also have a fallback. |
Fixes #12
I added an initial approach to the different hydration techniques as Astro (copy-pasted from the issue and Astro's codebase, mainly).
Should be the technique a prop in block.json rather than an attribute? (I guess choosing the hydration technique on the editor is an overkill)
Should we allow the Block developer to choose the hydration technique or is it a complex concept for most developers? (I still have to check some docs about IntersectionObserver and RequestIdleCallback)