Some bindings that should be marked as volatile are not, so changes may not be properly detected.
While there is code to detect some conditionals in binding expressions, it does not trigger on ??. This means a binding expression such as x => x.foo ?? x.bar might miss changes to bar.
Aggregate bindings are never marked as volatile due to a bug in the logic. The HTMLBindingDirectiveconstructor tests the stringified binding function for volatility, rather than the parsed parts of the aggregate expression.
π» Repro or Code Sample
The following binding expressions will not reliably detect changes:
my-attr="${x => x.foo ?? x.bar} because nullish coalescing does not match the regex
my-attr="foo ${x => x.bar && x.baz} because aggregate bindings are never marked volatile
my-attr="foo ${x => x.bar || x.baz} because aggregate bindings are never marked volatile
π€ Expected Behavior
Attributes should always be updated when a value in the binding expression changes.
π― Current Behavior
Attributes are not always updated when a value in the binding expression changes.
π Bug Report
Some bindings that should be marked as volatile are not, so changes may not be properly detected.
??
. This means a binding expression such asx => x.foo ?? x.bar
might miss changes tobar
.HTMLBindingDirective
constructor tests the stringified binding function for volatility, rather than the parsed parts of the aggregate expression.π» Repro or Code Sample
The following binding expressions will not reliably detect changes:
my-attr="${x => x.foo ?? x.bar}
because nullish coalescing does not match the regexmy-attr="foo ${x => x.bar && x.baz}
because aggregate bindings are never marked volatilemy-attr="foo ${x => x.bar || x.baz}
because aggregate bindings are never marked volatileπ€ Expected Behavior
Attributes should always be updated when a value in the binding expression changes.
π― Current Behavior
Attributes are not always updated when a value in the binding expression changes.
π Possible Solution
π¦ Context
Discovered during resolution of https://github.com/ni/nimble/pull/1839