Cloudflare Rewrites Next.js: The AI-Driven Shift in Commercial Open Source

Cloudflare Rewrites Next.js: The AI-Driven Shift in Commercial Open Source

Introduction

The recent announcement by Cloudflare that they have rewritten Next.js in just one week with the help of AI has sent shockwaves through the developer community. This achievement, which would have taken years of engineering time without AI, raises important questions about the future of commercial open source software and the role of AI in software development.

The Next.js Ecosystem: A Recap

Next.js is the most popular full-stack React framework, with close to half of all React developers using it. The best place to deploy Next.js applications is on Vercel, thanks in part to its proprietary build output. However, this proprietary format makes it difficult for other hosting providers to deploy Next.js applications without relying on undocumented APIs that can introduce breaking changes.

The State of JS 2025 survey reveals that the most popular build tools in the web ecosystem are Vite, Webpack, Turbopack, and Bun. Vite is the most popular choice for new projects due to its speed and developer experience, while Turbopack is optimized for larger Next.js applications.

What Cloudflare Did With Next.js

Cloudflare replaced the build engine in Next.js with Vite, creating a new package called vinext. This allows Next.js applications to be easily deployed on Cloudflare's infrastructure. The project is experimental and not guaranteed to work, but it demonstrates the potential of AI in software development.

AI Brings the Impossible Within Reach

Cloudflare claims that one engineer used AI to rebuild Next.js from scratch in just one week, at a cost of $1,100 in tokens. The resulting vinext project is a drop-in replacement for Next.js, built on Vite, that deploys to Cloudflare Workers with a single command. Early benchmarks show that it builds production apps up to 4x faster and produces client bundles up to 57% smaller.

The vinext project has 67,000 lines of code, compared to Next.js' 194,000 lines of code. This leaner implementation does not need to support legacy Next APIs and currently supports 94% of the Next.js API.

The Implications of AI-Driven Software Development

The Cloudflare announcement has significant implications for the future of commercial open source software. With AI, the cost of rewriting existing software has become ~100x cheaper, and maintenance is likely to be much cheaper as well. This raises questions about the value proposition of commercial open source software and the role of AI in software development.

"AI Slop" Still an Issue

While the Cloudflare announcement is impressive, there are concerns about the quality of vinext. Vercel has criticized vinext for being insecure and unfit for production usage. The vinext project is still experimental and requires cleanup and auditing to make it production-ready.

Conclusion

The Cloudflare rewrite of Next.js with AI is a significant event with major potential ripple effects. It demonstrates the power of AI in software development and raises important questions about the future of commercial open source software. As AI continues to evolve, we can expect to see more innovations in software development, and the lines between what is possible and what is not will continue to blur.