Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Additional object type overrides #423
The changes in this commit are a sort of minimal set of overrides allowing the Map type to share inspect and diff code with the base object plugin. If you want to see how they are used, I split out the Map code itself into a separate repo https://github.com/alexjeffburke/unexpected-map.
My hope is what's here strikes a decent balance between re-use while avoiding invasive changes to other areas that might require other approaches (i.e. "to satisfy"). I'm more than willing to iterate on this and the main reason for sharing it now is to get agreement on the approach and early feedback.
Look forward to hearing your thoughts!
This looks really good so far! Here are my preliminary comments.
I'm assuming there'll be more later -- at the very least
<object> to [exhaustively] satisfy <object> should also be updated to support the new hooks, right?
In other words, it would be really great to get this landed :)
changed the base branch from
Mar 4, 2018
@sunesimonsen thanks for the review and the kind words :)
I confess to being a little unsure about the API change you wanted, but I've just pushed up a commit which changes all the type property() calls to take cloned output - that result is then intermixed with the other output as appropriate by the caller. If that's not quite what you were looking for just let me know, but I will say I think it looks a lot cleaner now.
I have WIP code for a Map plugin somewhere here and I'd still like to check it works against this version of the hooks after all the changes and rebasing before any release, but I'm feeling pretty confident about what's here at the moment. Let me know what you and @papandreou think.
@sunesimonsen @papandreou I've just pushed up what I think may be the final changes to address the review comments. All the calls into property() methods on types are given output.clone() - as an additional consequence, the drawing parts of the diff code for array-like types has begun to look a lot closer to the code that's within the "to satisfy" assertion. Let my know what you think.
I've responded to all the feedback bar the point about
I've tracked down the last missed
Thanks for all the review time and I'm getting really excited to see this land :D