fix(catalog): hydrate CSR component pages#5813
fix(catalog): hydrate CSR component pages#5813copybara-service[bot] merged 1 commit intomaterial-components:mainfrom
Conversation
|
I'm not super familiar with the catalog's setup. What issue is this fixing/how can I test it? |
My apologies for the initial PR description's alarmist tone, this fix isn't addressing an obvious critical bug. Instead, it's about correcting the Right now, Furthermore, analyzing the source code (https://github.com/11ty/is-land/blob/main/is-land.js) reveals a crucial hydration optimization: nested BTW, I created a starter kit (boilerplate) using your catalog as base idea because I love how you set it up and I documented how everything works under the hood. |
asyncliz
left a comment
There was a problem hiding this comment.
Thanks for the explanation! I think I understand :)
4b7bd62
into
material-components:main
Description
This
{% if not ssrOnly %}...{% else %}...{% endif %}is a conditional statement that checks if a front matter variable namedssrOnlyisfalse.If it is
falsethen the JavaScript is loaded and hydrated onto the components nested inside on an idle callback via the<lit-island>utility.Essentially, a
<lit-island>tag is a wrapper or a container designed to encapsulate other Lit components and control when and how they are hydrated (become interactive) on the client side.This PR fixes the layout structure to provide hydration or not depending on the
ssrOnlyattribute.