DEV Community

Cover image for Why Theo is Wrong & We'll Get a Laravel for JavaScript
vincanger for Wasp

Posted on • Originally published at wasp-lang.dev

Why Theo is Wrong & We'll Get a Laravel for JavaScript

JavaScript's Need for a Full-stack Framework

Why Don't We Have A Laravel For JavaScript?”. This is the question Theo poses in his most recent video.

And if you’re not familiar with tools like Laravel and Ruby-on-Rails, they are opinionated full-stack frameworks (for PHP and Ruby) with lots of built-in features that follow established conventions so that developers can write less boilerplate and more business logic, while getting the industry best practices baked into their app.

Image description

He answers this question with the opinion that JavaScript doesn’t need such frameworks because it’s better to select the tools you want and build the solution you need yourself.

This sounds great — and it also happens to be a nice flex if you’re a seasoned dev — but I feel that he doesn’t back up this claim very well, and I’m here to tell you where I think he’s wrong.

In my opinion, the better question to ask is why don’t we have a Laravel for JavaScript yet? The answer being that we’re still working on it.

In his summary of the full-stack frameworks of the JavaScript world that could be comparable to Laravel or Rails, he fails to consider a few important points:

  1. People really want a Laravel / Rails for JavaScript. If they didn’t, there wouldn’t be so many attempts to create one, and he wouldn’t be making a video whose sole purpose is to respond to the pleading cry “WHY DOESN’T JAVASCRIPT HAVE ITS OWN LARAVEL!?
  2. He fails to consider the timing and maturity of the underlying tools within the JS ecosystem. Perhaps it’s not that a Laravel for JavaScript doesn’t need to exist, it’s just that it doesn’t exist yet due to some major differences in the ecosystems themselves, like how old they are and where the innovation is mostly happening.
  3. He also fails to ask for whom these types of solutions are suitable for. Surely, not all devs have the same objectives, so some might opt for the composable approach while others prefer to reach for a framework.

So let’s take a look at how we got to the point we’re at today, and how we might be able to bring a full-stack framework like Laravel or Rails to the world of JavaScript.

Getting Shit Done

In his video, Theo brings up the point that "there's a common saying in the React world now which is that ‘if you're not using a framework you're building one’”. Even though this is meant to be used as a criticism, Theo feels that most JavaScript devs are missing the point and that building your “own framework” is actually an advantage.

Image description

He feels that the modular nature of the JavaScript ecosystem is a huge advantage, but that sounds like a lot of pressure on the average developer to make unnecessary judgement calls and manage lots of boilerplate code.

Sure, you have teams that need to innovate and meet the needs of special use cases. These are the ones that prioritize modularity. They tweak, improve, and squeeze as much out of developer experience (DX) and performance as possible to get their unique job done right.

But on the other hand, there are also numerous teams whose main objective is producing value and innovating on the side of the product they are building, instead of the tools they are using to build it. These devs will favor a framework that allows them to focus solely on the business logic. This gives them a stable way to build stuff with best practices so they can easily advance from one project to another. In this camp are also the lean, mean indiehackers looking for frameworks so they can move fast and get ideas to market!

Image description

It’s a bit like the difference between Mac and Linux. Mac’s unified stack that just works out-of-the box means many professionals prefer it for its productivity, whereas Linux is great if you’re looking for flexibility and have the time and knowledge to tweak it to your desires. Both are valid solutions that can coexist to meet different needs.

This focus on productivity is what made Rails so powerful back in the day, and why Laravel is such a loved framework at the moment. And the many attempts at creating such a framework for JavaScript is proof enough that there is a large subset of JavaScript devs who also want such a solution.

But maybe the reason such a framework doesn’t exist yet doesn’t have to do with whether devs want one or not, but rather the important factors which are needed in order for such a framework to come together haven’t aligned up until this point. For such a framework to be widely adoptable, it first needs underlying technologies that are stable enough to build upon. After that, it needs time and many iteration cycles to reach maturity itself, so that devs can feel comfortable adopting it.

Have these factors aligned in the JavaScript world to give us the type of frameworks that PHP and Ruby already have? Maybe not quite yet, but they do seem to be slowly coming together.

Comparing Ecosystems

One of Theo’s main points is that JavaScript as a language enables a level of modularity and composability that languages like Ruby and PHP don’t, which is why Ruby and PHP ecosystems are well served by full-stack frameworks, but JavaScript doesn’t need one since you can just compose stuff on your own.

