Ideas for Arc XP

Isomorphic state

We continue to run into instances where it would be helpful to have a server-side state passed to the client-side to reduce the maximum required lookups to content sources to ensure having content for a component to render.

Right now as far as we can tell, if we have a component, it must pull the content using useContent client-side and server-side if state needs to be updated later in the lifecycle.

https://github.com/infrastructure-components/isomorphic-state/blob/master/src/index.tsx

  • Michael Newman
  • Oct 20 2020
  • Future consideration
  • Attach files
  • Sean Shannon commented
    November 10, 2020 20:41

    Thanks for your suggestion! This is an interesting idea that I think we can investigate further down the road - however, at this time we are going to keep the fetchContent and useContent hooks the same since I believe they can accomplish most of what you would like to do. Just to clarify, useContent should not need to refetch content via an HTTP call as long as that content is up-to-date (i.e. not expired). So if your concern is too many HTTP calls, I believe that use case should be solved.

  • JP Blanchette commented
    October 27, 2020 19:45