I've been writing code for a while now, and I remember the Rails era well. Suddenly, we had a way to build applications with this weird new language, Ruby, that allowed us to have server and client together in a way that made sense. This magical pattern, known as the Model-View-Controller (MVC) paradigm, allowed us to structure our applications in a way that made it easy to manage data and present it to the user.
Rails was one of the first frameworks to introduce this concept, and it was quickly adopted by many popular services, such as GitHub. While these services may have moved some of the client-side functionality to other frameworks, such as React, the general infrastructure is still built around the patterns that Rails invented.
But this article isn't about Ruby or Rails. It's about Laravel, another all-in-one framework that has gained popularity in recent years. When we talk about an all-in-one framework, we mean a framework that includes everything you need to build a web application, from setting up a mail server to managing notifications and websockets. The value of an all-in-one framework is that it saves you the time and effort of finding and integrating multiple solutions for each individual problem.
Laravel is a PHP framework, and it has gained a reputation as the "PHP framework for web artisans." This may sound a bit pretentious, but let's be real, we're JavaScript devs, and we've said way more pretentious stuff in our time. The reason Laravel has gained popularity is because it is an all-in-one solution that includes primitives for many common web development tasks, such as setting up a mail server, managing notifications, and handling websockets.
One of the most powerful features of Laravel is Livewire, which allows you to update the client as new data comes in or as a user clicks a button. This allows for a dynamic, interactive user interface that is powered by server-side code and constantly interacting back and forth via websockets.
But the real reason I wanted to talk about Laravel is because it is an example of an all-in-one framework, and I want to explore the idea of whether or not we need an all-in-one framework for JavaScript.
Back in the day, the alternative to the Rails stack was the MEAN stack, which included Express, Angular, and Node. Of these four technologies, I can definitively say that at least two of them are a mistake, if not three. The problem with the MEAN stack was that it was so modular and the parts were not necessarily built to be very compatible with each other. This made it difficult to implement and build around, and if one of those parts was hard to work with, it could make the entire solution a nightmare to work with.
The beauty of an all-in-one solution, like Rails or Laravel, is that it provides recommendations for every problem you might have and guarantees that it will at least work, even if it's not perfect. This is in contrast to a highly modular solution, where it can be difficult to identify a good solution and the risk of picking the wrong one is always present.
The reason we don't have a Laravel for JavaScript is because things are so much better without it. The JavaScript ecosystem is much more mature and there are infinitely more people making awesome new solutions that improve on certain problems. This is the magic of JavaScript – it's way easier to swap these pieces in and out and compose them in the ecosystem around everything from npm to react components to hooks to all the stuff that we adopt and use in these infrastructures and servers and applications.
In conclusion, while Laravel and other all-in-one frameworks have their place in the web development world, the JavaScript ecosystem is better off without one. The ability to compose and assemble our own best solution from a wealth of great full stack all-in-one solutions and individual pieces is one of the strengths of JavaScript. It might be confusing and overwhelming for beginners to have so many options, but the reality is that it's hard to pick wrong if you're following recommended solutions and the docs are less than 5 years old. So, let's embrace the magic of JavaScript and continue to build awesome solutions with it.