Rails and Next.js: the perfect combination for modern web development (Part 1)

Raphael Almeida Araújo
3 min readJul 10, 2023

--

I’m not giving up my knowledge of over ten years in Ruby on Rails and all the benefits it offers me, just for a more appealing View.

Next.js, among other great Javascript frameworks, has evolved a lot over the last few months. Like any good framework, the community or private companies play a key role in this evolution.

As a full-stack developer using Ruby on Rails for over ten years, I’ve been keeping up to date and watching for Javascript technologies constantly appearing on the market. In my position, Javascript’s grass has always looked greener to me than Ruby’s. I think more for marketing reasons than efficiency. But when I decided to change yards, I came across some holes and stones that were not visible from afar. Not to mention that I always missed my beautiful, comfortable chair that awaited me on the other side.

The main reason I found the grass greener in Javascript was the existing componentization in frameworks like React and Vue. There’s even a great Ruby library with this same framework designed to integrate with Ruby on Rails, which you can find at https://viewcomponent.org/. While using the View Component, I can only see myself trying to find a way for things to work as they did in React. But in the end, I never came up with something as good as a React component.

For those who still can’t enjoy everything React has to offer and still haven’t had the opportunity to experience what it’s like to use componentization with React, I recommend taking a look at this fantastic component library https://www.radix-ui.com /. It’s really worth taking a look at the usage examples and even the project’s source code to see how to create very well-structured components.

As I understand it, the React community could count on several specialist members who had the same goal of getting where they got to. While the Ruby developers did their best to try and keep up, they couldn’t rely on the full apparatus that the Javascript community had access to.

After a few years of going back and forth, I decided it was time to remove the fence and enjoy both yards simultaneously.

I understood that there are many letters in the MVC (Model, View, and Controller) of Ruby on Rails and that it wouldn’t hurt to change the V for R and make my Model, React and Controller.

So that was it. Sitting in my pretty chair, I can now see my two backyards as one and can walk freely between them. There are still holes and rocks on both sides, but now I can dig a little dirt from one side to plug the hole on the other.

The second part is here https://medium.com/@raphox/rails-and-next-js-the-perfect-combination-for-modern-web-development-part-2-308d2f41a767

--

--