What each part runs on, how you use it, and where the speed comes from. Code is from the local branch; numbers are from bench/lean-fe on an M4 Mac, measured on the real Povio Diagrams app ported over.
It is React. Not HTML, not HTMX. React 19 with React DOM and react-router on the web; React Native with Expo Router on iOS and Android. Pages are normal React components with hooks and state.
The app itself renders as fast as any React app. What got faster is everything around React: how the bundle is built, how the dev server starts and reloads, and how few steps sit between a page file and the browser.
| Part | What runs it | Instead of (Povio Diagrams today) |
|---|---|---|
| UI | React 19, React DOM | same |
| Routing | react-router 6.30, routes made from src/pages at build time | TanStack Router + generated route tree |
| Bundler | Bun.build (native, written in Zig), called in-process | Vite 8 + Rolldown + plugins |
| CSS | Tailwind v4 through @tailwindcss/node + oxide (Rust scanner) | @tailwindcss/vite |
| Hot reload | Bun's reactFastRefresh transform + our chunk differ | Vite HMR |
| API client | Hooks generated from robodev/api/**, types from the Robodev SDK | OpenAPI spec → codegen client |
| Data cache | ~350 lines on useSyncExternalStore | TanStack Query |
| Auth | Built in: export const auth = "required" | hand-written guards + glue |
| Mobile | React Native + Expo Router + Metro, driven by robodev mobile | a separate app |
| E2E | pyro, run by robodev test | Playwright setup |
No router config. Each file under src/pages is a page; its default export is the component. Optional named exports set auth and the tab title.
src/pages/
_layout.tsx → wraps every page
index.tsx → /
todos/index.tsx → /todos
todos/[id].tsx → /todos/:id
(info)/about.tsx → /about (group, no URL part)
board/[id].native.tsx → phone-only version
import { type PageProps } from "@robodev-ai/app";
import { useGetTodosById } from "../../api.gen";
export const auth = "required"; // login redirect
export const title = "Todo";
export default function TodoDetail(
{ params }: PageProps<{ id: string }>
) {
const todo = useGetTodosById(params);
...
}
At build time Robodev writes the entry file you'd normally write yourself. Each page becomes a lazy import(), so each page is its own chunk:
// Generated by Robodev from src/pages. Do not edit; add pages instead.
import { createApp } from "@robodev-ai/app";
import app from "/…/src/app.ts";
import "/…/src/app.css";
createApp({
app,
pages: {
"_layout.tsx": () => import("/…/src/pages/_layout.tsx"),
"index.tsx": () => import("/…/src/pages/index.tsx"),
"todos/[id].tsx": () => import("/…/src/pages/todos/[id].tsx"),
},
});
createApp turns that map into react-router routes with lazy loaders:
const lazy = async () => {
const mod = await pages[file]!();
const page = asPage(mod, file); // reads default + auth/title/render exports
return { element: <PageView page={page} file={file} /> };
};
return spec.index ? { index: true, lazy } : { path: spec.path, lazy };
...
const router = createBrowserRouter([...extra, rootRoute]);
The route table is a plain string generated in a few milliseconds. There's no route-tree codegen pass, no server bundle and no prerender step. The browser loads the entry, then only the layout and the page it is on.
The backend is files in robodev/api. Each exported get/post/patch/del becomes a hook in src/api.gen.ts. No endpoint strings and no types written by hand.
export const get = defineApi({
auth: "required",
query: z.object({
status: z.enum(["all","open","done"]).optional(),
}),
handler: async (ctx) => {
const rows = await ctx.db.select()
.from(todos)
.where(eq(todos.userId, ctx.user!.id));
return rows.map(toTodo);
},
});
export const post = defineApi({
body: z.object({ title: z.string().min(1) }),
handler: ...
});
import { useGetTodos, usePostTodos }
from "../../api.gen";
const todos = useGetTodos({
query: { status }, // checked against the zod schema
});
const create = usePostTodos();
todos.data // Todo[], from what the handler returns
todos.loading
await create.mutate({ title }); // refetches /api/todos
import type * as api0 from "../robodev/api/todos";
export function useGetTodos(
options?: ApiHookOptions<typeof api0.get>) {
return useApi<typeof api0.get>("/api/todos", options);
}
HandlerResponse<TResult> in the SDK), with error envelopes like { status, body } removed.import type only: the TypeScript compiler drops these imports, so no server code or database driver reaches the browser or the phone.robodev dev watches robodev/api and rewrites the file within 50 ms of a change. mobile, test, deploy and the hosted build regenerate it too.Generating the hooks is string work, around a millisecond, with no OpenAPI spec and no codegen CLI. At runtime it is a thin wrapper around fetch and useSyncExternalStore, not a query library.
robodev dev, robodev deploy and the hosted build all go through buildApp, which makes one Bun.build call inside the CLI process:
await writeApiHooks(root); // layer 2
const entrySource = generateAppEntry({ paths, ... }); // layer 1
result = await bun.build({
entrypoints: [input.entry],
format: "esm",
target: "browser",
splitting: true, // a chunk per page
minify: production,
sourcemap: production ? "none" : "linked",
jsx: { runtime: "automatic", importSource: "react" },
...(hmr ? { reactFastRefresh: true, metafile: true } : {}),
define, // import.meta.env.*
plugins: [appPlugin({ tailwind: await loadTailwind(bun, root) })],
});
Tailwind runs inside that same call. The CSS plugin loads the project's own @tailwindcss/node compiler and @tailwindcss/oxide, a Rust scanner that finds class names in the source. The compiled CSS is reused when no class names changed.
index.html; lean does neither.| Production build, Povio Diagrams | Cold | Warm median |
|---|---|---|
Vite (vite build --mode robodev) | 2,760 ms | 2,275 ms |
Lean (buildApp, minified, split) | 267 ms | 192 ms |
| Output JS, gzip | Vite 1.79 MB · lean 1.85 MB (+3%; mostly mermaid in both) | |
So the output is about the same size. It isn't fast because it ships less; it's fast because it builds faster.
/**
* The dev build runs Bun's reactFastRefresh transform and writes chunks under stable
* names (/__robodev/src/pages/todos.js, no content hash). After each rebuild
* planHotUpdate compares the new output with the last good one:
* - changed chunks, plus every chunk that statically imports one of them, are re-run
* as copies under /__robodev/hot/<gen>/
* - when that set reaches the entry chunk (React, the router, src/app.ts) the page reloads
* - CSS swaps in place.
*/
Chunks are renamed so a name depends only on what's inside. An edit to one page changes one chunk, not every hashed file name, so the browser re-runs just that chunk and React Fast Refresh swaps the component in place.
| Dev | Vite | Lean |
|---|---|---|
| Start → login page ready in the browser | 1,425 ms (no backend) | 848 ms (with Postgres + backend) |
| Requests to load the page | 181 | 20 |
| Edit → visible, state kept (Diagrams) | 185 ms | 221 ms |
| Edit → visible, state kept (lean starter) | – | 77 ms |
| /auth, same static server | Vite build | Lean build |
|---|---|---|
| Requests | 17 | 14 |
| Transferred (gzip) | 199 KB | 187 KB |
| Localhost: form mounted | 546 ms | 38 ms |
| 10 Mbps / 40 ms RTT: form mounted | 774 ms | 341 ms |
Read this one carefully. The original's ~520 ms gap between "loaded" and "ready" is constant across runs and matches TanStack Router's default 500 ms pending time (pendingMinMs). That's our reading of the numbers; we haven't profiled it. It's a router setting, not something Vite causes, so the original could close most of that gap by changing it.
robodev mobile generates an Expo Router app from src/pages. Each screen is a two-line re-export, so the page stays the single source:
import { screen } from "@robodev-ai/app/native";
import * as page from "../../../src/pages/todos/[id]";
export default screen(page, "todos/[id].tsx");
robodev mobile # iOS simulator
robodev mobile --android # Android emulator
robodev mobile --tunnel # QR code for a real phone
robodev mobile --headless --logs # for agents
@robodev-ai/app resolves to the React Native build on the phone, so Stack, Text, Button and the generated hooks work unchanged.board/[id].native.tsx over board/[id].tsx on the phone. Write one only where the screen needs to differ.adb reverse, the LAN and the tunnel only ever expose that one port.screen() keeps one stable wrapper per file, so an edit swaps the page in place and keeps its state.No Xcode project and no Android Studio build: it runs in Expo Go with Metro, so the app is running about 4 s after the command when the simulator is already booted.
| Step | Usual setup | Lean | Main reason |
|---|---|---|---|
| Production build | 2.3 s | 0.19 s | native bundler in-process, no server bundle or prerender |
| Dev start → page | 1.4 s | 0.85 s | bundled chunks: 20 requests, not 181; backend included |
| Page ready | 546 ms | 38 ms | probably the router's 500 ms pending default (not profiled) |
| Hot reload | 185 ms | 221 ms | lean rebuilds the whole bundle |
| API client | codegen step | none | types read straight from the routes |