Open runspired opened 2 years ago
This is expected—but likely worth documenting somewhere.
For other folks who hit this: any getter which only interacts with the auto-tracking system (which includes getters using @cached
) will require @dependentKeyCompat
for downstream computed properties to be updated: it's a necessary bridge between the "pull"-based system of Octane/auto-tracking, where everything between a tracked property and the reactivity layer (mostly templates) is totally ignorant of the reactivity in general, and the "push" based system (where we actively notified subscribers, who were also actively caching their dependent keys' values).
If creating a
cached
property that is only consumed by onecomputed
property (e.g. nothing else would cause it to recompute), specifying that property as a dependent key requires that the property be defined with bothcached
anddependentKeyCompat
for it to work properly, like so: