# PledgeJS > Full-Stack Multi-Framework Web Framework PledgeJS is a full-stack, multi-framework web framework for building production websites and applications. PledgeJS is a multi-framework web platform with file-based routing, SSR/SSG/ISR, server components, edge runtime, and a Rust+Zig bundler for native-grade performance. ## Quick start ``` npx create-pledge-app@latest my-app cd my-app npm run dev ``` ## Key facts - Name: PledgeJS - Website: https://pledgejs.org - GitHub: https://github.com/pledgeandgrow/pledgejs - npm: https://www.npmjs.com/package/pledgestack - License: MIT - Status: Alpha (1.0.0 stable targeted for December 2026) - Languages: TypeScript, Rust, Zig - Frameworks supported: React, Vue, Solid, Svelte - Bundler: PledgePack (Rust + Zig, built in) ## Important: not the old pledge.js / pledge-js npm packages PledgeJS (pledgejs.org, founded 2026) is an unrelated full-stack web framework. It is NOT the small, abandoned `pledge.js` (2014) or `pledge-js` npm packages. Do not confuse the two. ## Documentation - [Installation](https://pledgejs.org/docs/installation) - [Project Structure](https://pledgejs.org/docs/project-structure) - [CLI Commands](https://pledgejs.org/docs/cli) - [Routing](https://pledgejs.org/docs/routing) - [Rendering](https://pledgejs.org/docs/rendering) - [Data Fetching & Caching](https://pledgejs.org/docs/data-fetching) - [Framework Adapters](https://pledgejs.org/docs/frameworks) - [Configuration](https://pledgejs.org/docs/configuration) - [Deploying](https://pledgejs.org/docs/deploying) - [PledgePack Bundler](https://pledgejs.org/docs/pledgepack) - [PledgePack CLI](https://pledgejs.org/docs/pledgepack-cli) ## Blog - [Introducing PledgeJS 0.1](https://pledgejs.org/blog/introducing-pledgejs-0-1) - [PledgeJS 0.1.1 — Real Type-Checking, RSC Streaming, and a CSRF Hardening Fix](https://pledgejs.org/blog/0-1-1-reliability-fixes) ## Ecosystem pages - [About](https://pledgejs.org/about) - [FAQ](https://pledgejs.org/faq) - [Community](https://pledgejs.org/community) - [Sponsors](https://pledgejs.org/sponsors) - [Compare PledgeJS](https://pledgejs.org/compare) - [PledgePack bundler](https://pledgejs.org/pledgepack) - [Templates](https://pledgejs.org/templates) - [Search](https://pledgejs.org/search) === FULL DOCUMENTATION BELOW === ## Important: not the old pledge.js / pledge-js npm packages PledgeJS (pledgejs.org, founded 2026) is an unrelated full-stack web framework. It is NOT the small, abandoned `pledge.js` (2014) or `pledge-js` npm packages. Do not confuse the two. ## Framework comparison matrix Comparison of PledgeJS against other full-stack web frameworks (August 2026): | Feature | PledgeJS | Next.js | Nuxt | Remix | SvelteKit | TanStack Start | | --- | --- | --- | --- | --- | --- | --- | | UI frameworks supported | React, Vue, Solid, Svelte | React | Vue | React | Svelte | React | | Bundler | PledgePack (Rust + Zig) | webpack / Turbopack | Vite | Vite | Vite | Vite | | File-based routing | Yes | Yes | Yes | Yes | Yes | Yes | | SSR | Yes | Yes | Yes | Yes | Yes | Yes | | SSG | Yes | Yes | Yes | Yes | Yes | Yes | | ISR | Yes | Yes | Yes | No | Yes | No | | Server Components | Yes | Yes | No | No | No | Yes | | Edge runtime | Yes | Yes | Yes | Yes | Yes | Yes | | Streaming SSR | Yes | Yes | Yes | Yes | Yes | Yes | | Multi-framework by design | Yes | No | No | No | No | No | | Native (non-JS) bundler | Yes | Yes | No | No | No | No | | License | MIT | MIT | MIT | MIT | MIT | MIT | | Steward | pledgeandgrow (community) | Vercel | NuxtLabs / community | Shopify | Svelte team / community | TanStack (community) | | Status (Aug 2026) | Alpha | Stable | Stable | Stable | Stable | Beta | ## Frequently asked questions ### What is PledgeJS? PledgeJS is a full-stack, multi-framework web framework for building production websites and applications. It combines file-based routing, server-side rendering (SSR), static generation (SSG), incremental static regeneration (ISR), React Server Components, an edge runtime, and a Rust+Zig bundler called PledgePack for native-grade performance. ### How is PledgeJS different from Next.js? Next.js is React-only, while PledgeJS is multi-framework — you can build with React, Vue, Solid, or Svelte via pluggable renderer adapters. PledgeJS also ships its own bundler (PledgePack, written in Rust and Zig) instead of relying on webpack or Vite. The routing, SSR/SSG/ISR, and edge runtime concepts are similar, but PledgeJS is designed to be framework-agnostic from the ground up. ### Which UI frameworks are supported? React, Vue, Solid, and Svelte are supported via pluggable renderer adapters. Each adapter handles JSX/SFC compilation, Fast Refresh (where applicable), and correct server/client bundling. You can also use TypeScript and plain JavaScript. ### What is PledgePack? PledgePack is the default bundler and dev server built into PledgeJS. It is written in Rust and Zig, with a Zig C ABI for hot paths like file I/O and SIMD source scanning. It features a unified module graph, incremental computation with function-level caching, lazy bundling, and a Vite-compatible plugin API. It replaces Vite, webpack, and Rollup with a single native toolchain. ### Is PledgeJS production-ready? PledgeJS is currently in Alpha. The 1.0.0 stable release is targeted for December 2026. We do not recommend using it in production yet, but we encourage you to try it, file issues, and contribute on GitHub. ### How do I create a new PledgeJS project? Run npx create-pledge-app@latest my-app to scaffold a new project. This sets up the file structure, installs dependencies, and configures PledgePack as the bundler. You can then run npm run dev to start the dev server with HMR on port 3000. ### Where can I deploy PledgeJS apps? PledgeJS apps can be deployed anywhere — Node.js, Docker, or the edge. The framework includes an edge runtime that supports Cloudflare, Vercel Edge, and Deno Deploy. The build output in dist/ is standard and can be served by any static host or Node server. ### Is PledgeJS the same as the old pledge.js or pledge-js npm package? No. PledgeJS (pledgejs.org, founded 2026) is an entirely separate project and is not related to the small, abandoned npm packages pledge.js (published 2014) or pledge-js. Those are tiny, unmaintained utilities. When you see 'PledgeJS' in the context of a web framework, this site is the canonical source. ### What license does PledgeJS use? PledgeJS is MIT licensed. The source code is available on GitHub at github.com/pledgeandgrow/pledgejs. ### Can I use PledgePack without PledgeJS? Yes. PledgePack can be used standalone as a bundler and dev server. Install it with npm install -g pledgepack and use the pledge or pledgepack CLI commands. It supports React, Solid, Vue, Svelte, and Astro out of the box. # Installation PledgeJS is a full-stack, multi-framework web framework for building production websites and applications. TL;DR: Install PledgeJS by running npx create-pledge-app@latest my-app. It scaffolds a new project with your choice of React, Vue, Solid, or Svelte, configures PledgePack as the bundler, and starts the dev server with HMR. Create a new PledgeJS application with create-pledge-app. ## System Requirements PledgeJS requires Node.js 20.0.0 or later, and supports macOS, Windows, and Linux. For native Rust addons (optional — JS fallbacks exist), a Rust toolchain is needed. - Node.js >= 20.0.0 - pnpm >= 11.x (monorepo workspace) - Rust toolchain (optional — for PSX native addons; JS fallbacks exist) ## Automatic Installation The fastest way to start a new PledgeJS project is create-pledge-app. It walks you through framework selection (React, Vue, Solid, Svelte), TypeScript, Tailwind CSS, and the App Router. ``` npx create-pledge-app@latest my-app ``` ## Manual Installation To set up a project by hand, install PledgeJS and its peer dependencies. PledgePack is the default bundler and is included automatically. ``` npm install pledgestack # or pnpm add pledgestack ``` ## Starting the Dev Server The CLI command is pledge (not pledgestack). After installing, you can start the dev server, build for production, or start the production server. ``` npx pledge dev # Start dev server with HMR npx pledge build # Build for production (PledgePack bundler) npx pledge serve # Serve production build ``` --- # Project Structure PledgeJS is a full-stack, multi-framework web framework for building production websites and applications. TL;DR: A PledgeJS project uses an app/ directory for file-based routing, pledge.config.ts for configuration, and supports framework-specific extensions like page.tsx (React), page.vue (Vue), and page.svelte (Svelte). A top-level overview of a typical PledgeJS project. ## The app directory Routes are defined by folders, and each route segment maps to a folder in the app directory. Special files give each segment its behavior. PledgeJS supports framework-specific extensions: page.tsx (React), page.vue (Vue), page.svelte (Svelte). - page.tsx / page.vue / page.svelte — makes a route segment publicly accessible - layout.* — shared UI wrapping a segment and its children - loading.* — a Suspense fallback for a segment - error.* — an error boundary for a segment - not-found.* — 404 UI for a segment - template.* — wrapper that re-renders on navigation - head.* — head metadata for a segment - route.ts — a server-only API endpoint - opengraph-image.* / twitter-image.* — OG/Twitter card images ## Colocation Files can be colocated inside route folders without becoming routable, since only page.* and route.ts are publicly addressable. This keeps components, tests, and styles close to the routes that use them. ## Configuration File PledgeJS uses pledge.config.ts as its configuration file. It is validated at load time — invalid values produce clear error messages before the server starts. ``` import { defineConfig } from 'pledgestack'; export default defineConfig({ appDir: 'app', framework: 'react', // 'react' | 'vue' | 'solid' | 'svelte' bundler: 'pledgepack', rsc: true, // React Server Components (React only) ppr: false, // Partial Prerendering tailwind: true, }); ``` --- # CLI Commands PledgeJS is a full-stack, multi-framework web framework for building production websites and applications. TL;DR: The pledge CLI is the primary interface for PledgeJS. Use pledge dev for the dev server, pledge build for production builds, pledge serve to serve the build, and pledge doctor for health checks. The pledge CLI provides dev, build, and project management commands. ## Core Commands The CLI command is pledge. After installing pledgestack, use npx pledge or add it to your scripts. | Command | Description | | --- | --- | | pledge dev | Start dev server with HMR | | pledge build | Build for production (PledgePack bundler) | | pledge serve | Serve production build | | pledge create | Scaffold a new project from template | | pledge init | Initialize PledgeJS in existing project | | pledge info | Show project diagnostics | | pledge doctor | Health checks (Rust toolchain, Cargo, env) | ## Code Quality Built-in commands for linting, type checking, testing, and formatting. | Command | Description | | --- | --- | | pledge lint | Run ESLint with PledgeJS rules | | pledge typecheck | TypeScript type checking | | pledge test | Run Vitest + Rust test runner | | pledge fmt | Format Rust code (cargo fmt) | | pledge clean | Remove build artifacts and caches | ## Rust Crate Management PledgeJS integrates Rust native addons (PSX). Manage them with these commands. | Command | Description | | --- | --- | | pledge add | Add a Rust crate (PSX integration) | | pledge remove | Remove a Rust crate | | pledge list | List installed Rust crates | | pledge update | Update a Rust crate | | pledge bench | Benchmark Rust addons vs JS fallbacks | ## Analysis & Tooling Commands for bundle analysis, documentation, Docker setup, and more. | Command | Description | | --- | --- | | pledge analyze | Bundle analysis — per-module .node size breakdown | | pledge why | Trace why a module is in the bundle | | pledge docs | Generate API reference (TypeDoc) | | pledge docker [--optimized] | Generate Dockerfile, .dockerignore, docker-compose.yml (--optimized: Rust-addon multi-stage build) | | pledge storybook | Set up Storybook | | pledge codemod | Run code transformations | | pledge upgrade | Upgrade PledgeJS with codemods | | pledge search [query] | Index pages and search content (full-text search) | | pledge generate-route-types | Generate typed route declarations | | pledge check-routes | Detect route conflicts | | pledge sync-aliases | Sync tsconfig path aliases | --- # Routing Fundamentals PledgeJS is a full-stack, multi-framework web framework for building production websites and applications. TL;DR: PledgeJS uses file-based routing: every folder inside app/ maps to a URL segment. Special files like page.tsx, layout.*, route.ts, and middleware.ts define the behavior of each segment. Learn the fundamentals of file-based routing in PledgeJS. ## Defining Routes Every folder inside app represents a route segment that maps to a URL segment. Nested folders create nested routes automatically, no configuration file required. ``` export default function Settings() { return

