Server-side React, without the ceremony.
A minimal SSR framework built on rspack. Export a component, export getInitProps, run one command.
npx hadars new my-appReact Fast Refresh
Full HMR via rspack-dev-server โ module-level patches, no full-page reloads.
True SSR
Components render on the server with your data, then hydrate on the client.
Code splitting
loadModule('./Comp') splits on the browser and bundles statically on the server.
Head management
HadarsHead controls title, meta, link, and script tags on both server and client.
Cross-runtime
Bun, Node.js, and Deno โ uses the standard Fetch API throughout.
Multi-core
Set workers: os.cpus().length to fork a process per CPU core in production.
Minimal example
// hadars.config.ts
import type { HadarsOptions } from 'hadars';
const config: HadarsOptions = { entry: 'src/App.tsx', port: 3000 };
export default config;// src/App.tsx
import React from 'react';
import { HadarsHead, type HadarsApp, type HadarsRequest } from 'hadars';
interface Props { user: { name: string } }
const App: HadarsApp<Props> = ({ user }) => (
<>
<HadarsHead status={200}>
<title>Hello {user.name}</title>
</HadarsHead>
<h1>Hello, {user.name}!</h1>
</>
);
export const getInitProps = async (req: HadarsRequest): Promise<Props> => ({
user: await db.getUser(req.cookies.session),
});
export default App;Full getting started guide โLive demo
This page is a hadars app. The values below were produced on the server.
_R_b7e_Counter starts at zero on every load (SSR renders 0, client hydrates 0). Clicking proves the React tree is live. Open the console โ no hydration warnings.