Ever since we started with the "new UI", so basically the jQuery.wikibase.***view widgets, we have been using wikibase.fetchedEntities as a global front-end data store. This store is being accessed in the view widgets. It is just a plain object where each field key is an entity ID and the content is a "wikibase.store.FetchedContent" object holding an "wikibase.Entity" instance as its content.
In case of the php EntityView and on certain special pages (e.g. SimpleQuery special page) the backend is generating a serialized, "basic" version of all used entities and puts that serialized form into the mw.config var "wbUsedEntities". In the front-end code initializing the respective view, the "wbUsedEntities" is being deserialized and put into wikibase.fetchedEntities.
In some cases, e.g. creating a new claim via the claimview widget, the widget will receive information about the entities used in the new claim (e.g. main snak's property) and add it to wikibase.fetchedEntities.
Instead of having this "global store", we should just inject some proper store instance into the widgets. There should be a proper interface for the store and different implementations. When requesting data from the store, a promise should be returned to support asynchronous store implementations.
Version: unspecified
Severity: normal
Whiteboard: u=dev c=frontend p=5