Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): Update dependency mobx to version .x 🌟 #4710

Merged
merged 4 commits into from
Jul 15, 2019

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Jul 15, 2019

This PR contains the following updates:

Package Type Update Change
mobx (source) devDependencies major 3.6.2 -> 4.12.0

Release Notes

mobxjs/mobx

v4.12.0

Compare Source

v4.11.0

Compare Source

BREAKING CHANGE

Reverted the support of Symbols in general in MobX 4, as it gives to many potential build errors and increases the system requirements for MobX 4 (which was an oversight in 4.10.0). Apologies for the breaking change (lack of new major version numbers). If lock files are properly used however, no harm should be caused by this change.

v4.10.0

Compare Source

v4.9.4

Compare Source

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

v4.3.0

Compare Source

  • Introduced the entries(observable) API, by @​samjacobclift through #​1536
  • Fixed #​1535: Change in nested computed value was not propagated if read outside action context when there is a pending reaction. For more details see the exact test case.
  • Illegal property access through prototypes is now a warning instead of an error. Fixes #​1506. By @​AmazingTurtle through #​1529
  • Fixed issue where providing a custom setter to @computed({ set: ... }) wasn't picked up
  • Fixed #​1545: Actions properties where not re-assignable when using TypeScript
  • Illegal Access checks are now a warning instead of an error. Fix

v4.2.1

Compare Source

v4.2.0

Compare Source

  • Introduced configure({ enforceActions: "strict" }), which is more strict then enforceActions: true, as it will also throw on non-observed changes to observables. See also #​1473
  • Fixed #​1480: Exceptions in the effect handler of reaction where not properly picked up by the global reaction system
  • Fixed a bug where computed values updated their cached value, even when the comparer considered the new value equal to the previous one. Thanks @​kuitos for finding this and fixing it! #​1499
  • Undeprecated ObservableMap, fixes #​1496
  • Observable arrays now support Symbol.toStringTag (if available / polyfilled). This allows libraries like Ramda to detect automatically that observable arrays are arrays. Fixes #​1490. Note that Array.isArray will keep returning false for the entire MobX 4 range.
  • Actions are now always configurable and writable, like in MobX 3. Fixes #​1477
  • Merged several improvements to the flow typings. #​1501 by @​quanganhtran
  • Fixed several accidental usages of the global fail, by @​mtaran-google through #​1483 and #​1482

v4.1.1

Compare Source

  • Import default from MobX will no longer throw, but only warn instead. This fixes some issues with tools that reflect on the default export of a module
  • Disposing a spy listener inside a spy handler no longer causes an exception. Fixes #​1459 through #​1460 by farwayer
  • Added a missing runInAction overload in the flow typings. #​1451 by AMilassin
  • Improved the typings of decorate. See #​1450 by makepost

v4.1.0

Compare Source

  • Introduced keepAlive as option to computed
  • All observable api's now default to any for their generic arguments
  • Improved flow cancellation
  • The effect of when is now automatically an action.
  • @computed properties are now declared on their owner rather then the protoptype. Fixes an issue where @computed fields didn't work in React Native on proxied objects. See #​1396
  • action and action.bound decorated fields are now reassignable, so that they can be stubbed

v4.0.2

Compare Source

  • Fixed issue where exceptions like TypeError: Cannot define property:__mobxDidRunLazyInitializers, object is not extensible. were thrown. Fixes #​1404
  • Improved flow typings for flow, #​1399 by @​ismailhabib

v4.0.1

Compare Source

v4.0.0

Compare Source

  • For the highlights of this release, read the blog:
  • For migration notes: see the wiki page
  • Note; many things that were removed to make the api surface smaller. If you think some feature shouldn't have been removed, feel free to open an issue!

This is the extensive list of all changes.

New features