While JavaScript is a peculiar language, with its support for both functional and imperative paradigms and dynamic nature, it also comes with a lot of pitfalls (although it has improved quite a bit lately), so you don’t typically hear it get praised in the way Theo does here. In fact, you are probably more likely to hear praise for Ruby and its properties as a modular and flexible language.

So if it isn’t some unique properties of JavaScript as a language that make it the king of web dev, what is it then?

Image description

Well, the answer is pretty simple: JavaScript is the language of the browser.

Way back when most of the web development was happening on the server side, PHP, Java, Ruby and other languages where reigning supreme. During this era, devs would only write small pieces of functionality in JavaScript, because most of the work was being handled server-side.

But as web development evolved and we started building richer applications, with more dynamic, responsive, and real-time features, a lot of code moved away from the server and over towards JavaScript on the client, because it’s (basically) the only language that supports this. So instead of doing your development mostly in PHP or Ruby with a little bit of JavaScript sprinkled in there, you were now splitting your apps between substantial amounts of JavaScript on the client, plus Ruby or PHP on the server.

JavaScript’s final power move came with the arrival of NodeJS and the ability to also write it on the server, which secured its position as the king of web dev languages. Today, devs can (and do) write their entire apps in JavaScript. This means you need to know one language less, while you’re also able to share the code between front-end and back-end. This has opened up a way for better integration between front-end and back-end, which has snowballed into the ecosystem we know today.

So it’s not so much the unique properties of JavaScript as a language that have made it the dominant ecosystem for web development, but more its unique monopoly as the only language that can be used to write client code, plus it can also be used server-side.

Image description

As Theo says, “we’ve got infinitely more people making awesome solutions” in the JavaScript ecosystem. That’s right. It’s exactly those infinite number of developers working in the space creating the flexibility and modular solutions for JavaScript, rather than it being an innate quality of the programming language.

And because the JavaScript ecosystem is still the hottest one around, it has the most devs in total while continuing to attract new ones every day. This means that we get a large, diverse community doing two main things:

  1. Innovating
  2. Building

The innovators (and influencers) tend to be the loudest, and as a result opinion largely skews in their favor. But there is also a lot of building, or “normal” usage, happening! It’s just that the innovators tend to do the talking on behalf of the builders.

So with all that’s going on in the JavaScript ecosystem, is it pointless to try and build a lasting framework for JavaScript developers, as Theo suggests, or are we on the path towards achieving this goal regardless of what the innovators might claim?

Show Me What You’re Working With

Theo also drops the names of a bunch of current JavaScript frameworks that have either failed to take off, or “just can’t seem to get it right” when it comes to being a comprehensive full-stack solution.

Image description

And he does have a point here. So far, solutions like Blitz, Redwood, Adonis, or T3 haven’t managed to secure the popularity in their ecosystem that Rails or Laravel have in theirs.

But these things take time.

Have a look at the graph above. Laravel and Rails have been around for 13-15 years! The JavaScript frameworks being used in comparison are just getting started, with some of them, like Wasp and Redwood, at similar stages in their development as Laravel and Rails were during their initial years.

As you can see, it takes time for good solutions to reach maturity. And even with some of these frameworks starting to stagnate their great initial growth is evidence that demand for these tools definitely exists!

The main overlying issue that tends to plague these tools is that Javascript as an ecosystem is moving quite fast, so for a solution like this to survive long term, it needs to not only be opinionated enough, but also modular enough to keep up with the shifts in the ecosystem.

Image description

One factor that prevents frameworks from reaching this state is being tied too tightly to the wrong technology. This was NextJS for BlitzJS, GraphQL for Redwood, and Blaze for MeteorJS. And another factor is not going big enough with the framework, because it seems too daunting a task within the JavaScript ecosystem, where things move fast and everyone is “terrified of being opinionated” because they might get criticized by the loudest voices in the scene.

In other words, frameworks that avoid going big on their own, and going truly full-stack, like Ruby-on-Rails and Laravel went, miss the opportunity to solve the most common pain-points that continue to plague JavaScript developers.

But, the JavaScript ecosystem is maturing and stabilizing, we are learning from previous attempts, and there will be a full-stack framework bold enough to go all the way in, get enough things right, and persist for long enough to secure its place.

Say Hi to Wasp

In his comparison of JavaScript frameworks on the market today, Theo also fails to mention the full-stack framework for React & NodeJS that we’re currently working on, Wasp.

