How we rebuilt Next.js with AI in one week (opens in new tab)
Vinext is an experimental, Vite-based reimplementation of Next.js built in one week by one engineer and an AI model. It preserves much of Next.js’s API and project structure while avoiding the fragile process of adapting Next.js/Turbopack output for serverless platforms. Early results suggest builds can be up to 4× faster, client bundles up to 57% smaller, and Cloudflare Workers deployment can be handled with a single command.
The Deployment Challenges of Next.js
- Next.js provides an excellent developer experience but relies on a bespoke build and deployment toolchain.
- Deploying to platforms such as Cloudflare, Netlify, or AWS Lambda requires reshaping Next.js output.
- OpenNext addresses this problem but must reverse-engineer build artifacts, making it vulnerable to changes between Next.js versions.
- Next.js’s planned adapters API improves deployment support but does not solve the underlying Turbopack dependency.
next devruns only in Node.js, making it difficult to develop against platform-specific APIs such as Durable Objects, KV, and AI bindings.
Vinext’s Vite-Based Architecture
- Vinext reimplements the Next.js API surface directly on Vite rather than wrapping or adapting Next.js output.
- Existing
app/,pages/, andnext.config.jsfiles can be reused. - Developers install it with
npm install vinextand replacenextscripts withvinext. - It supports:
- Routing
- Server-side rendering
- React Server Components
- Server actions
- Caching
- Middleware
- Hot module replacement
- Vite’s Environment API allows the output to run across different platforms.
Early Performance Results
- Benchmarks compared vinext with Next.js 16 using the same 33-route App Router application.
- Type checking and ESLint were disabled for Next.js to focus on compilation and bundling.
- Static pre-rendering was disabled with
force-dynamicfor a fairer comparison. - Early results showed:
- Production builds up to 4× faster
- Gzipped client bundles up to 57% smaller
- The results measure build performance, not serving performance, and come from a single test application.
- The authors describe the figures as directional because both vinext and its supporting tools are still evolving.
- Vite’s architecture and the upcoming Rust-based Rolldown bundler are identified as major sources of potential performance gains.
Cloudflare Workers Deployment
vinext deploybuilds the application, generates Worker configuration, and deploys it automatically.Both the App Router and Pages Router are supported.
Applications retain client-side hydration, interactive components, navigation, and React state.
A Cloudflare KV cache handler provides Incremental Static Regeneration:
import { KVCacheHandler } from "vinext/cloudflare"; import { setCacheHandler } from "next/cache"; setCacheHandler(new KVCacheHandler(env.MY_KV_NAMESPACE));The cache layer is pluggable, allowing alternatives such as R2 or future Cache API improvements.
Because development and deployment can both run in
workerd, applications can use Durable Objects, AI bindings, and other Cloudflare services without Node.js compatibility workarounds.
Broader Ecosystem Potential
- Although Cloudflare Workers is the initial target, roughly 95% of vinext is platform-independent Vite code.
- Its routing, SSR pipeline, module shims, and React Server Components integration are not Cloudflare-specific.
- A proof of concept reportedly ran on Vercel in under 30 minutes.
- The project is open source and invites other hosting providers to contribute deployment targets.
Experimental Status
- Vinext is less than a week old and has not been tested under meaningful production-scale traffic.
- The authors recommend caution before adopting it for critical applications.
- Its test suite already includes more than 1,700 Vitest tests and 380 Playwright end-to-end tests, including tests ported from Next.js and OpenNext.
- The project reportedly cost approximately $1,100 in AI-token usage to build.
Vinext is best viewed as a promising experimental alternative rather than a drop-in replacement ready for every production workload. Teams interested in platform-native development and faster Vite-based builds can evaluate it carefully, while waiting for broader compatibility and real-world validation.