This repository was archived by the owner on Oct 11, 2020. It is now read-only.
fix(deps): update dependency mobx to v6 - #117
Open
renovate[bot] wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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:
^5.9.4->^6.0.0Release Notes
mobxjs/mobx
v6.0.0Compare Source
New features
makeObservable(target, annotations)is now the recommended way to make objects with a fixed shape observable, such as classes.makeAutoObservable(target)will automatically determine the annotations used bymakeObservable. Methods will be marked as 'autoAction', so that they can be used both from a computed value or as standalone method.observable.arraynow supports{ proxy: false }as option.reaction's effect function now receives the previous value seen by the reaction as second argument.flowcan now be used as annotation as well. You might needflowResultin case you use TypeScript to extract the correct result type. details.Breaking changes
Changes that might affect you
decorateAPI has been removed, and needs to be replaced bymakeObservablein the constructor of the targeted class. It accepts the same arguments. Themobx-undecoratecan transform this automatically.extendObservable/observable, fields that contained functions used to be turned into observables. This is no longer the case, they will be converted intoautoActions.observedmode.toJSno longer takes any options. It no longer converts Maps and Sets to plain data structures. Generic, flexible serialization of data structures is out of scope for the MobX project, and writing custom serialization methods is a much more scalable approach to serialization (tip: leveragecomputeds to define how class instances should be serialized).interceptandobserveare no longer exposed on observable arrays, maps and boxed observables. Import them as utility from mobx instead:import { observe, intercept } from "mobx", and pass the collection as first argument:observer(collection, callback). Note that we still recommend to avoid these APIs.observableMap.toPOJO(),observableMap.toJS()have been dropped. Usenew Map(observableMap)instead if you want to convert an observable map to a plain Map shallowly.observableMap.toJSON()now returns an entries array rather than a new Map, to better support serialization.observableSet.toJS()has been dropped. Usenew Set(observableSet)instead if you want to convert an observable Set to a plain Set shallowly.observableMap.toJSON()now returns an array rather than a new Set, to better support serialization.isArrayLikeis no longer exposed as utility. UseArray.isArray(x) || isObservableArray(x)instead.Obscure things that don't work anymore, but that probably won't affect you
@observableormakeObservable) that is already declared in a super class.runInActionno longer supports passing a name as first argument. Name the original function or useaction(name, fn)()if you care about the debug name.computed(getterFn, setterFn)no longer accepts a setter function as a second argument. Use thesetoption instead:computed(getterFn, { set: setterFn }).findIndex/findmethod, theoffsetargument (the third one) is no longer supported, to be consistent with ES arrays.computedConfigurableofconfigureis no longer supported as it is now the default.observableArray.toJS()has been removed, useobservableArray.slice()instead, which does the same.IGNORE_MOBX_MINIFY_WARNINGenvironment flag._allowStateChangesInComputation(fn)is no longer needed, userunInAction(fn)instead.computed, thewhenpredicate (first arg), andreactionpredicate (first arg) it is now forbidden to directly change state. State changes should be done in their effect functions, or otherwise at least wrapped inrunInAction(only the state change, not the observables you want to track!). Note that this is still an anti-pattern.observableArray.get()andobservableArray.set()methods are no longer supported.IObservableObjectinterface is no longer exported from MobX.reactioneffect function, the disposer object, is now passed in as third argument. The second argument is now the previous value seen by the reaction.onBecomeObserved/onBecomeUnobservedwill now only trigger for observables that are actually used by a reaction (see #2309 for background).Fixes
thisfor array callbacks such as inarray.forEacharray.concaton(un)BecomeObservedon(un)BecomeObservedwas triggered for observables changed in actions without having an observerRenovate configuration
📅 Schedule: At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻️ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by WhiteSource Renovate. View repository job log here.