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

Change hasItems to look at filteredItems in block editor inserter #21138

Merged

Conversation

@StevenDufresne
Copy link
Contributor

@StevenDufresne StevenDufresne commented Mar 25, 2020

Description

This PR removes the use of useMemo on the suggestion list and addresses issue: #21069.

We most likely want to revisit the logic here but for now, this will restore functionality.

How has this been tested?

  1. Using the steps to reproduced contained in the issue linked above.

Types of changes

Removing useMemo on the suggestion list. This will result in a slight degrade in performance for users that have a large number of blocks... Should be negligible.

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.
  • I've updated all React Native files affected by any refactorings/renamings in this PR.
@StevenDufresne StevenDufresne changed the title Remove useMemo on suggestion list. [WIP] Remove useMemo on suggestion list. Mar 25, 2020
@StevenDufresne
Copy link
Contributor Author

@StevenDufresne StevenDufresne commented Mar 25, 2020

Opened this a bit premature. :)

To do:

  1. Figure out why the test was passing.
  2. Figure out why 2 tests are failing after change.

@StevenDufresne StevenDufresne changed the title [WIP] Remove useMemo on suggestion list. Remove useMemo on suggestion list. Mar 26, 2020
@StevenDufresne StevenDufresne changed the title Remove useMemo on suggestion list. Change hasItems to look at filteredItems in block editor inserter Mar 26, 2020
@StevenDufresne StevenDufresne changed the title Change hasItems to look at filteredItems in block editor inserter Change hasItems to look at filteredItems in block editor inserter Mar 26, 2020
@StevenDufresne
Copy link
Contributor Author

@StevenDufresne StevenDufresne commented Mar 26, 2020

@youknowriad I updated the hasItems check to look at the filteredItems list. These changes work as expected.

Copy link
Contributor

@youknowriad youknowriad left a comment

Thanks. LGTM

@youknowriad youknowriad merged commit 23e64dc into WordPress:master Mar 29, 2020
2 checks passed
2 checks passed
@github-actions
build
Details
@travis-ci
Travis CI - Pull Request Build Passed
Details
@github-actions github-actions bot added this to the Gutenberg 7.9 milestone Mar 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants