Most active commenters
  • pjmlp(3)

←back to thread

298 points sangeeth96 | 37 comments | | HN request time: 0.001s | source | bottom
1. chuckadams ◴[] No.46237166[source]
I remember when the point of an SPA was to not have all these elaborate conversations with the server. Just "here's the whole app, now only ask me for raw data."
replies(7): >>46237234 #>>46237514 #>>46237562 #>>46237703 #>>46237856 #>>46238657 #>>46239228 #
2. tshaddox ◴[] No.46237234[source]
That was indeed one of the main points of SPAs, but React Server Components are generally not used for pure SPAs.
replies(2): >>46237516 #>>46241009 #
3. ◴[] No.46237514[source]
4. reactordev ◴[] No.46237516[source]
Correct, their main purpose is ecosystem lock-in. Because why return json when you can return html. Why even build a SPA when the old school model of server-side includes and PHP worked just fine? TS with koa and htmx if you must but server-side react components are kind of a waste of time. Give me one example where server side react components are the answer over a fetch and json or just fetching an html page?
replies(2): >>46237878 #>>46238984 #
5. rustystump ◴[] No.46237562[source]
It also decoupled fe and backend. You could use the same apis for say mobile, desktop and web. Teams didnt have to cross streams allowing for deeper expertise on each side.

Now they are shoving server rendering into react native…

6. pjmlp ◴[] No.46237703[source]
Until they discovered why so many of us have kept with server side rendering, and only as much JS as needed.

Then they rediscovered PHP, Rails, Java EE/Spring, ASP.NET, and reboted SPAs into fullstack frameworks.

replies(2): >>46238277 #>>46238386 #
7. hedayet ◴[] No.46237856[source]
I'd be interested in adopting a sole-purpose framework like that.
8. tshaddox ◴[] No.46237878{3}[source]
I like RSCs and mostly dislike SPAs, but I also understand your sentiment.
9. sangeeth96 ◴[] No.46238277[source]
> Then they rediscovered PHP, Rails, Java EE/Spring, ASP.NET, and reboted SPAs into fullstack frameworks.

I can understand the dislike for Next but this is such a poor comparison. If any of those frameworks at any point did half the things React + Next-like frameworks accomplished and the apps/experiences we got since then, we wouldn't be having this discussion.

replies(7): >>46238440 #>>46238587 #>>46238618 #>>46238988 #>>46239039 #>>46240341 #>>46241462 #
10. whizzter ◴[] No.46238386[source]
I sometimes feel like I go on and on about this... but there is a difference between application and pages (even if blurry at times), and Next is a result of people doing pages adopting React that was designed for applications when they shouldn't have.
11. Atotalnoob ◴[] No.46238440{3}[source]
Blazor? Razor pages?
12. brazukadev ◴[] No.46238587{3}[source]
We are having this discussion because at some point, the people behind React decided it should be profitable and made it become the drug gateway for NextJS/Vercel
replies(1): >>46241475 #
13. ◴[] No.46238618{3}[source]
14. moomoo11 ◴[] No.46238657[source]
I think people just never understood SPA.

Like with almost everything people then shit on something they don’t understand.

15. nawgz ◴[] No.46238984{3}[source]
The only example that has any traction in my view are web-shops, which claim that time-to-render and time-to-interactivity are critical for customer retention.

Surely there are not so many people building e-commerce sites that server components should have ever become so popular.

replies(1): >>46239540 #
16. tacker2000 ◴[] No.46238988{3}[source]
How does Next accomplish more than a PHP/Ruby/whatever backend with a React frontend?

If anything the latter is much easier to maintain and to develop for.

17. acdha ◴[] No.46239039{3}[source]
> If any of those frameworks at any point did half the things React + Next-like frameworks accomplished and the apps/experiences we got since then, we wouldn't be having this discussion.

This is interesting because every Next/React project I see has a slower velocity than the median Rails/Django product 15 years ago. They’re just as busy, but pushing so much complexity around means any productivity savings is cancelled out by maintenance and how much harder state management and security are. Theoretically performance is the justification for this but the multi-second page load times are unconvincing.

From my perspective, it really supports the criticism about culture in our field: none of this is magic, we can measure things like page-weight, response times, or time to complete common tasks (either for developers or our users), but so much of it is driven by what’s in vogue now rather than data.

replies(1): >>46239816 #
18. mubou2 ◴[] No.46239228[source]
It's funny (in a "wtf" sort of way) how in C# right now, the new hotness Microsoft is pushing is Blazor Server, which is basically old-school .aspx Web Forms but with websockets instead of full page reloads.

Every action, every button click, basically every input is sent to the server, and the changed dom is sent back to the client. And we're all just supposed to act like this isn't absolutely insane.

replies(7): >>46239539 #>>46239898 #>>46239981 #>>46240135 #>>46240268 #>>46240784 #>>46240850 #
19. c0balt ◴[] No.46239539[source]
Hotwire et al are also doing part of this. It isn't a new concept but it seems to come and go it terms of popularity
20. skydhash ◴[] No.46239540{4}[source]
The thing is time to render and interactivity is much more reliant on the database queries and the internet connection of the user than anything else. Now instead of a spinner or a progress bar in the toolbar of the browser, now I got skeleton loaders and use half of GB for one tab.
replies(1): >>46240826 #
21. ricardobeat ◴[] No.46239816{4}[source]
+1 to this. I seriously believe frontend was more productive in the 2010-2015 era than now, despite the flaws in legacy tech. Projects today have longer timelines, are more complex, slower, harder to deploy, and a maintenance nightmare.
replies(1): >>46240294 #
22. McGlockenshire ◴[] No.46239898[source]
> And we're all just supposed to act like this isn't absolutely insane.

