Is Next.js Still the Best Choice? Our Journey to Test the Limits
It was one of those pivotal mornings. I sat down with a steaming cup of coffee, looking at our 80,000 lines of code React project, and a thought gnawed at me.
"Is Next.js still the right way to move forward?"
Our startup had invested countless hours into this framework, but the industry moves fast. Vite was gaining traction, and I needed to know if we were still on the right track.
This question wasn't just about technology. It was about our team's future, workflow, and, ultimately, product. And so, we decided to test it; could Vite be our answer?
The Dilemma: Is Next.js Losing Its Way?
"We needed to decide for our application we were building for nearly two years now, with 80,000 lines of code—is it actually the best idea to stay on Next.js to be future proof?" (from the video).
Next.js had been the backbone of our application. It's great for SEO, has a fantastic developer community, and plenty of ready-made solutions for everyday challenges. But there's also a downside: increasing complexity and shifting towards server-side paradigms that didn't necessarily align with our company’s strategy.
Honestly, I was happy to leave the full-stack idea, which was so prominent with PHP back then, so I am not the biggest fan of this new route.
The idea of Vite, with its speed, simplicity, and closer alignment with ES Modules, appealed to the developer in me. We decided to make the leap, even if only to test if the grass was greener on the other side.
So, we took a day and six hours of focused effort to migrate the entire application to Vite.
No gimmicks, no excuses.
Just an honest, hands-on experience to see if the hype held any weight. It’s easy to get lost in developer chatter about what's best or trending, but I wanted accurate, concrete results.
The Migration: Fast, Straightforward, but No Silver Bullet
"The migration took 6 hours, but that was to the point where the application was running as before. Overall, the application took 1200 hours to build. As a comparison, the migration was under 1% of the time." (from the video).
The migration was surprisingly smooth. We brought over our stack TypeScript, TanStack Query, Zustand, and Tailwind, and within six hours, we had our application running as before. Six hours of effort compared to the 1200 hours invested into building it initially was like switching lanes on a highway rather than rebuilding the car from scratch.
We quickly saw some benefits. Vite's build times were around 30% faster, and Hot Module Replacement (HMR) was a dream—70% faster than Next.js.
But these weren’t game-changing numbers.
The bundle size reduction was minor, just 10% smaller, not enough to justify a full-fledged migration purely on that basis.
The real challenge came when we moved beyond surface-level improvements. Converting imports from CommonJS to ES Modules was a hurdle. Refactoring our Next.js-specific components like useRouter and next/image to work within Vite took some time, but it was doable.
The switch highlighted how different these two worlds were: Next.js, deeply intertwined with server-side, versus Vite, which allowed us to stay more agnostic.
What We Learned: Is It Time to Abandon Next.js?
"The numbers we have are actually no reason to migrate from Next.js to Vite because it's not that much, to be honest. It is an improvement in developer experience, maybe faster CI/CD build times, but that's it." (from the video).
Ultimately, we found that there’s no clear winner.
Next.js still shines for CMS-heavy applications and server-side generation, which makes it excellent for SEO-driven projects or full-stack approaches.
Vite, on the other hand, brought back a certain purity and speed that felt more aligned with the original vision of React—an agnostic approach, a leaner developer experience.
If you are entirely on client-side rendering and value speed and modularity, Vite might be the answer. However, if you're heavily invested in server-side features or building full-stack solutions, Next.js still holds a strong position.
Key Takeaways & Learnings:
Smooth Migration: Moving from Next.js to Vite was straightforward, especially for CSR-focused applications.
Developer Experience: Vite significantly improves build speed and HMR, which can enhance productivity.
No Major Gains in Bundle Size: Bundle size differences were minimal, which means performance gains might not be a compelling reason for most applications.
Server-Side Complexity: Next.js remains better suited for applications needing SEO and server-side rendering capabilities.
Agnostic Approach: Vite felt more future-proof in some aspects, particularly when aligning with modern JavaScript practices like ES Modules.
The Bottom Line: Which Way Should You Go?
So where does that leave us? We haven’t completely jumped ship from Next.js yet. But the test migration was an enlightening experience. The technology landscape is evolving, and it's important to periodically reassess whether the tools you chose years ago are still the right tools for today’s challenges. This experiment gave us some good food for thought but didn’t provide a clear-cut answer.
If you’re facing a similar decision, ask yourself—what are your application's actual needs? Server-side generation, SEO, and rapid CMS development still favor Next.js. But if you want something fast, modern, and closer to web standards, maybe it’s time to give Vite a shot.
Share this post