Resolve partial content: Video list item clicked on, should immediately display channel and title since it's available
Handle relations: User associated with a Video should be stored in the User cache. when requesting that user, the data about the user, gathered from the video, should be resolved
Reactive: Any updates to the cache should be immediately resolved in the UI
TTL: Basic TTL with refetching and options to return available stale data
Nice to have:
Provider agnostic: Ideally this can run at the standard provider level instead of having to write an implementation for each provider which would be a large maintenance burden potentially
Cross tab sync: Display updates the cache in all of the tabs immediately, the same system could be used for settings sync as well. Potentially by using the extension
Urql's graphcache solves almost all these problems but it would require using GraphQL. Also, it would be complex since some data is optional depending on the entry point (i.e. subscriber count is available when getting recommended videos on youtube). This means the provider would need to define what properties are available to the consumer which is the opposite of the GraphQL. It might be possible to write individual schemas or use directives but this complexity may not be worth it
Must be able to:
Nice to have:
Urql's graphcache solves almost all these problems but it would require using GraphQL. Also, it would be complex since some data is optional depending on the entry point (i.e. subscriber count is available when getting recommended videos on youtube). This means the provider would need to define what properties are available to the consumer which is the opposite of the GraphQL. It might be possible to write individual schemas or use directives but this complexity may not be worth it