#NextJS and tRPC
9 messages ยท Page 1 of 1 (latest)
why use tRPC for that? You really shouldn't directly access the system from the JS side. For security and performance it's best to access the system from Rust. Tauri has built-in rust apis for this that you can call from JS.
but the serverside props needs disabled
The whole server side of nextjs will be disabled so there is nothing tRPC could connect to. (Not that i understand what trpc would even solve here ๐ค )
So forgetting accessing the file system. Would it be possible to use tRPC to make data requests? Probably not if server side is disabled and that data should be retrieved up front or through an API I assume?
Would it be possible to use tRPC to make data requests?
From where? To remote servers? Sure. To the non-existend nextjs backend? Nope, if it would be possible the "normal" ways would work too :)
think of tauri as your server backend and nextJS as your frontend. You no longer have the NextJS backend - tauri is now filling that role.
So would you even recommend using nextjs framework for a green field react project?
In my opinion - not really. Not unless you have an already existing NextJS project and you wish to port it to tauri, or you're more comfortable within the NextJS framework.
If those two things are not applicable to you - there are far lighter and more straightforward frameworks to use.
Personally, i prefer to use SolidJS with tauri.
Lot's of people use Svelte as well. Vue is also quite popular.
If you must stick to the React ecosystem - Plain react is good, or Nuxt. NextJS is also fine, as long as you understand the adaptations needed.