Hacker News new | ask | show | jobs
by dtagames 1137 days ago
I work with SPAs with API calls every day. It definitely reduces the server interactions over computing everything on that side, and it gives fewer points of contact with the server about the user's behavior. For example, many clicks and other actions will not result in any server contact at all.

I'm aware that they call it "reactive" but I'll stick with my rationale. There is no way they would use a Google product like that.

2 comments

I... don't believe you? Like looking at the network request of any SPA I've ever seen there's just tons of requests for even simple page loads. One for main content, one for profiles, one for comments, etc.

In theory stuff like graphql helps but in the reality I'm living in SPA's hit multiple endpoints to get render even simple pages.

Definitely true, and mine do also. It's a side effect of the migration to microservices and away from monolithic endpoints.
An enterprise React app I am currently working with takes about 50 requests to fully render the app post-login. Switching to another view (no reload) takes another few dozen. That's a lot of "server interactions", pretty standard for SPAs, but YMMV.