Vinext: The AI-Built Next.js Replacement by Cloudflare That Changes Everything
Cloudflare built Vinext — a drop-in Next.js replacement on Vite — with AI in one week for $1,100. It delivers 4.4x faster builds, 57% smaller bundles, and one-command deploys to Workers. Here is everything you need to know.
The Problem Nobody Wanted to Say Out Loud
Next.js is the dominant React framework. Millions of developers build with it every day, and it has earned that position through a genuinely excellent developer experience. But beneath the surface, there has always been a quiet frustration in the broader serverless ecosystem: deploying Next.js outside of Vercel is hard — sometimes brutally hard.
The tooling is deeply bespoke. Next.js invested heavily in its custom compiler (Turbopack), and if you want to deploy to Cloudflare Workers, Netlify, or AWS Lambda, you cannot simply point and shoot. You have to take the build output and reshape it into something the target platform can run. That gap is exactly what OpenNext was designed to bridge — and while it works, it is essentially a game of whack-a-mole. Every Next.js release risks breaking the brittle reverse-engineering assumptions OpenNext relies on.
Cloudflare had been collaborating with the Next.js team on a first-class adapters API. It is still early. And even with adapters, you are still locked into the Turbopack toolchain. During development, next dev runs exclusively in Node.js with no way to plug in a different runtime — which means if your app uses platform-specific APIs like Durable Objects, KV, or Workers AI bindings, you cannot test that code locally without messy workarounds.
That frustration set the stage for an experiment: What if you did not adapt Next.js output — but simply reimplemented it?
What Is Vinext?
Vinext (pronounced vee-next) is Cloudflare's experimental, open-source reimplementation of the Next.js API surface, built entirely on top of Vite. It is not a wrapper around Next.js. It is not a fork. It is a clean re-implementation of the same developer-facing API — routing, server rendering, React Server Components, server actions, caching, middleware — delivered as a Vite plugin.
The result is a drop-in replacement. Your existing app/ directory, pages/ directory, and next.config.js work as-is. You swap one package for another:
npm install vinext
Then replace next with vinext in your package.json scripts:
vinext dev # Development server with HMR
vinext build # Production build
vinext deploy # Build and deploy to Cloudflare Workers
That is the entire migration for most applications. The CLI surface, the file-system routing conventions, the next/link, next/navigation, and next/image imports — all reimplemented and available through the vinext package.
The AI Angle: One Engineer, One Week, $1,100
What makes this story remarkable is not just the technical achievement — it is how fast it happened. A single Cloudflare engineer, using Claude Code as an AI development partner, built a working reimplementation of Next.js from scratch in roughly one week. The total cost in AI token spend: approximately $1,100.
The majority of the code, tests, and documentation in vinext were written by AI models. The repository even ships with an AGENTS.md file — a system-prompt-style document that instructs AI coding agents on how to contribute to the project, covering architecture conventions, testing expectations, and code quality gates.
This is not vibe-coded slop, though. The vinext team set up rigorous quality gates: continuous integration runs benchmarks on every merge to main, a shared 33-route test fixture validates both frameworks against the same workload, and the full benchmark history is public at benchmarks.vinext.workers.dev. The AI wrote the code, but the engineering discipline was very much human.
"It's 2026, and the cost of building software has completely changed." — Steve Faulkner, Cloudflare
The implications go beyond vinext itself. If one engineer can reimplement the most popular React framework in a week using AI assistance, it fundamentally changes what "competitive moats" mean in the framework ecosystem. Features that took years to build can now be re-created in days — the leverage is enormous.
Performance Benchmarks: The Numbers Are Real
Cloudflare tested vinext against Next.js 16 using a shared 33-route App Router application. The methodology was deliberately conservative: TypeScript type checking and ESLint were disabled in Next.js (Vite does not run these during builds), and force-dynamic was used so Next.js would not gain unfair time savings from pre-rendering static routes. Both frameworks were doing the same core work — compiling, bundling, preparing server-rendered routes.
Production Build Time
- Next.js 16.1.6 (Turbopack): 7.38 seconds (baseline)
- vinext (Vite 7 / Rollup): 4.64 seconds — 1.6x faster
- vinext (Vite 8 / Rolldown): 1.67 seconds — 4.4x faster
Client Bundle Size (gzipped)
- Next.js 16.1.6: 168.9 KB (baseline)
- vinext (Rollup): 74.0 KB — 56% smaller
- vinext (Rolldown): 72.9 KB — 57% smaller
The 4.4x build speed figure deserves a caveat: vinext currently pins to Vite 7 with Rollup. The 4.4x number reflects the upcoming Vite 8 with Rolldown — a Rust-based bundler that is still in development. The current production path (Vite 7) gives you a solid 1.6x build speedup and the same 56% bundle size reduction today.
Even so, the structural reasons for these advantages are sound. Vite is built around first-class ES modules and a clean separation between dev server and production bundler. It does not carry years of legacy architectural decisions the way Next.js does. When Rolldown lands in Vite 8, the performance story gets dramatically better.
Migrating from Next.js: A Practical Guide
For the majority of Next.js applications, migration to vinext is genuinely simple. Here is what the process looks like in practice.
Step 1: Swap the Package
npm uninstall next
npm install vinext
Step 2: Update package.json Scripts
// Before
{
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start"
}
}
// After
{
"scripts": {
"dev": "vinext dev",
"build": "vinext build",
"start": "vinext start"
}
}
Step 3: Your App Code Stays the Same
Your existing Next.js application code requires no changes for basic migration. App Router files, Pages Router files, layouts, loading states, error boundaries — all of it is supported as-is. Server components, client components, and the "use client" / "use server" directives all work.
Step 4: Deploy to Cloudflare Workers
vinext deploy
This single command handles everything: building the application, auto-generating the Worker configuration, and deploying to Cloudflare's global network. No wrangler.toml required upfront — vinext generates it for you.
Enabling Cloudflare-Specific Features
Once deployed on Workers, you unlock native Cloudflare bindings. For production caching with ISR (Incremental Static Regeneration), you can wire up the built-in KV cache handler:
import { KVCacheHandler } from "vinext/cloudflare";
import { setCacheHandler } from "next/cache";
setCacheHandler(KVCacheHandler);
For accessing Cloudflare bindings (KV, Durable Objects, Workers AI) inside Server Components and Server Actions:
import { getCloudflareContext } from "vinext/cloudflare";
export default async function Page() {
const { env } = await getCloudflareContext();
const value = await env.MY_KV.get("some-key");
return <div>{value}</div>;
}
This pattern is a significant improvement over the workarounds required with OpenNext — direct access to platform bindings from standard React Server Components, with full type safety.
Running on Node.js (Non-Cloudflare)
Vinext is not Cloudflare-only. Approximately 95% of its codebase is platform-agnostic Vite code. You can run it on any Node.js server:
vinext build
vinext start # Runs on Node.js, port 3000
Deployment to Vercel, Netlify, AWS, and Deno Deploy is available via the Nitro Vite plugin, with more native adapters planned.
What Is Currently Supported
Vinext covers a surprisingly broad surface area for a project built in a week:
- App Router — file-system routing, nested layouts, loading and error states,
generateMetadata - Pages Router —
getServerSideProps,getStaticProps,getStaticPaths, API routes - React Server Components — via
@vitejs/plugin-rsc - Server Actions —
"use server"functions, form actions - Caching — ISR,
"use cache", fetch cache, Cloudflare KV handler - Middleware —
middleware.tsat the root, with full request/response access - Next.js module imports —
next/link,next/navigation,next/image,next/headers,next/cookies - HMR in development — Vite fast hot module replacement
- Traffic-Driven Prerendering (TPR) — an experimental Cloudflare-exclusive feature that pre-renders pages based on actual traffic analytics
Limitations and Honest Caveats
Vinext is explicitly experimental and under heavy development. Before reaching for it in production, teams should be aware of several important constraints.
Incomplete compatibility. While the core API surface is implemented, some edge cases and advanced Next.js features may not behave identically. Applications that rely on undocumented Next.js internals, or that use @next/mdx, next-auth, or other deeply coupled third-party integrations, may require additional work.
The 4.4x speed claim needs context. The headline 4.4x figure is tied to Vite 8 with Rolldown, which is not yet production-ready. The real-world speedup today is 1.6x — still meaningful, but less dramatic than the headline.
No official Vercel-specific feature support. By definition, vinext is not Next.js. If your team is deeply invested in Vercel's Next.js-specific features — like Vercel's ISR infrastructure, Edge Config, or Vercel Middleware integrations — you may find gaps.
Community and ecosystem maturity. Next.js has years of tutorials, libraries, and StackOverflow answers. Vinext is weeks old. Expect to encounter rough edges that require upstream issue reports or workarounds.
AI-generated code risks. The codebase was largely written by AI models, which can introduce subtle bugs or inconsistencies. The CI benchmarks and test suite help, but comprehensive production hardening takes time that a week-old project simply has not had yet.
The Bigger Picture: What This Means for Next.js Alternatives
Vinext is part of a broader shift happening across the frontend ecosystem. Vite has effectively won the build tool wars — Astro, SvelteKit, Nuxt, Remix, and now vinext all build on it. The question is no longer whether Vite will displace proprietary toolchains, but when.
The AI dimension makes this shift accelerate in ways that are hard to predict. Cloudflare proved that a full framework reimplementation is now a week-long project for one engineer. The same playbook could be applied to anything: a Vite-native Remix, a fresh competitor to Next.js designed from the ground up around edge-native constraints, or entirely new frameworks we have not imagined yet.
Vercel, for its part, has a commercial incentive to keep Next.js on Turbopack and tightly coupled to its platform. That is a legitimate business model. But for developers who want full portability — to deploy identically on Cloudflare, AWS, bare metal, or their laptop — vinext points toward a compelling future: the same developer experience, without the platform lock-in.
The OpenNext project will likely continue to exist as a compatibility shim for teams already running Next.js in production who cannot switch. But for new projects, or teams willing to accept some experimental roughness, vinext is a serious option worth evaluating today.
Getting Started
Vinext is open source and available now. Adding it to an existing Next.js project is a two-minute exercise:
npm uninstall next
npm install vinext
For new projects:
npx create-vinext-app my-app
The full source, documentation, and live benchmark results are available at github.com/cloudflare/vinext. Cloudflare's official blog post — "How we rebuilt Next.js with AI in one week" by Steve Faulkner — is worth reading in full for the engineering rationale and architecture decisions behind it.
Vinext is not ready to replace Next.js for every production workload today. But it is already running in production for some Cloudflare customers, the benchmark trajectory is impressive, and the core insight — that the Next.js API surface is something that can and should be decoupled from any single toolchain or platform — feels correct.
Sometimes the most disruptive projects start as week-long experiments. Keep an eye on this one.
Admin
Cal.com
Open source scheduling — self-host your booking system, replace Calendly. Free & privacy-first.
Comments (0)
Sign in to comment
No comments yet. Be the first to comment!