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

Core Data: Add util for minimally modifying items. #16823

Merged
merged 1 commit into from
Jul 30, 2019

Conversation

epiqueras
Copy link
Contributor

Extracted from #16761

Description

This PR adds a utility for minimally modifying items, to the core data package in preparation for refactoring the editor store to rely entirely on core/data entities. The utility maps an item to a new item, retaining non primitive value references where possible (where deeply equal). This is necessary so that components that depend on these values don't update unnecessarily.

How has this been tested?

Unit tests were written and ran to test for expected functionality.

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.

@epiqueras epiqueras added the [Package] Core data /packages/core-data label Jul 30, 2019
@epiqueras epiqueras added this to the Future milestone Jul 30, 2019
@epiqueras epiqueras self-assigned this Jul 30, 2019
Copy link
Contributor

@youknowriad youknowriad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The utility looks good to me. I was wondering if we should use it in the RECEIVE_ITEMS action right now (without the full edit PR)

@epiqueras
Copy link
Contributor Author

The utility looks good to me. I was wondering if we should use it in the RECEIVE_ITEMS action right now (without the full edit PR)

I opted not to, because then we would be doing what the editor store already does and hamper performance unnecessarily.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Core data /packages/core-data
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants