OpenRSC is an unopinionated, open source React Server Components implementation package for Vite.
npm install open-rscOpenRSC is a self-owned, open-source React Server Components implementation package for Vite.
!Version
!License
!Downloads
!Stars
- Lightweight: The OpenRSC archive is ~30kb. No more bloated React applications!
- Asynchronous RSC: Leverage the power of React Server Components for improved performance and user experience.
- Vite HMR: Enjoy hot module replacement, even in server components, for rapid development.
- "use client" directive: Easily distinguish between server and client components.
- Self-owned: Modify OpenRSC to fit your specific project needs and requirements.
- Scalable and Flexible: Designed to grow with your project, from small applications to large-scale systems.
- Framework Agnostic: Supports multiple server frameworks including Hono, Express, Koa, and node-http.
- TypeScript Support: Built with TypeScript for enhanced developer experience and type safety.
To install OpenRSC in your Vite project, navigate to the root directory of your repository and run:
```
npx open-rsc@latest init
This command will guide you through the setup process, including selecting your preferred server framework and project structure.
1. Route Configuration
Add your routes in the routes configuration file generated by the OpenRSC CLI:
``
export const routes = [
// Route example
{
path: '/',
component: () => import('./modules/lander'),
}
];
2. App Entry
Add the OpenRSC router in your app entry (usually `src/app.tsx`):
```
function App() {
return
}