New Livewire goodies: wire:text, wire:show, and $js()
Hello citizens of Livewire Land, If you got my last email, you know I've been thinking a lot about building optimistic UIs with Livewire . What in the name of Belsnickel is an optimistic UI? It's when the UI updates instantly, without waiting for a network roundtrip. Think of a like button that increments immediately, even before the server confirms it. Alright, back to business. Run composer update livewire/livewire , and you'll get these new goodies: wire:text wire:show wire:cloak wire:transition $js(...) $this->js(...) Alright, let's dig in... First up, wire:text : Binds text content directly to a Livewire property. Why not just in Blade? Because Blade needs a roundtrip to update, whereas wire:text reflects changes instantly (like with wire:model ). Check out the wire:text docs → Okay, let's keep going. Next up, wire:show : Shows/hides elements based on a property's state—without removing the...