News for hackers. Stuff that matters.
Re:Arwes: Futuristic Sci-Fi UI Web Framework by afavour on Friday June 23, 2023 @07:30PM (#36453652)
React can be used without JS or by hydrating subtrees but those are very uncommon. It’s certainly not React’s “happy path”.
Re:Arwes: Futuristic Sci-Fi UI Web Framework by kamikaz1k on Friday June 23, 2023 @07:40PM (#36453712)
Literally just a single API call: renderToString

https://react.dev/reference/react-dom/server/renderToString

Re:Arwes: Futuristic Sci-Fi UI Web Framework by afavour on Saturday June 24, 2023 @08:16PM (#36463963)
Yes, I’m very aware, but renderToString is designed for later client side hydration.

To make your point you would have wanted to cite renderToStaticMarkup, but tellingly no-one ever does.

Re:Arwes: Futuristic Sci-Fi UI Web Framework by eyelidlessness on Friday June 23, 2023 @08:56PM (#36454305)
Rendering to static HTML is actually pretty common. Admittedly, hydrating subtrees is fairly uncommon (at least where the full tree is also rendered by React server-side), but it’s well within the “happy path” and both patterns have been heavily promoted by React from very early on.

What’s not within the “happy path” is automating any sort of partial hydration process, which is unfortunate, but it seems pretty likely RSC is going to subsume that use case for most anyone trying to solve it with React.