We’ve been working hard on Wasp to be the truly full-stack framework that meets the demands of web developers and fills that void in the JavaScript ecosystem to become the framework they love to use.

Image description

With Wasp, we decided to go big, opinionated, and truly full-stack. In other words, we’re going all in with this framework.

That means thinking from first principles and designing a novel approach that only Wasp uses, like building our own compiler for our configuration language, and truly going full-stack, while also keeping it modular enough to move together with the ecosystem as it progresses.

This means that we spent more time in the beginning trying different approaches and building the foundation, which finally brought us a significant jump in usage starting in late 2023. Wasp is now growing strong, and at a really fast pace!

It’s really cool for us to see Wasp being used today to ship tons of new apps and businesses, and even being used internally by some big names and organizations (more info on that will be officially released soon)!

Image description

What Wasp does differently than other full-stack frameworks in the JavaScript world is that it separates it’s main layer of abstraction into its own configuration file, main.wasp. This config file gives Wasp the knowledge it needs to take care of a lot of the boilerplatey, infrastructure-focused code, and allows it to have this unique initial compile-time step where it is able to reason about your web app before it generates the code for it in the background (using that knowledge while generating it).

In practice, this means that all you have to do is describe your Wasp app at a high level in Wasp’s config file, and then implement everything else in technologies that you’re familiar with such as React, NodeJS, and Prisma. It also means that Wasp has a high modularity potential, meaning we are building it to also support other frontend frameworks in the future, like Vue, Solid or Svelte, and to even support additional back-end languages, like Python, Go or Rust.

If you’re the kind of developer that wishes a Rails or Laravel for JavaScript existed, then you should give Wasp a try (and then head into our Discord and let us know what you think)!

Where Are We Headed?

We firmly believe that there will be a full-stack framework for JavaScript as there is Laravel for PHP and Ruby-on-Rails for Ruby.

It just seems like, at the moment, that we’re still working towards it. It also seems very likely that we will get there soon, given the popularity of current meta-frameworks and stacks like NextJS and T3.

But this stuff takes time, and patience.

Plus, you have to be bold enough to try something new, knowing you will get criticized for your work by some of the loudest voices in the ecosystem.

That’s what we’re prepared for and why we’re going all in with Wasp.

See you there!

Image description

Top comments (31)

Collapse
 
jakewilson profile image
Jake Wilson

You guys have completely missed AdonisJS. Backend JS framework built specifically to mimic Laravel.

adonisjs.com/

Collapse
 
vincanger profile image
vincanger

Adonis is mentioned in both the video and the article!

Collapse
 
jakewilson profile image
Jake Wilson • Edited

Yeah sorry I realized that after posting.

So the article I guess is not that JS frameworks haven't tried to go the Laravel route, it's that the ones that have done it successfully have just not gotten popular enough.

Honestly the problem is that the JS ecosystem moves too fast. There are too many new, shiny JS thing-a-jigs coming out all the time that are practically unmaintained after a few years. So even if someone comes out with something like this that truly is the (current) perfect solution, it gets ignored by so many JS devs because it's easy to assume it's just another new thing that will be forgotten in 2 years.

Laraval is successful because it was awesome but also it came out at a time where there weren't tons of big frameworks that felt "just right". Codeigniter was getting old, Symfony was super confusing and used too many "magic methods", CakePHP was a dinosaur. Laravel was timed perfectly and was simple and brilliant to use. Also the PHP "ecosystem" was extremely new. The idea of package managers was still very new.

