We've often encountered, that it would be nice, if we could have something like global content be available for every page/template without setting up a global content source for every page/resolver.
Example use-case:
We have feature flags configured in outbound feeds.
In fusion, we use these feature flags to dynamically show or hide features. We call useContent to get these feature flags.
Due to how fusion engine works (two render passes), the first render pass does not have the feature flags data yet
If we do a conditional useContent for the data required by the enabled features, the data would only be available in a non-existent third render pass, so it will be done on the client instead of on the server. I.e. no SSR.
Our current workaround is to always call the content source for the possibly enabled feature, even if it's not enabled.
Our proposal:
Make a pattern or provide an arc-config option for a content-source that is always called.
Maybe differentiate between output types? Or pass the output type to the content source
The content-source should receive meta-data like the url and arc-site for the current request
The result of the content-source should then be available to the first render-pass.
Nice to haves:
Optionally provide renderables to the content-source or allow fetching them somehow
Optionally provide the global content of the page/resolver to the content-source
A bit of background:
I think a big part of these kind of issues is the first/second render pass pattern using useContent calls to register required content-sources in the first pass. If we had a way to analyze the renderables up front and prepare data upfront (like in Next.js), this would not be an issue.