4 ms·
I've been using vite for building a new web app and have enjoyed the experience so far. One thing I'd love to be able to do is to do the classic thing of rende
by cetra3 5y ago
I've been using vite for building a new web app and have enjoyed the experience so far.
One thing I'd love to be able to do is to do the classic thing of rendering things mostly as html templates on server side, but serving up JS for particular page components. I also don't want to use node for SSR if at all possible, but seems to be the only route available.
That way I can easily support non-js users of the app (bing struggles to index my site at all). It used to be a lot easier to do this, but I guess it's out of vogue now!
- probst 5y agoI have exactly the same need (and problem too)! I'll monitor this thread and see if anyone else has any solutions to this. I really would like not to have node running on my server in order to get SSR! Which effectively means I'll either have to serve entirely static pages and then hydrate them based on some model client side (which isn't server side rendering by any definition of the term), or I have to recreate the entirety of the HTML rendering functionality for my server side in my language of choice. I guess there might not be a way around the second option?
- jasonkester 5y agoYeah, I've had to deal with this at every js shop I work with recently, so I built this to solve the problem: https://webrender.io/ https://webrender.io/ Essentially, it's a reverse proxy that serves a cached, pre-rendered HTML version of your site to bot traffic while sending real users onward to your actual website. It works kind of like Cloudflare (which it's built on top of). You can also hit it with an API from your end if you want to just forward bots or aren't comfortable sticking somebody else's service in front of your site.
- kiejo 5y agoIt sounds like https://astro.build https://astro.build might be a good fit if you're looking to generate mostly HTML and only use JS for a few interactive components on the page. It's still very new and I haven't worked with it yet.