#Should I use Next over Vite-React even for pure frontend apps?
1 messages · Page 1 of 1 (latest)
🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord
🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize
✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)
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.
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
why
I've used Next.js but if project is getting bigger it is so confused to manage file, directory and routes.
And why is it flat out better anyways, due to much less complexity?
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.
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
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
From my understanding the big difference is that I'd have an "use client" everywhere
I was thinking of this because I am now in big trouble