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

[4.x] Prevent handling field previews when previews are disabled #9353

Merged
merged 2 commits into from
Jan 18, 2024

Conversation

duncanmcclean
Copy link
Member

@duncanmcclean duncanmcclean commented Jan 18, 2024

This pull request adds some checks to prevent unnecessary field previews from being computed & emitted to parent components when field previews are disabled.

Without these changes, any time a field's value changes, it would compute & emit the field preview, even if it's a root field or the parent Bard/Replicator has field previews disabled.

This should hopefully help somewhat with performance with the Bard & Replicator fieldtypes. 🤞

In the first commit, I made it so the replicator-preview-updated event doesn't get emitted when field previews are disabled.

Then, in my second commit, I added the same check to the replicatorPreview method on the individual fieldtypes because even the fact we're generating them in the first place is going to have some kind of performance impact, especially for fields with larger values (like Bards & Replicators).

Maybe we don't need the checks in both places, maybe we do. Happy to change it.

Closes #9248.
Potentially helps with #9351.

@jasonvarga jasonvarga merged commit 112f877 into 4.x Jan 18, 2024
37 checks passed
@jasonvarga jasonvarga deleted the prevent-emitting-field-previews-when-disabled branch January 18, 2024 20:43
@ryanmitchell
Copy link
Contributor

Just to say this made a big difference on one of our replicator heavy sites, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Slow page loading time with too much Replicator (due to preview, enabled or disabled).
3 participants