neomjs / neo

The application worker driven frontend framework
https://neomjs.com
MIT License
2.83k stars 151 forks source link

model.Component: Improve support for using data records inside VM data properties & binding into record fields #5602

Open tobiu opened 1 month ago

tobiu commented 1 month ago

VMs have a safeguard to not change the internal structure of records: https://github.com/neomjs/neo/blob/dev/src/model/Component.mjs#L518

Normally, each object property would get replaced with setters to get change events, but this could easily break the internal logic of records, which is also get & set driven.

if we wanted to bind to specific record fields, we would need to extend the logic a bit: e.g. somewhere here: https://github.com/neomjs/neo/blob/dev/src/data/RecordFactory.mjs#L329

records do fire change events on their store, but we would need a notification for a given VM which then could trigger onDataPropertyChange().