4 ms·
From the article (italics mine) - > So why is Next.js so pushy about it? (React server components) > I can't avoid feeling that the new direction taken by Nex
by thunderbong 3y ago
From the article (italics mine) -
> So why is Next.js so pushy about it? (React server components)
> I can't avoid feeling that the new direction taken by Next.js is not designed to help developers, but to help Vercel sell React. You can't really sell a service around SPAs: once compiled, a SPA is a single JS file that can be hosted for free anywhere. But a server-side rendered app needs a server to run. And a server is a product that can be sold. Perhaps I'm a conspiracy theorist, but I don't see another reason to break the React ecosystem like this.
- dimmke 3y agoI’ve had this thought for a while. Companies like Vercel have coined the term “composable” but it really does feel like this is what is actually driving things.
- aigoochamna 3y agoIf you think that way, you are not objectively weighing the benefits of server side rendering. It _is_ useful and shouldn't be tossed away for the benefits of a 6MB javascript blob.
- 8n4vidtmkvmk 3y agoYou can do better than a 6MB blob. You can code split and cache. It's not that bad. Especially if it's an app, not an SEO site.
- aigoochamna 3y agoA 6MB blob is identical to 2MB, 1MB and 3MB blobs.
- erhaetherth 3y agoNot quite. 1. They can potentially be downloaded and parsed in parallel 2. They can be invalidated independently, meaning on your next visit you may only need to re-DL the 1MB blob instead of the whole thing 3. Not every page will need all 3 blobs, you might only need the 2MB blob to load the homepage which means it'll load a little bit quicker. Then you can either load the next blob on the next click, or start downloading it in the background so the next click is nearly instant 4. You can do this not just between pages, but progressively within a single page. Render part of the UI, wait for the 2nd blob, then render the components that need that bit.
- DangitBobby 3y agoPretty much every app I've ever needed required an API, which meant a server, which meant Next.js would have been a viable candidate. Sure, there are use-cases that you truly don't need an API or you can just hook up to an existing one, but I don't think they're nearly as common.
- boringuser2 3y agoI don't think any of what you're saying really makes much sense. Merely having a server doesn't mean SSR provides business-relevant benefits.
- 5Qn8mNbc2FNCiVV 3y agoNext.js provides API routes / initial serverside loaders for your routes. Disable SSR, Next.js still benefits from being able to write CRUD code in the same codebase and most applications need that anyways
- HelloNurse 3y agoIf I understand correctly, this server side component technology is strictly JavaScript (or maybe Typescript etc.), so how can it be marketed as a step forward compared to having the React pages interact with any kind of back end through reasonably standard web services? Throwing away perfectly good backends and replacing them with new and relatively unproven JavaScript implies so much code churn, and novel deployment and management difficulties, that fatally bad downsides like the likelihood of crucifying the masochist hipster's application or site to specific cloud services seems a minor detail. Is it simply a perversion that has been designed to appeal to exclusively JavaScript project of exclusively JavaScript programmers who have some hope of salvaging and porting already JavaScript business logic?
- solarkraft 3y ago> how can it be marketed as a step forward compared to having the React pages interact with any kind of back end through reasonably standard web services? With RSP you can implement a server function and (relatively) directly call it on the server, type-safely. Try doing that another back-end (I have and mostly failed).
- piperswe 3y agoIsn't that the purpose of tRPC?
- justinclift 3y agoSounds like a potential foot-gun for input validation by the backend getting missed. :(
- moritzwarhier 3y agoI don't understand your argument at all. Why would a TS backend be inferior to a PHP backend, for example? Because for many people, that's the tradeoff. Think of a new project. You'll still have "OOP" PHP + some random templating language + the infamously hard to do "sprinkles" of JS. In the end lots of people start to shoehorn their PHP or Django CMS into REST API parts anyway, reinventing the wheel over and over again, for every new requirement. I have nothing against PHP or Django or other server technologies with corresponding templating languages. But to churn on the "old and proven" point in 2023 seems odd to me. It's tradeoffs all the way down.