From harness-claude
Delays hydration of below-fold or non-critical React SSR components to improve Time to Interactive. Useful for pages with many interactive elements.
How this skill is triggered — by the user, by Claude, or both
Slash command
/harness-claude:react-progressive-hydrationThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
> Delay hydration of below-fold or non-critical components to improve TTI
Delay hydration of below-fold or non-critical components to improve TTI
IntersectionObserver)requestIdleCallback)React.lazy + Suspense for code-splitting alongside hydration deferral.function LazyHydrate({ children }: { children: React.ReactNode }) {
const [hydrated, setHydrated] = useState(false);
const ref = useRef<HTMLDivElement>(null);
useEffect(() => {
const observer = new IntersectionObserver(([entry]) => {
if (entry.isIntersecting) {
setHydrated(true);
observer.disconnect();
}
});
if (ref.current) observer.observe(ref.current);
return () => observer.disconnect();
}, []);
return (
<div ref={ref}>
{hydrated ? children : <div dangerouslySetInnerHTML={{ __html: '' }} />}
</div>
);
}
Progressive hydration is distinct from islands: islands prevent hydration entirely for static regions, while progressive hydration defers hydration of React components that will eventually be interactive.
React 18 selective hydration: React.lazy with Suspense boundaries already enables selective hydration in React 18 with hydrateRoot. React prioritizes hydrating components the user interacts with first.
Libraries: react-lazy-hydration, react-intersection-observer provide production-ready utilities for this pattern.
Measurement: Use Lighthouse TTI, Chrome DevTools Performance tab, and WebPageTest to verify improvements. Premature optimization without measurement is counterproductive.
https://patterns.dev/react/progressive-hydration
npx claudepluginhub intense-visions/harness-engineering --plugin harness-claudeImplements lazy loading strategies using Intersection Observer, code splitting, and virtual scrolling to minimize initial payload and prioritize above-the-fold content.
Optimizes React 18/19 and Next.js performance with 70+ rules across 8 priority categories: waterfalls, bundle size, server-side, client fetching, re-render, rendering, JS micro-perf, advanced.
Optimizes React 18/19 and Next.js performance with 70+ rules across 8 priority categories: waterfalls, bundle size, server/client fetching, re-renders, rendering, JS micro-performance, and advanced patterns.