microsoft / fast

The adaptive interface system for modern web experiences.
https://www.fast.design
Other
9.17k stars 587 forks source link

fix(fast-element-1): some template bindings not properly being marked as volatile #6966

Open m-akinc opened 2 months ago

m-akinc commented 2 months ago

πŸ› Bug Report

Some bindings that should be marked as volatile are not, so changes may not be properly detected.

  1. 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.
  2. Aggregate bindings are never marked as volatile due to a bug in the logic. The 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:

πŸ€” 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