
Waku is a minimal React framework that offers a lightweight and enjoyable developer experience while supporting modern React 19 features such as server components and actions. It's ideal for building marketing sites, headless commerce, and web applications, though for large enterprise projects, a more comprehensive framework might be preferable.
Getting started with Waku involves using the create command with your preferred package manager, which scaffolds a new project with default settings. Common commands include waku dev for local development, waku build for production builds, and waku start to serve the production build locally. It requires Node.js version 20.19.0 or higher.
Waku introduces a flexible architecture where server components can perform async operations and securely fetch data, while client components can use React features like state and effects. The 'use client' directive is used to create server-client boundaries within components. Components can be shared between server and client, and server components can import client components to create boundaries.
Routing in Waku is file-based, located in ./src/pages, supporting static, dynamic, nested, and catch-all routes. Layouts can be nested and are created with _layout.tsx files, allowing for shared UI components like headers, footers, or sidebars. Routes can be grouped using parentheses for organizational purposes.
Waku supports static prerendering (SSG) and server-side rendering (SSR), with each page or layout specifying its render mode via a getConfig function. It also allows for static paths to be generated programmatically for dynamic routes.
Components called slices can be reused across pages and layouts, created in the _slices directory, and can be static, dynamic, or lazy-loaded. Slices enable component composition and can be nested or parameterized for dynamic content.
The framework provides a comprehensive API for programmatic routing, including creating pages, layouts, roots, and slices, with support for static and dynamic rendering modes. It also offers a server entry point (waku.server.tsx) for defining routes and components, and a client entry point (waku.client.tsx) for hydration.
Waku includes robust data fetching, mutation, and server action capabilities, allowing server-side logic to be executed securely from components. API routes are created in the _api directory, supporting various HTTP methods and dynamic segments.
Deployment options include Vercel, Netlify, Cloudflare Workers, Deno, Bun, and AWS Lambda, with specific adapters and configurations for each platform. Environment variables can be private or public, with public variables prefixed by WAKU_PUBLIC_.
The framework also handles metadata, head tags, and static assets, which can be placed in the public directory. It supports integrating with CSS frameworks like Tailwind CSS and customizing the HTML, head, and body tags via special root components.
Waku is actively developed and welcomes contributions and community participation. For more details, check out the documentation, join community channels, or contribute to the project.