Skip to content
This repository has been archived by the owner on Mar 18, 2019. It is now read-only.

chore(deps): update dependency mobx to v5 #39

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

renovate[bot]
Copy link

@renovate renovate bot commented Jun 7, 2018

This PR contains the following updates:

Package Type Update Change References
mobx devDependencies major 4.3.0 -> 5.9.0 homepage, source

Release Notes

mobxjs/mobx

v5.9.0

Compare Source

Features

  • Introduced support for observable sets! Through #​1592 by @​newraina
  • observable.box now accepts an equals option, to be able to pass a custom comparision function. Through #​1862, #​1874 by @​fi3ework. Fixes #​1580
  • Improved logging of reactions; if an action throws an exception, errors in reactions that react to that are only logged as warnings. Fixes #​1836

Fixes

  • Improved typings for flow, see #​1827 by @​xaviergonz
  • Don't allow subclassing map, fixes #​1858
  • Fixed trace(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 #​1867
  • The options enforceActions and isolateGlobalState now work correctly when used together. Fixes #​1869

v5.8.0

Compare Source

  • MobX now requires TypeScript 3 (this was already the case in 5.7.0, but in this version the difference is actually noticeable in the typings).
  • Fixed array dehancer sometimes skipping. Fixes #​1839 through #​1841 by k-g-a
  • Fixed issue where webpack 4 wouldn't use the ESM module #​1834 by mrtnbroder
  • Improved type inference for flow in TypeScript 3. Fixes #​1816 through #​1825 by ismailhabib
  • Introduced support for global environment variable IGNORE_MOBX_MINIFIY_WARNING=true to skip the built-in minification warning. See #​1835 by fi3ework
  • Fixed onBecome(Un)Observed dispoer cleanup. Fixes #​1537 through #​1833 by fi3ework

v5.7.0

Compare Source

  • Upgraded typings to TypeScript 3
  • Fixed #​1742, change detection fails when multiple mobx instances were active.
  • Fixed #​1624, use built-in flow types for iterators
  • Fixed #​1777 through #​1826, stack overflow exception, in development mode, when using @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 #​1534
  • Fixed #​1796, undeleting a property that had an initial value of undefined was undetected
  • Improved Flow typings, see #​1794 and #​1786

v5.5.2

Compare Source

v5.5.1

Compare Source

  • toJS now has a recurseEverything everything option, that even detects and converts observable objects that are "behind" non-observable objects. See #​1699 by wangyiz4262
  • Added flow typings form comparer, see #​1751 by pdong
  • Update flow typings for configuration options, #​1772 by alexandersorokin

v5.5.0

Compare Source

(Minor version of 5 was bumped significantly to make the number better correlate together :-))

  • Fixed #​1740: combining decorators and extendObservable in a class constructor caused errors to be thrown
  • Fixed #​1739:
    • Proxies: delete-ing a property was not always picked up by the reactivity system
    • Non-proxies: remove()-ing a property was not always picked up by the has() and get() utilities
    • has now returns true for computed fields
    • get now returns a value for computed fields
  • Introduced _allowStateChangeInsideComputed. Don't use it :-).
  • MobX is now transpiled using babel 7

v5.1.2

Compare Source

  • Fixed #​1650, decorating fields with the name toString does not behave correctly.

v5.1.1

Compare Source

v5.1.0

Compare Source

  • Improved handling of multiple MobX instances. MobX will no longer complain about being loaded multiple times (one should still prevent it though, to prevent blowing up bundle size!), but merge internal state by default. If multiple MobX versions need to be loaded, call configure({ isolateGlobalState: true }). Note that this means that observables from the different MobX instances won't cooperate. Fixes #​1681, #​1082
  • enforceActions options now supports the values: "never", "observed" and "always" to make the behavior more clear. Fixes #​1680, #​1473

v5.0.5

Compare Source

  • Fixed #​1667: creating a large array could result in undefined items (MobX 4.* was not affected)

v5.0.4

Compare Source

v5.0.3

Compare Source

  • Fixed issue where it was no longer possible to define custom properties on observable arrays

v5.0.2

Compare Source

  • Fixed issue where iterators where not compiled to ES5, breaking the ES5 based builds.

v5.0.0

Compare Source

