OJ is a Rust-native build tool that acts as a drop-in replacement for Vite, focused on reducing memory use and improving cold/warm start latency for scenarios like CI, agent farms, and multi-tenant hosting. It runs production React apps without source changes, supports streaming SSR via renderToReadableStream with client hydration, and uses a small persistent Node module runner in dev to re-evaluate only changed server modules instead of rebuilding bundles per request. Plugin compatibility is maintained: Vite/Rollup-style plugins run through a persistent Node plugin host, OJ can read vite.config.{ts,js,mjs} or an oj.plugins.mjs, and it adopts relevant vite config fields and tsconfig path aliasing. It also has first-class support for TanStack Start apps and emits practical build artifacts (Node server.mjs, Cloudflare worker.mjs, content-hashed client assets, prerendered routes).
Benchmarks generated large React component trees (1k/5k/10k) and compared OJ (bundle and unbundled) with Vite and Vite’s experimental bundled mode. Bundle-mode OJ consistently beats Vite on cold start, warm start, and reload (up to 4-8x faster at 10k components) while HMR latency is comparable. The most striking gap is memory: OJ uses 43-115 MB vs Vite’s 361 MB-1.75 GB. Production builds are on par with Vite (same Rollup engine and byte-identical outputs).
Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.