Rendering
SSR, SSG, ISR, RSC, and Partial Prerendering in PledgeJS.
TL;DR
PledgeJS supports server-side rendering (SSR), static site generation (SSG), incremental static regeneration (ISR), React Server Components (RSC, React-only), and Partial Prerendering (PPR) — a static shell with streaming dynamic holes.
Last updated: August 22, 2026
Server-Side Rendering
renderSSR() renders pages with layout chains, error boundaries, and Suspense loading states (React). Each renderer adapter implements its own SSR via the framework's native APIs. Streaming SSR is supported — React uses renderToPipeableStream with Suspense boundaries for true progressive streaming.
Static Site Generation
Routes are prerendered at build time whenever possible. Use generateStaticParams to specify which dynamic routes to pre-render. Use static-export mode for a fully static output.
React Server Components
RSC is React-only. PledgeJS integrates react-server-dom-webpack for flight payload generation, RSC streaming, and client manifests. Flight payloads are streamed progressively — chunks are pushed to the client as they arrive rather than buffered into a single blob before anything is sent. Other frameworks (Vue, Solid, Svelte) use standard SSR with hydration.
Partial Prerendering (PPR)
PPR prerenders a static shell at build time and streams dynamic holes at request time. Rust-based PPR via rust-ppr.ts with JS fallback. Set ppr: true in your config to enable.
export default defineConfig({
ppr: true, // static shell + streaming dynamic holes
});Client Components
Add the 'use client' directive at the top of a file to opt a component and its imports into the client bundle, which is required for interactivity like state and event handlers.
'use client';
import { useState } from 'react';
export default function Counter() {
const [count, setCount] = useState(0);
return <button onClick={() => setCount(count + 1)}>{count}</button>;
}JIT Templates
A hot route template compiler profiles SSR renders and compiles frequently-rendered routes to native functions that bypass React reconciliation. Uses the rust-jit-templates NAPI addon with JS fallback.