Early Thoughts on NextJS Coming from Ruby on Rails

Share

Early Thoughts on NextJS Coming from Ruby on Rails

I have been a Ruby on Rails developer since the pre 1.0 days and truly do love the framework and all it has to offer. However, for those paying attention, around the time of Rails 4-5ish area the g...

Ewakened @kentf

I have been a Ruby on Rails developer since the pre 1.0 days and truly do love the framework and all it has to offer. However, for those paying attention, around the time of Rails 4-5ish area the growing power of React and Node was becoming overwhealming and while DHH and Basecamp were still driving a ton of innovation on the front-end with their Basecamp.com re-write and the addition of webpacker, it became clear that the Rails way was falling short when compared to tools like React.

I recenty inherited a new front-end codebase written in React that didn’t follow a ton of conventions and I was left evaluating front-end frameworks for a re-write. I looked at React 18, Remix and NextJS.

To be fair, I did look at Hotwire and Stimulus and even the ReasonML framework thanks to recommendation from React Core member: Cheng Lou but I will save that for another post.

I am currently settled on giving NextJS a try, fully commit and if it sucks… well it’s just the front-end, easy to fix :)

Disclaimer: I am less than 2 weeks into a NextJS rewrite, it’s early days, but I have some impressions and takes worthy of a post already.

Config vs. convention

If you are coming from Django or Rails, you will like that in NextJS everything has a place. It’s definitiely convention over configuration which is nice, however, it’s not as dogmatic as Rails or Django which I believe is a bug, not a feature. For all the shit that DHH takes, the Rails Doctrine is why so many folks love Rails, and why billions of dollars of value has been built on it’s back.

Where do you put components?

What’s the best way to handle data-fetching?

Are there naming conventions for the different kinds of components?

All of these could use some good conventions!

React, React, React

You have love React to love NextJS or at least learn to love React. I have had a troubled past with React. We were lucky at Tilt, we were one of the first companies outside of Facebook and Instagram that really embraced React in it’s early days. We got to see and use it with some help from Facebook engineers before the public did and it was really cool at the time. A lot of the stuff that we were doing manually, it just soved for us. That being said, it’s different. It’s akin to learning how to write Haskell if you have only known Ruby or Python. It’s a mind fuck and you have to embrace the pain and learn new patterns.

But NextJS is just react with some sugar on top. So you can always drop down into pure React components and get the job done.

Server-Side Rendering

I haven’t explored the different rendering schemes a lot yet in Next but it’s deifnitelty a big reason I chose it over Remix for example. The good news is that it looks like the directives to convert something from server-side to client side is a simple deocrator at the top of the file and then NextJS will handle the caching and complexity for you. Sounds Rails-y, sounds great but I expect the devil will be in the details here.

Routing

Alright, time for my hot take. Directory based rendering is not going to last for a long time in NextJS. It feels like a hacked way to go from their tradtional /pages magic to a more /app or /src based React app. Building folder structures and then giving your folders weird names with [username] syntax and then calling that in a view file feels weird.

This feels like a transitionary step and my guess is it won’t last. It’s fine, and works well, but coming from the Ruby / Rails / Sinatra world it feels like a toy that is made of plastic and not metal. It’s brittle and will likely break.

My hope is that they continue to get inspired by Rails, Django, Express etc and adopt a simple. `routes` file along with some generators or other conventions as to where your files should go, and then give you the power to break those conventions.

Conclusion

Overall, Next.js is a powerful framework that’s well worth considering if you’re coming from a Rails background. I can’t say NextJS is going to take the crown as my favourite framework from Rails anytime soon but I am enjoying it and it’s well worth considering if you are coming from a Rails or Django background.

Read more

Introducing Runner

Introducing Runner

It was December 28th. I woke up at 6am and Cursor had been running all night. I had Claude working while I slept, writing code, pushing commits, doing things that would have taken me a full day. Just sitting there staring at the screen, coffee getting cold, and realizing life wasn't going to be the same. I got a taste of the agentic workflow and couldn't go back. Turns out I wasn't the only one. When the Christmas break ended, Charlie and Yitong, my co-founders at Agora, had similar epiphanies

By Kent Fenwick
How I build: Dec 2025 Edition

How I build: Dec 2025 Edition

I treat AI as a tool and like any tool, people can use the same tools in different ways to acheive different results. I recently realized that I use AI differently than some of my colleagues so I was encouraged to share how I code. Before I talk about the tools and tactics, it's important to remember that I have a golden rule when using AI to code: Don't get AI to build something you don't understand or haven't built at least 3 times before. CRUD application? ✅ Simple Tab View Mobile App? ✅

By Kent Fenwick
The Messy Middle

The Messy Middle

My family is moving into a new house and we wanted to do a little bit of remodelling upstairs. Nothing big, just closing off a wall, making a closet a little bigger and swapping out a sink in the bathroom. My wife's family owns a construction business, so we are lucky to have an inside track with contractors and knowledge. My father in law is a genius, he runs his own construction business but still made time to come and measure, sketch and draw up the plans himself. My wife and I his customers

By Kent Fenwick
Someone needs to hear it

Someone needs to hear it

So, you want to write something but you are feeling like you can’t finish and post it for a really simple reason: there are 6 people in the world smarter than you on this topic, surely they should write it not you. During an interview today for Agora’s product manager, a warrior of art reminded me of this mental block and it rung so true. How many great pieces of advice, lessons, ideas and inspiration are left unsaid due to someone feeling as though they aren’t qualified enough to talk about it

By Kent Fenwick