Minor Changes
-
6b3fb0ee725c0521bbaf7ba901a30261472a0e71#4639 Thanks @ashishkr96! - feat(mobx): make the 2022.3@computeddecorator lazy.ComputedValueis now created on first read of the decorated getter rather than eagerly during instance construction, avoiding wasted allocations for getters that are never used. On a 50k-instance × 10-getter class with one read per instance this cuts construction heap by ~50% and construction time by ~25%; the steady-state read path is unchanged. Closes #4616. -
f0c68749428fd4d3bba48e9685e44fd1ddbbee76#4658 Thanks @ashishkr96! - feat(mobx): make the 2022.3@observable accessordecorator lazy.ObservableValueis now created on first read/write/observe of the decorated accessor rather than eagerly during instance construction, avoiding wasted allocations for fields that are never touched. On a 50k-instance × 10-field class with sparse access (1 of 10 fields read per instance), this cuts construction heap by ~82% and construction time by ~86% versus the eager path. Follow-up to #4639.
Patch Changes
-
7eb54418b16fb9b415c04c5b8e05779790dd74ed#4659 Thanks @kubk! - Fix regression from #4639 where isComputedProp returned false for lazy @computed properties before first read -
c22b4b705447a4ccdce93473255f4beb170613f3#4657 Thanks @kubk! - AddgetOrInsertandgetOrInsertComputedtoObservableMapfor compatibility with ESNextMaptypings.