The most satisfying thing I did today was to remov...
# random
l
The most satisfying thing I did today was to remove all those 
if (isLoading) { <LoadingSkeletons/> }
 from the public pages of my side project app. There's tremendous performance gains to be had by pre-rendering pages (and treating the pre-render as a skeleton), and then fetching for fresh data with SWR after load if necessary. Thesis: https://twitter.com/sarupbanskota/status/1281054466628673536 Solution: https://twitter.com/sarupbanskota/status/1281057252225323010
l
What are you using? Ok. Looked at your tweet! 😊
Haven’t used Next as yet - but does the pre-rendering depend on a specific backend stack that you are using to serve the data?
l
Not sure if I understood your question correctly @loud-glass-33663 — what's an example of backend stack? Do you mean backend = like Rails, or more something like Firebase or a REST API?
l
Sorry. I meant do you need to be running node or something like that or can I be running python, .Net or any other API engine to power the app? I am guessing Next.js is a front end framework only? Like React / Angular / Vue?
l
Next.js is a hybrid — you could be running it as purely static (frontend/SSG), full-stack (i.e SSR), or hybrid (iSSG). If you have a static frontend with Next.js, you can activate what I described, in an API-agnostic manner. So your API could be .Net-powered and you get the benefits of the approach I described. But if your entire product is a monolith (e.g a Rails monolith where you have templates), then Next.js isn't very useful. In theory you can still get the results of the approach I described using other "full-stacks", but I don't know of any other framework that has an idiomatic approach to achieve this. I hope this makes sense!
👍 1
l
Yep it does. The API-agnostic thing is what I was looking at. Personally, I am not too fond of JS based backend systems - so this would definitely work in my case the next time I need a front end framework.
approved 1