Open o1y opened 1 year ago
I've also been noticing some significant loading delays with large page builder values that contain many sets, and using v-if
over v-show
with collapse by default does help a lot.
Of course the reasons for using v-show
are detailed in that PR, but since Bard sets are actually (unintentionally) using v-if
right now I'm wondering if maybe the original reasons for switching to v-show
are no longer a problem? There have been a number of changes/fixes related to tracking hidden field state since then.
If that is the case then could replicators use v-if
as well now?
I'm testing v-if
on a site with large page builders at the moment and haven't yet run into issues with conditional fields/reordering sets etc.
We have to be very careful about not just switching back to v-if
though, as v-show
was very intentional for fixing a lot of issues around conditional fields and data flow.
If there are performance issues around v-show, I think we should be addressing them in ways that don't cause regressions around all the data flow edge cases we were solving with that v-show
change.
Maybe there's more we can do performance-wise to defer slower logic until fields/sets are expanded/shown, without disrupting data flow on save with field conditions, revealers, default field values, etc.
Worth looking into!
Maybe there's more we can do performance-wise to defer slower logic until fields/sets are expanded/shown, without disrupting data flow on save with field conditions, revealers, default field values, etc.
^ On thate note, like this kinda stuff https://github.com/statamic/cms/pull/8716 cc/ @jacksleight 💘
Keep in mind, v-if
was just hiding our actual performance issues like a big bandaid, while causing other problems in the process.
^ On thate note, like this kinda stuff #8716 cc/ @jacksleight 💘
Keep in mind,
v-if
was just hiding our actual performance issues like a big bandaid, while causing other problems in the process.
Yeah good point! v-if
was actually my first attempt at fixing the issue that PR addresses, but it did just feel like a workaround rather than a proper fix. 🙂
Bug description
Since the implementation of PR #6902, which changed the
v-if
conditions to v-show
, there has been a noticeable degradation in performance in our "Page Builder" replicator field, which is using lots of nested replicator fields. I tracked the loading time of my replicator using the browser's performance profiler:Firefox
Chrome
The times only represent the Vue/JS loading time, until the Publish form is loaded.
Thank you @jonassiewertsen, for pointing out the pull request!
How to reproduce
Logs
No response
Environment
Installation
Fresh statamic/statamic site via CLI
Antlers Parser
None
Additional details
By the way, it seems that there is a regression regarding the Bard Set
v-show
. It seems the change from #6902, was probably lost during resolving a merge conflict when merging the 3.3 Branch: https://github.com/statamic/cms/blob/ee63549314abfadbe508e9533dcf10b23dc70cab/resources/js/components/fieldtypes/bard/Set.vue#L38