dom-expressions icon indicating copy to clipboard operation
dom-expressions copied to clipboard

Respect order of directives against dynamic attributes

Open lxsmnsyc opened this issue 2 years ago • 2 comments

Currently, directives are always guaranteed to run first, regardless if the dynamic attribute is declared first. We can consider this issue in the future however we can't do this right now considering that dom-expressions does not do true fine-grained attributes, as dynamic attributes are grouped into a single effect rather than their own independent effects. With ordered directives, it requires these dynamic attributes to either be split into their own independent effects or their group sequences (longest sequence of dynamic attributes before and after a directive, much like mergeProps is right now.), but of course we don't want this right now as this trades the creation/memory cost against the update cost.

lxsmnsyc avatar Jan 07 '22 05:01 lxsmnsyc

Yeah it might be interesting adding a first run type mechanism. There is complexity there, but maybe a simple is first sort of check could allow us to run these things in order inside the effect if necessary. The cost of doing one extra check each time isn't going to sink us.

ryansolid avatar Jan 07 '22 05:01 ryansolid

Being optimistic, I'd say we could probably generate the effects first before the directives, so that the directives are guaranteed to run after all dynamic attributes has been set.

lxsmnsyc avatar Jan 07 '22 06:01 lxsmnsyc