Skip to content

SYSTEM Cited by 1 source

vinext

vinext ("vee-next", github.com/cloudflare/vinext) is a drop-in replacement for Next.js built on top of Vite as a plugin, deployable to Cloudflare Workers with a single vinext deploy command. Announced 2026-02-24, ~1 week after the first commit.

npm install vinext
# replace "next" with "vinext" in package.json scripts
vinext dev     # HMR dev server
vinext build   # production build
vinext deploy  # build + deploy to Cloudflare Workers

Existing app/, pages/, and next.config.js work as-is.

Architecture

vinext is not a wrapper around Next.js / Turbopack output — contrast OpenNext. It is a clean reimplementation of the Next.js API surface as a Vite plugin: routing, server rendering, React Server Components, server actions, caching, middleware, file-system routing. ~95 % is pure Vite — none of it Cloudflare-specific. Canonical wiki instance of patterns/clean-reimplementation-over-adapter.

Deployment

  • Primary target: Cloudflare Workers. Both App Router and Pages Router supported. Full client-side hydration, interactive components, client-side navigation, React state.
  • Cross-platform by Vite: Vite output runs on any platform via the Vite Environment API. PoC on Vercel took "less than 30 minutes."
  • Cloudflare Agents live example: next-agents.threepointone.workers.dev runs inside workerd during both dev and deploy — Durable Objects, AI bindings, and all Cloudflare-specific services available without getPlatformProxy workarounds.

Caching

Production caching for ISR is pluggable via setCacheHandler():

import { KVCacheHandler } from "vinext/cloudflare";
import { setCacheHandler } from "next/cache";
setCacheHandler(new KVCacheHandler(env.MY_KV_NAMESPACE));

KVCacheHandler is the default for most applications. R2 fits apps with large cached payloads. A forthcoming Cache-API-based alternative is named as roadmap. Canonical wiki instance of patterns/pluggable-cache-handler.

Traffic-aware Pre-Rendering (TPR)

vinext deploy --experimental-tpr queries Cloudflare zone analytics at deploy time and pre-renders only the URLs covering 90 % of real traffic. Example deploy log from the launch post:

Building...
Build complete (4.2s)
TPR (experimental): Analyzing traffic for my-store.com (last 24h)
TPR: 12,847 unique paths — 184 pages cover 90% of traffic
TPR: Pre-rendering 184 pages...
TPR: Pre-rendered 184 pages in 8.3s → KV cache
Deploying to Cloudflare Workers...

Resolves build time scales linearly with generateStaticParams() without coupling the build to the production database. Everything not pre-rendered falls back to on-demand SSR + ISR. Canonical wiki instance of concepts/traffic-aware-prerendering + patterns/traffic-aware-prerendering.

Benchmarks

33-route App Router fixture; Next.js configured with TypeScript + ESLint disabled and force-dynamic to isolate bundler + compilation time. Public methodology + historical results at benchmarks.vinext.workers.dev.

Framework Build time Gzipped bundle
Next.js 16.1.6 (Turbopack) 7.38 s 168.9 KB
vinext (Vite 7 / Rollup) 4.64 s (1.6×) 74.0 KB (56 % smaller)
vinext (Vite 8 / Rolldown) 1.67 s (4.4×) 72.9 KB (57 % smaller)

Measures compilation + bundling only, not serving performance. "Take them as directional, not definitive."

Testing + quality gates

"Almost every line of code in vinext was written by AI. But every line passes the same quality gates you'd expect from human-written code."

  • 1,700+ Vitest unit tests
  • 380 Playwright E2E tests
  • Tests ported from Next.js's own repo (attribution preserved) and OpenNext's Cloudflare conformance suite.
  • 94 % API coverage of Next.js 16.
  • Type checking via tsgo; linting via oxlint. CI runs all of it on every PR.
  • AI-agent code review on opened PRs; second agent addresses review comments. Browser-level testing via agent-browser.
  • Verified against the Next.js App Router Playground.

Canonical wiki instance of concepts/ai-agent-guardrails.

Build-cost numbers

  • ~$1,100 in Claude API tokens for the whole project.
  • 800+ sessions in OpenCode.
  • First commit 2026-02-13; basic App + Pages Router SSR + middleware + server actions + streaming same evening; App Router Playground rendering 10/11 routes day 2; vinext deploy working day 3; remainder of week spent hardening.
  • One engineer (engineering manager) directing AI.

Migration

Install via Agent Skill:

npx skills add cloudflare/vinext

Then in any supported AI coding tool (Claude Code, OpenCode, Cursor, Codex, …): "migrate this project to vinext." The skill handles compatibility check, dependency install, config generation, dev-server startup. Canonical wiki instance of patterns/migration-as-agent-skill.

Manual path:

npx vinext init    # migrate an existing Next.js project
npx vinext dev
npx vinext deploy

What's not supported (yet)

Customers

  • National Design Studio — beta site CIO.gov in production at publication time, "with meaningful improvements in build times and bundle sizes."

Caveats

  • Experimental, < 1 week old at announcement. "Proceed with appropriate caution" for production.
  • Benchmarks measure a single 33-route App Router app, not a representative sample.
  • Static-pre-rendering gap is significant for content-heavy sites today.
  • TPR is experimental + Cloudflare-specific (requires edge analytics).
  • @vitejs/plugin-rsc is itself "still early."

Seen in

Last updated · 200 distilled / 1,178 read