A checklist showing eleven new features and improvements in Laravel Livewire v3, from Alpine-based core to the Teleport directive.

The Dawn of Laravel Livewire v3 in the Laravel Ecosystem

Laravel Livewire has transformed the way you build dynamic interfaces with Laravel. Livewire is the brainchild of Caleb Porzio. It simplifies the process of building modern, interactive web applications without leaving the comfort of Laravel. The developer community has been waiting over a year for Livewire v3. It's almost here. Livewire v3 was slated for official release on July 20th, 2023. It promises many new features and improvements for your Laravel development experience.

All-New Alpine-Based Core#

Livewire v3 features a completely rewritten core, relying heavily on Alpine.js. This enhancement improves diffing capabilities and reduces code duplication, speeding up feature development and enabling the addition of many new features. The architectural shift means faster load times and a more responsive user experience when working with your Livewire components.

Automatic Injection of Livewire Scripts, Styles, and Alpine#

With Livewire v3, you no longer need to manually add Livewire scripts, styles, or Alpine to your layouts. Everything required is automatically injected upon installation of Livewire. This streamlines your setup process and eliminates the common gotcha of forgetting a required script tag.

Hot Reloading Without a Build Step#

Livewire v3 introduces hot reloading without a build step. Changes made in your code editor are immediately reflected in the browser without breaking your components' state. This capability dramatically reduces your development friction and helps you iterate faster on your features.

Enhanced Transitions with wire:transition#

Livewire v3 introduces a new wrapper around x-transition called wire:transition. This feature allows you to add smooth transitions to any element that is shown or hidden using Livewire. The transitions make your interface feel polished and responsive to user interactions.

Writing JavaScript Functions in PHP Classes#

Livewire v3 allows you to write JavaScript functions directly in backend Livewire components. This feature executes JavaScript code without sending requests to the backend, giving you a direct way to handle client-side behavior while keeping your component logic centralized. Learn more about how to structure your application by reading our guide on building and launching Laravel applications.

Locked Properties#

In Livewire v3, you can create properties that cannot be updated from the frontend. This feature enhances security by preventing unauthorized updates to sensitive data. Locked properties give you fine-grained control over what data can be modified through the client-side interface.

Deferred wire:model by Default#

Livewire v3 makes deferred functionality the default for the wire:model directive. This change optimizes performance by reducing unnecessary requests to the server. Your components will now batch updates more intelligently, resulting in fewer round trips.

Intelligent Request Batching#

Livewire v3 introduces intelligent request batching. This feature batches multiple wire:poll events, listeners, and method calls into one request when possible, further improving performance. The optimization is transparent to you, yet has a measurable impact on your application's responsiveness.

Reactive Properties and Nested Components#

Livewire v3 introduces reactive properties for nested components. When a parent component's property is updated, the child component's data is automatically kept in sync. This bidirectional reactivity simplifies your component communication and reduces boilerplate code. If you're evaluating different approaches to building reactive frontends in Laravel, you may want to compare Livewire with Splade and Inertia.js to understand which best fits your project needs.

Modelable Properties#

Livewire v3 simplifies the process of modelling a property from a parent to a child component. This feature allows for automatic updates in the parent anytime the property is updated in the child. Modelable properties give you a cleaner, more intuitive API for two-way binding.

Access Parent Component's Data and Methods Using $parent#

In Livewire v3, you can access a parent component's data and methods using the new $parent property. This feature provides a convenient way to interact with the parent component when needed, though it's recommended to use reactive properties or modelable properties when possible for cleaner architecture. As Laravel continues to evolve, you can also explore Laravel Folio to see how file-based routing is changing the way developers structure their Laravel applications.

Teleport Directive#

The new @teleport Blade directive in Livewire v3 allows you to teleport a piece of markup and render it in another part of the DOM. This capability can help you avoid z-index issues with modals and slideouts, simplifying your component structure.

A Salute to the Open Source Community#

The success of Livewire and the anticipation for v3 is a testament to Caleb Porzio's vision, dedication, and tireless work. His efforts continue to shape the Laravel ecosystem and have a significant impact on the broader PHP community. However, the success of any open-source project is not the work of a single individual. Many contributors, directly or indirectly, have played a part in making Livewire what it is today. For software engineering practices that support this kind of community-driven development, explore our work on design and delivery excellence.

Livewire has revolutionized the way you build dynamic interfaces in Laravel, and the journey to this point has been nothing short of incredible. As you anticipate the release of Livewire v3, take a moment to appreciate the immense effort and dedication of Caleb Porzio and all the contributors who have helped shape this framework.

The Laravel community awaits the release of Livewire v3 with bated breath. The new features and improvements promise to significantly enhance your Laravel development experience and open up new possibilities for full-stack Laravel development.

Questions this post answers

When will Laravel Livewire v3 be released?
Livewire v3 was slated for official release on July 20th, 2023. The brainchild of Caleb Porzio, this release represents over a year of development. It brings a completely rewritten Alpine-based core with numerous performance and developer experience improvements to the Laravel ecosystem.
What is the biggest change in Livewire v3?
The most significant change is the all-new Alpine-based core, which has been completely rewritten. This enhancement improves diffing capabilities and reduces code duplication. Feature development speeds up, and developers add new features without the overhead of previous versions.
Does Livewire v3 require manual setup of scripts and styles?
No. With Livewire v3, developers no longer need to manually add Livewire scripts, styles, or Alpine to their layouts. Everything required is automatically injected upon installation of Livewire, simplifying the setup process significantly.

Keep reading