<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Nathaniel Pisarski on Medium]]></title>
        <description><![CDATA[Stories by Nathaniel Pisarski on Medium]]></description>
        <link>https://medium.com/@nathanpisarski?source=rss-127e1a9c344b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*gVvcpJD2ldEpUjtg.</url>
            <title>Stories by Nathaniel Pisarski on Medium</title>
            <link>https://medium.com/@nathanpisarski?source=rss-127e1a9c344b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 16:47:37 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nathanpisarski/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Making the case AGAINST Laravel Livewire]]></title>
            <link>https://medium.com/@nathanpisarski/making-the-case-against-laravel-livewire-a88c68ca0627?source=rss-127e1a9c344b------2</link>
            <guid isPermaLink="false">https://medium.com/p/a88c68ca0627</guid>
            <category><![CDATA[laravel]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[livewire]]></category>
            <category><![CDATA[frontend]]></category>
            <category><![CDATA[php]]></category>
            <dc:creator><![CDATA[Nathaniel Pisarski]]></dc:creator>
            <pubDate>Sun, 26 Jan 2020 02:57:08 GMT</pubDate>
            <atom:updated>2020-06-12T16:00:46.327Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>EDIT: Since the writing of this article, updates have been made to Livewire that have fixed some of the things I complain about below. Caleb and other developers have also given their opinion in the comments. The article below is preserved in its original state. Note that due to the new releases, there will be innacuracies, and my opinion has changed. I still believe that Livewire is rarely the BEST solution, but my opinion has shifted to the stance that sometimes, it can be a GOOD solution.</strong></p><p>If you haven’t heard of <a href="https://laravel-livewire.com/">Laravel Livewire,</a> it’s a creative new web framework spearheaded by a developer named <a href="https://twitter.com/calebporzio">Caleb Porzio</a>. Caleb is a charismatic guy, and has done fantastic talks at Laracon, and tutorial videos for Laracasts. I don’t want anything I write in this article to appear to be an attack on Caleb, because he’s a “straight-up G”, as they say. And he’s really passionate about developing Livewire and Alpine.js. With that said…</p><p>The concepts underpinning Livewire are fundamentally dangerous, and the reality is that it will hurt the maintainability and “purity” of any project it touches. I would advise <em>against</em> using it in any serious project.</p><p>So, why am I so salty about Livewire? Let’s dive right in.</p><h3>What Livewire Is</h3><p>Before we can understand what’s wrong with its design, we first have to understand Livewire itself.</p><p>Livewire tells developers to “Believe in the Backend”. The first words on <a href="https://laravel-livewire.com/">laravel-livewire.com</a> read “JavaScript is crazy these days”. An inherent unhappiness in the landscape of modern web development is the driving force in Livewire. It aims to provide a dynamic, modern web experience without having to mess around with Reactive web frameworks or Javascript at all.</p><p>And for the most part: <strong>it can. </strong>Livewire really works, and over the next few years we’ll almost definitely see some big, serious projects in it.</p><h3>What Livewire Does</h3><p>Livewire’s technique is neat. When you use it, you:</p><ul><li>Write a PHP class, that will act as the backend portion of a frontend component. The public fields will be visible to Livewire.</li><li>Write a frontend component in Laravel’s templating language (Blade). This component references the fields in the backend component that you wrote before.</li><li>Write methods in your backend-component’s class, that change the state of the public fields.</li><li>Instantiate the component in another view, or another component.</li></ul><p>When you visit the page, Livewire will render the initial state of component as HTML and inject it into the page that you see. Livewire will have already attached auto-generated Javascript events to the page, that call the methods you wrote in step 3 above.</p><p>When you perform some action, the Javascript events that Livewire generates will make an AJAX request to the backend’s Livewire endpoint. This will call the method that you wrote, changing the public properties that you defined.</p><p>Next, your backend component’s render method is called, producing a chunk of HTML. This chunk of HTML is the response to the AJAX request.</p><p>Finally, this HTML is hot-patched into the page by the client-side Livewire component. And the round-trip is complete.</p><h3>An Example</h3><p>Let’s actually make an end-to-end example so this makes a bit more sense. You can skip this if my description of Livewire made sense.</p><p><strong>Creating the Backend Component</strong></p><p>You create a PHP class with public fields and methods.</p><blockquote>Author’s Note: I wanted to take a second to talk about the… content of the code below. I used a website called <a href="https://inspirobot.me/">https://inspirobot.me/</a> to generate “Inspirational” quotes, using AI. And, well, I think that bot needs therapy. Sorry about the quotes below.</blockquote><pre>&lt;?php<br>declare(strict_types = 1);<br><br>namespace App\Http\Livewire;<br><br>use Livewire\Component;<br><br>final class Quotes extends Component<br>{<br>    public ?string $quote = null;<br><br>    // Generated With: https://inspirobot.me/<br>    public const <em>QUOTES </em>= [<br>        &quot;Is pornography what we&#39;ll live on when we run out of addiction?&quot;,<br>        &quot;News channels are not your friends&quot;,<br>        &quot;Being a librarian can often be like getting blackmailed. It sounds kinda cool, till you realize it&#39;s actually happening&quot;,<br>        &quot;Without security there can be no barbarism&quot;,<br>        &quot;Feeling woke? Be afraid. Very afraid&quot;,<br>        &quot;If you are the fattest person in the Facebook group, you do not belong in the Facebook group&quot;,<br>        &quot;Don&#39;t begin. Why not just be who you always wanted to be?&quot;,<br>        &quot;Humankind ain&#39;t Humankind&quot;,<br>        &quot;Search for your debt. Search for education.&quot;,<br>        &quot;Capricorn (Dec. 22 - Jan. 19), An Annoying Woman&quot;,<br>        &quot;Behind every neglectful donor stands a clever whore&quot;<br>    ];<br><br>    public function switchQuote()<br>    {<br>        $this-&gt;quote = static::<em>QUOTES</em>[array_rand(static::<em>QUOTES</em>)];<br>    }<br><br>    public function render()<br>    {<br>        return view(&#39;livewire.quotes&#39;);<br>    }<br>}</pre><p>So, here we have a public field ($quote ) and a method that updates it (switchQuote). Activating “switchQuote” chooses another quote at random to replace $quote.</p><p><strong>Creating the frontend component</strong></p><p>Now we just need a component that references the public fields of the Backend livewire component.</p><pre>&lt;div style=&quot;text-align: center&quot;&gt;<br>    &lt;h1&gt;{{ $quote }}&lt;/h1&gt;<br>    &lt;button wire:click=&quot;switchQuote&quot;&gt;New Quote&lt;/button&gt;<br>&lt;/div&gt;</pre><p>So, {{$quote}} is the Laravel Blade way of saying “put the value of $quote here”. wire:click is a special Livewire way of saying “When this is clicked, use livewire magic to call the `switchQuote` method on the backend”.</p><p><strong>Invoke</strong></p><p>Now we just invoke it, somewhere in our existing view.</p><p>@livewire(&#39;quotes&#39;)</p><p>So, how did it work?</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F4TjW3DV1gBw%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D4TjW3DV1gBw&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F4TjW3DV1gBw%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/fd04c6693bee5a2ef06cf3fdccc50c3d/href">https://medium.com/media/fd04c6693bee5a2ef06cf3fdccc50c3d/href</a></iframe><p>Not bad. We just made a dynamic webpage without meddling in the world of Javascript, NPM, WebPack, Vue, React, Babel, etc. Maybe there’s something to this Livewire thing after all?</p><h3>What Livewire Does Wrong</h3><p>So, now we know what livewire is and what it does. So… why did I say it was dangerous earlier?</p><p>Livewire’s faults can be broken down into the following categories:</p><ul><li>Livewire violates the separation of concerns</li><li>Livewire violates the single-responsibility principle</li><li>Livewire complicates the development workflow</li><li>Livewire is inefficient</li><li>Livewire is difficult to test</li><li>Livewire is inherently imperative, whereas user interfaces are inherently declarative.</li><li>Livewire is an unfortunate victim of <a href="https://en.wikipedia.org/wiki/Conway&#39;s_law">Conway’s Law</a></li><li>Livewire has technical misgivings</li><li>Liveware has a lack of support, and probably always will</li></ul><p>This might take a while, but I want to go over these one-by-one and really hit the point home HOW Livewire falls short and WHY it’s a problem.</p><h3>Livewire violates Separation of Concerns</h3><p><a href="https://en.wikipedia.org/wiki/Separation_of_concerns">Separation of Concerns</a> is a principle that says that software should be split up into “chunks”, where each chunk worries about a different “concern”.</p><p>In a common web application, you have layers. So:</p><ul><li>The database layer is the core of the application, and knows NOTHING about what’s above it.</li><li>The data-access-layer (DAL) reads from the Database, and knows ONLY about the database layer</li><li>The ‘Model Layer’ is largely pure. It knows ONLY about the “Data Transfer Objects” (or DTO’s) which are returned from the Data-Access-Layer.</li></ul><blockquote>Author’s Note: “pure” in this context means that its state is 100% determined by the parameters it receives. Or “props”, to use React parlance.</blockquote><ul><li>The ‘Service Layer’ or ‘Business Layer’ knows ONLY of the Model layer, and the Data-Access-Layer. This is where the “Logic” of the application happens. But if situations arise it’s permissible if it knows about the database layer.</li><li>The “View Model Layer” is, again, pure. It is fed entirely through parameters from the service layer.</li><li>The “Presentation” layer is the highest possible layer. It, theoretically, should be able to know about all the layers below it. In practice, is should only interact with the View Model Layer. This is a core concept of MVVM. <a href="https://en.wikipedia.org/wiki/Finite-state_machine">It has a finite list of states which may or may not change exactly what is displayed.</a></li></ul><p><strong>Example</strong></p><p>You are looking at a recipe online.</p><p>The recipe came from a RecipeViewModel.php, which was hydrated by the RecipeController, which got its data from RecipeRepository.php, which used Eloquent to query the Database layer. When you click “Like” on the website, it submits a request to RecipeController, which calls RecipeRepository, which ultimately uses Eloquent to increment a like counter in the Database. The Presentation Layer’s state is updated to that of an incremented like.</p><p><strong>How does Laravel Livewire violate Separation of Concerns?</strong></p><p>Laravel Livewire requires that the backend keeps track of the presentation layer’s state. If you were writing a “Counter” component, which keeps track of clicks, an action in the Presentation Layer would rely on state in the layer before it (the Controller / View Model layer).</p><p>This intermixes the responsibilities of the layers. It means that the previous layer (the View-Model layer) is dictating how something should be presented. <strong>It’s tracking state and data that was created in the presentation layer.</strong> It’s violating separation of concerns because the layers have been walked backwards.</p><p>It’s also incredibly likely that the Livewire Component will need to query for more data, depending on what happens. This is reaching backwards for a previous layer as well. It breaks the purity of the component even further, since its state may rely on the previous layer’s information.</p><p>For instance, in the Livewire documentation, they have this example:</p><pre>public function mount()<br>    {<br>        $this-&gt;message = &#39;Hello &#39; . auth()-&gt;user()-&gt;first_name;<br>    }</pre><p>This shows the Livewire component (which is essentially a view-model) querying for the currently authenticated user. This relies on global state, which will also make testing it a lot harder, but we’ll talk about that later. Also, remember that as I said earlier, view-models are meant to be pure. They, ideally, have no knowledge of any layer before it. That’s the controller’s job.</p><p>To illustrate why this is really a problem, think about Custom Polymorphic Types in Laravel Eloquent. <a href="https://laravel.com/docs/5.8/eloquent-relationships#custom-polymorphic-types">When a default polymorphic type</a> is used in the database, it <strong>requires that a PHP class name is stored in the database</strong>. Layer 0 (the database) is requiring knowlege of layer 2–3 (the data access layer, or the model layer). If we change the name of the class, it breaks the database.</p><p>In Laravel Livewire, if we change the presentation layer, it might actually introduce bugs in our View-Model layer.</p><p><strong>A bug should only be able to affect the layers which come after it</strong>. This is not the case in Laravel Livewire.</p><h3>Livewire violates the single-responsibility principle</h3><p>In a similar vein, Laravel Livewire is also guilty of violating two of the SOLID principles: the <a href="https://en.wikipedia.org/wiki/Single_responsibility_principle">Single Responsibility Principle</a> being one. In the Unix Philosophy, this was called<a href="https://en.wikipedia.org/wiki/Unix_philosophy#Do_One_Thing_and_Do_It_Well"> “Do One Thing and Do It Well” (DOTADIW)</a>. Basically, each component of a software system should have one (and ONLY one) role.</p><p>However, Livewire components do many things. They control logic and transformations of data. They are stateful by design, so track state. They also control how the data within them looks.</p><p>Let’s take an example and compare React and Livewire, with regard to the single-responsibility principle . In both cases, we want to show a Recipe that can be liked.</p><p><strong>LIVEWIRE</strong></p><p>In Livewire, you would have a RecipeControler, which passes data to recipe.blade.php, which invokes a Livewire component Recipe.php with data.</p><p>The component renders HTML that displays the recipe and like button.</p><p>When you click Like, the Livewire component accesses the Data Access Layer to increment the like count.</p><p>It updates its own internal state, decides how it’s supposed to look, and then re-renders its HTML.</p><p>Notice how many things that one component decided to do on its own.</p><p><strong>REACT + REDUX</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ojzBafdeEdlIPvLn" /></figure><p>Now, this exact same interaction in React+Redux would look something like this:</p><p>An action is dispatched in the presentation layer.</p><p>Middleware decides that it cares about the action, and makes a stateless API call which returns a Recipe view-model from the Controller.</p><p>Another Action is dispatched in the Presentation layer with the data.</p><p>A reducer decides that it cares about that type of action (and only that type of action). The reducer updates the state.</p><p>A selector in the container React component updates its internal component state.</p><p>The now-updated state is declarative, so it automatically trickles down into the child component.</p><p>The user clicks Like</p><p>A callback from the container component dispatches another Action</p><p>Middleware decides it cares about that action, and dispatches another stateless API call.</p><p>The response comes, and flows through redux as an Action again.</p><p>The reducer decides it cares about that Action, and updates state.</p><p>Again, the change flows to the container via the selector, and finally to the child component.</p><p>So… There’s a lot more steps in React+Redux, but notice how each actor along the way does one (and only one) thing.</p><p>Imagine the difference between debugging the Laravel Livewire version and the React+Redux version.</p><p>In Laravel Livewire, you click ‘Like’ and the display is wrong. It could be the fault of:</p><ul><li>The markup in the blade file(s)</li><li>The state-updating logic in the Livewire component</li><li>The business logic in the data-access layer</li><li>Some issue with the global state of the backend, if it must query for other information</li></ul><p>You really don’t have any idea where the bug is occurring.</p><p>Contrasting that with React+Redux, where you know exactly where the problem is occurring. The view is messed up? the markup in the presentational component is wrong. The state in the component doesn’t update when an item is liked? The selector isn’t selecting properly. The STATE itself isn’t updating, but the action was dispatched? There has to be a problem with the reducer.</p><p>Laravel Livewire, in essence, is acting as a swiss-army knife here. It’s attempting to do everything. It simplifies things in the process, but it definitely violates the single-responsibility principle. And when something goes wrong, we say “something’s wrong with the swiss-army knife”, not “something’s wrong with the phillips-head screwdriver”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/476/0*Tp8sXFwaODfDOM1P.jpg" /></figure><h3>Livewire complicates the development workflow</h3><p>This is a very practical negative side-effect that using Laravel Livewire will have on your workflow.</p><p>In a single-page application, the presentational client(s) and the backend service(s) which support them can be developed in unison. The team can agree on an API and begin developing the frontend and backend side-by-side.</p><p>With Laravel Livewire, the lines between backend and frontend are blurred. Since the backend concerns itself with frontend state, it must be developed as one unit.</p><p>In situations where the team is comprised of soley full-stack developers, the effect of this might not be too bad. They probably already develop features as one deliverable unit. But as the project grows, this restriction can provide some real pain. It also leads to the next point:</p><h3>Livewire is inefficient</h3><p>This doesn&#39;t matter so much in 2020, where bandwidth is mostly fast and cheap. However, the reality of the situation is that Livewire makes AJAX Requests for <strong>every. single. thing. </strong>that you do.</p><p>It also makes Livewire the polar opposite of a <a href="https://developers.google.com/web/progressive-web-apps">Progressive Web App</a>. If you lose connection, the most basic functions of your app’s presentation layer will cease to function. Modals won’t open, dropdowns won’t… drop down, et cetera. In Livewire’s defense here, it does provide functionality that helps with this. It makes it easy to alert the user that the app will be malfunctioning, but it will still malfunciton.</p><p>It also replaces entire chunks of HTML at a time, and forces the browser to re-draw it. Depending on how large your Livewire component is, this could actually make a noticeable difference to the user. In contrast, frameworks like Vue and React use a “<a href="https://reactjs.org/docs/faq-internals.html">Virtual Dom</a>”, and a highly efficient diffing algorithm in order to make their updates. And they cut out the network call completely.</p><h3>Livewire is inherently imperative, whereas user interfaces are inherently declarative.</h3><p>As stated in the Livewire Documentation, Livewire is <strong>NOT</strong> Reactive. This is a gigantic difference between it and React/Vue/Marko/Angular et all.</p><p>There’s a reason why so many frameworks are declaritive. User interfaces are declaritive by their very nature. <a href="https://flutter.dev/docs/get-started/flutter-for/declarative"><strong>You define what something <em>is,</em> not what it <em>does</em></strong></a>. The fact that the element showing the quote gets its innerHTML DOM attribute set to the value of the new quote is an implementation detail. We shouldn’t have to tell it how to update the quote. We just tell it, “Here’s where the quote goes. Here’s how it looks.”. And then we write code about changing the quote itself. The framework handles the rest.</p><p>You might think that Livewire is “declaritive enough”. I mean, you’re not manually updating DOM attributes.</p><p>But the <em>second</em> you start nesting Livewire views, its declaritive facade falls apart.</p><p>Imagine you have a Livewire component, that is an input and an error message.</p><p>You want a child component to update a parent component’s state? <strong>YOU CAN’T</strong>.</p><p>You want a parent component to pass down a state change to a child component? <strong>YOU CAN’T.</strong></p><p>You can’t even pass down a closure from the parent to the child, because Livewire needs primitive types and arrays.</p><p>If you really want to do one of those things, you need to use <a href="https://laravel-livewire.com/docs/events/">Livewire Events.</a> Which means that the one of the components needs to be privy of the implementation details of the other in order to update its properties. This violates separation of concerns again.</p><p>That means if you have a tree of 3 nested components, where maybe some are lists of components (i.e generated in loops), it’s going to be inconvenient to make a working UI.</p><p>Imagine, for instance, this scenario:</p><blockquote>Create an application which displays the letters of the alphabet, and if you click a letter it goes away</blockquote><p>Well damn, that seems pretty easy in React. Here’s the full solution:</p><pre>import <strong><em>React</em></strong>, {useState} from &#39;react&#39;;<br><br>export const AlphabetBox = ({isVisible, letter, onLetterClick}) =&gt; isVisible &amp;&amp; (&lt;span onClick={onLetterClick}&gt;{letter}&lt;/span&gt;);<br><br>export const AlphabetContainer = ({}) =&gt; {<br>    let [blacklist, setBlacklist] = useState([]);<br><br>    const [addToBlacklist, removeFromBlacklist, isInBlacklist] = [<br>        letter =&gt; setBlacklist([...blacklist, letter]),<br>        letter =&gt; setBlacklist(blacklist.filter(item =&gt; item !== letter)),<br>        letter =&gt; blacklist.includes(letter)<br>    ];<br><br>    return &#39;abcdefghijklmnopqrstuvwxyz&#39;.split(&#39;&#39;).map(letter =&gt; {<br>        return &lt;AlphabetBox onLetterClick={() =&gt; addToBlacklist(letter)} isVisible={!isInBlacklist(letter)} letter={letter} /&gt;<br>    });<br>};</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h1IRxFUM66iwRNATOkz2gA.png" /></figure><p>Now what about Livewire?</p><p>Well, each letter would have to dispatch a Livewire event to the parent. The parent would then have to dispatch a livewire event that somehow each letter component listens for, and knows whether or not it is the one who should update. There are no higher-order components so this becomes harder.</p><p><strong>The value that’s passed to it from the “Alphabet Container” Livewire component doesn’t matter. </strong>As soon as there’s user interaction, all of the displayed data is coming from the payload of events.</p><p>It’s important to note that at this point, the parent has lost all control of the children. Their states will match only because they both independently updated them the same way. However, a slight gust of wind and these states could de-synchronize. That’s just straight-up impossible in React.</p><h3>Livewire has a lack of support, and probably always will to some degree</h3><p>This is to be expected from a beta product, and not really a gripe. It’s just a reality of where Livewire is right now. No tooling supports it, so things like syntax highlighting doesn’t exist.</p><p>BUT, something unique to Livewire is that some types of tooling will never be available to it. At least, not without a ton of work.</p><p>In Vue or React, I can examine every event, and I can see the payloads. <strong>I can see the current state of all components in the system. </strong>I can rewind, replay, or alter history events in Redux / VueX. Since the state is kept server-side in Laravel Livewire, this will never be possible, unless some type of driver is built to broadcast this information to the frontend, or some server-side dashboard is built. The best we can do is analyze the result of the render function and try to anticipate how we got that result.</p><h3>Laravel falls victim to Conway’s Law</h3><p>Finally, some of Livewire’s technical misgivings break some of the most powerful frontend design patterns and techniques.</p><p>It also falls victim to <a href="https://en.wikipedia.org/wiki/Conway%27s_law">Conway’s Law,</a> which (to paraphrase) states that a system is bound exhibit properties of its host system. For instance, an OCAML library is bound to present ideas which resemble OCAML itself, but possibly a more limited version.</p><p>The problem is, Livewire is attempting to cross an air-gap. So, all-of-a-sudden the way that you’re designing Presentational components represents PHP.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/722/1*tKDWdQ8iTPkuPmt9Id0FzA.png" /></figure><p>The primary manifestation of this is the fact that <strong>Livewire can only use primitive types, and arrays.</strong> This means that one of the most common representations of data in the frontend (the Object) is inaccessible to Livewire. You can emulate it with arrays, but it might be difficult.</p><p>You can’t pass in functions, or generate Livewire components on-the-fly, so things like <a href="https://reactjs.org/docs/higher-order-components.html">Higher-Order Components</a> cannot be done with Livewire. It can’t be over-emphasized how much of a loss this is. Higher-order components are incredibly powerful, and things like PHP Traits just can’t replace them. I mean, there’s no such thing as a parameterized trait.</p><h3>So… Why are people excited about Livewire if it presents all these problems?</h3><p>Well, this is actually a super interesting question. Again, Livewire’s website’s <strong>first sentence</strong> says “JavaScript is crazy these days”. And notoriously, PHP has some of the world’s most pragmatic programmers. “Don’t make it pretty, just make it work.”, “Pretty” here meaning “easy-to-maintain”.</p><p>In my opinion, people are invested in Livewire because it is the fairy-tale they want to come true. The backend is the final source of truth. Only one skillset is needed to develop these applications.</p><p>But, today <strong>that’s just simply not reality. </strong>If you want to follow best practices in a modern application, you need:</p><ul><li><strong>Continuous Integration</strong> for optimal teamwork</li><li><strong>Continuous Deployment </strong>for optimal workflow</li><li><strong>Cloud-Based</strong> environment for optimal uptime, maintainability, and speed.</li><li><strong>Containerized</strong> solutions for optimal testing and reproducability. No “it doesn’t happen on my machine” problems.</li><li>Possibly an <strong>orchestrator</strong>, like ECS or Kubernetes, or even Serverless computing, for optimal performance and control in the cloud-first world</li><li>A declaritive, reactive <strong>frontend framework</strong> for dynamic content</li><li>A backend web-service</li><li>A database, whether or not it’s NoSQL, a Graph database, or relational</li></ul><h3>Is there a way to fix Livewire?</h3><p>Laravel Livewire has a good idea, just backwards. <a href="https://inertiajs.com/">Intertia.js</a> is a library that has a similar idea, but the frontend ultimately holds the presentational state. After the initial page-load, it works exactly like a single-page application in React+Redux would.</p><p>These frameworks strive to create a soltuion for people who don’t want to create API endpoints for a dynamic frontend to call. Intertia.js just leaves out the part of the backend storing UI state, which I personally believe should be <a href="https://en.wikipedia.org/wiki/Considered_harmful">considered harmful.</a> Microsoft <a href="https://dotnet.microsoft.com/apps/aspnet/web-apps/blazor">would disagree.</a></p><h3>Conclusion</h3><p>So, I want to reiterate: I am not trying to be negative, or to crush the hopes and dreams of Caleb or anyone working on/with his project. I will likely continue using Livewire day-to-day at my job, and not complain about it one bit. I just felt the need to point out that Livewire is potentially dangerous, both from a technical and philosophical point-of-view.</p><p>If you can correct something in this article, or you agree / disagree, don’t be afraid to leave a comment. I promise that if there’s an issue with this article I will change it. Thanks for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a88c68ca0627" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>