4 ms·
Netflix didn't move away from react. They render landing pages with static react components through server-side rendering and only add the minimal interactivity
by cpckx 1y ago
Netflix didn't move away from react. They render landing pages with static react components through server-side rendering and only add the minimal interactivity on top through client side js to avoid shipping all of react's state management etc. to the client.
- mike_hearn 1y agoThat way of using it is so different to how you're supposed to use that it might as well not be React at all. It was designed as an in-browser framework and is poorly designed for server-side template rendering.
- whoknowsidont 1y agoReact has always done SSR first and then hydrated state on the client. What leads you to believe that this is not how you're supposed to use it? Doing pure SSR with React is simply... do not hyrdrate state on the client. Really really straightforward. This is such a vanilla setup and was kind of the big selling point to start with from the get-go? Why do you claim otherwise?
- sbergot 1y agoThis is factully wrong. You are confusing react with nextjs. React produce html documents, and the first usecase was reactdom, a pure client rendering library.
- whoknowsidont 1y agoNo. I'm speaking from experience having used React from its very first release. You're not only factually wrong about me being wrong, your knowledge is obviously quite limited. React has always initially rendering components on the server, then hydrated on the client. You don't have to take my word for it, download the initial release and try it out yourself: https://github.com/facebook/react/releases/tag/v0.4.0 https://github.com/facebook/react/releases/tag/v0.4.0 Go ahead, run that and write a simple app. Even better, want to do full SSR with no client lifecycle? Write an app that uses "React.renderComponentToString" and then describe what's happening for me. Even .NET had solutions around using React just for SSR: https://reactjs.net/features/server-side-rendering.html https://reactjs.net/features/server-side-rendering.html Claiming that react itself could not just render out a component server-side and spit out the HTML to the client requires several critical misconceptions about how software in general works lol.
- skowron 1y agoAren't you a treasure, thank the gods you're here to condescend us plebs.
- deleted 1y ago[deleted]
- whoknowsidont 1y agoClaiming something is objectively wrong while stating something that can be refuted with 10 seconds of Googling means you're massaging your own ego at the expense of everyone else's time. Grow up.
- skowron 1y agoYou're still condescending. It's unbecoming.
- mike_hearn 1y agoI didn't know that, thanks for the pointer, but ReactJS did start as a client side only framework. React's history starts around 2010 or so, it was integrated into Facebook in 2011 and Instagram 2012 before being open sourced in 2013. And it was that first open source release that added renderComponentToString: long after React had been deployed on some of the world's largest websites. Also, renderComponentToString isn't SSR. That term usually implies client side hydration so event handlers work, as React is all about state management. But in that release there is no mention of hydration. You could of course do it by hand by rendering to HTML server side, then replacing the entire DOM with a new client side rendered version yourself if you don't mind wiping user's state in some cases, which of course people do! For SSR to work properly took longer. And that makes sense. Facebook don't use JS on the server side, at least not in that era, their web servers were all PHP/hack. So what would have done the SSR?
- rafark 1y agoJust as a fun fact, React’s jsx is actually a port of XHP which was initially developed for PHP in 2009 I believe. This would explain why react’s components were class based at first (because php leans heavily towards class based OO programming).