capri-js / capri

Build static sites with interactive islands
https://capri.build
MIT License
208 stars 5 forks source link

SSR #40

Closed andreyvolokitin closed 1 year ago

andreyvolokitin commented 2 years ago

Hello and thanks for this awesome project!

As mentioned in motivation section, Capri fits quite unique set of goals, while alternatives are hard to find. SSR is mentioned as experimental with the focus on SSG. But one popular use-case — ecommerce —actually can benefit hugely from Capri, but it often requires SSR due to a more dynamic nature. Also SSR capability makes Capri even more unique.

Could SSR be made a first-class citizen for Capri?

fgnass commented 2 years ago

Yes, it surely could!

You can take a look at these SSR demos to see what's already possible:

They all use one of these build targets:

Can you go into detail what exactly Capri would need to in your opinion in order to cover your use case?

andreyvolokitin commented 2 years ago

No specific details as of now, but I plan to use Capri for e-commerce site with SSR at unknown deploy target. I looked into vercel/cloudflare examples, and it looks like in order to do SSR at i.e. self-hosted express, one could add a new BuildTarget for this

What I meant by this issue is if SSR functionality is "production ready", because the "experimental" note here: https://capri.build/docs/project-structure/client-entry/

fgnass commented 1 year ago

The "experimental" note is now removed and there is a new SSR section in the docs: https://capri.build/docs/ssr/