[ $davids.sh ] — david shekunts blog

**🎩 Gentlemen, it appears we're in recursion... and the culprit is React 18

# [ $davids.sh ] · message #153

**🎩 Gentlemen, it appears we're in recursion... and the culprit is React 18

**In the early days of my frontend career, the frontend was generated through templating on the backend

Back then, a "frontend developer" was called a "layout designer" - a specialist who designed HTML templates, while the "backend developer" would take them, write functions to retrieve data from the database, and insert it into these templates

Later, libraries for SPA (I started with Backbone, but the first revolution was made by Angular 1) appeared

That's when we had a complete separation of "frontend developers" who wrote all the client-side logic and "backend developers" who created APIs for the client

Over time, it became clear that search engines didn't want to adapt to SPA, and the rendering speed was poor when loading from the frontend, so frameworks like Next.js and Remix started to appear

Now, frontend developers could not only make requests to the backend but also add requests to the database in the server-side rendering logic

And finally, React 18 is released, which adds support for server-side rendering components directly within itself... meaning that frontend developers can now write requests to the database directly in special React components, which will be loaded on the server and sent to the client...

https://nextjs.org/docs/advanced-features/react-18/server-components

If we don't go into details, this is exactly how web development was initially set up, only now frontend developers can write requests to the database for rendering templates, not just backend developers

In my opinion, this is very good news, because as a backend developer, I hate writing API endpoints for the frontend, especially CRUD-like ones

If frontend developers will handle requests to the database for retrieving/creating data, I'll be happy, and I'm even ready to create separate optimized tables for them

On the other hand, I've only seen a couple of good frontend developers in my career who wrote decent SPAs, and now we're going to let them touch the database...

We'll see how it goes, and I wish you all a powerful boost 💪

  • @ Bogdan Node.js RentalClub · # 288

    We discovered astro.build for ourselves and now we live in happiness)))

  • @ [ $davids.sh ] · # 293

    Oh, by the way, a question: I've only worked with Next.js myself and I see people online saying: "Astro is for static content sites, while Next.js is for dynamic SPAs" — but I don't quite understand how this manifests.

    Astro does allow passing client-side components with logic, just like Next.js, so how is it "insufficient" for SPAs then?