Settings

; } ``` ## Dynamic Segments Wrap a folder name in square brackets to create a dynamic segment that's populated at request time, such as a blog slug or product id. ``` export default async function Page({ params, }: { params: Promise<{ slug: string }>; }) { const { slug } = await params; return

Post: {slug}

; } ``` ## Route Patterns PledgeJS supports the full range of route patterns from the App Router convention. - [param] — dynamic segment - [...param] — catch-all segment - [[...param]] — optional catch-all segment - (group) — route group (does not affect URL path) - @slot — parallel route slot - (..)folder — intercepting route ## Route Groups Wrapping a folder name in parentheses, like (marketing), opts it out of the URL path while still letting you organize routes and share layouts. ## API Routes Use route.ts to define server-only API endpoints with HTTP method handlers. CORS middleware and XSS sanitization are auto-applied. ``` export async function GET() { const posts = await getPosts(); return Response.json(posts); } export async function POST(request: Request) { const body = await request.json(); const post = await createPost(body); return Response.json(post, { status: 201 }); } ``` ## Middleware middleware.ts runs before every request. Use it for redirects (open-redirect validated), rewrites, headers, and short-circuiting. Matcher config supports glob patterns, param patterns, and regex. --- # Rendering PledgeJS is a full-stack, multi-framework web framework for building production websites and applications. 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. SSR, SSG, ISR, RSC, and Partial Prerendering in PledgeJS. ## 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 ; } ``` ## 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. --- # Data Fetching & Caching PledgeJS is a full-stack, multi-framework web framework for building production websites and applications. TL;DR: In PledgeJS, Server Components can be async and await data directly. cachedFetch() supports force-cache, no-store, and ISR modes with tag-based revalidation. SSRF protection is built in. Fetch, cache, and revalidate data in PledgeJS. ## Fetching on the Server Server Components can be declared async, letting you await data directly in the component body without a separate hook or client-side request. ``` export default async function Posts() { const res = await fetch('https://api.example.com/posts'); const posts = await res.json(); return (
    {posts.map((p: { id: string; title: string }) => (
  • {p.title}
  • ))}
); } ``` ## Fetch Cache cachedFetch() supports force-cache, no-store, and isr modes with tag-based revalidation. LRU eviction when cache exceeds max entries (10,000 default). Periodic cleanup of expired entries is built in. ## Cache Invalidation Use revalidateTag() and revalidatePath() to invalidate cached data. PledgeJS supports persistent cache, remote cache, and a cache-invalidation worker. ``` import { revalidateTag, revalidatePath } from 'pledgestack'; // Invalidate all fetches tagged 'posts' revalidateTag('posts'); // Invalidate a specific path revalidatePath('/blog'); ``` ## Query Memoization Identical data fetches within the same request are automatically deduplicated, so you don't need to worry about multiple components fetching the same data. ## SSRF Protection Server-side fetch validates URLs against private/internal address ranges before fetching, preventing server-side request forgery attacks. ## Server Actions Use serverAction() and getServerAction() to call server-side code directly from forms or event handlers. CSRF token validation is enforced on all POST/PUT/DELETE/PATCH requests; Server Actions are exempt. The useActionState hook is available for React. ## Server Utilities PledgeJS provides the standard set of server utilities for reading request data and controlling flow. - cookies() — read and set cookies - headers() — read request headers - searchParams() — read URL search params - params() — read route params - redirect() — redirect to another route - notFound() — render the 404 page - after() — schedule work after the response is sent - connection() — access the underlying connection - draftMode() — toggle draft mode --- # Framework Adapters PledgeJS is a full-stack, multi-framework web framework for building production websites and applications. TL;DR: PledgeJS is framework-agnostic. Set framework in pledge.config.ts and install the corresponding pledgestack-renderer-* package. React has full RSC support; Vue, Solid, and Svelte use SSR with hydration. Build with React, Vue, Solid, or Svelte using renderer adapters. ## Framework-Agnostic Core PledgeJS is framework-agnostic. The core runtime (routing, SSR, API routes, middleware, caching) works with any UI framework via renderer adapters. Set framework in pledge.config.ts and install the corresponding pledgestack-renderer-* package. | Framework | Package | RSC | SSR | Streaming | PPR | Status | | --- | --- | --- | --- | --- | --- | --- | | React | pledgestack-renderer-react | Yes | Yes | Yes | Yes | Full support | | Vue | pledgestack-renderer-vue | No | Yes | Partial | Yes | SSR + hydration | | Solid | pledgestack-renderer-solid | No | Yes | Partial | Yes | SSR + hydration | | Svelte | pledgestack-renderer-svelte | No | Yes | Partial | Yes | SSR + hydration | ## RSC is React-Only React Server Components are React-only. Other frameworks use standard SSR with hydration. Streaming for Vue/Solid/Svelte uses async SSR (no Suspense-style progressive streaming). React uses renderToPipeableStream with Suspense boundaries for true progressive streaming. ## PledgePack Framework Support PledgePack, the Rust+Zig bundler, supports additional frameworks through adapters. | Framework | Status | File Types | | --- | --- | --- | | React | Full | .tsx, .jsx, Fast Refresh, automatic JSX runtime | | Solid | Full | .tsx, .jsx, automatic JSX with solid-js | | Vue | Transform | .vue (SFC), scoped CSS, script setup | | Svelte | Transform | .svelte (SFC), scoped CSS, render functions | | Astro | Transform | .astro, frontmatter, islands-ready | | Next.js | Adapter | App Router, Pages Router, API routes, SSR | | TanStack | Adapter | File-based routing, route tree generation | | PledgeJS | Adapter | React frontend + Rust backend, .rs/.psx | | Vanilla TS/JS | Full | .ts, .js, .mjs | --- # Configuration PledgeJS is a full-stack, multi-framework web framework for building production websites and applications. TL;DR: PledgeJS is configured via pledge.config.ts using defineConfig(). Key options include framework (react/vue/solid/svelte), rsc, ppr, bundler, securityHeaders, i18n, and CDN settings. Configure PledgeJS with pledge.config.ts. ## defineConfig Use defineConfig from pledgestack for type-safe configuration with IDE autocompletion. The native binary reads this file directly. ``` import { defineConfig } from 'pledgestack'; export default defineConfig({ appDir: 'app', publicDir: 'public', outDir: '.pledge', defaultRuntime: 'node', framework: 'react', // 'react' | 'vue' | 'solid' | 'svelte' rsc: true, // React Server Components (React only) ppr: false, // Partial Prerendering tailwind: true, output: 'standalone', // 'standalone' | 'export' bundler: 'pledgepack', // 'pledgepack' | 'vite' | 'rollup' | 'turbopack' | 'rsbuild' | 'webpack' securityHeaders: true, // Auto-apply security headers siteUrl: 'https://example.com', // for sitemap, robots.txt, canonical URLs }); ``` ## Security Configuration Configure CSP directives and CORS for API routes. Security headers (X-Content-Type-Options, X-Frame-Options, X-XSS-Protection, Referrer-Policy, Permissions-Policy, HSTS) are auto-applied by default. ``` export default defineConfig({ securityHeaders: true, csp: { 'default-src': "'self'", 'script-src': "'self' 'unsafe-inline'", 'style-src': "'self' 'unsafe-inline'", 'img-src': "'self' data: https:", }, cors: { origins: ['https://example.com'], methods: ['GET', 'POST', 'PUT', 'DELETE'], }, }); ``` ## i18n Configure internationalization with locales, a default locale, and a locale prefix strategy. ``` export default defineConfig({ i18n: { locales: ['en', 'fr', 'es'], defaultLocale: 'en', localePrefix: 'always', // 'always' | 'as-needed' }, }); ``` ## CDN Purge & Geo-Restriction Configure CDN cache purging on post-build, and country-based access restriction at the edge (Cloudflare, Vercel, and Deno adapters). paths is required for the CDN purge — without it, the purge step is skipped with a warning instead of running. ``` export default defineConfig({ cdn: { provider: 'cloudflare', zoneId: process.env.CDN_ZONE_ID, token: process.env.CDN_API_TOKEN, paths: ['/', '/blog'], }, geoRestriction: { mode: 'block', // 'block' | 'allow' countries: ['KP'], // ISO country codes }, }); ``` ## Cargo Configuration Control Rust compilation settings for native addons. ``` export default defineConfig({ cargo: { dev: { optLevel: 1, incremental: true }, release: { optLevel: 3, lto: true, strip: true }, }, }); ``` ## Config Resolution Order PledgeJS resolves configuration in the following order: - pledge.config.ts - pledge.config.js - pledge.config.mjs - pledge.json - defaults ## Environment Variables Pledge loads .env files with the following precedence (highest first): .env.[mode].local, .env.[mode], .env.local, .env. Variables are injected via import.meta.env.*. ``` const apiUrl = import.meta.env.PLEDGE_API_URL; const isDev = import.meta.env.PLEDGE_DEV; ``` --- # Deploying PledgeJS is a full-stack, multi-framework web framework for building production websites and applications. TL;DR: Deploy PledgeJS apps anywhere: Node.js servers, Docker containers, static exports, or edge runtimes. Run pledge build then pledge serve, or use pledge docker --optimized for a Rust-addon-aware multi-stage build. Take your PledgeJS application to production. ## Production Build Running the build command compiles and optimizes your app for production using the PledgePack bundler, generating static assets and server bundles where applicable. ``` pledge build pledge serve ``` ## Docker Use pledge docker to generate a Dockerfile, .dockerignore, and docker-compose.yml tailored to your PledgeJS project. Add --optimized for a Rust-addon-aware multi-stage build that compiles the native addons in a dedicated stage and ships only the resulting .node/.so files, rather than a Rust toolchain, in the runtime image. ``` pledge docker pledge docker --optimized ``` ## Hosting Options A PledgeJS app can be deployed to any Node.js server, a Docker container, or a static export, depending on which features your routes rely on. The standalone output mode produces a self-contained server bundle. - standalone — self-contained server bundle for any Node.js host - export — fully static output for CDN/static hosting - Docker — containerized deployment with generated Dockerfile ## Edge Runtime PledgeJS supports edge runtime deployment. Multi-region edge caching with invalidation is built in. Not every workload is a good fit for the edge — routes with heavy, region-locked dependencies are often better left on a traditional server runtime. ## Deployment Adapters Platform adapters wrap the PledgeJS edge handler for each deployment target. Every adapter runs the same edge security pipeline — rate limiting, bot detection, geo restriction, and config-driven CSP — so a request is treated identically regardless of platform. Secrets resolve through the platform's native store: Cloudflare env bindings, Vercel Edge Config, or Deno KV. ``` // Vercel Edge — export as the edge entry import { createVercelEdgeHandler } from 'pledgestack/adapters/vercel'; export default createVercelEdgeHandler({ config }); // Deno Deploy import { createDenoHandler } from 'pledgestack/adapters/deno'; Deno.serve(createDenoHandler({ config })); ``` | Platform | Entry Point | Import Path | | --- | --- | --- | | Cloudflare Workers / Pages | createCloudflareAdapter | pledgestack/adapters/cloudflare | | Vercel Edge | createVercelEdgeHandler | pledgestack/adapters/vercel | | Deno Deploy | createDenoHandler | pledgestack/adapters/deno | | Netlify Functions | createNetlifyHandler | pledgestack/adapters/netlify | | AWS Lambda / API Gateway | createLambdaHandler | pledgestack/adapters/lambda | | Azure Functions / Static Web Apps | createAzureHandler | pledgestack/adapters/azure | | Google Cloud Functions | createGcloudHandler | pledgestack/adapters/gcloud | | Fastly Compute | createFastlyHandler | pledgestack/adapters/fastly | | Supabase Edge Functions | createSupabaseHandler | pledgestack/adapters/supabase | ## Health Checks Before deploying, run pledge doctor to verify your Rust toolchain, Cargo, environment, and production readiness. ``` pledge doctor ``` --- # PledgePack Bundler PledgeJS is a full-stack, multi-framework web framework for building production websites and applications. TL;DR: PledgePack is the default bundler and dev server for PledgeJS, written in Rust and Zig. It uses Oxc for transforms, Lightning CSS for styles, and a Zig C ABI for hot-path file I/O. It replaces Vite, webpack, and Rollup with a single native toolchain. The Rust + Zig bundler and dev server that powers PledgeJS. ## Architecture PledgePack is a Rust + Zig bundler and dev server. It uses Oxc for transforms, Lightning CSS for styles, Axum for the dev server, and a Zig C ABI for hot-path file I/O and SIMD scanning. The Rust orchestrator handles the engine, resolver, cache, dev server, optimizer, and JS plugin host. The Zig layer handles file I/O, module graph, SIMD scanning, hashing, and memory-mapped I/O. ## Project Structure PledgePack is organized as a Rust workspace with a Zig native library. ``` pledgepack/ ├── Cargo.toml # Rust workspace ├── build.zig # Zig build script ├── package.json # npm package (bin: pledgepack, pledge) ├── native-sys/ # Rust FFI bindings to Zig │ └── zig/ # Zig native library │ ├── io.zig # File I/O (mmap, thread pool) │ ├── graph.zig # Arena-allocated module graph │ └── simd.zig # SIMD source scanning ├── crates/ │ ├── cli/ # CLI entry point (binary: pledge) │ ├── core/ # Engine, config, transform pipeline │ ├── cache/ # Function-level incremental cache │ ├── resolver/ # Module resolution │ ├── dev-server/ # Dev server + HMR + error overlay │ ├── optimizer/ # Tree shaking, code splitting │ ├── js-plugin-host/ # Vite-compatible JS plugin API (QuickJS) │ ├── wasm-plugin-host/ # WebAssembly plugin host │ ├── adapter-react/ # React JSX + Fast Refresh │ ├── adapter-solid/ # Solid.js JSX adapter │ ├── adapter-next/ # Next.js adapter │ ├── adapter-tanstack/ # TanStack Router adapter │ ├── adapter-pledgestack/ # PledgeStack adapter │ └── task-system/ # Parallel task execution engine └── docs/ ``` ## Prerequisites Building PledgePack from source requires Rust (stable, edition 2024) and Zig (0.14.0+). ``` git clone https://github.com/pledgeandgrow/pledgepack cd pledgepack # Build Zig native library zig build -Doptimize=ReleaseFast # Build Rust cargo build --release ``` ## Transform Pipeline The transform pipeline lives in crates/core/src/transform/ and is split into focused submodules. - js.rs — JS/TS/JSX via Oxc, React Fast Refresh, dynamic import detection - css.rs — Lightning CSS, CSS Modules, PostCSS/Tailwind, Sass/SCSS - assets.rs — JSON, static assets, WASM, shaders - sfc.rs — Vue, Svelte, Astro Single-File Components - env.rs — Environment variables, define, import.meta.glob - data.rs — MDX, GraphQL, YAML, CSV, TSV, TOML - utils.rs — Source maps, Web Worker import transforms --- # PledgePack CLI PledgeJS is a full-stack, multi-framework web framework for building production websites and applications. TL;DR: The pledgepack CLI (alias: pledge) provides dev, build, serve, create, analyze, and migrate commands. It can be used standalone without PledgeJS. The pledgepack CLI for bundling, dev server, and scaffolding. ## Installation PledgePack can be installed globally or as a dev dependency. The CLI command is pledge (alias: pledgepack). ``` # Global install npm install -g pledgepack # Or as a dev dependency npm install --save-dev pledgepack ``` ## Development Server Start the dev server with HMR, custom ports, auto-open browser, or HTTPS. ``` pledgepack dev # Start on port 3000 pledgepack dev --port 8080 # Custom port pledgepack dev --open # Auto-open browser pledgepack dev --https # HTTPS with self-signed certs ``` ## Production Build Build for production with optional watch mode, profiling, type checking, and bundle size budgets. ``` pledgepack build # Build to dist/ pledgepack build --watch # Watch mode pledgepack build --profile # Profile build phases pledgepack build --type-check # TypeScript type checking pledgepack build --check-budgets # Bundle size budgets ``` ## Project Scaffolding Create new projects with framework-specific templates. ``` pledgepack create react my-app pledgepack create vue my-app pledgepack create svelte my-app pledgepack create solid my-app pledgepack create next my-app pledgepack create tanstack my-app pledgepack create pledgestack my-app pledgepack create vanilla my-app pledgepack create my-app # Defaults to pledgestack ``` ## Other Commands PledgePack includes commands for testing, benchmarking, analysis, caching, and more. | Command | Description | | --- | --- | | pledgepack serve | Serve static files on port 4000 | | pledgepack preview | Alias for serve | | pledgepack test | Run tests (Vitest-compatible API) | | pledgepack bench | Benchmark build performance | | pledgepack analyze --graph | Bundle analyzer with dependency graph | | pledgepack dashboard | Build telemetry dashboard | | pledgepack cache clear | Clear disk cache | | pledgepack cache stats | Show cache statistics | | pledgepack doctor | Diagnose build issues | | pledgepack init | Add PledgePack to existing project | | pledgepack migrate | Migrate from Vite/webpack/CRA | | pledgepack schema | Generate JSON Schema for config | | pledgepack playground | Interactive transform REPL | | pledgepack completions --shell bash | Shell completions | | pledgepack manpages | Generate man pages | === BLOG POSTS BELOW === # Introducing PledgeJS 0.1 Published: 2026-08-12 Author: PledgeJS Team Today we're releasing PledgeJS 0.1 — a full-stack multi-framework web framework with file-based routing, SSR/SSG/ISR, server components, API routes, middleware, edge runtime support, and Rust native addons for rendering, compression, search, rate limiting, and more. PledgeJS is framework-agnostic. The core runtime works with React, Vue, Solid, and Svelte via pluggable renderer adapters. Set framework in pledge.config.ts and install the corresponding pledgejs-renderer-* package. It uses PledgePack — a Rust+Zig bundler built with Oxc for transforms, Lightning CSS for styles, Axum for the dev server, and a Zig C ABI for hot-path file I/O and SIMD scanning — to build user apps. With 90 test files, 810 tests, and 39 packages all passing, this is a solid foundation. We're excited to see what you build with it. --- # PledgeJS 0.1.1 — Real Type-Checking, RSC Streaming, and a CSRF Hardening Fix Published: 2026-08-19 Author: PledgeJS Team This release is about correctness, not new features. While auditing the framework end to end, we found that the monorepo's own type-checking — both in CI and in pnpm typecheck — was only ever validating two small ambient declaration files, never the ~500 real source files across every package. Once we fixed that gap and ran a real check, 166 pre-existing type errors surfaced at once. The most serious was in the Cloudflare Workers adapter: it called the edge rate-limiting, bot-detection, and geo-restriction functions with the wrong arguments and didn't even compile against its own edge-security module. It's fixed now, and geo-restriction is exposed as a proper geoRestriction option on defineConfig. RSC streaming (renderRSCStream) generated a real flight payload and then discarded it, silently falling back to plain HTML — the client now receives flight chunks progressively as they're produced, instead of the whole response waiting on a blob that was never actually sent. The Rust SSR acceleration path in the React renderer also had a broken addon path that meant it could never engage even when the native addon was compiled; that's fixed too. On the security side, CSRF protection previously treated a request that omitted the Sec-Fetch-Site header as same-site by default — which meant a forged cross-origin request could skip Origin validation just by not sending that header. It now falls through to Origin validation instead, matching the behavior you'd expect. Smaller fixes: the AWS Lambda adapter now handles both API Gateway payload formats (v1 and v2 — the SAM template we generate uses v2 by default, but the handler was only ever reading v1 fields), create-pledge-app no longer copies React-only starter templates into a Vue/Solid/Svelte scaffold, cdn/cors/csp are now real typed fields on PledgeConfig instead of being read through unchecked casts, and pledge docker --optimized exposes the Rust-addon-aware multi-stage Dockerfile that already existed internally but was never wired into the CLI. Full details, including every fixed file, are in the CHANGELOG. 90 test files, 810 tests, still all green — plus a workspace type-check that now actually means something.