Auth1Specialist
Man... Filament is so damn slow :(
Can you do some profiling to see what's causing this delay? (Or do some caveman debugging, by commenting parts out / returning early, doing the call a few times, and check the time it takes) ...
If you have really big components with a lot of selects that load data, it can significantly slow things down, but without more information it's a bit hard to help here IMO.
Some general tips and tricks I can give:
- Is this on every request? Or just with working with some components?
If it's on some components, I have some tips that I use myself (These are generally for Livewire, so these work for Filament as well.):
- Work with private properties in Livewire components as much as possible, when they are public they have to get diffed / synced / ... every time
- I also have a lot of success with caching filament Forms in my components, like so:
I do that because these are big forms with a lot of relations / .... and these get used in the createAction, editAction, ... so normally these are initialised multiple times, meaning duplicate queries meaning longer load times ...
- Other than that, I also split Livewire components if they get too large.
30 replies
Add part of filament in external Page
How I did it (temporarily) was the following, but this worked:
- Create full page Livewire (filament) components
- Set livewire inject_assets to TRUE in the config
- Load the full page with HTMX inside of your old page
13 replies
Why does nothing in this #$%^#$ work as described in docs?
I would also like to give some tips here:
- Setup xdebug to debug PHP code that gets executed;
- Laracast also have some great series on PHP / Alpine / ... as well. Not tutorials mind you (they also have those), but explainers on how the libraries (high-level) work. The way you grow as a developer is to realise everything you need of information is actually in the code (if you take the approach of digging into the libraries source-code, you will learn much faster).
Good luck!
51 replies
Repeater optimistic UI with livewire
Yea. Figured as much. Hmmn, OK, let me go down the rabbithole ^^. I will report back when I got it working :D.
Jep, I agree on the "optimistic" comment. In my mind it was something like: "Show what the UI would be before the roundtrip happens. So I didn't know how to differently name it than "optimistic UI".
Thanks for the answer!
7 replies
Repeater optimistic UI with livewire
Specifically I am looking to alter the "Add " / "Delete"-actions to rapidly display / remove a new record without a roundtrip.
So when clicking, a new row gets added (or the row gets deleted) without doing a roundtrip.
Deleting the record seems quite doable.
But I am afraid that creating a new item will be pretty tricky (generating new form elements that play nicely with the current livewire BE actions, which also can be altered afterwards using the $get and $set seem a bit harder).
7 replies