Reactivity of modal opened by action
Hey guys, I am working with filament panel builder and it's resource pages, specifically ListRecords Page and it's headerActions. I have an CreateAction there, which opens a multi-step wizard in Modal.
I am struggling with performance of this modal. It takes a lot of time to open modal, to transition to next step of wizard or to trigger final execution. When analyzing I have noticed, that the main problem is "reactivity" of filament/livewire. Opening/transitioning of modal not only fetches data for modal update itself, but also refreshes the underlying table with data, which are behind the modal.
Data I am loading to my table on this page are pretty heavy and querying them take time. While it is completely fine for my user to wait for page load with data, it's not okay to wait for modal, because they don't expect table to be refreshed.
Therefore my question: Is it possible to "disable reactivity", so the modal of createAction will not trigger refresh of data within table?
I have tried to search in docs, using google, in source code or here on Discord, but with no luck.
Any ideas?
Thank you!
3 Replies
AFAIK, no. This is how livewire works unfortunately. The best you can do is try to optimise your queries as much as possible.
On a side note, in case you are using
debugbar
, there is is known performance impact when collecting the views. Either disable it entirely, or remove the views
from the collectors.But is it Livewire doing this? On the same page we also have filament widgets that are above table. And those widgets are not refreshed. So it looks like there must be a way to tell livewire which parts should be fetched and which not.
This is 100% livewire, so the widgets will be set to a null refresh you can poll them to refesh.
But livewire works by sending all the html back and forth too.
You shouldn't have heavy tables as that leads to poor UX. Livewire sends the data back and form in form of HTML because that's how livewire works