Affects Version/s: None
Fix Version/s: None
Component/s: Data Binder
Even if the user attempts to express a preference for which components should have their initial model values take priority during the "init transaction" by using directives such as
, the framework may sort the application times of these initial values into an ordering which leads to a final set of resolved values around the model skeleton that does not respect this preference.
For example, this test environment taken from a branch of @colin 's Aconite project at https://github.com/colinbdclark/aconite/blob/gh-9/tests/unit/video-performer-tests.js#L19 specifies an initial value for a component which participates in a relay with two subcomponents:
The subcomponents have been each set up in https://github.com/colinbdclark/aconite/blob/gh-9/src/video-performer.js with a relay directive as follows which should prevent child values from propagating up to the parent:
The definition does indeed stop the propagation of the child values during the init transaction, but the final resolved value across the skeleton is not the one that the user desires - during the process of resolving the init transaction, the parent's value is applied first and the children's later, leading the children to have the default value of loop: false and only the parent with the inconsistent, desired value of loop: true.
It is finally time to bite the bullet and introduce a topological sorting algorithm that guarantees to respect such one-way directives during the init transaction - that is, the directed graph induced by such directives needs to be parsed out of the total configuration and used to induce a topological sorting order which applies "most depended-on values" last.