T
TanStack•10mo ago
exotic-emerald

Cache transfer with SSR

I was wondering if there is some guidance on using angular query with ssr. The cache transfer for httpClient could probably take are of most of the hydration but I was wondering if there is a more direct integration that can be used.
10 Replies
yappiest-sapphire
yappiest-sapphire•10mo ago
It was some time ago that I last tried SSR but I think I got error NG0506 so that would need to be fixed. The devtools are already excluded from running on the server.
exotic-emerald
exotic-emeraldOP•10mo ago
I'll give it another go then and see what the current state is on that
yappiest-sapphire
yappiest-sapphire•10mo ago
I'll look into it too and there's also a bug reported on running Cypress tests that I suspect has the same cause (gc timer running in Angular zone) I tried just now with Angular 19 SSR and I don't get errors anymore. HttpClient caching works too.
exotic-emerald
exotic-emeraldOP•10mo ago
That's great Do you maintain a list of things that have to be done for angular query? Ideally sorted by familiarity and skill 😉
yappiest-sapphire
yappiest-sapphire•10mo ago
Yeah I want to add an issue and add sub-issues to that with all the things that need to happen. Also there are bugs to fix: https://github.com/TanStack/query/issues?q=is%3Aissue%20state%3Aopen%20label%3A%22package%3A%20angular-query%22%20 SSR testing and documentation is very welcome too Or adding example applications in general
exotic-emerald
exotic-emeraldOP•10mo ago
I'll give the ssr parts a go and see if I can contribute some insights I want to use it with trpc, seems like a great fit initially
yappiest-sapphire
yappiest-sapphire•10mo ago
Never used it but TRPC sure looks good. Does it work with Angular too?
exotic-emerald
exotic-emeraldOP•10mo ago
Generally yes, I wrote that basics of a link that uses angular httpClient to get the serverside cache and interceptors Basics of a link here: it works for all the things I've tried so far, I think the docs are not ideal.
yappiest-sapphire
yappiest-sapphire•10mo ago
That's really cool, TRPC makes a lot sense as it saves a ton of work I can imagine
exotic-emerald
exotic-emeraldOP•10mo ago
Especially the typing should work nicely, possibly one could even derive query keys from the procdures that are called 🤔

Did you find this page helpful?