volto icon indicating copy to clipboard operation
volto copied to clipboard

Look ma, no AsyncConnect (useQuery, instead)

Open sneridagh opened this issue 3 years ago • 3 comments

I had this in my mind since some time ago...

It turns out it does work :) PoC correct SSR working only for root route.

So, next steps, if we want to follow the rabbit hole:

  • Make it work for all routes, detect Express route, pass it to react-query.
  • Ask in a single SSR request for common expansions (breadcrumbs, navigation, etc)
  • Put in place a way to extend that with route matching "a la AppExtras/slots" way
  • Scale the useQuery "actions" as we do with the Redux-based ones now, app-wide architecture
  • Remove the (initial) request triggers from breadcrumbs, nav and alike
  • Think in a way to make coexist this with Redux API requests
  • Eventually upgrade to RR6.4

sneridagh avatar May 29 '22 16:05 sneridagh

Deploy Preview for volto canceled.

Name Link
Latest commit 4c04700cf32efcf3ae20f31d874f6049ad978fcb
Latest deploy log https://app.netlify.com/sites/volto/deploys/63f079e2adc51b0008868e62

netlify[bot] avatar May 29 '22 16:05 netlify[bot]

Nice! withContent.js is missing, and I think we should also be getting rid of the request triggers in the nav components (breadcrumbs, navigation, etc). I think we need to move completely to "static", introspectable methods of async data fetching. for backwards compatibility, we can keep the asyncExtenders configuration, as the function signature could be more or less the same (I don't know about redux store, but I feel the redux store may be needed in some of those functions).

tiberiuichim avatar May 30 '22 07:05 tiberiuichim

@tiberiuichim doh, pushed!

Indeed, I just added it to the to-do list. +1 to all.

sneridagh avatar May 30 '22 07:05 sneridagh