Skip to content
This repository was archived by the owner on May 16, 2021. It is now read-only.

Bump mobx from 5.15.7 to 6.0.2#53

Closed
dependabot-preview[bot] wants to merge 1 commit into
masterfrom
dependabot/npm_and_yarn/mobx-6.0.2
Closed

Bump mobx from 5.15.7 to 6.0.2#53
dependabot-preview[bot] wants to merge 1 commit into
masterfrom
dependabot/npm_and_yarn/mobx-6.0.2

Conversation

@dependabot-preview

Copy link
Copy Markdown
Contributor

Bumps mobx from 5.15.7 to 6.0.2.

Release notes

Sourced from mobx's releases.

v6.0.2

Patch Changes

Changelog

Sourced from mobx's changelog.

6.0.2

Patch Changes

6.0.1

  • Fixed issue in TS typings of makeObservable in combination with a member named toString()

6.0.0

New features

  • makeObservable(https://github.com/mobxjs/mobx/blob/mobx6/target, annotations) is now the recommended way to make objects with a fixed shape observable, such as classes.
  • makeAutoObservable(https://github.com/mobxjs/mobx/blob/mobx6/target) will automatically determine the annotations used by makeObservable. Methods will be marked as 'autoAction', so that they can be used both from a computed value or as standalone method.
  • MobX 6 can be used in both modern environments, and environments that don't support Proxy. So both MobX 4 and 5 users can upgrade to 6. See proxy support for more details.
  • observable.array now supports { proxy: false } as option.
  • reaction's effect function now receives the previous value seen by the reaction as second argument.
  • flow can now be used as annotation as well. You might need flowResult in case you use TypeScript to extract the correct result type. details.

Breaking changes

Changes that might affect you

  • The decorate API has been removed, and needs to be replaced by makeObservable in the constructor of the targeted class. It accepts the same arguments. The mobx-undecorate can transform this automatically.
  • When using extendObservable / observable, fields that contained functions used to be turned into observables. This is no longer the case, they will be converted into autoActions.
  • Strict mode for actions is now enabled by default in observed mode.
  • toJS no 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: leverage computeds to define how class instances should be serialized).
  • The methods intercept and observe are 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. Use new 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. Use new Set(observableSet) instead if you want to convert an observable Set to a plain Set shallowly.
  • observableSet.toJSON() now returns an array rather than a new Set, to better support serialization.
  • Sorting or reversing an observableArray in a derivation (without slicing first) will now throw rather than warn. In contrast, it is now allowed to sort or reverse observable arrays in-place, as long as it happens in an action.
  • isArrayLike is no longer exposed as utility. Use Array.isArray(x) || isObservableArray(x) instead.

Obscure things that don't work anymore, but that probably won't affect you

  • It is no longer possible to re-decorate a field (through either @observable or makeObservable) that is already declared in a super class.
  • runInAction no longer supports passing a name as first argument. Name the original function or use action(name, fn)() if you care about the debug name.
  • computed(getterFn, setterFn) no longer accepts a setter function as a second argument. Use the set option instead: computed(getterFn, { set: setterFn }).
  • In observable arrays, for findIndex / find method, the offset argument (the third one) is no longer supported, to be consistent with ES arrays.
  • The option computedConfigurable of configure is no longer supported as it is now the default.
  • observableArray.toJS() has been removed, use observableArray.slice() instead, which does the same.
  • Killed support for the IGNORE_MOBX_MINIFY_WARNING environment flag.
  • _allowStateChangesInComputation(fn) is no longer needed, use runInAction(fn) instead.
  • In computed, the when predicate (first arg), and reaction predicate (first arg) it is now forbidden to directly change state. State changes should be done in their effect functions, or otherwise at least wrapped in runInAction (only the state change, not the observables you want to track!). Note that this is still an anti-pattern.
Commits

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
  • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
  • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
  • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language
  • @dependabot badge me will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot dashboard:

  • Update frequency (including time of day and day of week)
  • Pull request limits (per update run and/or open at any time)
  • Automerge options (never/patch/minor, and dev/runtime dependencies)
  • Out-of-range updates (receive only lockfile updates, if desired)
  • Security updates (receive only security updates, if desired)

Bumps [mobx](https://github.com/mobxjs/mobx) from 5.15.7 to 6.0.2.
- [Release notes](https://github.com/mobxjs/mobx/releases)
- [Changelog](https://github.com/mobxjs/mobx/blob/mobx6/CHANGELOG.md)
- [Commits](mobxjs/mobx@5.15.7...v6.0.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
@dependabot-preview dependabot-preview Bot added the dependencies Pull requests that update a dependency file label Nov 3, 2020
@dependabot-preview

Copy link
Copy Markdown
Contributor Author

Superseded by #54.

@dependabot-preview dependabot-preview Bot deleted the dependabot/npm_and_yarn/mobx-6.0.2 branch November 4, 2020 05:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants