DEV Community

Discussion on: I Love Writing JavaScript, But Livewire Is A Great Way To Avoid Writing JavaScript For Stupid Reasons

Collapse
 
realtebo profile image
Mirko Tebaldi

Only a side note. Every client action will result in a server ajax call. Yes, fully automated. But I don't want every click on a plus or a minus or on an accordion will make an ajax call. This cannot scale

Collapse
 
darakanoit profile image
Dahaka K

I plan to use it in conjunction with a roadrunner ( roadrunner.dev/ ) to avoid performance overhead and scale.

Collapse
 
shelob9 profile image
Josh Pollock

You're correct about clicks. I don't think that part of this scales. That isn't a reason to say the whole idea doesn't scale.

If it was something with a lot of clicks, I'd write some client-side JavaScript to handle it. What I actually used this for was pagination, search, and other things that the end user perceives as page changes, this makes it faster for them.

Collapse
 
alexmartinfr profile image
Alex Martin • Edited

True! That's why Caleb recommends using Alpine* or even vanilla JavaScript in addition to Livewire. It's perfect for this kind of interaction 😉

Collapse
 
jleonardolemos profile image
Leonardo Lemos

You do have the possibility to change some data binding parameters in order to prevent too much requests, you can reproduce any SPA with livewire with the same amount of ajax calls