Building Modern Frontends Without a JavaScript Framework

For the last decade a certain idea has taken hold. If you want to build a modern web application you need a JavaScript framework. You build a backend API maybe in Rails and then you build a completely separate frontend application in React Vue or Svelte. This is now the default assumption.

But this assumption comes with a cost. A huge cost. Suddenly you have two projects instead of one. You have two languages two sets of dependencies and two build processes. You have to think about API versioning CORS and how to manage state on the client. A single new feature requires changes in multiple places. The complexity adds up fast and it slows you down.

What if this default assumption is wrong for most applications? What if you could get the fast interactive feel of a single page application without building one?

A Simpler Way

The Rails ecosystem has been quietly refining a different approach. It’s an idea that seems almost backward at first. Instead of sending JSON from the server and rendering it with JavaScript you send fully formed HTML over the wire.

This isn’t a return to full page reloads. This is about sending small targeted HTML fragments in response to user interactions. This is the core idea behind Hotwire a collection of technologies that includes Turbo and Stimulus.

Think of it this way. Your server is already good at rendering HTML. It has direct access to your database and your models. Why duplicate all that rendering logic in JavaScript? Why not let the server do what it does best and just send the result?

Understanding Turbo

Turbo is the part of Hotwire that makes this feel fast and seamless. It does this in a few ways.

Turbo Drive intercepts all link clicks and form submissions. Instead of making a full page request it fetches the page in the background using JavaScript and then replaces the page’s body with the new content. It’s a simple change that makes your application feel instantly faster. It’s the new Turbolinks.

Turbo Frames let you break a page into independent pieces. A frame can be updated on its own without affecting the rest of the page. You could have a form in a frame. When you submit it only the frame’s content gets replaced with the server’s response. This is great for inline editing or multi step forms.

Turbo Streams are the most powerful part. They deliver page changes over WebSockets or in response to form submissions. A stream is a small piece of HTML with an instruction like 'append this to the list' or 'replace this element'. When your Rails app creates a new comment it can send a Turbo Stream to every connected user. The new comment just appears on their screen without them needing to refresh the page. This gives you realtime features with very little code.

A Sprinkle of Stimulus

Sometimes you do need custom client side interactivity. You might need to toggle a dropdown menu manage a complex multi select field or copy a value to the clipboard. Sending HTML from the server isn’t the right tool for these jobs.

This is where Stimulus comes in. Stimulus is a very small JavaScript framework. It’s designed to connect JavaScript objects to elements on your page using simple HTML attributes. You don’t have a giant JavaScript object managing your whole application’s state. Instead you have small independent controllers that each do one specific thing.

If you need a controller to hide and show a panel you write that controller. If you need another to handle a popover you write that one. They don’t know about each other. This approach keeps your JavaScript organized and minimal. You use it when you need it and it stays out of your way when you don’t.

The Real Benefit is Speed

Technology is only interesting when it helps you build better things faster. The combination of Rails and Hotwire does exactly that. By avoiding the need for a separate JavaScript frontend you cut the complexity of your project in half.

You have one codebase. You have one language. Your views are just ERB files rendered on the server. You can build rich interactive features that feel like a single page application while writing the same simple server side code you always have.

This is a massive advantage for small teams and early stage startups. It means you can ship features faster and with fewer bugs. You can focus on solving your users' problems instead of wrestling with build tools and state management libraries. The old way of building Rails apps is new again and it is faster than ever.

Think about a complex UI you've built recently. Now try the prompt below for yourself.

— Rishi Banerjee
September 2025