Tech stack for dekstop apps?
Answered
Chinese perch posted this in #help-forum
Chinese perchOP
React with electron or next with electron???
Answered by Ray
I highly suggest using Vite + react-router (or another router). It feels good to not worry about writing SSR safe code. Because even if you build Next using static-export, the dev server is SSR'ed and gives error if you load client-only modules.
Plus:
- the compile time with Vite is much faster
- Next routing is great for websites, but doesn't work quite well for desktop apps so you'll have to do a lot of manual state matching
Plus:
- the compile time with Vite is much faster
- Next routing is great for websites, but doesn't work quite well for desktop apps so you'll have to do a lot of manual state matching
46 Replies
ugh, nexts is a full stack framework
you don't use next.js with electron
use client library/framework like react, svelte, vue, etc.
IDK my list is correct, but you can't use next.js with electron, even if you do, u prolly need to use static export.
IDK my list is correct, but you can't use next.js with electron, even if you do, u prolly need to use static export.
better of not using it
@averydelusionalperson ugh, nexts is a full stack framework
Chinese perchOP
I know, but that doesnt mean it can make dekstop apps right
yeah, it means it can't, you can't use server side features
which is like the whole point of next.js
Chinese perchOP
why cant I use server side features? At the end, its just Showing whats on the webstie
*website
/browser
cause desktop app isn't a server
next.js is basically a node server
with some magic
Chinese perchOP
but it can run on the browser right
yeah, browser != desktop
Chinese perchOP
electron just shows that
in a native page
chromium page
it does some shit on server, return data to the client, and client renders it on browser
and desktop app is missing server part
it only has client
Chinese perchOP
its not a native dekstop app
Its a chromium instance
it is a browser
doesn't matter, chromium isn't a server, nor is a browser
this is how the next.js application works.
you hit a route -> it goes to (server) -> it gets data & does shit -> it returns rendered html with the data it got from server to the client/browser -> it renders the html on browser
you hit a route -> it goes to (server) -> it gets data & does shit -> it returns rendered html with the data it got from server to the client/browser -> it renders the html on browser
now, the desktop app is missing server.
so, you can only return html, and it renders on browser/chromium.
so, you can only return html, and it renders on browser/chromium.
so, frameworks like react, vue, svelte works cause they don't have a server, but next.js does.
you can use static export if you're that desperate to use next.js, but that is just like using regular react, but with next.js routing AFAIK.
@Chinese perch React with electron or next with electron???
I highly suggest using Vite + react-router (or another router). It feels good to not worry about writing SSR safe code. Because even if you build Next using static-export, the dev server is SSR'ed and gives error if you load client-only modules.
Plus:
- the compile time with Vite is much faster
- Next routing is great for websites, but doesn't work quite well for desktop apps so you'll have to do a lot of manual state matching
Plus:
- the compile time with Vite is much faster
- Next routing is great for websites, but doesn't work quite well for desktop apps so you'll have to do a lot of manual state matching
Answer
lmao, I hate writing detailed explanation
your message is longer than mine 

hmm, mine isn't formatted.
and I like arguing lol
IDK why my brain goes hakuna matata mode, whenever someone argues with my valid point
I was waiting for you to show up, so the OP can understand what I'm trying to say, they don't seem to undersand my language 

what do you don't understand lmao?
I'll explain
Chinese perchOP
nono
nvm
okay then, if your problem is solved, consider marking answer as solution.
Chinese perchOP
thanke
@Chinese perch thanke
Your welcome
@Chinese perch thanke
btw, you could also try electron + remix with spa mode, it gives you file base routing and spa. Basically, its just react + react-router but file base routing