So here are some JS frameworks that provide opinionated setups closest to what you are used to:
Remix.run and RedwoodJS are two fullstack React frameworks that comes from old RoR folks who aim to recreate the Rails/Laravel experience for JS/TS. Remix is SSR and progressive enhancement / web standards focused, and RedwoodJS is CSR and GraphQL focused and brings a larger and more opinionated suite of tools (testing etc.). Coming from Rails myself, RedwoodJS gave me the most Rails-like feel, but YMMV.
NextJS is the market leader for a fullstack React framework, ofc (see Solito and Tamagui for a cross-platform React experience that works well together, and can give you a React Native app from the same codebase as your webapp!). Note that NextJS relies on Webpack for config and bundling client assets, not the newer and popular and lighter Vite.
(If you want more freedom and less opinions than NextJS - maybe you found RoR or Laravel too magic or too constraining at scale - and you want a Vite based setup with ‘blazingly fast’ DX, then try vite-plugin-ssr. It follows the less-magic and libraries-over-frameworks approach, and could especially be what you want if you found Rails too architecturally constraining at scale.)
Remix and Redwood has their own integrated solutions for data loading between client/server. NextJS too, but it is currently discouraged as being too confusing.
So for NextJS data loading in particular - that also works cross-platform (with both NextJS and React Native) - I recommend:
- tRPC, as a favored choice amongst many, to call backend functions directly from the frontend (it uses React Query under the hood to handle caching, retries etc.), and gives the much loved full stack TypeScript type inference.
But if you are focused on web only, then you might like:
- BlitzJS as «the missing fullstack toolkit for NextJS», also made by a RoR guy trying to make NextJS come closer to the Rails DX we knew and loved. It’s a web-focused alternative to tRPC, and also has a plug-and-play solution for Authentication, and some CLI scaffolding helpers (to get started quickly, like you may have loved in Rails).
If you still decide you need GraphQL - like if you need to expose your API to third parties, or have strict frontend/backend team separation - then I recommend:
- Choose Redwood, since it has its own integrated GraphQL solution that takes care of it end-to-end.
But, if you want a potentially even sweeter GraphQL setup, or need SSR which Redwood doesn’t have yet, then choose:
GQty on the client, for inferred queries/mutations. Rapid dev speed. Move to URQL or Relay at scale.
pothos-graphql on the server, for auto building the schema from your TS code (aka. code-first). Better than Nexus.
That will give you fullstack type inference with GraphQL like with tRPC/BlitzJS, and either will give your faster dev speed than other solutions, closest possible to Rails/Laravel.
So in summary, to get the Rails/Laravel experience in JS/TS:
Choose either Remix/Redwood/Next.
If you chose Next, then for smooth data loading between client/server use tRPC/Blitz. Alternatively, if you chose Next/Remix and really need GraphQL, then use GQTy + Pothos.
That’s the gist of it. Hope it helps!
Top comments (0)