u/shaberman

▲ 7 r/rails

Joist 2.3 (TypeScript ORM) with Rails-style Scopes

Hi r/rails, feel free to ignore this if you feel it's in bad taste, but Joist is a TypeScript ORM that's always unashamedly been a Rails/ActiveRecord clone, although with our own innovations like N+1 prevention and fine-grained reactivity.

Our last release just added Rails-style scopes: https://joist-orm.io/blog/joist-2-3/

Just thought I'd post here as an FYI if any Rails devs find themselves on TypeScript backends and want some of that Rails/ActiveRecord DX/ergonomics. Thanks!

reddit.com
u/shaberman — 2 days ago

Joist 2.3 with Rails-style Scopes

Hey r/typescript, Joist has always been a "Rails-ish" ORM, but we never had an equivalent to their scopes feature. But a friend was converting their Rails app to Joist and lamenting "why no scopes?", so we took a stab at it -- and now have them!

Fluent DSLs like this in TypeScript are kinda hard to pull off, so we lean on Joist's `joist-codegen` step, a little similar to TanStack Router's vite plugin doing build-time codegen to help with the static typing -- I don't totally love that compromise, but I think the API ergonomics were worth it.

Ngl I procrastinated posting the release notes b/c r/typescript hates ORMs -- all good, but 🤷 not looking for another debate today. ✌️

joist-orm.io
u/shaberman — 2 days ago

Simplest Possible Closure Tables

Hey folks, we wanted to implement the closure table pattern for some auth logic at work, and realized the declarative/reactive infra of our Joist ORM made it particularly succinct, so wrote up a post about how it worked out. Thanks!

joist-orm.io
u/shaberman — 2 months ago