Package Exports
- @cmj/juice/create
- @cmj/juice/package.json
- @cmj/juice/plugin
- @cmj/juice/runtime
Readme
🧃 Juice
Zero-bloat React 19 RSC framework.
Streaming SSR. Server Actions. Zero config.
Install
npm install @cmj/juice react@^19 react-dom@^19 vite@^6Quickstart
npx @cmj/create-juice-app my-app
cd my-app
npm install
npm run devOr scaffold for a specific target:
npx @cmj/create-juice-app my-app --target cloudflareTargets: bun (default), node, cloudflare, deno
CLI
| Command | Description |
|---|---|
juice create <name> |
Scaffold a new Juice app |
juice dev |
Start the Vite dev server |
juice build |
Production build (client + SSR) |
API
juice/plugin
The Vite plugin. Zero config.
// vite.config.ts
import { defineConfig } from 'vite';
import juice from '@cmj/juice/plugin';
export default defineConfig({
plugins: [juice()],
});juice/runtime
The WinterCG-compliant edge runtime.
// server.ts
import { createRouter } from '@cmj/juice/runtime';
import manifest from './dist/flight-manifest.json' with { type: 'json' };
const handler = createRouter(manifest);
// handler: (Request) => Promise<Response>How It Works
Source (.tsx) → Vite Plugin → flight-manifest.json → Runtime → Response- Compile: The Vite plugin detects
'use client'and'use server'directives, generates proxy modules, and emits aflight-manifest.json. - Serve: The runtime reads the manifest and streams RSC responses using React 19's
renderToReadableStream. - Deploy: The
Request → Responsesignature works on any WinterCG platform.
Features
- React 19 RSC — Server Components, Suspense, streaming SSR
- Server Actions —
'use server'with FormData support - Zero config — One plugin call, no magic files
- Zero runtime deps — Pure ESM, nothing to install at runtime
- Multi-platform — Bun, Node.js, Cloudflare Workers, Deno
- Empathic errors — "What-Why-How" error messages for fast debugging
- HMR — Full hot module replacement in development
License
MIT