Livewire considerations

  Рет қаралды 4,019

PHP Annotated

PHP Annotated

Күн бұрын

In this next part of our Livewire series, I want to discuss some concerns.
Previous videos:
- Building a game with PHP and Laravel Livewire: • Building a game with P...
- Extending my Laravel Livewire game, with ONE line of JavaScript: • Extending my Laravel L...
- Learn about how I made my map game: stitcher.io/blog/procedurally...

Пікірлер: 13
@aghitsnidallah7953
@aghitsnidallah7953 Жыл бұрын
I built an app using a full-page Livewire, a pretty big app that has been used in my country, nation-wide. After a year of inspecting, and doing some stress test here and there, I came with a conclusion that Livewire should not be used as a big, whole-app component. Imagine re-rendering more than 400KB worth of data to your browser, every time the user clicks. This is definitely my mistake, deciding to use a stack blindly without knowing how it behaves in the background. I think, the good approach on using Livewire is only when you need an interactive set of component or form, not a whole page. I would really like to see Livewire put a real case of scenario in their documentation page, along with warnings what might could happened if you do a wrong approach.
@JohnRoux
@JohnRoux Жыл бұрын
This is less a livewire problem and more an architecture problem with your app. Using livewire to handle the server-client comms doesn't mean you should ignore them entirely. You can use any tool badly
@lanrewaju
@lanrewaju Жыл бұрын
@@JohnRoux sure thing buddy
@phpannotated
@phpannotated Жыл бұрын
In case you're wondering: I used Alpine.js as a way to hook into DOM events for my custom implementation, just FYI: alpinejs.dev/
@guramikutivadze
@guramikutivadze Жыл бұрын
In my opinion it's better to render map with js and validate it on save. validation can be done much faster and will be used only one time on save.
@mayanksgajjar
@mayanksgajjar Жыл бұрын
I found performance issue with Livewire, when I use Post::with('comments') but due to Livewire nature of converting collection to array/json, it costs N+1 query in getters/setter
@guramikutivadze
@guramikutivadze Жыл бұрын
it's not livewire issue.
@mayanksgajjar
@mayanksgajjar Жыл бұрын
@@guramikutivadze how?
@cristianbilu
@cristianbilu Жыл бұрын
You don't get N+1 queries in Livewire without getting them without using Livewire, if you want us to help you find a root cause please share a gist.
@martinh4982
@martinh4982 Жыл бұрын
This happens if you serialize an entire model over the "wire", ie if you have public properties that are Eloquent models. What I tend to do is only store the model's id in a public property. This helps with performance, payload size, and I have more controller over how the model is re-instantiated on subsequent page calls.
@JohnRoux
@JohnRoux Жыл бұрын
@@martinh4982 Yep, in the same way, you shouln't serialize that whole collection when putting it in a job. Even with things like Laravel doing some magic to help you out a bit
@user-mm9ys6gn2e
@user-mm9ys6gn2e 11 ай бұрын
Isn't this solved with Livewire 3?
@DanielSpravtsev
@DanielSpravtsev Жыл бұрын
I think in case of livewire you should pick the right tool for your task: Livewire or Alpinejs. Alpine works great with livewire, so there won’t be any problem if you just pick the right tool 😀
PHP on the frontend! No more Javascript!
14:47
Aaron Francis
Рет қаралды 119 М.
PHP 8.4: new without parentheses
13:42
PHP Annotated
Рет қаралды 4,8 М.
ОСКАР vs БАДАБУМЧИК БОЙ!  УВЕЗЛИ на СКОРОЙ!
13:45
Бадабумчик
Рет қаралды 6 МЛН
路飞被小孩吓到了#海贼王#路飞
00:41
路飞与唐舞桐
Рет қаралды 74 МЛН
How to ACTUALLY get into Gamedev
14:01
DaFluffyPotato
Рет қаралды 701 М.
Programming Is NOT Enough | Add these 7 skills…
13:19
Travis Media
Рет қаралды 415 М.
How principled coders outperform the competition
11:11
Coderized
Рет қаралды 1,6 МЛН
Caleb Porzio "Livewire 3" - Laracon US 2023 Nashville
43:28
PHP doesn't suck (anymore)
10:48
Aaron Francis
Рет қаралды 200 М.
Building a game with PHP and Laravel Livewire
7:01
PHP Annotated
Рет қаралды 18 М.
Livewire VS Vue.js: Practical Example of Dependent Dropdowns
13:40
Laravel Daily
Рет қаралды 42 М.
Bob Nystrom - Is There More to Game Architecture than ECS?
23:06
Roguelike Celebration
Рет қаралды 195 М.
ОСКАР vs БАДАБУМЧИК БОЙ!  УВЕЗЛИ на СКОРОЙ!
13:45
Бадабумчик
Рет қаралды 6 МЛН