chore(deps): update dependency mobx to version .x 🌟 #4712
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
4.12.0
->5.11.0
5.9.0
->5.11.0
Release Notes
mobxjs/mobx
v5.11.0
Compare Source
computedConfigurable
config #2011, #2013v5.10.1
Compare Source
change.object
through #1985 by xaviergonzv5.10.0
Compare Source
set
support forobservable.set
, see #1945 by xaviergonzv5.9.4
Compare Source
ObservableMap
, see #1930 by pimterrytoStringTag
for Maps and Sets, see #1929 by lennerdv5.9.0
Compare Source
Features
observable.box
now accepts anequals
option, to be able to pass a custom comparision function. Through #1862, #1874 by @fi3ework. Fixes #1580Fixes
flow
, see #1827 by @xaviergonztrace(true)
not being able to handle multi-line comments in traced function. Fixes #1850@computed
now introduces non-configurable properties, to fail fast on incorrect inheritance or property deletion. Fixes #1867enforceActions
andisolateGlobalState
now work correctly when used together. Fixes #1869v5.8.0
Compare Source
flow
in TypeScript 3. Fixes #1816 through #1825 by ismailhabibIGNORE_MOBX_MINIFIY_WARNING=true
to skip the built-in minification warning. See #1835 by fi3eworkv5.7.0
Compare Source
@computed
on a React component. The MobX 5 behavior here has been reverted to the MobX 4 behavior.v5.6.0
Compare Source
keepAlive
has become smarter and won't recomputed computed values that are kept alive, as long as they aren't read. Implements #1534undefined
was undetectedv5.5.2
Compare Source
toJS
not handlingnull
values correctly. Fixes #1557 through #1783 by @wangyiz4262v5.5.1
Compare Source
toJS
now has arecurseEverything
everything option, that even detects and converts observable objects that are "behind" non-observable objects. See #1699 by wangyiz4262comparer
, see #1751 by pdongv5.5.0
Compare Source
(Minor version of
5
was bumped significantly to make the number better correlate together :-))extendObservable
in a class constructor caused errors to be throwndelete
-ing a property was not always picked up by the reactivity systemremove()
-ing a property was not always picked up by thehas()
andget()
utilitieshas
now returnstrue
for computed fieldsget
now returns a value for computed fields_allowStateChangeInsideComputed
. Don't use it :-).v5.1.2
Compare Source
toString
does not behave correctly.v5.1.1
Compare Source
decorate
, see #1711 by makepostv5.1.0
Compare Source
configure({ isolateGlobalState: true })
. Note that this means that observables from the different MobX instances won't cooperate. Fixes #1681, #1082enforceActions
options now supports the values:"never"
,"observed"
and"always"
to make the behavior more clear. Fixes #1680, #1473v5.0.5
Compare Source
v5.0.4
Compare Source
IAutorunOptions
decorate
now can apply multiple decorators, by accepting an array and applying them right to left:decorate(Todo, { title: [serializable(primitive), persist('object'), observable] })
. By @ramybenaroya through #1691 and #1686flow
so that it accepts async generators. By @dannsam through #1656 and #1655keys()
now also supports arrays. Fixes #1600 through #1601 by @nunocastromartinsv5.0.3
Compare Source
v5.0.2
Compare Source
v5.0.0
Compare Source
Release blogpost
Proxy support!
MobX 5 is the first MobX version fully leveraging Proxies. This has two big advantages
The system requirements to run MobX has been upped
Proxies
. In practice this means, no Internet Explorer (Edge is fine). No nodejs < 6. React Native on Android only when JavaScript core is upgraded. All modern browsers are supported.Breaking changes
Proxy
API.spy
has become a no-op in production buildsarray.move
andarray.peek
are removed from the APIarray.find
andarray.findIndex
since they were not standardized in ES..$mobx
property has been dropped from all observables and replaced by a Symbol. Instead of usingx.$mobx.name
, useimport { $mobx } from "mobx"; x[$mobx].name
etc.New features
proxy: false
argument toobservable.object
to disable proxying (theoretically slightly faster, but removes no dynamic key addition)Known Issues
[mobx] Dynamic observable objects cannot be frozen]
. A place where that might happen unexpectedly is when passing an observable object asstyle
property to a React component. Like<span style={someObservableObject} />
, since React will freeze all style objects. The work-around is to simply pass a fresh, non-observable object for styling like:<span style={{...someObservableObject}} />
.If you are usingFixed in mobx-react 5.2.1. But note that you should still migrate away frommobx
withmobx-react
, and you are upgradingmobx-react
to the MobX 5 compatible version (mobx-react@5.2.0
) you will notice thatthis.props
orthis.state
are not yet observable in theconstructor
orcomponentWillMount
. This is for forward compatibility with React 16.3 wherecomponentWillMount
has been deprecated. In most cases usingcomponentDidMount
instead will suffice, especially when the goal is to setup reactions. For more info see #478.componentWillMount
😎.toEqual
might throw an errorallKeys[x].match is not a function
when trying to equal observable arrays. This is a bug in Jest report. The simple work around for now is to slice (ortoJS
if the problem is recursive) the array first.toEqual
matcher might no longer correctly equal your class instances, complaining about differences in the MobX adminstration. This is due to a bug with the processing of symbols: report. For now you might want to use a custom matcher if you are directly equalling observable objects. As a work aroundtoJS(object)
could be used before diffing.Note June 7th, 2018: Both issues are already in Jest master and should be released soon.
Migration guide
slice()
arrays when passing them to external libraries. (Note you still shouldn't pass observable data structures to non-observer
React components, which is an orthogonal concept)reverse
orsort
operations directly on observableArray's anymore, as it's behavior slightly differed from the built-in implementations of those methods. Instead useobservableArray.slice().sort()
to perform the sort on a copy. This gives no additional performance overhead compared to MobX 4. (The reason behind this is that built-insort
updates the array in place, but the observable array implementation always performed the sort on a defensive copy, and this change makes that explicit).isArrayLike()
sinceArray.isArray()
will now return true for observable arraysAPI's that have been dropped
arrayBuffer
setting is no longer supported byconfigure
(it has become irrelevant)observable.shallowBox
,observable.shallowArray
,observable.shallowMap
,observable.shallowObject
,extendShallowObservable
api's have been removed. Instead, pass{ deep: false }
to their non-shallow counter parts.observableArray.peek
,observableArray.move
Renovate configuration
📅 Schedule: "before 3am on the first day of the month" in timezone America/New_York.
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻️ Rebasing: Whenever PR becomes conflicted, or if you modify the PR title to begin with "
rebase!
".🔕 Ignore: Close this PR and you won't be reminded about these updates again.
This PR has been generated by Renovate Bot. View repository job log here.