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

Bump MobX version to 6.12 and simplify stores #3453

Closed
brojd opened this issue Nov 29, 2023 · 1 comment
Closed

Bump MobX version to 6.12 and simplify stores #3453

brojd opened this issue Nov 29, 2023 · 1 comment
Assignees

Comments

@brojd
Copy link
Contributor

brojd commented Nov 29, 2023

Currently we're using MobX v5.13.0. We should bump the version to latest stable which is 6.12.0. Thanks to it we will be able to use makeAutoObservable and as a result:

  1. remove a lot of decorators from the code (with makeAutoObservable every class method is an action by default, every setter is a computed, every other property is an observable
  2. remove a lot of this bindings because this will be automatically bound to the store class
  3. identify and get rid of updating observable without an action. In new version every case like that will be logged in the console so we need to fix all such places. Using actions has benefits including performance so it will have a positive impact on the app itself
@brojd brojd self-assigned this Nov 29, 2023
@maskin25 maskin25 self-assigned this Dec 12, 2023
@brojd brojd removed their assignment Dec 12, 2023
github-merge-queue bot pushed a commit that referenced this issue Jan 3, 2024
# What this PR does

- update 
  "mobx" to "6.12.0",
  "mobx-react" to "9.1.0",
- add `runInAction` when update observables after async operations
- update babel config and ts config according to the
[guide](https://mobx.js.org/migrating-from-4-or-5.html)
- add  `makeObservable(this);` to each model constructor

## Which issue(s) this PR fixes

#3453

## Checklist

- [ ] Unit, integration, and e2e (if applicable) tests updated
- [ ] Documentation added (or `pr:no public docs` PR label added if not
required)
- [ ] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not
required)
@joeyorlando
Copy link
Contributor

closing as completed in #3561

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants