Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

[flagged]


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)


Or just be a sane person and use HTML, CSS, and templates, and sprinkle some HTMX on top for interactivity.


What is the sane person’s templates?


React can be used without JS or by hydrating subtrees but those are very uncommon. It’s certainly not React’s “happy path”.


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.


Literally just a single API call: renderToString

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


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.


What would be the right tool for an entertaining highly interactive and animated (game-like, but still mostly text based) thing then? Used to be Java applets and Flash. Now is "webapps" and WebGL.

Or is that it should have been handrolled using CSS animations and framework-less JS?

Or is it more that we're acting like it's 1995 and the web is for reading text documents only, and anything other than that is nerd blasphemy? (Not saying you're saying this, but it is something some still press; they hate the web stack being used in other ways).


CSS + HTML5


I’m a ~25 year web development veteran who has grown to absolutely hate CSS for building any remotely complex UI.


did you even look at their site? the last thing i would call it is a "normal website"




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: