home / skills / harborgrid-justin / lexiflow-premium / .github-skills
/frontend/.github-skills
This skill helps reduce client bundle size by leveraging server components and streaming to minimize JavaScript and improve perceived performance.
npx playbooks add skill harborgrid-justin/lexiflow-premium --skill .github-skillsReview the files below or copy the command above to add this skill to your agents.
---
name: zero-bundle-size-rsc
description: Minimizing client bundles through aggressive use of Server Components and streaming protocols.
---
# Zero-Bundle-Size React Server Components
## Summary
Minimizing client bundles through aggressive use of Server Components and streaming protocols.
## Key Capabilities
- Partition application graphs into Server/Client subtrees.
- Eliminate data-fetching libraries from client bundles.
- Serialize complex data structures across the network boundary.
## PhD-Level Challenges
- Formalize the serialization constraints of Server Components.
- Analyze the bandwidth vs. CPU trade-off of RSC payloads.
- Implement a dynamic import strategy for polymorphic server components.
## Acceptance Criteria
- Show a reduction in initial JS execute time.
- Demonstrate zero client-side JS for static subtrees.
- Provide a report on payload size reduction.
This skill minimizes client bundle size by aggressively leveraging React Server Components and streaming protocols. It focuses on partitioning app graphs so static and data-heavy logic run on the server, reducing the amount of JavaScript shipped to the browser. The result is faster initial load, lower CPU on clients, and measurable reductions in payload and JS execution time.
The skill analyzes the component graph and splits it into server and client subtrees, converting eligible components to Server Components. It replaces client-side data-fetching libraries with server-side data resolution and serializes complex structures across the server boundary using a compact, streaming-friendly format. Streaming techniques deliver renderable chunks progressively so the browser receives HTML first and minimal hydration-related JS only when needed.
Will this eliminate all client-side JavaScript?
Not always; interactive widgets still require client components. The skill aims to reach zero client JS for static subtrees and minimize JS for interactive areas.
How do you handle complex data like class instances or circular structures?
The skill uses a serialization strategy designed for Server Components that flattens or rehydrates complex structures into a compact, transferable form and documents constraints for edge cases.