Skip to content

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

Merged
epiqueras merged 1 commit intomasterfrom
add/core-data-util-for-minimally-modifying-items
Jul 30, 2019
Merged

Core Data: Add util for minimally modifying items.#16823
epiqueras merged 1 commit intomasterfrom
add/core-data-util-for-minimally-modifying-items

Conversation

@epiqueras
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

@epiqueras epiqueras force-pushed the add/core-data-util-for-minimally-modifying-items branch from 340f616 to 2cc458d Compare July 30, 2019 21:51
@epiqueras epiqueras merged commit 823ba36 into master Jul 30, 2019
@epiqueras epiqueras deleted the add/core-data-util-for-minimally-modifying-items branch July 30, 2019 22:10
@youknowriad youknowriad modified the milestones: Future, Gutenberg 6.3 Jul 31, 2019
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