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

> React components cannot do this — full stop.

Render your react components on the server and send them over the wire as plain html. no client side javascript required — full stop.



Or You could instead use this magic thing that has been around for decades, has massive tooling and most importantly, doesn't lock you into one specific ecosystem of language that was never supposed to be run server side to begin with;

Html templating


That's exactly what React is though?

Rendering react on the server isn't some magical hip technology. It's just a different template framework. I'm not pretending this is anything special or fancy.


Technically you're still running JS first, just on a different machine.


So just run javascript before your components render so you don't have to run javascript before your components render.


If you find a way to deliver a website without running any code, let me know!


I just think SSR is kind of missing it because web components allow a static frontend bundle to have a power that was previously reserved for SSR or HTML-only apps.

Moving the render off the client is nice, but removing the prerender altogether is something much cooler.


If you have a static frontend bundle, isn't that just SSG (static site generation)? And if you can generate the site at build time, what's the fundamental difference between any of the non-web component SSG solutions and a web component SSG solution? Sure, you can pretend like there will be "no build step". But only if you're fine with "no proper cache headers" (and a long tail of other things). So in practice - hopefully there _will_ be a build step anyhow.


Have a HTML page that you just send. It’s really simples.


Send like in the mail on a USB stick?


You don't think code editors use code?


Websites with ads should take notice of this.


> Render your react components on the server and send them over the wire as plain html. no client side javascript required — full stop.

Doesn't this then require the server to be written in Javascript as well?




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

Search: