Re:Arwes: Futuristic Sci-Fi UI Web Framework
by eyelidlessness on Friday June 23, 2023 @02:32PM
(#36450581)
Why? React’s component model can be an excellent abstraction for building a “normal website”—or rather, its component parts—for developers who prefer it. React can compile to static HTML, without running any JS client side, and/or can be used to mount or hydrate arbitrary subtrees however one sees fit. (I’d probably favor Preact or Solid for the latter, but React is a perfectly cromulent choice)
[ Parent
| on HN ]
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
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.
Or just be a sane person and use HTML, CSS, and templates, and sprinkle some HTMX on top for interactivity.
Re:Arwes: Futuristic Sci-Fi UI Web Framework
by eyelidlessness on Tuesday June 27, 2023 @11:07PM
(#36501777)
What is the sane person’s templates?