Next.js Comparison
Vike differs from Next.js in three fundamental ways:
- Vike is UI Framework agnostic.
Vike is completely agnostic to React and its source code has zero dependency on React. You can actually use Vike with any other UI Framework (Vue, Preact, Solid, etc.).
With Vike, you implement and fully control the React integration, which has many benefits. For example, you can use Relay in the same way that Facebook does (with a render-as-you-fetch stream) which isn't possible with Next.js.
- Vike is server and deployment agnostic.
With Vike, you keep full control over your server and you can use any deployment strategy.
- Vike is full-fledged yet minimal.
All dependencies are either shared with Vite (e.g. fast-glob
) or fully/transitively owned (e.g. @brillout/json-serializer
). Adding Vike to your Vite app doesn't add any frivolous dependency.
We believe Vike hits the sweet spot of being a full-fledged frontend tool while avoiding unnecessary bells and whistles.
Beyond these structural differences,
Vike introduces features such as blazing fast HMR (powered by Vite), first-class SPA support (especially with the upcoming new Vike design), Domain-driven File Structure, state-of-the-art Code Splitting (powered by Vite/Rollup), Automatic Deployment Synchronization, Build Your Own Framework, etc.
Turbopack replicates some of Vite's blazing fast DX techniques, but it's still in its infancy and it'll take a while until Turbopack is production-ready. With Vite, you can use lightning fast DX today.
Finally, Vike is a community project: instead of leaning on a framework with business interests that are fundamentally at odds with yours, use a community-driven project that is sponsored by and made for the community.
UI Framework agnostic
With Vike, you integrate React yourself. This means you need to write a little bit more boilerplate but, in exchange, you get a lot more flexibility.
Because you integrate React yourself, you have full control over the frontend integration of your favorite tools (data fetching, state management, authentication, etc.).
For example, you can use Relay and Apollo in ways that aren't possible with Next.js.
Relay is a state-of-the-art GraphQL client developed and used at scale by Facebook (which invented GraphQL). The YouTube video "Re-introducing Relay" explains in detail the benefits of Relay.
Many users and sponsors leverage Vike's flexibility to integrate Relay with SSR Streaming.
Except of React, Vike includes everything you'd expect from a frontend framework: Client-side Routing, HMR, Filesystem Routing, Pre-rendering, Data Fetching, Code Splitting, Layouts, i18n, etc.
Server/deployment agnostic
From a server perspective, Vike is just a middleware that can run anywhere (AWS, Vercel, Cloudflare, Deno Deploy, etc.).
To integrate Vike, you simply add Vike's middleware to your server (Express.js, Fastify, Edge Worker, Serverless Function, etc.).
With Vike, you have full control over your server and deployment, one of the most critical aspects of your architecture.
Manual integrations
As depicted above, Vike's philosophy is that you integrate tools manually instead of being locked into decisions made by your framework. Use any tool you want, however you want.
All-in-all, Vike is less easy, but simpler. For large scale projects, simplicity is fundamentally more important than being "easy".
Last but not least, manual integration is fun and insightful. (Whereas fighting a framework is pesky.)
Build your own framework
Vike is designed from the ground up to enable users to build frameworks on top of Vike.
You can build your own Next.js with only hundreds of lines of code.
While there are many uses cases for building your own framework, the most prominent one is building company internal frameworks.
We foster the proliferation of React frameworks, highly-tailored to specific use cases.
User feedback
From @Axxxx0n:
- Blazing fast development speed powered by Vite (on-demand transpiling, native ESM).
- Next.js has to have many examples and a whole plethora of libraries are existing just to integrate some library with Next.js because it's not trivial (for example next-i18next). With Vike, you just read the documentation of the library you want to integrate and you're good to go.
- When new React features arrive you can start to use it right away and don't have to wait for the Next.js team to integrate it. (Streaming API, server components, suspense on server, partial hydration, etc.)
- Next.js can't read files in
/public
directory after it was built, i.e. user uploaded images.
- With
getServerSideProps()
, Next.js blocks client-side rendering.
- You cannot bypass data fetching on client-side navigation (Next.js - #23921) while with Vike you're flexible and can choose what you want.
- Next.js is really pushing the Vercel platform and is starting to show in recent feature updates. Features that align with this are getting priority while important fixes are delayed.
- Next.js is leaning on serverless and complicates usage when you don't want it.
Detailed comparison table
From @patryk-smc and @redbar0n:
| Vike | Next.js |
---|
UI Framework | Any (React, Preact, Solid, etc.) | React only |
Code-splitting and bundling | Yes | Yes |
HMR | Yes, fast | Yes, slow |
SPA | Yes | Limited |
SSR | | |
Control | Full control | Limited / Black box |
Renderers | Yes, create as many you need | Just one (_app.ts file) |
RSC (React Server Components) | Work in progress | Yes, experimental |
Routing | | |
Filesystem Routing | Yes | Yes |
Domain-driven Filesystem Routing | Yes | No |
Client Routing | Yes | Yes |
Server Routing | Yes | No |
Base URL | Yes | Limited |
Integrations | | |
HTTP server | No*, bring your own | Baked-in, custom server partially supported with caveats[1][2] |
Apollo Client with SSR | Fully supported | Partially supported |
Relay with SSR | Fully supported | Partially supported |
Extras | | |
Head component | No*, use a tool like react-helmet. | Yes, next/head |
Image component | No*, use a tool like:Also see awesome-vite. | Yes, next/image |
API routes | No*, use your server or an RPC tool. | Yes |
Internationalization (i18n) | Yes | Limited |
Deployment synchronization | Yes | No |
Build your own framework | Yes | No |
Deployment options | | |
Vercel | Yes, minimal config | Yes, zero config |
Cloudflare Workers | Yes, minimal config | No, work in progress |
Node server (Docker, Heroku, Digital Ocean etc.) | Yes, minimal config | Yes, but limited |
(*) Vike doesn't ship those extras by design.