3 ms·
> 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
by madeofpalk 3y ago
> 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.
- Spivak 3y agoSo just run javascript before your components render so you don't have to run javascript before your components render.
- madeofpalk 3y agoIf you find a way to deliver a website without running any code, let me know!
- freeone3000 3y agoHave a HTML page that you just send. It’s really simples.
- 1-more 3y agoSend like in the mail on a USB stick?
- robertoandred 3y agoYou don't think code editors use code?
- Spivak 3y agoI 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.
- jkrems 3y agoIf 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.
- jzombie 3y agoWebsites with ads should take notice of this.
- micromacrofoot 3y agoTechnically you're still running JS first, just on a different machine.
- Xeamek 3y agoOr 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
- madeofpalk 3y agoThat'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.
- lelanthran 3y ago> 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?