Release blogpost

Proxy support!

MobX 5 is the first MobX version fully leveraging Proxies. This has two big advantages

  1. MobX can now detect the addition of properties on plain observable objects, so it is now possible to use plain observable objects as dynamic collections.
  2. Observable arrays are now recognized as arrays by all third party libraries, which will avoid the need to slice them.
The system requirements to run MobX has been upped
  • MobX 5 can only be used on environments that support 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.
  • Since MobX no longer runs on older browsers, the compilation target has been upgraded to ES2015 syntax supporting browsers. This means that MobX is not loadable on older browsers without down compilation to ES5.
  • If for whatever reason your project cannot meet this requirements, please stick to MobX 4. It will be actively maintained. All current features of MobX 5 are expressable in MobX 4 as well, but it means that for example to use dynamic objects some additional APIs are needed.
  • The performance footprint of MobX 5 should be pretty similar to MobX 4. In our performance tests we saw some minor improvements in memory footprint, but overall it should be pretty comparable.
Breaking changes
  • The required runtime needs to support the non-polyfillable Proxy API.
  • The minimum runtime target is now ES2015, not ES5
  • spy has become a no-op in production builds
  • All earlier deprecated APIs are dropped. Make sure to not have any deprecation warnings before upgrading.
  • array.move and array.peek are removed from the API
  • Dropped the third argument to array.find and array.findIndex since they were not standardized in ES.
  • .$mobx property has been dropped from all observables and replaced by a Symbol. Instead of using x.$mobx.name, use import { $mobx } from "mobx"; x[$mobx].name etc.
  • In some cases, the order in which autoruns are fired could have changed due to some internal optimizations (note that MobX never had a guarantee about the order in which autoruns fired!)
New features
  • It is possible to pass the proxy: false argument to observable.object to disable proxying (theoretically slightly faster, but removes no dynamic key addition)
