33
loading...
This website collects cookies to deliver better user experience
{{variables}}
.{% raw %}
tag. It was a big hassle to code, and I couldn't get Vue to load properly even though I hacked Nunjucks quite bit at this point. And I decided to give up because I wasn't prepared to do the required dev-ops wrangling.dev
script and a build
script that checks almost all of my boxes.<MyComponent /> ... </MyComponent>
<MyComponent:load /> ... </MyComponent>
<MyComponent:idle /> ... </MyComponent>
<MyComponent:visible /> ... </MyComponent>
<MyComponent />
— renders an HTML-only version so there's no JS<MyComponent:load />
— renders component on page load<MyComponent:idle />
— uses requestIdleCallback() to render MyComponent as soon as main thread is free<MyComponent:visible />
— uses IntersectionObserver to render MyComponent when the element enters the viewportload
or idle
or visible
. I can let Astro take care of it for me instead..njk
file.<Markdown>
component that does the same!33