The changes mentioned here are discussed in detail in the release highlights, or were simply updated in the docs.

  • MobX 4 introduces separation between the production and non production build. The production build strips most typechecks, resulting in a faster and smaller build. Make sure to substitute process.env.NODE_ENV = "production" in your build process! If you are using MobX in a react project, you most probably already have set this up. Otherwise, the idea is explained here.

  • Introduced flow to create a chain of async actions. This is the same function as asyncActions of the mobx-utils package

  • These flow's are now cancellable, by calling .cancel() on the returned promise, which will throw a cancellation exception into the generator function.

  • flow also has experimental support for async iterators (async * function)

  • Introduced decorate(thing, decorators) to decorate classes or object without needing decorator syntax.

  • Introduced onBecomeObserved and onBecomeUnobserved. These API's enable hooking into the observability system and get notified about when an observable starts / stops becoming used. This is great to automaticaly fetch data from external resources, or stop doing so.

  • computed / @computed now accepts a requiresReaction option. If it set, the computed value will throw an exception if it is being read while not being tracked by some reaction.

  • To make requiresReaction the default, use mobx.configure({ computedRequiresReaction: true })

  • Introduced mobx.configure({ disableErrorBoundaries }), for easier debugging of exceptoins. By NaridaL through #​1262

  • toJS now accepts the options: { detectCycles?: boolean, exportMapsAsObjects?: boolean }, both true by default

  • Observable maps are now backed by real ES6 Maps. This means that any value can be used as key now, not just strings and numbers.

  • The flow typings have been updated. Since this is a manual effort, there can be mistakes, so feel free to PR!

  • computed(fn, options?) / @computed(options) get fn() now accept the following options:

    • set: (value) => void to set a custom setter on the computed property
    • name: "debug name"
    • equals: fn the equality value to use for the computed to determine whether its output has changed. The default is comparer.default. Alternatives are comparer.structural, comparer.identity or just your own comparison function.
    • requiresReaction: boolean see above.
  • autorun(fn, options?) now accepts the following options:

    • delay: number debounce the autorun with the given amount of milliseconds. This replaces the MobX 3 api autorunAsync
    • name: "debug name"
    • scheduler: function a custom scheduler to run the autorun. For example to connect running the autorun to requestAnimationFrame. See the docs for more details
    • onError. A custom error handler to be notified when an autorun throws an exception.
  • reaction(expr, effect, options?) now accepts the following options:

    • delay: number debounce the autorun with the given amount of milliseconds. This replaces the MobX 3 api autorunAsync
    • fireImmediately. Immediately fire the effect function after the first evaluation of expr
    • equals. Custom equality function to determine whether the expr function differed from its previous result, and hence should fire effect. Accepts the same options as the equals option of computed.
    • All the options autorun accepts
  • when(predicate, effect?, options?) now accepts the following options:

    • name: "debug name"
    • onError. A custom error handler to be notified when an autorun throws an exception.
    • timeout: number a timeout in milliseconds, after which the onError handler will be triggered to signal the condition not being met within a certain time
  • The effect parameter of when has become optional. If it is omitted, when will return a promise. This makes it easy to await a condition, for example: await when(() => user.profile.loaded). The returned promise can be cancelled using promise.cancel()

  • There is now an utility API that enables manipulating observable maps, objects and arrays with the same api. These api's are fully reactive, which means that even new property declarations can be detected by mobx if set is used to add them, and values or keys to iterate them.

    • values(thing) returns all values in the collection as array
    • keys(thing) returns all keys in the collection as array
    • set(thing, key, value) or set(thing, { key: value }) Updates the given collection with the provided key / value pair(s).
    • remove(thing, key) removes the specified child from the collection. For arrays splicing is used.
    • has(thing, key) returns true if the collection has the specified observable property.
    • get(thing, key) returns the chlid under the specified key.
  • observable, observable.array, observable.object, observable.map and extendObservable now accept an additional options object, which can specify the following attributes:

    • name: "debug name"
    • deep: boolean. true by default, indicates whether the children of this collection are automatically converted into observables as well.
    • defaultDecorator: <decorator> specifies the default decorator used for new children / properties, by default: observable.deep, but could be changed to observable.ref, observable.struct etc. (The deep property is just a short-hand for switching between observable.deep or observable.ref as default decorator for new properties)
Breaking changes

