Live data from Hacker News

New React docs pretend SPAs don't exist anymore

wasp-lang.dev

51–60 of 225 posts

Re: New React docs pretend SPAs don't exist anymore

#51
post #32

This comment thread is a little funny because every single HN thread outside of this one rants super aggressively about webpages that don't show any content before JS loads, but this thread has managed to collect the opposite group together for once because React's docs have updated to stop actively recommending tools that force that problem to happen.

It can be true that SPAs are overused and that people think of react as an SPA framework.

Re: New React docs pretend SPAs don't exist anymore

#52
post #24

I don't understand the pivot back to SSR. Tearing down and standing up the entire DOM and page memory between navigations is just unnecessary work. Little things like maintaining scroll position in the page's navigation bar meaningfully improve usability and are only achievable with a SPA-based approach. This doesn't discount the challenges of building SPAs: bundle sizes, performance, etc. can be concerns if not mana…

the biggest problem with SPAs is none of the devs making them seem to remember how nice it was to open different pages of a site in different tabs. it's all horribly phone/tablet centric. middle-clicking doesn't even pop links in new tabs because they break basic browser features. you're lucky if you can even tell what's a real link and what's just going to rearrange your current page.

I don't understand this. All the popular/used routing frameworks by default support "open link in new tab" (render , and listen to onClick to do SPA transition). Developer have to deviate from the easy and commonly documented way of doing things to break this. Any website that doesn't do this is fundamentally broken and built by teams that deliberately disregarded this behaviour.

Re: New React docs pretend SPAs don't exist anymore

#53
post #18

There are a myriad of reasons why I prefer SPA to server rendered content for most applications. The main exception is if I have a public facing, unauthenticated application that I need indexed, I'll go for SSR. Off the top of my head, here are benefits to SPA: - I can just serve a few static files from a CDN. Every user gets the same client. - Most requests made by the application are actually smaller. I'm just load…

this is a really good summary, thanks!

Re: New React docs pretend SPAs don't exist anymore

#55
post #39

Earlier quoted context omitted.

SPAs, microservices, nosql (Redis), and serverless are all still alive and well, they just aren’t a hammer for all problems like (some) people treated them originally. Nerds getting overexcited about new tech is an old story and it will continue to happen indefinitely as much as we like to smug post about it. IDK about GraphQL since I’ve not used it but I’ve read lots of stuff recently about frameworks/ORMs working t…

That's exactly my point.

Your comment sounds a bit dismissive though. They all provide plenty value individually. A lot of this stuff needs to be used IRL for the community to understand the limits and there will always be junior devs and cowboys willing to risk it.

Plus not all of it is merely overexcitement/immaturity either, small companies and small dev teams often try to keep their toolsets small and eventually end up pigeonholing stuff into tech that doesn’t fit, until they get time/resources to do it properly. Some things are more obvious in retrospect.

The vast majority of the software world is still pretty conservative when you look beyond HN and Twitter.

Re: New React docs pretend SPAs don't exist anymore

#56
post #6

Hype driven developers/marketers believe the only type of websites that exists are those which need indexable content for SEO purposes. More news at 11

SEO is an important part of marketing for a lot of companies. It's not hype, it's just regular marketing

Re: New React docs pretend SPAs don't exist anymore

#57
post #50
post #47

Earlier quoted context omitted.

A lot of people still mix jQuery and React in the same parent project. Mostly just via legacy support when using existing serverside frameworks but still sometimes having the fallback easy DOM/event stuff is just easier when you need to get it done (keeping the HTML/views isolated from each other of course so you don’t mix concepts). It doesn’t sound pretty but they can serve dual purposes. I don’t know enough about…

I am sure you can do something with it… But htmx is all about replacing server rendered html with server rendered html partials. I would like to see what reacts vdom does when you keep ploping some partials into DOM it thinks it controls.

Yeah they’d have to be isolated from each other if that’s the case. Which would defeat the value if it’s a small project starting from scratch with a limited scope frontend-wise (which htmx typically implies whenever I’ve seen it used or mentioned).

Re: New React docs pretend SPAs don't exist anymore

#58
post #18

There are a myriad of reasons why I prefer SPA to server rendered content for most applications. The main exception is if I have a public facing, unauthenticated application that I need indexed, I'll go for SSR. Off the top of my head, here are benefits to SPA: - I can just serve a few static files from a CDN. Every user gets the same client. - Most requests made by the application are actually smaller. I'm just load…

You get all these benefits using something like NextJS's static site exports which I'm using right now on Cloudflare Pages (it's built-in). Works perfect for a SPA plus you get the SEO benefits. Only downside is we had to use query param for URLs instead of path-based params but it works the same in the code

Re: New React docs pretend SPAs don't exist anymore

#59
post #24

I don't understand the pivot back to SSR. Tearing down and standing up the entire DOM and page memory between navigations is just unnecessary work. Little things like maintaining scroll position in the page's navigation bar meaningfully improve usability and are only achievable with a SPA-based approach. This doesn't discount the challenges of building SPAs: bundle sizes, performance, etc. can be concerns if not mana…

the biggest problem with SPAs is none of the devs making them seem to remember how nice it was to open different pages of a site in different tabs. it's all horribly phone/tablet centric. middle-clicking doesn't even pop links in new tabs because they break basic browser features. you're lucky if you can even tell what's a real link and what's just going to rearrange your current page.

This only happens now with an SPA due to laughable incompetence or deliberate disregard. You have to go out of your way to not use whatever Link component or similar tool provided by your SPA library/framework of choice. Any team that incompetent or negligent would be just as likely to break link behavior even if they aren’t using an SPA.

I’m surprised the criticism is still ubiquitous: it’s either 5+ years out of date or some people run into these terrible sites a lot for some reason.

Re: New React docs pretend SPAs don't exist anymore

#60

I don't understand the pivot back to SSR. Tearing down and standing up the entire DOM and page memory between navigations is just unnecessary work. Little things like maintaining scroll position in the page's navigation bar meaningfully improve usability and are only achievable with a SPA-based approach. This doesn't discount the challenges of building SPAs: bundle sizes, performance, etc. can be concerns if not mana…

I think you might be using the term “SSR” in a non-standard way. In the context of JavaScript apps, SSR refers to an initial pre-rendering of the HTML of a SPA page on the first browser page load. Subsequent navigations in that same browser tab would render on the client just like an SPA that doesn’t have SSR.

You might be talking about what the JavaScript community has started to call “MPA,” which doesn’t seem to have converged on a clear meaning but seems to usually imply that some or all page navigations do involve a trip to the web server and an HTML response.

Post reply on HN