Should I use Next over Vite-React even for pure frontend apps?
Unanswered
Giant panda posted this in #help-forum
Giant pandaOP
Just wanting to know if you guys use it, and if I should, and if yes why.
13 Replies
Asian black bear
Next supports SPA features, but isn't primarily designed for it. You have to ask yourself whether you prefer the app router and server components (for static content) or whether you just want to use TanStack Router or React Router. It's likely a Vite-based SPA is just flat out better anyways.
@Giant panda Just wanting to know if you guys use it, and if I should, and if yes why.
Orange-crowned Warbler
I think Vite-React is better than Next.js
Cuz if your project is getting bigger it is very hard to handle project with Next.js
@Giant panda why
Orange-crowned Warbler
I've used Next.js but if project is getting bigger it is so confused to manage file, directory and routes.
@Asian black bear Next supports SPA features, but isn't primarily designed for it. You have to ask yourself whether you prefer the app router and server components (for static content) or whether you just want to use TanStack Router or React Router. It's likely a Vite-based SPA is just flat out better anyways.
Giant pandaOP
And why is it flat out better anyways, due to much less complexity?
Asian black bear
The dev server and tooling in general are significantly faster since they don't have to bundle as much. Also the SPA ecosystem is just mature enough. When you use Next for a SPA you're trying to shoehorn something into a SPA that really isn't designed with it in mind.
Chub mackerel
I would still pick Next.js server actions are huge DX benefit than going back to old stuff, then ofc if you have separate backend completely then yeah vite and next in pure SPA are not different, but still Next gives alot of benefits cause it is a framework
I mean we had decades of 0 SPA and different social media dashboard stuff working fine, with Next you have the DX of it and SPA feel i mean it is a no brainer, with vite you have to setup own router
@Orange-crowned Warbler I've used Next.js but if project is getting bigger it is so confused to manage file, directory and routes.
Chub mackerel
File based can be messy on large codebases but still it offers a clear way where stuff is nested but this is subjective, the fact that many frameworks are choosing the filesystem path shows its value
@Chub mackerel I mean we had decades of 0 SPA and different social media dashboard stuff working fine, with Next you have the DX of it and SPA feel i mean it is a no brainer, with vite you have to setup own router
Giant pandaOP
From my understanding the big difference is that I'd have an
"use client"
everywhereI was thinking of this because I am now in big trouble
Having a vite + react app that will need ssg on one specific poage