The changes mentioned here are discussed in detail in the migration notes

  • MobX 4 requires Map to be globally available. Polyfill it if targeting IE < 11 or other older browsers.
  • For typescript users, MobX now requires Map and several Symbols to exist for its typings. So make sure that the lib configuration of your project is set to "es6". (The compilation target can still be "es5")
  • observable.shallowArray(values) has been removed, instead use observable.array(values, { deep: false })
  • observable.shallowMap(values) has been removed, instead use observable.map(values, { deep: false })
  • observable.shallowObject(values) has been removed, instead use observable.object(values, {}, { deep: false })
  • extendShallowObservable(target, props), instead use extendObservable(target, props, {}, { deep: false })
  • The decorators observable.ref, observable.shallow, observable.deep, observable.struct can no longer be used as functions. Instead, they should be passed as part of the decorators param to resp. observable.object and extendObservable
  • The new signature of extendObservable is extendObservable(target, props, decorators?, options?). This also means it is no longer possible to pass multiple bags of properties to extendObservable. extendObservable can no longer be used to re-declare properties. Use set instead to update existing properties (or introduce new ones).
  • Iterating maps now follows the spec, that is, map.values(), map.entries(), map.keys(), map[@&#8203;@&#8203;iterator]() and array[@&#8203;@&#8203;iterator]() no longer return an array, but an iterator. Use mobx.values(map) or Array.from(map) to convert the iterators to arrays.
  • dropped @computed.equals, instead, you can now use @computed({ equals: ... })
  • useStrict(boolean) was dropped, use configure({ enforceActions: boolean }) instead
  • isolateGlobalState was dropped, use configure({ isolateGlobalState: true}) instead
  • If there are multiple mobx instances active in a single project, an exception will be thrown. Previously only a warning was printed. Fixes #​1098. For details, see #​1082.
  • Dropped the shareGlobalState feature. Instead, projects should be setup properly and it is up to the hosting package to make sure that there is only one MobX instance
  • expr has been moved to mobx-utils. Remember, expr(fn) is just computed(fn).get()
  • createTransformer has been moved to mobx-utils
  • Passing context explicitly to autorun, reaction etc is no longer supported. Use arrow functions or function.bind instead.
  • Removed autorunAsync. Use the delay option of autorun instead.
  • autorun, when, reaction don't support name as first argument anymore, instead pass the name option.
  • The extras. namespace has been dropped to enable tree-shaking non-used MobX features. All methods that where there originally are now exported at top level. If they are part of the official public API (you are encouraged to use them) they are exported as is. If they are experimental or somehow internal (you are discouraged to use them), they are prefixed with _.
  • Dropped bower support. Fixes #​1263
  • The spyReportStart, spyReportEnd, spyReport and isSpyEnabled are no longer public. It is no longer possible to emit custom spy events as to avoid confusing in listeners what the possible set of events is.
  • Dropped isStrictModeEnabled
  • observable(value) will only succeed if it can turn the value into an observable data structure (a Map, Array or observable object). But it will no longer create an observable box for other values to avoid confusion. Call observable.box(value) explictly in such cases.
  • isComputed and isObservable no longer accept a property as second argument. Instead use isComputedProp and isObservableProp.
  • Removed whyRun, use trace instead
  • The spy event signature has slightly changed
  • The Atom class is no longer exposed. Use createAtom instead (same signature).
  • Calling reportObserved() on a self made atom will no longer trigger the hooks if reportObserved is triggered outside a reactive context.
  • The options struct and compareStructural for computed values are deprecated, use @computed.struct or computed({ equals: comparer.structural}) instead.
  • isModifierDescriptor is no longer exposed.
  • deepEqual is no longer exposed, use comparer.structural instead.
  • setReactionScheduler -> configure({ reactionScheduler: fn })
  • reserveArrayBuffer -> configure({ reactionErrorHandler: fn })
  • ObservableMap is no longer exposed as constructor, use observable.map or isObservableMap instead
  • map -> observable.map
  • runInAction no longer accepts a custom scope
  • Dropped the already deprecated and broken default export that made it harder to tree-shake mobx. Make sure to always use import { x } from "mobx" and not import mobx from "mobx".
  • Killed the already deprecated modifiers asFlat etc. If you war still using this, see the MobX 2 -> 3 migration notes.
  • Observable maps now fully implement the map interface. See #​1361 by Marc Fallows
  • Observable arrays will no longer expose the .move method
  • Dropped the observable.deep.struct modifier
  • Dropped the observable.ref.struct modifier
  • observable.struct now behaves like observable.ref.struct (this used to be observable.deep.struct). That is; values in an observable.struct field will be stored as is, but structural comparison will be used when assigning a new value
  • IReactionDisposer.onError has been removed, use the onError option of reactions instead
Issues fixed in this release:

The issues are incoprorated in the above notes.

  • #​1316 - Improve observable api
  • #​992 - onBecomeObserved & onBecomeUnobserved
  • #​1301 - Set onError handler when creating reactions
  • #​817 - Improve typings of observe
  • #​800 - Use Map as backend implementation of observable maps
  • #​1361 - Make observableMaps structurally correct maps
  • #​813 - Create separate dev and production builds
  • #​961, #​1197 - Make it possible to forbid reading an untracked computed value
  • #​1098 - Throw instead of warn if multiple MobX instances are active
  • #​1122 - Atom hooks fired to often for observable maps
  • #​1148 - Disposer of reactions should also cancel all scheduled effects
  • #​1241 - Make it possible to disable error boundaries, to make it easier to find exceptions
  • #​1263 - Remove bower.json

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 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 added renovate Triggered by renovatebot type: dependencies labels Jul 15, 2019
@renovate
Copy link
Contributor Author

renovate bot commented Jul 15, 2019

PR has been edited

👷 This PR has received other commits, so Renovate will stop updating it to avoid conflicts or other problems. If you wish to abandon your changes and have Renovate start over you may click the "rebase" checkbox in the PR body/description.

@jennifer-shehane jennifer-shehane self-requested a review July 15, 2019 07:42
@jennifer-shehane jennifer-shehane merged commit 9304b7a into develop Jul 15, 2019
@renovate renovate bot deleted the renovate/mobx-4.x branch July 15, 2019 07:58
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jul 29, 2019

Released in 3.4.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
renovate Triggered by renovatebot type: dependencies
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants