Releases: mobxjs/mobx
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
This release fixes a plethora of bugs related to sub-classing and reflecting / iterating on observable objects.
The behavior of MobX is in many edge cases much more explicitly defined now.
A new annotation was introduced: @override
/ override
to support re-defining actions and computed values(!) on sub classses.
For idiomatic MobX usage this release should have little impact, but if you are using a lot of sub-classing, reflection APIs or direct object manipulations like defineProperty
,
this release might introduce previously unseen errors for cases that silently failed before, or even worked successfully even though the correct behavior wasn't specified earlier.
If you are migrating from MobX 4/5 we strongly recommend to go to 6.1 in one go, and skip 6.0.*, as some buggy behavior compared to the previous majors has been corrected.
As always, our libraries come as-is and are maintained by volunteers. Upgrades are at own risk and voluntary. Bug reports require a minimal reproductions and a correctly filled out issue template.
Support the ongoing maintenance at: https://opencollective.com/mobx
Minor Changes
28f8a11d
#2641 Thanks @urugator!
action
,computed
,flow
defined on prototype can be overriden by subclass viaoverride
annotation/decorator. Previously broken.- Overriding anything defined on instance itself (
this
) is not supported and should throw. Previously partially possible or broken. - Attempt to re-annotate property always throws. Previously mostly undefined outcome.
- All annotated and non-observable props (action/flow) are non-writable. Previously writable.
- All annotated props of non-plain object are non-configurable. Previously configurable.
- Observable object should now work more reliably in various (edge) cases.
- Proxied objects now support
Object.defineProperty
. Previously unsupported/broken. extendObservable/makeObservable/defineProperty
notifies observers/listeners/interceptors about added props. Previously inconsistent.keys/values/entries
works likeObject.keys/values/entries
. Previously included only observables.has
works likein
. Previously reportedtrue
only for existing own observable props.set
no longer transforms existing non-observable prop to observable prop, but simply sets the value.remove/delete
works with non-observable and computed props. Previously unsupported/broken.- Passing
options
toobservable/extendObservable/makeObservable
throws if the object is already observable . Previously passed options were mostly ignored. autoBind
option is now sticky - same asdeep
andname
option.observable/extendObservable
now also picks non-enumerable keys (same asmake[Auto]Observable
).- Removed deprecated
action.bound("name")
- Proxied objects should be compatible with
Reflect
API. Previously throwing instead of returning booleans.
[email protected]
Patch Changes
- Updated dependencies [
28f8a11d
]:
[email protected]
Patch Changes
- Updated dependencies [
28f8a11d
]:
[email protected]
Patch Changes
-
6b304232
#2644 Thanks @rokoroku! - Fix broken error reference in errors.ts -
83b84fd3
#2740 Thanks @iChenLei! - Infer optional / promiseaction
args type correctly -
65c7b73b
#2717 Thanks @ahoisl! - The TypeScript typeCreateObservableOptions
is now exported. -
989390d4
#2594 Thanks @urugator! - Fixed #2579 -observable
does not ignore class instances -
dea1cf18
#2726 Thanks @mweststrate! - fix:onBecomeObserved
was not triggered correctly for computed dependencies of computeds. Fixes #2686, #2667 -
592e6e99
#2743 Thanks @vkrol! - RemovesideEffects
section inmobx-react-lite
package.json
🚨🚨🚨 If you are upgrading from V4/V5, please follow the migration guide.