News for hackers. Stuff that matters.
Re:React Server Components made our site A LOT faster by nwienert on Thursday September 21, 2023 @04:46PM (#37604066)
Unbelievable, deceptive levels of clickbait at play - they moved from a client app to a server app, so of course the initial render is faster.

This has nothing to do with RSC, and @dang /moderators should probably change the headline.

"Moving from a client-side app to a server app (using React Server Components) made our site faster" is very unsurprising, not very interesting (what would be interesting is comparison from another server rendering technique), and wouldn't have made the HN homepage likely, but they've already cheesed their way here.

Re:React Server Components made our site A LOT faster by throwaway10965 on Thursday September 21, 2023 @04:50PM (#37604122)
I don't see the difference between their and your headline.
Re:React Server Components made our site A LOT faster by nwienert on Thursday September 21, 2023 @04:56PM (#37604213)
Because they could have moved to a server based app not using RSC and seen similar gains, so the deception is they are trying to make it seem like RSC caused the gain (and riding on the back of a hyped new technology) whereas it's not really the case.
Re:React Server Components made our site A LOT faster by madjam002 on Thursday September 21, 2023 @05:26PM (#37604600)
But RSC is how you do server based apps with React, and they’re clearly sticking with React.

Sure you can render to static markup without RSC but then you have to do a lot of work to mix server/interactive client components, RSC makes it a lot easier to achieve “server based apps”.

It’s not a deceptive headline at all.

Re:React Server Components made our site A LOT faster by nwienert on Thursday September 21, 2023 @06:27PM (#37605296)
I think it’s less work to just use static content in places and avoid having to learn a whole new model of rendering, routing, data fetching and a lot of rules than it is to have a traditional ssr app that compiles a few static pieces of content.
Re:React Server Components made our site A LOT faster by ricardobeat on Thursday September 21, 2023 @05:46PM (#37604848)
RSC is how React figured out partial hydration. Before this, you would simply not move to a server-rendered app, as it was not worth it - the client bundle would stay the same and you're just increasing overhead.
Re:React Server Components made our site A LOT faster by nwienert on Thursday September 21, 2023 @06:30PM (#37605325)
Not true in the slightest. A server rendered app would deliver your html up front so your app is completely rendered immediately, this has been common for many years now and improves performance quite a bit. Couple with sending some static parts that avoid JS which is quite doable you have 90 some perfect of the benefit in a simpler model. That’s also why more direct a comparison of a SSR app to a RSC app is interesting.

Partial hydration is great but it’s a real shame react is coupling it to a whole new routing model, server forced rendering, and a whole new component model, with complex limitations and rules on use and a inherent waterfalls as a side effect. There’s no reason to. You can get partial hydration any number of ways and avoid all the complexity.

Re:React Server Components made our site A LOT faster by ricardobeat on Thursday September 21, 2023 @10:04PM (#37607022)
> Couple with sending some static parts that avoid JS which is quite doable

If when you say "they could have moved to a server based app", you are implying that they could have done partial hydration easily some other way, that's a wild assumption. Until very recently partial hydration was not even on the table, as the community decided that downloading 10MB of JS for every website was fine, and not 'quite doable' for the majority of React apps; they are usually monolithic and built on top of frameworks that make it difficult. Not impossible (we were doing this back in 2016 with different tech), but very uncommon.

As I said above, this is exactly what RSC is solving for. It's not a new thing, but the first solution endorsed by React itself, and enabled them (and potentially all React apps) to gain SSR with partial hydration, reduce bundle sizes and actually improve load performance.

I'm not a big fan of any of this, just stating what it is. And I agree that it introduces monstrous complexity to an ecosystem that's already overflowing with it. Astro for example achieves this without introducing too many new concepts.

Re:React Server Components made our site A LOT faster by nwienert on Friday September 22, 2023 @02:08AM (#37608452)
Totally agree that partial hydration helps more than full hydration, but note that if you compared SSR vs RSC the charts they posted wouldn't look so impressive.

Maybe I was too strong worded, but the point stands that without making it really clear they are "skipping a generation" basically, it makes their comparison look extremely favorable, whereas RSC actually has a big overhead: it serializes all props and the entire tree that's not hydrated into an arbitrary serialization format that JS then needs to parse and hydrate. They actually are far from as zero-cost as other partial hydration methods. And if you had compared SSR vs RSC you'd see that the numbers don't actually improve so much.

So is it like 10/10 deceptive? No, but it's also a meme thats going around and not the first article to try and gain attention by conveniently leaving out of the title and most of the article that 80% of the gain they got was just going from client-only to server-rendered, and not actually RSC. I absolutely stand by it being deceptive, if only on a more annoying than actually harmful level. The graphs aren't comparing SSR to RSC, they're comparing the (comparatively much, much worse) client-only to RSC.

Re:React Server Components made our site A LOT faster by ricardobeat on Friday September 22, 2023 @08:18PM (#37619433)
> 80% of the gain they got was just going from client-only to server-rendered

That's what the article is about, isn't it? The gain comes from going from client-only to server-rendered. Yes. They did this using RSC.

> if you had compared SSR vs RSC you'd see that the numbers don't actually improve so much

From the article: We saw a whopping 62% reduction in bundle size as well as as 63% improvement in Google's Speed Index. You would not get those gains by simply enabling SSR in an existing app, as the bundle size will remain the same. Unless.. you use Astro or RSC to enable SSR with partial hydration.

Re:React Server Components made our site A LOT faster by nwienert on Sunday September 24, 2023 @12:28PM (#37634532)
No, speed index would go up massively. A huge amount of lighthouse improves with server rendered content.

Likewise RSC is not nearly as free as other partial hydration methods. You send a full serialized copy of the tree and props over that has to be manually de serialized. This nullifies much of the benefit. Further, you still send the large (even larger now) copy of React. This is exactly why the comparison would be interesting to see, and why I brought up my concerns - it seems people are pretty under informed about this.

Re:React Server Components made our site A LOT faster by Izkata on Friday September 22, 2023 @10:30AM (#37612562)
> and not 'quite doable' for the majority of React apps

The article is about a mostly-static marketing page.

Re:React Server Components made our site A LOT faster by ricardobeat on Friday September 22, 2023 @08:48PM (#37619631)
I agree that's a bad choice, but it doesn't change the fact partial hydration was not available until very recently. Without Astro/RSC, you can either have SSG / SSR with large bundles, or an SPA with large bundles. These are the options.
Re:React Server Components made our site A LOT faster by willio58 on Thursday September 21, 2023 @10:32PM (#37607186)
I think their headline makes total sense. It's true after all, turns out putting most of the work on your server rather than your client is a great idea for performance.

You seem to be taking personal offense to using React Server Components for this, which is odd to me.

Re:React Server Components made our site A LOT faster by nwienert on Friday September 22, 2023 @02:02AM (#37608420)
You do know you can move to the server without RSC? This misconception is exactly what I'm talking about.
Re:React Server Components made our site A LOT faster by eyelidlessness on Thursday September 21, 2023 @10:57PM (#37607324)
This is a weird take, given that RSC is generally positioned for this kind of conversion. Among others, sure, but this is definitely one. It’s not deceptive to write about using a tool for one of its explicit intended purposes.
Re:React Server Components made our site A LOT faster by nwienert on Friday September 22, 2023 @02:09AM (#37608463)
Re:React Server Components made our site A LOT faster by eyelidlessness on Friday September 22, 2023 @11:42AM (#37613496)
It seems as though you’re reading this article—and apparently others on the topic—as some form of attention metric gaming combat. I think the author just, uh… wrote an article about their experience with adopting a technology.

You clearly have familiarity with the technical landscape, perhaps more than most here! And maybe I’m projecting this part, but my hunch is that (like me) you follow the space closely? If I may offer some advice, for whatever it’s worth: there’s going to be a very long tail of people coming to this, or any similar, solution with less depth of knowledge and nuance, and it might be a more enjoyable reading experience to preemptively give them some grace on that.

Re:React Server Components made our site A LOT faster by nwienert on Friday September 22, 2023 @04:50PM (#37617591)
I feel like my comments are fine and curious who you think I'm not giving grace to, I'm not attacking anyone except the article framing itself. My only ask was that HN, which usually clarifies titles to be more accurate avoid extra hype, apply that here, as the company obviously profits at the expense of the uninformed with the title here.

If anything I'm helping people less experienced understand this. HN does this title clarification all the time for much less concrete things.

I'd ask you why you felt necessary to bring in the "weird" adjective when clearly you understand this area and exactly how the less informed may not understand those graphs and title - in this very thread many of people even seem totally confused that RSC = the only way to do server rendering = novel to React. If I can give you feedback as well, instead of trying to score a point and muddy waters, just write the improved version of what I'm saying if you feel capable of doing so.

Re:React Server Components made our site A LOT faster by eyelidlessness on Friday September 22, 2023 @05:30PM (#37618051)
> If I can give you feedback as well, instead of trying to score a point and muddy waters

Not trying to score anything, I just sincerely think your approach to the article and its discussion is unnecessarily combative.

> just write the improved version of what I'm saying if you feel capable of doing so.

I don’t agree with your perspective that there’s anything deceptive or untoward about the article—or its title—as presented. I don’t feel capable of rewriting that position. Cheers!

Re:React Server Components made our site A LOT faster by nwienert on Friday September 22, 2023 @05:53PM (#37618284)
I guess the three people who confused it in this very thread were just wrong to be confused.
Re:React Server Components made our site A LOT faster by eyelidlessness on Friday September 22, 2023 @07:53PM (#37619267)
I can’t stop you from continuing to engage combatively, but I’ll ask you to kindly stop doing so with me. Thanks.
Re:React Server Components made our site A LOT faster by nwienert on Saturday September 23, 2023 @05:11PM (#37627593)
Similarly, I can't stop you from coloring my (very much benign) comments as weird, rude and combative, which I myself find rude and combative.

If you wish to engage substantively, do see the multiple confused people in this very thread that illustrate the point clearly. It's very hard to reconcile their confusion with your point that this is clear to the general audience.

Perhaps your very experience with the subject is a hindrance to seeing that. Cheers.

Re:React Server Components made our site A LOT faster by nwienert on Sunday September 24, 2023 @07:14PM (#37638078)
For posterity, the parent comment edited out the word rude.