Known Issues
  • Observable objects can no longer be frozen (otherwise they would become un-observable😎). If you are actually trying to do so MobX will now throw an exception like: [mobx] Dynamic observable objects cannot be frozen]. A place where that might happen unexpectedly is when passing an observable object as style 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 using mobx with mobx-react, and you are upgrading mobx-react to the MobX 5 compatible version (mobx-react@5.2.0) you will notice that this.props or this.state are not yet observable in the constructor or componentWillMount. This is for forward compatibility with React 16.3 where componentWillMount has been deprecated. In most cases using componentDidMount instead will suffice, especially when the goal is to setup reactions. For more info see #​478. Fixed in mobx-react 5.2.1. But note that you should still migrate away from componentWillMount😎.
  • Jest toEqual might throw an error allKeys[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 (or toJS if the problem is recursive) the array first.
  • Jest 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 around toJS(object) could be used before diffing.

Note June 7th, 2018: Both issues are already in Jest master and should be released soon.

Migration guide
  • Make sure to not use any API that produces deprecation warnings in MobX 4. Beyond that MobX 5 should pretty well as drop-in replacement of MobX 4.
  • You could perform the following clean ups:
    • Don't 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)
    • You could replace observable maps with observable objects if you are only using string-based keys.
  • Don't call the reverse or sort operations directly on observableArray's anymore, as it's behavior slightly differed from the built-in implementations of those methods. Instead use observableArray.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-in sort updates the array in place, but the observable array implementation always performed the sort on a defensive copy, and this change makes that explicit).
  • you may remove usages of isArrayLike() since Array.isArray() will now return true for observable arrays
API's that have been dropped
  • The arrayBuffer setting is no longer supported by configure (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

v4.9.3

Compare Source

  • Fixed observable.set compatibility with IE 11, see #​1917 by kalmi

v4.9.2

Compare Source

  • Fixed regression #​1878, accidental use of Symbol breaking Internet Explorer / React Native compatibility.

v4.9.1

Compare Source

  • Fixed regression in toJS: observable maps were not properly serialized. Fixes #​1875

v4.9.0

Compare Source

Features

  • Introduced support for observable sets! Through #​1592 by @​newraina
  • observable.box now accepts an equals option, to be able to pass a custom comparision function. Through #​1862, #​1874 by @​fi3ework. Fixes #​1580
  • Improved logging of reactions; if an action throws an exception, errors in reactions that react to that are only logged as warnings. Fixes #​1836

Fixes

  • Improved typings for flow, see #​1827 by @​xaviergonz
  • Don't allow subclassing map, fixes #​1858
  • Fixed trace(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 #​1867
  • The options enforceActions and isolateGlobalState now work correctly when used together. Fixes #​1869

v4.8.0

Compare Source

  • MobX now requires TypeScript 3 (this was already the case in 5.7.0, but in this version the difference is actually noticeable in the typings).
  • Fixed array dehancer sometimes skipping. Fixes #​1839 through #​1841 by k-g-a
  • Fixed issue where webpack 4 wouldn't use the ESM module #​1834 by mrtnbroder
  • Improved type inference for flow in TypeScript 3. Fixes #​1816 through #​1825 by ismailhabib
  • Introduced support for global environment variable IGNORE_MOBX_MINIFIY_WARNING=true to skip the built-in minification warning. See #​1835 by fi3ework
  • Fixed onBecome(Un)Observed dispoer cleanup. Fixes #​1537 through #​1833 by fi3ework

v4.7.0

Compare Source

  • Upgraded typings to TypeScript 3
  • Fixed #​1742, change detection fails when multiple mobx instances were active.
  • Fixed #​1624, use built-in flow types for iterators
  • Fixed #​1777 through #​1826, stack overflow exception, in development mode, when using @computed on a React component. The MobX 5 behavior here has been reverted to the MobX 4 behavior.

v4.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 #​1534
  • Fixed #​1796, undeleting a property that had an initial value of undefined was undetected
  • Improved Flow typings, see #​1794 and #​1786

v4.5.2

Compare Source

v4.5.1

Compare Source

  • toJS now has a recurseEverything everything option, that even detects and converts observable objects that are "behind" non-observable objects. See #​1699 by wangyiz4262
  • Added flow typings form comparer, see #​1751 by pdong
  • Update flow typings for configuration options, #​1772 by alexandersorokin

v4.5.0

Compare Source

(Minor version of 5 was bumped significantly to make the number better correlate together :-))

  • Fixed #​1740: combining decorators and extendObservable in a class constructor caused errors to be thrown
  • Fixed #​1739:
    • Proxies: delete-ing a property was not always picked up by the reactivity system
    • Non-proxies: remove()-ing a property was not always picked up by the has() and get() utilities
    • has now returns true for computed fields
    • get now returns a value for computed fields
  • Introduced _allowStateChangeInsideComputed. Don't use it :-).
  • MobX is now transpiled using babel 7

v4.4.2

Compare Source

  • Fixed #​1650, decorating fields with the name toString does not behave correctly.

v4.4.1

Compare Source

v4.4.0

Compare Source

  • Improved handling of multiple MobX instances. MobX will no longer complain about being loaded multiple times (one should still prevent it though, to prevent blowing up bundle size!), but merge internal state by default. If multiple MobX versions need to be loaded, call configure({ isolateGlobalState: true }). Note that this means that observables from the different MobX instances won't cooperate. Fixes #​1681, #​1082
  • enforceActions options now supports the values: "never", "observed" and "always" to make the behavior more clear. Fixes #​1680, #​1473

v4.3.2

Compare Source

v4.3.1

Compare Source

  • Fixed [#​1534](Fixes #​1534): @​computed({keepAlive: true}) no long calculates before being accessed.
  • Added the $mobx export symbol for MobX 5 forward compatibity

Renovate 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 if you modify the PR title to begin with "rebase!".

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Renovate Bot. View repository job log here.

@renovate renovate bot force-pushed the renovate/mobx-5.x branch 3 times, most recently from 56c396f to 1637f8e Compare June 11, 2018 13:06
@renovate renovate bot force-pushed the renovate/mobx-5.x branch 3 times, most recently from 497c457 to 5cea79f Compare August 27, 2018 09:41
@renovate renovate bot force-pushed the renovate/mobx-5.x branch 2 times, most recently from 3cb7241 to cb66122 Compare September 18, 2018 19:56
@renovate renovate bot force-pushed the renovate/mobx-5.x branch 2 times, most recently from 77dbbff to 4f6e154 Compare October 23, 2018 09:25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant