-
Notifications
You must be signed in to change notification settings - Fork 43
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
Refactor IgnoreChanges #1639
Refactor IgnoreChanges #1639
Conversation
Opening for early feedback. We don't have to merge yet I guess until I have an end to end demonstration that 1614 is viable on top of this (I will rebase). But this seems to me like it could help. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left a couple of comments, but I'm over all in favor of a refactor like this.
e1f53ab
to
d223e57
Compare
Taking a deferred breaking change here: - remove shim.ProviderWithContext - make shim.Provider require Context in all runtime methods - shim.Provider NewDestroyDiff now accepts a token to specialize it for a type
d223e57
to
59c21dc
Compare
@iwahbe PTAL, I simplified this a bit and removed old way of doing things instead of deprecating it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
The intent here is to refactor the code without any observable changes to make possible further extensions such as #1614 .
Specifically, before this PR:
That is the interface is to compute a diff first, and then side-effect to ignore changes.
After this PR we have this instead:
So the algorithm to ignore changes is specified upfront when constructing the diff. This seems to be useful to un-constrain the implementation of shim.Provider a little bit, specifically in #1614 that is trying to change the internal representation of InstanceDiff implementation in such a way that it is inconvenient to process IgnoreChanges after the InstanceDiff is constructed already.