News for hackers. Stuff that matters.
Re:Progressive JSON by jatins on Sunday June 01, 2025 @01:46AM (#44148895)
I have seen Dan's "2 computers" talk and read some of his recent posts trying to explore RSC and their benefits.

Dan is one of the best explainers in React ecosystem but IMO if one has to work this hard to sell/explain a tech there's 2 possibilities 1/ there is no real need of tech 2/ it's a flawed abstraction

#2 seems somewhat true because most frontend devs I know still don't "get" RSC.

Vercel has been aggressively pushing this on users and most of the adoption of RSC is due to Nextjs emerging as the default React framework. Even among Nextjs users most devs don't really seem to understand the boundaries of server components and are cargo culting

That coupled with fact that React wouldn't even merge the PR that mentions Vite as a way to create React apps makes me wonder if the whole push for RSC is for really meant for users/devs or just as a way for vendors to push their hosting platforms. If you could just ship an SPA from S3 fronted with a CDN clearly that's not great for Vercels and Netflifys of the world.

In hindsight Vercel just hiring a lot of OG React team members was a way to control the future of React and not just a talent play

Re:Progressive JSON by Garlef on Sunday June 01, 2025 @03:46AM (#44149293)
I think there's a world where you would use the code structuring of RSCs to compile a static page that's broken down into small chunks of html, css, js.

Basically: If you replace the "$1" placeholders from the article with URIs you wouldn't need a server.

(In most cases you don't need fully dynamic SSR)

The big downside is that you'd need a good pipeline to also have fast builds/updates in case of content changes: Partial streaming of the compiled static site to S3.

(Let's say you have a newspaper with thousands of prerendered articles: You'd want to only recompile a single article in case one of your authors edits the content in the CMS. But this means the pipeline would need to smartly handle some form of content diff)

Re:Progressive JSON by danabramov on Sunday June 01, 2025 @04:43AM (#44149497)
RSC is perfectly capable of being run at the build-time, which is the default. So that’s not too far from what you’re describing.
Re:Progressive JSON by kenanfyi on Sunday June 01, 2025 @03:03AM (#44149135)
I find your analysis very good and agree on why companies like Vercel are pushing hard on RSC.
Re:Progressive JSON by foo42 on Sunday June 01, 2025 @03:24AM (#44149212)
[flagged]
Re:Progressive JSON by tomhow on Sunday June 01, 2025 @03:52AM (#44149318)
Please don't do this here. If a comment seems unfit for HN, please flag it and email us at [email protected] so we can have a look.
Re:Progressive JSON by kenanfyi on Monday June 02, 2025 @11:02AM (#44159546)
Sorry, what? Is it just my phrasing or my rant on VC-backed entities pushing things to gain advantage?
Re:Progressive JSON by danabramov on Sunday June 01, 2025 @04:28AM (#44149437)
You’re wrong about the historical aspects and motivations but I don’t have the energy to argue about it now and will save it for another post. (Vercel isn’t setting React’s direction; rather, they’re the ones who funded person-decades of work under the direction set by the React team.)

I’ll just correct the allegation about the Vite — it’s being worked on but the ball is largely in the Vite team’s court because it can’t work well without bundling in DEV (and the Vite team knows it and will be fixing that). The latest work in progress is here: https://github.com/facebook/react/pull/33152.

Re: people not “getting” it — you’re kind of making a circular argument. To refute it I would have to shut up. But I like writing and I want to write about the topics I find interesting! I think even if you dislike RSC, there’s enough interesting stuff there to be picked into other technologies. That’s really all I want at this point. I don’t care to convince you about anything but I want people to also think about these problems and to steal the parts of the solution that they like. Seems like the crowd here doesn’t mind that.

Re:Progressive JSON by andrewingram on Sunday June 01, 2025 @08:02AM (#44150268)
I also appreciate that you’re doing these explainers so that people don’t have to go the long way round understand what problems exists that call for certain shapes of solutions — especially when those solutions can feel contrived or complicated.

As someone who’s been building web UI for nearly 30 years (scary…), I’ve generally been fortunate enough that when some framework I use introduces a new feature or pattern, I know what they’re trying to do. But the only reason I know what they’re trying to do is because I’ve spent some amount of time running into the problems they’re solving. The first time I saw GraphQL back in 2015, I “got” it; 10 years later most people using GraphQL don’t really get it because they’ve had it forced upon them or chose it because it was the new shiny thing. Same was true of Suspense, server functions, etc.

Re:Progressive JSON by metalrain on Sunday June 01, 2025 @04:45AM (#44149505)
While RSC as technology is interesting, I don't think it makes much sense in practice.

I don't want to have a fleet of Node/Bun backend servers that have to render complex components. I'd rather have static pages and/or React SPA with Go API server.

You get similar result with much smaller resources.

Re:Progressive JSON by pas on Sunday June 01, 2025 @08:03AM (#44150277)
It's convenient for integrating with backends. You can use async/await on the server, no need for hooks (callbacks) for data loading.

It allows for dynamism (user only sees the menus that they have permissions for), you can already show those parts that are already loaded while other parts are still loading.

(And while I prefer the elegance and clean separation of concerns that come with a good REST API, it's definitely more work to maintain both the frontend and the backend for it. Especially in caes where the backend-for-frontend integrates with more backends.)

So it's the new PHP (with ob_flush), good for dashboards and big complex high-traffic webshop-like sites, where you want to spare no effort to be able to present the best options to the dear customer as soon as possible. (And also it should be crawlable, and it should work on even the lowest powered devices.)

Re:Progressive JSON by robertoandred on Sunday June 01, 2025 @02:46PM (#44152915)
RSCs work just fine with static deployments and SPAs. (All Next sites are SPAs.)
Re:Progressive JSON by ec109685 on Monday June 02, 2025 @03:39AM (#44156507)
How do you avoid having your users stare at spinners while their browser makes api calls (some of them depending on each other) in order to render the page?
Re:Progressive JSON by presentation on Monday June 02, 2025 @08:21AM (#44158074)
That's fine for you, but not all React users are you. It makes much sense in practice for me.
Re:Progressive JSON by throwingrocks on Sunday June 01, 2025 @05:05AM (#44149580)
> IMO if one has to work this hard to sell/explain a tech there's 2 possibilities 1/ there is no real need of tech 2/ it's a flawed abstraction

There’s of course a third option: the solution justifies the complexity. Some problems are hard to solve, and the solutions require new intuition.

It’s easy to say that, but it’s also easy to say it should be easier to understand.

I’m waiting to see how this plays out.

Re:Progressive JSON by liamness on Sunday June 01, 2025 @07:17AM (#44150067)
You can of course still just export a static site and host it on a basic CDN, as you say. And you can self host Next.js in the default "dynamic" mode, you just need to be able to run an Express server, which hardly locks you into any particular vendor.

Where it gets a little more controversial is if you want to run Next.js in full fat mode, with serverless functions for render paths that can operate on a stale-while-revalidate basis. Currently it is very hard for anyone other than Vercel to properly implement that (see the opennextjs project for examples), due to undocumented "magic". But thankfully Next.js / Vercel have proposed to implement (and dogfood) adapters that allow this functionality to be implemented on different platforms with a consistent API:

https://github.com/vercel/next.js/discussions/77740

I don't think the push for RSC is at all motivated by the shady reasons you're suggesting. I think it is more about the realisation that there were many good things about the way we used to build websites before SPA frameworks began to dominate. Mostly rendering things on the server, with a little progressive enhancement on the client, is a pattern with a lot of benefits. But even with SSR, you still end up pushing a lot of logic to the client that doesn't necessarily belong there.

Re:Progressive JSON by lioeters on Sunday June 01, 2025 @09:20AM (#44150669)
> thankfully Next.js / Vercel have proposed to implement (and dogfood) adapters that allow this functionality to be implemented on different platforms with a consistent API:

Seeing efforts like this (started by the main dev of Next.js working at Vercel) convinces me that the Vercel team is honestly trying to be a good steward with their influence on the React ecosystem, and in general being a beneficial community player. Of course as a VC-funded company its purpose is self-serving, but I think they're playing it pretty respectably.

That said, there's no way I'm going to run Next.js as part of a server in production. It's way too fat and complicated. I'll stick with using it as a static site generator, until I replace it with something simpler like Vite and friends.

Re:Progressive JSON by presentation on Monday June 02, 2025 @08:21AM (#44158069)
for what it's worth I am a NextJS developer and everyone on my team had a pretty easy time getting used to client/server components.

Do I wish that it were something like some kind of Haskell-style monad (probably doable in TypeScript!) or a taint or something, rather than a magic string comment at the top of the file? Sure, but it still doesn't seem to be a big deal, at least on my team.

Re:Progressive JSON by chamomeal on Monday June 02, 2025 @11:29AM (#44159872)
Tangent: next.js is pretty amazing but it’s still surprising to me that it’s become to default way to write react. I just don’t enjoy writing next.js apps even though typescript is my absolute favorite language, and I generally love react as well.