hn.today

Show HN: OJ – A drop-in replacement for Vite in Rust

github.com10 points0 comments
Screenshot of Show HN: OJ – A drop-in replacement for Vite in Rust

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).

Read on github.com0 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Programming

Code Scans

Code Scans

Devin introduces Code Scans, a tool that helps teams identify and implement codebase improvements based on engineering goals. It uses parallel investigation and automates pull requests, saving time and enhancing software quality. (devin.ai)

Bend

Bend

Bend is a high-speed programming language that emphasizes correctness through proofs and laws, ensuring AI-generated code is error-free. It compiles to native code, runs parallel across multiple cores or GPUs, and verifies AI adherence to rules with rapid type checking and proof systems. (bend-lang.com)

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.