intertwingly

It’s just data

Submitted for Your Approval


Imagine, if you will, a classic Rails "Getting Started" tutorial: a blog with articles and nested comments, demonstrating core MVC patterns including RESTful controllers with CRUD actions, Active Record models with has_many/belongs_to associations, validations, and dependent: :destroy. The views use ERB partials for DRY rendering, form_with for model-backed forms, flash notices, and standard view helpers like pluralize and truncate.

Now imagine it modernized: Tailwind CSS for styling. Hotwire's Turbo Streams and Action Cable for real-time updates. When articles or comments are created/deleted, changes broadcast automatically to all connected browsers via broadcasts_to callbacks, with no custom JavaScript required.

Try it yourself.

Open two browser windows. Add a comment in one. Watch it appear in the other. Close the browser. Come back. The data is still there.

Now open the editor. Change a view. Add a validation. The preview updates instantly — Vite HMR, hot module replacement, the whole modern dev experience. No Node installed. No Ruby installed. No terminal. Just a browser tab.

Real-time sync. Turbo Streams. Action Cable. Active Record persistence.

Now check the URL. github.io. No server running. No backend. Just static files on GitHub Pages. You check the docs:

Note

GitHub Pages does not support server-side languages such as PHP, Ruby, or Python.

You turn off wifi, disconnect your ethernet, unplug your router. Everything continues to work - updates made in one window are reflected in the other.

You open developer tools. Click on the Network tab. No server requests are issued as you navigate. You click on Sources. You see ruby2js/app/controllers/articles_controller.rb. You set a breakpoint in the index action. You navigate to the index. You see "Paused in debugger".

You're traveling through another dimension -- a dimension not only of sight and sound but of mind. A journey into a wondrous land whose boundaries are that of imagination. That's a signpost up ahead: your next stop: the Twilight Zone!

Rails Patterns, JavaScript Runtimes

Beyond that signpost you find Juntos — a quickstart with live demos, documentation, and source code. MIT licensed.

A picture is coming together. The blog demo was a real Rails application running full stack in your browser. Action Cable over BroadcastChannel. Active Record over IndexedDB. The editor runs on WebContainers — Node.js and npm, entirely in browser memory. The same patterns, the same code structure, no server.

What originally motivated this is now child's play to build. I want judges to be able to record scores during an event despite unreliable Wi-Fi. Downloading the agenda and that judge's scores entered to date and then running the existing ERB views over IndexedDB just works. Posting updates in real time when possible and batch when connectivity resumes is straightforward. Since each judge records their own scores, there are no merge conflicts. Mount the resulting offline SPA via Rack middleware, and everything works transparently.

Reality Check

This is a spike, not production code — the result of Demo Driven Development. Features that no demo required were deliberately skipped: migrations only go up, there's an untested MySQL adapter, and full Rails compatibility isn't the goal (method_missing simply can't work this way). The cross product of features, targets, and databases is enormous; some combinations are untested. If you hit a gap, it's likely a scope choice or a regression, not an oversight — open a discussion, an issue, or a pull request. The goal isn't to replace Rails — it's to take Rails patterns to places Ruby can't go. If running a full-stack application on Cloudflare, your iPhone, or offline in a browser sounds worthwhile, a few rough edges may be a fair trade.

Thank You

This stands on Rails's solid, time-tested design, JavaScript's Delightfully Weird ecosystem, and Vite. Turbo, Stimulus, Action Cable, and Tailwind are already JavaScript, so they can be used directly. Prism made it possible. Astro taught me a few design patterns. WebContainers from StackBlitz made the in-browser editor possible. Claude Code turned explorations that would have taken weeks into days. And a CI workflow that self-hosts, unit tests, and integration tests every demo kept it all honest.

What's Next

Beyond transpiling Rails to JavaScript: transpile views to Astro, Vue, and Svelte and transpile ActiveRecord to Drizzle ORM. Together, these enable true ejection — not Rails patterns running on JavaScript, but native framework code you could maintain without the original source. And maybe rewrite the whole thing in Rust, especially if Vite 8 exposes an interface for Rust plugins.

I'm no Rod Serling, but the world has forever changed. What I achieved in a few weeks would have taken a team and a year or more just a few years ago. Imagine what a suitably motivated undergrad will be able to accomplish in a weekend in just a few years.