mobxjs / mobx.dart

MobX for the Dart language. Hassle-free, reactive state-management for your Dart and Flutter apps.
https://mobx.netlify.app
MIT License
2.4k stars 310 forks source link

Allow users to bypass observability system for performance; Avoid unnecessary observable notifications of `@observable` fields of `Store`s; Fix Reaction lacks toString, so cannot see which reaction causes the error; Add StackTrace to reactions in debug mode to easily spot which reaction it is #844

Closed fzyzcjy closed 1 year ago

fzyzcjy commented 2 years ago

Close #857 Close #858 Close #859 Close #855 Close #864

Pull Request Checklist

netlify[bot] commented 2 years ago

Deploy Preview for mobx canceled.

Name Link
Latest commit 1803928507e994c7ac4c50575f62417afe0e8425
Latest deploy log https://app.netlify.com/sites/mobx/deploys/6319c5e7db1fa0000e17006a
fzyzcjy commented 2 years ago

p.s. I may not merge this before PRs like https://github.com/mobxjs/mobx.dart/pull/842 is merged, since otherwise my master branch will be destoryed

codecov[bot] commented 2 years ago

Codecov Report

Merging #844 (74ea2e5) into master (13b7e6d) will decrease coverage by 0.15%. The diff coverage is 86.36%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #844      +/-   ##
==========================================
- Coverage   98.96%   98.81%   -0.15%     
==========================================
  Files          55       55              
  Lines        1924     1945      +21     
==========================================
+ Hits         1904     1922      +18     
- Misses         20       23       +3     
Flag Coverage Δ
flutter_mobx 100.00% <ø> (ø)
mobx 98.33% <86.36%> (-0.20%) :arrow_down:
mobx_codegen 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
mobx/lib/src/core/atom.dart 93.87% <0.00%> (-6.13%) :arrow_down:
...rc/api/observable_collections/observable_list.dart 100.00% <100.00%> (ø)
...src/api/observable_collections/observable_map.dart 100.00% <100.00%> (ø)
...src/api/observable_collections/observable_set.dart 100.00% <100.00%> (ø)
mobx/lib/src/core/action.dart 100.00% <100.00%> (ø)
mobx/lib/src/core/atom_extensions.dart 100.00% <100.00%> (ø)
mobx/lib/src/core/computed.dart 100.00% <100.00%> (ø)
mobx/lib/src/core/context.dart 97.18% <100.00%> (+0.01%) :arrow_up:
mobx/lib/src/core/observable.dart 100.00% <100.00%> (ø)
mobx/lib/src/core/reaction.dart 98.57% <100.00%> (+0.04%) :arrow_up:
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 13b7e6d...74ea2e5. Read the comment docs.

fzyzcjy commented 2 years ago

Add onDispose callback to Computed, such that old values can be properly disposed

feature implemented, test added, and passed

fzyzcjy commented 2 years ago

@amondnet tests added

fzyzcjy commented 2 years ago

test reproduced #855

image

fzyzcjy commented 2 years ago

Revert "dispose"-related features according to #860

ghenry commented 1 year ago

Hi all,

If this is in a "LGTM" state, is it just awaiting for @pavanpodila to approve or can someone else help with the load?

Thanks.

amondnet commented 1 year ago

@fzyzcjy @ghenry This PR has solved many issues( https://github.com/mobxjs/mobx.dart/issues/857, https://github.com/mobxjs/mobx.dart/issues/858, https://github.com/mobxjs/mobx.dart/issues/859, https://github.com/mobxjs/mobx.dart/issues/855, https://github.com/mobxjs/mobx.dart/issues/864). If you bump the version and write a chagelog, I'll merge it.

amondnet commented 1 year ago

Hi, @fzyzcjy I add the missing tests, bump the version and write the changelog. https://github.com/mobxjs/mobx.dart/pull/894