Next.js Discord

Discord Forum

Don't understand the point of server/client abstraction for data fetching

Unanswered
British Shorthair posted this in #help-forum
Open in Discord
British ShorthairOP
The time it takes for the data to get to the client will be the same regardless of this abstraction. You can create a skeleton in your client component similarly to using the file based loader that NextJS provides right? Often times you're still passing in initial data to the client, and have a fetch on the client that consumes that initial data. So again, what is the point?

9 Replies

The point is that your users don't have to wait for your fetch requests before seeing content on the page. It's an important thing and you should avoid loading spinners and empty skeletons as much as you can cause people might bounce if they have to wait for more than a couple of seconds before they can see anything on the screen.
British ShorthairOP
If majority of your pages content is dependent on those fetches, then you'll make the user wait regardless no?
Think dashboards, practically the entire dashboard will be a skeleton, and that abstraction does what exactly in this case?
ehhhh
try to think of it less as performance improvements for the end user
and more as productivity improvements for the developer experience
when it comes to the server/client split in nextjs
(or lack thereof)
It also heavily depends on what you're building. A dashboard isn't expected to be instantly available and seo friendly while a marketing website is, and in that case the abstraction makes a lot of sense. It makes your lif as a developer much easier in those scenarios without ruining everything else you might be doing with Next