4 ms·
This is an unfortunate comparison. I actually chose Next.js because of its similarity to Rails - it's a batteries included, opinionated framework that favors co
by luketheobscure 2y ago
This is an unfortunate comparison. I actually chose Next.js because of its similarity to Rails - it's a batteries included, opinionated framework that favors convention over configuration (though it's not sold that way since these are not the currently trending buzzwords). There's absolutely nothing preventing you from using both tools. Rails works great as an API supporting a Next.js UI.
- caiohsramos 2y agoI'd say Next.js is the opposite of a "batteries included" framework. No abstractions for ORM, background jobs, sending emails, managing attachments, web socket communication - all very basic stuff when dealing with a production application.
- sankumsek 2y agoDo you have a suggestion for a more Rails-esque framework (maybe Django)?
- graypegg 2y agoIf we were keeping in the JS ecosystem, there’s Redwood [0] which has been around a while*. [0] https://redwoodjs.com/ https://redwoodjs.com/ * not comparable to Rails or Django’s definition of “a while” but it’s quite mature.
- Lio 2y agoBy all means use Django if you specifically want to work in python but otherwise if you really want a Rails-esque framework why not just use full stack Rails? You get much out of the box with Rails 8 now like deployment, caching, job queue, Hotwire, Turbo Frames and mobile.
- Onavo 2y agoAll these features are stateful or realtime. In a cloud/serverless world, they are all separate managed services ("compute/storage separation"). That's the trade-off of Next.js, greater productivity by standing on top of more hosted dependencies. Theoretically unlimited (within datacenter limits) scaling, bottlenecked only by your credit card.
- luketheobscure 2y agoIt is a batteries included _front end_ framework. You don't need to worry about compiling, routing, code splitting, etc. Most of the things you described should be handled by the back end service
- caiohsramos 2y ago>It is a batteries included _front end_ framework. From the first page of Next.js docs: "Next.js is a React framework for building full-stack web applications" > You don't need to worry about compiling, routing, code splitting, etc IMO that's the least you'd expect from a web framework.
- Mystery-Machine 2y agoNext.js doesn't even have authorization. What does it have? Server-side rendering? Cool.
- whstl 2y agoHey, let's be fair here: Rails also doesn't have built-in authorization. You need something like Pundit or CanCanCan if you don't want to built it yourself. Also Rails only recently got authentication. For more than a decade you needed Devise or something else.
- pcthrowaway 2y agoI mean it has a router (2 actually), and NextAuth seems to be becoming something of a standard for many Next devs. Meanwhile.. last I checked you still had to choose how you were going to roll your own auth in rails. Are people not often just installing bcrypt and adding a users table with their password hash? Or is there a generator for all that now? Anyway, I disagree with the idea that Next is Rails-like. Adonis is probably still the closest in the JS/node ecosystem, though Redwood might also serve a similar niche for the types of apps it works for. Next and the other "frontend metaframeworks" (as they're called now), are certainly much closer than the most popular choices 7 or 8 years ago (often cobbling together React and Express and an ORM like Prisma, making a bunch of other decisions, and then doing a bunch of the integration work by hand)
- rohan_ 2y agowouldn't using the nextjs backend / server components be far simpler and and streamlined
- pier25 2y agoNext is definitely not "batteries included". It solves close to nothing on the backend (like all fullstack JS frameworks).
- rglover 2y agoWell, not all of them [1]. DB access (drivers are automatically started, connected, and wired for use), queues, cron jobs, websockets, uploads, API helpers, simple routing, caches, indexes... It gets ignored, but there are (sane) options. I'm quite proud of the APIs, too. Easy to learn, tidy, and everything just works. [1] https://cheatcode.co/joystick https://cheatcode.co/joystick
- pier25 2y agoOk, you're right. I was referring to the usual ones (Next, Nuxt, SvelteKit, Remix, etc). Joytick looks cool. Besides this there's also NestJS https://nestjs.com/ https://nestjs.com/