Replies: 3 comments 4 replies
-
This is a great question—thanks for asking! 😄 For historical context, when we started working on partial hydration, we outlined three initial modes ( As time progressed, we saw requests for more granular control. If I'm reading your question correctly, then "hey why can't I use ( I'd really like to revisit this and see if there's a good API (probably similar to CSS at-rules?) that could handle the combinatorial nature of the hydration primitives we have. |
Beta Was this translation helpful? Give feedback.
-
I agree that Astro should support multiple <Component client:idle.onMedia(min-width: 400px) /> I could even imagine checks to prevent impossible combinations (if not from your editor, at least from the CLI console). For instance, we could prevent this: <!--Cannot chain "visible" from the "idle" directive-->
<Component client:idle.visible /> We could even introduce helpers for to all race conditions. For instance, either show on media or on click of some button (note <Component client:buttonClick.or.visible /> A lot of kinks to work out of course. @natemoo-re are there any existing RFCs on this subject that are worth linking as well? |
Beta Was this translation helpful? Give feedback.
-
One addon so to say on this I would request is dynamic allocation of hydration, if I map an array onto a component with hydration marked on it I would probably prefer rendering only the first few as is and the rest when in viewport so say something like <!-- some form of array map -->
<Component {index<6 ? client:load : client:visible} /> A bit like how some frameworks do for |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
hey there 👋
I am currently looking into how to best implement partial hydration in a different project and I wanted to see if there might be some overlap here.
While looking at it I get a little confused about the "ssr/render/client/server/..." options?
With the current API users could make "invalid" code by accident?
what wins now? idle, visible?
Is there a particular reason it's multiple boolean attributes and not one attribute with a value?
If there is none then I'm wondering if a single attribute might make sense?
Some possible ideas
How would something like this feel? use a single attribute like
render-mode
(or ssr-render, or ssr or ...)Beta Was this translation helpful? Give feedback.
All reactions