Skip to content

Prebuilt table preview performance improvements#119

Merged
erdembircan merged 8 commits intomasterfrom
template-performance
Nov 13, 2024
Merged

Prebuilt table preview performance improvements#119
erdembircan merged 8 commits intomasterfrom
template-performance

Conversation

@erdembircan
Copy link
Copy Markdown
Contributor

Background: Loading pre-built table previews on frontend hangs editor and takes a significant time.

Solution Summary:

  • Added a loading indicator to individual prebuilt cards for server fetch operations.
  • Added lazy load system for previews of those templates where now only template cards in view will be rendered. This way whole list is lighting fast and more responsive.

Known Limitations
The core of this preview system relies on WordPress's native component, which prevents ref-based approaches from functioning as intended. Specifically, the preview component loads a dummy webpage into an iframe, but without a callback for the page load completion event, the exact timing of the rendering operation cannot be pinpointed. Until WordPress provides such a callback, using a lazy loading system based on visibility remains the most accurate workaround for this issue.

Demo

@erdembircan erdembircan added the enhancement New feature or request label Nov 12, 2024
@erdembircan erdembircan self-assigned this Nov 12, 2024
@erdembircan erdembircan merged commit 1a1822f into master Nov 13, 2024
@permafrost06 permafrost06 deleted the template-performance branch November 15, 2024 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant