blazetrailsdev/trails: Silent Alpha
Trails, my port of Rails to TypeScript, is in alpha. You can install it today:
npm install -g @blazetrails/trails && trails new blog
Or skip the install and open the playground, which boots a full trails app, models to views, in your browser tab.
I'm calling it a silent alpha. Nothing is hidden, but I'm not shouting about it yet. The launch comes with a demo app I'm still finishing. Until then, this is for anyone who wants an early look.
What alpha took
Packages on npm. 65 of them, published under @blazetrails on
November 27. For months, apps consumed trails as tarballs packed from a
pinned commit. Now they install it like anything else.
Two sites. blazetrails.dev is the pitch to Rails developers: the same names and conventions, plus a compiler that catches what your agents get wrong. Its showcase is a typo in a controller action and an email template that passes the wrong locals to a partial. Rails finds both at runtime, when someone publishes a post or the email goes out. Trails' compiler reports both before the app runs, and the errors on the page are its real output. The second site, trails is JS-native, is the pitch to JavaScript developers: no Ruby anywhere, async all the way down, Temporal for dates, one SQLite API across six engines, and OpenAPI generated from types you already wrote.
Docs and guides. API docs and guides for every framework, from models to mailers to WebSockets.
Real apps on real packages. Every deploy target on the JS-native page links to a working example in the repo: AWS Lambda, Cloudflare Workers, React Native, Electron, a browser tab, and a $12 server. They run on the same packages you'd install.
The PR I kept open for eight months
The playground didn't start out the way it is now.
In March I opened PR #281: a browser sandbox and a marketing site, called Frontiers. It added 274,000 lines. It had its own virtual filesystem, its own transpiler, its own copies of things the real framework did. It was impressive to look at, and it was slop. Nobody could verify that the code worked, me included.
I left it open for eight months anyway, on purpose. It was a reminder of two things. Code quality has to be verifiable, not just plausible. And launching early would have cost me the splash I wanted. In March, trails was well short of 50% of ActiveRecord. A flashy demo on top of that would have made claims I couldn't back up, and you only get one first impression.
I closed it on November 20. The playground that replaced it isn't a separate
sandbox. It's examples/browser-sqlite, an ordinary trails app on the real
packages, running on sql.js, held to the same gates as everything else.
Porting Rails apps
Ported framework code is only half of it. The other half is apps.
The same parity tooling that measures trails against Rails can measure an app against its Rails original. A port goes in three steps. The structure gates give every Ruby file a TypeScript twin and a coverage number. Coding agents translate file by file, and the gates tell them what's still missing. Then the two apps run side by side and their output is compared path by path, the way trailmap's Rails twin is checked.
Writebook, 37signals' book-publishing app, was the test run. It's now an
Electron app: a full trails app in a desktop window, with no
Ruby installed. Porting it turned up framework gaps that the gem-level tests never
did, and it pulled in gems I hadn't ported yet. Trails now has rqrcode,
because Writebook draws QR codes.
Campfire, 37signals' chat app, is next. It's almost done, and it's the
launch demo. It has already pulled jwt and jbuilder into trails.
The first public showing
On November 23 I showed trails at GRWebDev's Community Code Showcase. I walked through blazetrails.dev and ran the playground live. I described trailmap, the dashboard I run the project from, as the first real trails site. And I explained what I think Rails got most right: it's a kitchen sink. In JavaScript you pick twenty libraries and wire them together. Rails picks for you, and models, views, jobs, mail, WebSockets and storage all arrive in one box.
What got the biggest reaction wasn't any of that. It was the scale: 10,648 merged PRs, and about 10,000 agent sessions managed to get there.
What alpha means
Honestly:
- Behavior has gaps. The API names are at or near 100% for every framework. Behavior parity is still being closed, and you'll find places where trails does something different from Rails.
- The docs are young. The guides exist, but some are thin.
- It's slower than Rails. On the $12 server benchmark, Rails with YJIT still serves more requests per second.
If you try it, start with trails new or the playground. I'd like to hear
what breaks.
Comments
Leave a Comment