it is taken form Modernize Data Fetching API - `@plone/client` · Issue #4347 · plone/volto · GitHub and now I have a doubt that how will this piece of code will be beneficial to other persons using our library @plone/client (as mentioned is the project ideas in gsoc). One thing we can do if it is unnessisary is that we can private it for just our use in plone's volto. I am stuck here, It might be a silly question but I would really love to hear about it from @sneridagh the mentor for this project.
As you might already know, Tanstack Query is an agnostic library. Meaning, it can be used in non-ReactJS frameworks, like Svelte, Preact, Angular, etc... The generic primitive that we can share is a function that generates the parameters to pass to Tanstack query, and this is the object with the parameters, in this case, contactDetailQuery.
While is not the goal of the project to provide all this integrations, it is to provide this primitives, so they can be easily reused in these frameworks.
Then in Volto, we will have to provide a set of custom hooks that consume these primitives. Although we can maintain them in @plone/client... something TBD.
Another goal of the project is to achieve maximum plugability, not only with Volto, but with any other framework.
@sneridagh Thank you sir for this information, while we are at this discussion I would really love to know more about AsyncConnect (or redux-connect library). As this is going to help boost my research on this project a lot.
Moreover, please point me towards some of the web links where I can study about this project's current custom made redux middleware we use in volto for server state management.
I know this all is for later when one of us contributors have been selected for the project but truly I love to know about these codebases which has actively been maintained for some years now and are used in production because growing up I want to create one such project of my own.
I think you don't have to put so much effort in understanding how AsyncConnect works in current Volto. Anyways, if you want, look at the source. You only have to know that AsyncConnect is used for the SSR (NodeJS Volto server side rendering Express engine) for render all the app in the server in the initial request. This is key for SEO to work correctly and for performance reasons.
Please take a look at the PoC that is mentioned in the PLIP, where AsyncConnect is removed from the equation, replaced by react-query.