-
Notifications
You must be signed in to change notification settings - Fork 364
Transitioning the Indexer from the static tree to the runtime tree
Currently, getting the root query of an Om Next app will not return an updated view on the app's query structure if some child instance of the root has changed its query. Transitioning the indexer to the runtime tree would allow a consistent view of the UI tree with respect to query structure. In order to achieve that, a few constraints need to be introduced in the way we allow components to change their queries at runtime.
- Restricting
set-query!
such that:
- we only allow an instance to set its query if it satisfies at least one of the following:
- the instance has a
ref
, independently of how many instances of such class exist
- we can get this new query via
subquery
later
- there's only one instance of this class in its
data-path
- this is possibly preferred over
class-path
since it builds directly on the structure of the queries in the app
- if none of the above apply, we change the query for the class
- this allows dynamism in setting the query for all the instances of a certain class in a join
- comparable to setting the query of all posts in a Dashboard similar to the "Queries with Unions" tutorial
- the instance has a
-
get-query
would need to be modified for component instances in order to make it work with the new semantics ofset-query!
-
build-index
would most probably be fixed for free because it just usesget-query
on the root and goes from there. -
full-query
would also be fixed for free because it leverages the indexes which we fixed in 3).