The JS module based ecosystem is just moving so fast it makes it hard for anything to get traction. React got really popular because Facebook pushed it hard and because it was doing virtual DOM stuff the best of anything that had tried it before. Even now there are arguably much better solutions than React like SvelteJS but again, it's easy for dev's to ignore it because is it just the latest shiny thing (I know Svelte isn't). I mean when was the last time you saw a job listing for Svelte?

Anyways, good article. Thanks,

Thread Thread
 
vincanger profile image
vincanger

Yep. This is the point. Hopefully the js ecosystem is reaching a stabilizing point so that the right framework around it can be built (it seems to be case)

Collapse
 
kulemantu profile image
Kago Kagichiri

Agreed. AdonisJS may not have the popularity of the other frameworks, but if I were moving engineers over from Laravel and Rails, I'd pick this. Methinks Wasp is more like Terraform for JS and may be a cognitive jump from coding to configuration...

Collapse
 
martinsos profile image
Martin Šošić

Vince I am thankful you took the initiative and time to write this article, it is important to have two sides in every argument and to show the whole picture so people can make their own conclusions, and this article brings the missing piece of argument to the video in question.

Collapse
 
vincanger profile image
vincanger

thanks for the support, Martin!

Collapse
 
darkmatterdev profile image
darkMatterDev

Good article! I definitely agree on the "loudest" comments. Everyone talks about Next because they have marketing and they have conferences but their alternatives do not. Personally I really like Adonis but they are not growing because they are quiet. I want a batteries included framework! Yes I have used Next, Nuxt, Nest, Adonis, and every other JS framework but I always go back to Laravel and Rails. In 1-2 lines in the terminal, I have a fully featured app with authentication, authorization, session management, validation, email, notifications, websockets, database setup, event queues, the whole nine, and with configuration all set up for me -- all under 10 seconds. And all of that is 1st party. The choice is simple! No JS framework, that I have used, comes close. Instead I have to choose between 3rd party alternatives and hope that some influencer doesn't make me feel bad on my decision, hope that whatever I choose has long term support, hope that whatever I choose is as robust as its Laravel/Rails counterpart, and hope that I don't have to replace whatever I choose with some new trendy alternative some influencer recommended. This process is absurd!

Collapse
 
gavinsykes profile image
Gavin Sykes

I subscribed to Josh Cirre recently, and he proposes that Laravel is the Laravel for JavaScript. Not everyone would be inclined to agree of course, but I certainly would!

youtube.com/watch?v=MGwgJeThQk4

A lot of the pieces are there already though admittedly there are some missing, for example I'd love a way to automate just running through your Laravel app and generating your TS types based on your models and resources, save you having to update all that manually.

Collapse
 
ariaieboy profile image
AriaieBOY
Collapse
 
gavinsykes profile image
Gavin Sykes

I knew it, I knew there would be! Thank you for this :D

Collapse
 
matijasos profile image
Matija Sosic

Yes, I think that's what makes for that Rails-like feeling everybody is talking about. Is there anything preventing Laravel from doing that?

Collapse
 
programmersoham profile image
Soham

Awesome Post Vinny 👏

Collapse
 
vincanger profile image
vincanger

🙏

Collapse
 
licto profile image
Licto

Vince, hats off to you.
The combination of memes and graphics always brings a smile to face!

Collapse
 
vincanger profile image
vincanger

haha thanks. no one has every commented on that aspect of the article. glad you enjoy them :)

Collapse
 
matijasos profile image
Matija Sosic

This is a really informative overview! I especially love the chart with rails/laravel and others, that shows it takes time to develop such a framework.

Collapse
 
vincanger profile image
vincanger

Yeah that really helps put things into perspective:)

Collapse
 
philipjc profile image
Philip J Cox • Edited

Program. Don’t follow trends. Less abstraction more thinking. 😀

Collapse
 
okchien profile image
asf afsa

tks author

Collapse
 
vincanger profile image
vincanger

ur welcome

Collapse
 
xet7 profile image
Lauri Ojansivu

Is there any PHP-like cheap shared hosting for Javascript or Ruby? URL?

Collapse
 
roguealien profile image
Rodrigo García

Well after reading your post I'm still thinking he's right. Why? Javascript best feature it's also its worst feature which is: it grows to fast.

Having in mind this growth and what you're saying is that they take time, which it does specially for mature, but by the time it has mature enough there will be probably a better way to do the same or much of it faster and with new stuff in mind. I believe the best thing is to have the payloadcms approach, to grow alongside other tools.

Although thinking in a kind of "future proof" project would be to have EVERYTHING in modules that can be updated single handed without affecting the others. For example you want AUTH? Install the package that handles it and creates everything for you, you want to use MVC here's the module, you want GraphQL here's the other module, and so. Think this would be a better way to future proof it instead of bundling everything together and hiding everything behind.

Btw I have tested AdonisJS and I'm currently using it in a production project it won't be my default way to go as backend but will probably go to payloadcms and nextjs if the integration goes as great as advertised.

Collapse
 
sonofyah profile image
son-of-Yah

You should consider giving AdonisJs a good review

Collapse
 
hrgdavor profile image
Davor Hrg

I sincerely hope not.

Collapse
 
knajjars profile image
Khalil Najjar

What can we do to sky rocket Adonis popularity?

Collapse
 
shanos profile image
Stefan Schulz

Strapi is also a kind of laravel for js

Some comments may only be visible to logged-in visitors. Sign in to view all comments.