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

Demonstrate dirty change tracking failure #660

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

NullVoxPopuli
Copy link

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.

@SergeAstapov
Copy link
Contributor

Seem like in order to fix this, we should use smth like TrackedObject as underlying data structure…
however as it’s not automatically deeply autotracked, I was thinking we may need to switch to smth like graph for the underlying data structure where each graph edge would be of type Change and it wpuld allow us to get rid of using spread when changes gets applied/reverted

sukima and others added 2 commits October 19, 2022 11:48
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
@NullVoxPopuli
Copy link
Author

NullVoxPopuli commented Oct 19, 2022

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

@sukima
Copy link

sukima commented Oct 20, 2022

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!

@sukima
Copy link

sukima commented Oct 20, 2022

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.

@NullVoxPopuli
Copy link
Author

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? 🤔

@sukima
Copy link

sukima commented Oct 21, 2022

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.

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

Successfully merging this pull request may close these issues.

3 participants