nlite is a small experimental React framework built on Vite and React Server Components.
This is a curiosity driven side project for learning how RSC, streaming SSR, static generation, file based routing, and deployment adapters can fit together on top of Vite.
- Uses React 19 and
@vitejs/plugin-rsc. - Provides file based routing from an
appdirectory. - Supports layouts, pages, loading UI, error UI, dynamic routes, and API routes.
- Includes streaming SSR and static generation experiments.
- Exposes a small CLI:
nlite dev,nlite build,nlite preview, andnlite start. - Includes a basic Cloudflare adapter experiment.
- Not stable.
- Not production ready.
- Not a Next.js replacement.
- Not guaranteed to keep the same APIs.
- Not thoroughly tested across every edge case.
Use it to read, experiment, break things, and understand the moving parts.
packages/nlite- the framework package and CLI.examples/*- a minimal examples.
- Node.js compatible with Vite 8 and React 19.
- pnpm.
pnpm installBuild the package:
pnpm nlite buildBasic example:
pnpm --filter example-basic dev
pnpm --filter example-basic build
pnpm --filter example-basic previewCloudflare example:
pnpm --filter example-cloudflare dev
pnpm --filter example-cloudflare build
pnpm --filter example-cloudflare preview
pnpm --filter example-cloudflare deployInside an app:
pnpm add nlite react react-domAdd scripts:
{
"scripts": {
"dev": "nlite dev",
"build": "nlite build",
"preview": "nlite preview"
}
}Create nlite.config.ts:
import { defineConfig } from "nlite/config";
export default defineConfig({});Create routes inside app:
app/
layout.tsx
page.tsx
api/status/route.tsMore package-level notes are in packages/nlite/README.md.
pnpm nlite dev # watch package build
pnpm nlite build # build package
pnpm lint # oxlint
pnpm format # oxfmt
pnpm test # vitestMIT