Releases: mobxjs/mobx
mobx-undecorate@1.0.7
mobx@6.1.5
Patch Changes
-
7820e5ea
#2769 Thanks @iChenLei! - add warn for extending builtins -
a7c15171
#2775 Thanks @pkit! - use globalThis in global detection -
5d41b646
#2774 Thanks @urugator! - Fix:makeAutoObservable
now working properly with symbolic keys
Fix:isComputedProp
andgetAtom
second arg type is incompatible with Symbols
mobx@6.1.4
mobx-undecorate@1.0.6
mobx@6.1.3
mobx@6.1.2
mobx@6.1.1
mobx@6.1.0
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.
mobx-react@7.1.0
Patch Changes
- Updated dependencies [
28f8a11d
]:- mobx@6.1.0
- mobx-react-lite@4.0.0
mobx-react-lite@3.2.0
Patch Changes
- Updated dependencies [
28f8a11d
]:- mobx@6.1.0