This is insane to you only if you didn't experience the emergence of this technique 20-25 years ago. Almost all server-side templates were already partials of some sort in almost all the server-side environments, so why not just send the filled in partial?

Business logic belongs on the server, not the client. Never the client. The instant you start having to make the client smart enough to think about business logic, you are doomed.

23. CharlieDigital ◴[] No.46239981[source]
It's kinda nice.

Main downside is the hot reload is not nearly as nice as TS.

But the coding experience with a C# BE/stack is really nice for admin/internal tools.

24. vbezhenar ◴[] No.46240135[source]
I saw this kind of interactivity in Apache Wicket Java framework. It's very interesting approach.
25. seer ◴[] No.46240268[source]
Isn’t that what Phoenix (Elixir) is? All server side, small js lib for partial loads, each individual website user gets their own thread on the backend with its own state and everything is tied together with websockets.

Basically you write only backend code, with all the tools available there, and a thin library makes sure to stich the user input to your backend functions and output to the front end code.

Honestly it is kinda nice.

replies(3): >>46240611 #>>46241083 #>>46242312 #
26. c-hendricks ◴[] No.46240294{5}[source]
I'm not so sure those woes are unique to frontend development.
27. seer ◴[] No.46240341{3}[source]
I still remember the joy of using the flagship rails application - basecamp. Minimal JS, at least compared to now, mostly backend rendering, everything felt really fast and magical to use.

Now they accomplished this by imposing a lot of constraints on what you could do, but honestly it was solid UX at the time so it was fine.

Like the things you could do were just sane things to do in the first place, thus it felt quite ok as a dev.

React apps, _especially_ ones hosted on Next.js rarely feel as snappy, and that is with the benefit of 15 years of engineering and a few order of magnitude perf improvement to most of the tech pieces of the stack.

It’s just wild to me that we had faster web apps, with better organizarion, better dev ex, faster to build and easier to maintain.

The only “wins” I can see for a nextjs project is flexibility, animation (though this is also debatable), and maybe deployment cost, but again I’m comparing to deploying rails 15 years ago, things have improved there as well I’m sure.

I know react can accomplish _a ton_ more on the front end but few projects actually need that power.

28. dmix ◴[] No.46240611{3}[source]
Also what https://anycable.io/ does in Rails (with a server written in Go)

Websockets+thin JS are best for real time stuff more than standard CRUD forms. It will fill in for a ton of high-interactivity usecases where people often reach for React/Vue (then end up pushing absolutely everything needlessly into JS). While keeping most important logic on the server with far less duplication.

For simple forms personally I find the server-by-default solution of https://turbo.hotwired.dev/ to be far better where the server just sends HTML over the wire and a JS library morph-replaces a subset of the DOM, instead of doing full page reloads (ie, clicking edit to in-place change a small form, instead of redirecting to one big form).

29. JeremyNT ◴[] No.46240784[source]
Well, maybe it isn't so insane?

Server side rendering has been with us since the beginning, and it still works great.

Client side page manipulation has its place in the world, but there's nothing wrong with the server sending page fragments, especially when you can work with a nice tech stack on the backend to generate it.

replies(1): >>46241520 #
30. nawgz ◴[] No.46240826{5}[source]
Not to defend the practice, I’ve never partaken, but I think there’s some legit timing arguments that a server renderer can integrate more requests faster thanks to being collocated with services and dbs.
31. oefrha ◴[] No.46240850[source]
Yes, I say this every time this topic comes up: it took many years to finally have mainstream adoption of client-side interactivity so that things are finally mostly usable on high latency/lossy connections, but now people who’re always on 10ms connections are trying to snatch that away so that entirely local interactions like expanding/collapsing some panels are fucked up the moment a WebSocket is disconnected. Plus nice and simple stateless servers now need to hold all those long-lived connections. WTF. (Before you tell me about Alpine.js, have you actually tried mutating state on both client and server? I have with Phoenix and it sucks.)
32. robertoandred ◴[] No.46241009[source]
Sure they are. Next sites are SPAs.
33. brendanmc6 ◴[] No.46241083{3}[source]
> Honestly it is kinda nice.

It's extremely nice! Coming from the React and Next.js world there is very little that I miss. I prefer to obsess over tests, business logic, scale and maintainability, but the price I pay is that I am no longer able to obsess over frontend micro-interactions.

Not the right platform for every product obviously, but I am starting to believe it is a very good choice for most.

34. pjmlp ◴[] No.46241462{3}[source]
They weren't the new shinny to pump up the CV, and fill the Github repo for HR applications.
35. pjmlp ◴[] No.46241475{4}[source]
Worse, because Vercel then started its marketing wave, thus many SaaS products only support React/Next.js as extensions points.

Using anything else requires yak shaving instead of coding the application code.

That is the only reason I get to use them.

36. qingcharles ◴[] No.46241520{3}[source]
Sure. The problem with some frameworks is that they attached server events to things that should be handled on the front-end without a roundtrip.

For instance, I've seen pages with a server-linked HTML button that would open a details panel. That button should open the panel without resorting to sending the event and waiting for a response from the server, unless there is a very, very specific reason for it.

37. mubou2 ◴[] No.46242312{3}[source]
Idk about Phoenix, but having tried Blazor, the DX is really nice. It's just a terrible technical solution, and network latency / spotty wifi makes the page feel laggy. Not to mention it eats up server resources to do what could be done on the client instead with way fewer moving parts. Really the only advantage is you don't have to write JS.