DEV Community

Cover image for Livewire: The best of both worlds
Robson Tenório
Robson Tenório

Posted on • Edited on

Livewire: The best of both worlds


One project

Image description

During the first web wave, you have heard about the MVC pattern. There was some technical limitations at that time to deliver a better user experience (UX): slow page transitions, "poor" interfaces and awful usability.

Ah, and we had the spaghetti style with some database queries inside views. But this was the programmers' fault, not a fault from the MVC pattern itself.

But... it worked out at the end of the day! It was one project.


Two projects

Image description

After the condemnation of the MVC pattern, modern frontend frameworks such as Vue, React and Angular rapidly emerged... now the application loads faster, full page reloads are not required anymore and users experience a better UX. You know it as SPA (Single Page Application).

By nature, a SPA imposes the concept of separation between frontend and backend. Now, you have two projects.

Then, every single time that the frontend needs some new data the backend needs to be improved. And now you get:

  • Two repositories to manage.
  • Two deploy pipelines to manage.
  • Two teams to manage.

Not to mention that it is necessary to duplicate:

  • Authentication.
  • Authorization.
  • Some parts of business rules.

Because, well... they are two different projects.

The pieces are separated but intimately linked. In the end, this is just one product splitted in two projects.


One project (again)

Image description

What if it was possible to make things simple again?

  • One deploy pipeline to manage.
  • One team to manage.
  • One project (again).

Now enters Livewire: a full-stack framework for Laravel that takes the pain out of building dynamic UIs.

You can go right away to the docs and find out by yourself how productive you can be.

If you have previously worked with Vue/React/Angular you will quickly notice something: where are the UI components libraries?

Well, there are not that many libraries available for Livewire. But, now you have MaryUI: great DX and UX with minimal effort.


Image description


Conclusion

A puzzle becomes easier to put together when the pieces are close enough to each other. Keep things simple and avoid complexity at all costs.

Remember that using Livewire will not stop people from making the same mistakes as they did in the past.

The problem is people, not technology.
-- sarcastic saying

Top comments (0)