T
TanStack5mo ago
ratty-blush

ssr only for a few pages?

Hey, I'm taking a serious look at adopting tanstack start. I do not build ecom apps or usually anything that is not behind a login. I'm on the fence atm about some things. I'm thinking of turning this particular production application into a tanstack app either with router or start. On one end, I could use astro for the domain.tld and about contact etc. the usual marketing stuff and then just tanstack router for the dashboard stuff at app.domain.tld. This seems mostly fine to be but also keeping it all in one deployment seems convenient as well, so I'm wondering if I can use tanstack start, only ssr the marketing pages and then let all other app pages avoid ssr entirely. would it be sane to have an off by default mode where I can opt in to ssr in only a few pages? I will have WAY more none-ssr pages vs. ssr pages?
7 Replies
ratty-blush
ratty-blushOP5mo ago
I've been doing react for years and last year I tried to commit to svelte/kit because I was tired of nextjs (preaching to the choir) and I don't trust the react router guys to not completely change and rebrand everything ever few years I am leaving svelte kit because tanstack makes me want to write react again
rival-black
rival-black5mo ago
we have rudimentary support for this via ssr:false on individual routes as well as defaultSsr: false on the router config
ratty-blush
ratty-blushOP5mo ago
perfect
rival-black
rival-black5mo ago
however, much more work is needed here
rival-black
rival-black5mo ago
GitHub
[RFC] SPA Mode Enhancements · TanStack router · Discussion #3394
TanStack Start is a unique opportunity for SPAs to have server-side features, but may come with some decisions to make. What does SPA mode mean? From my perspective, SPA mode is a general term for ...
rival-black
rival-black5mo ago
and please add your comments if you have some
ratty-blush
ratty-blushOP5mo ago
thank you very much, and I can see you in all the other questions being very responsive, I maintain some open source stuff myself so I find your diligence in answer things promptly to be very admirable, thank you again
Currently ssr: false for all other routes means "don't run ssr for this route and any children"
Currently ssr: false for all other routes means "don't run ssr for this route and any children"
this is actually perfect for me I will just nest that stuff all in a layout xxx/app/ and anything not ssr is just a child route

Did you find this page helpful?