-
-
Notifications
You must be signed in to change notification settings - Fork 141
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
Demonstrate dirty change tracking failure #660
base: master
Are you sure you want to change the base?
Demonstrate dirty change tracking failure #660
Conversation
Seem like in order to fix this, we should use smth like TrackedObject as underlying data structure… |
Prior to this change, the test was more a console log. This makes it an assertion so you can see the filed tests on reproduction.
Fixup repro test to a failing test
https://github.com/NullVoxPopuli/ember-deep-tracked/blob/main/ember-deep-tracked already solved this via Proxies :D I think in order for ember-changeset to be performant and correct in change-tracking, we may need to lose the dependency on validated-changeset |
I realized that dirty changes on a global standpoint is a big issue for asynchronous validations! If you have ten async validators and you make a change to one field all ten will spawn network requests! |
As an example on how best to approach the issue of deep tracking Immer.js is a prime example of tracking changes via on-demand proxies. |
It's there any advantage to this for our purposes over deep-tracked? 🤔 |
A super quick scan of your ember-deep-tracked and it looks like it is doing as I described above. It looks like it is generating a proxy for each level on demand (when the getter/setter is called). Pretty sure Immur does this also. |
Editing one value should not dirty other values.
This can be seen by editing any of the fields in the paused test, and seeing two logs print.
When this bug is fixed, only the log for the changed field should print.