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

Layout selector performance improvements #1577

Merged
merged 20 commits into from
Nov 9, 2020

Conversation

jrtashjian
Copy link
Member

@jrtashjian jrtashjian commented Jul 17, 2020

Description

The way we were using the BlockPreview component from Gutenberg was very slow when loading more than 5 previews in a list. With the release of Block Patterns in Gutenberg I've recognized performance improvements that were made in core where they BlockPreview component was being used inth block inserter. This PR takes those findings and implements them here.

The result is a more snappy interaction when interacting with the previews and no delay in interacting with the layout selector while previews load.

Types of changes

Enhancement

How has this been tested?

This has been tested manually with 1, 5, 10, 20, 50, and 100 layouts being added through the available filters in PHP.

Checklist:

  • My code is tested
  • My code follows accessibility standards
  • My code has proper inline documentation
  • I've included any necessary tests
  • I've included developer documentation
  • I've added proper labels to this pull request

@jrtashjian jrtashjian added [Type] Enhancement Something new that adds functionality [Status] In Progress Tracking issues with work in progress [Status] Do Not Merge Issues/PRs that should not be merged (yet) labels Jul 17, 2020
@jrtashjian jrtashjian self-assigned this Jul 17, 2020
@jrtashjian jrtashjian added [Status] Needs Review Tracking pull requests that need another set of eyes and removed [Status] Do Not Merge Issues/PRs that should not be merged (yet) [Status] In Progress Tracking issues with work in progress labels Oct 29, 2020
@cypress
Copy link

cypress bot commented Oct 29, 2020



Test summary

10 4 0 0Flakiness 0


Run details

Project CoBlocks
Status Failed
Commit 6b3538e
Started Nov 9, 2020 10:04 PM
Ended Nov 9, 2020 10:07 PM
Duration 03:25 💡
OS Linux Debian - 10.6
Browser Multiple

View run in Cypress Dashboard ➡️


Failures

Run group: e2e-chrome (Linux, Chrome )
src/extensions/layout-selector/test/layout-selector.cypress.js Failed
1 Extension: Layout Selector > inserts layout into page
2 Extension: Layout Selector > does not open modal when editing a draft post
Run group: e2e-firefox (Linux, Firefox )
src/extensions/layout-selector/test/layout-selector.cypress.js Failed
1 Extension: Layout Selector > inserts layout into page
2 Extension: Layout Selector > does not open modal when editing a draft post

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

@jrtashjian jrtashjian marked this pull request as ready for review October 29, 2020 18:15
@jonathanbardo
Copy link
Member

@jrtashjian Can you take a look at the conflict? Pretty sure it's only because we took out image fetch.

Copy link
Member

@jonathanbardo jonathanbardo left a comment

Choose a reason for hiding this comment

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

This LGTM. Small changes on the LayoutPreview markup only.

@richtabor richtabor added this to the 2.5.2 milestone Nov 9, 2020
@jrtashjian jrtashjian merged commit dcf94d6 into master Nov 9, 2020
@jrtashjian jrtashjian deleted the layout-selector-performance-experiment branch November 9, 2020 22:02
@jrtashjian jrtashjian removed the [Status] Needs Review Tracking pull requests that need another set of eyes label Nov 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Enhancement Something new that adds functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants