-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Add edits data to the useEntityRecord #54167
Add edits data to the useEntityRecord #54167
Conversation
Size Change: +21 B (0%) Total Size: 1.51 MB
ℹ️ View Unchanged
|
Flaky tests detected in 5b4ac31. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6079354743
|
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.
This looks good to me and is working and testing well. I'm not too familiar with this side of the codebase, so I've pinged a few other folks who may be able to help review this 🙇
Thanks for the ping, @mikachan. @matiasbenedetto, what would be the use case of the |
Hi thanks both for taking a look!
@Mamaduka the use case would be to know if some specific object path has changed.
In this way, we would be able to detect and later on, save only the changes on the specified object path using __experimentalSaveSpecifiedEntityEdits() as we are doing in this Font Library PR: #53884 |
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.
Thanks for the additional details, @matiasbenedetto!
The changes here look good to me 👍
What?
Get the edits from an entity record using the
useEntityRecord
hook.Why?
Currently, we can know if the entity has edits or not. With this change, we are getting the edits from the entity.
How?
By returning a
edits
key in the output of theuseEntityRecord
hook containing the nonTransientEdits of an entity record.Testing Instructions
Expected result: