3 ms·
Is it the lack of an activerecord analogue, which binds together basically everything in rails from routes to tests?
by ForTheKidz 2y ago
Is it the lack of an activerecord analogue, which binds together basically everything in rails from routes to tests?
- Kerrick 2y agoAdonisJS comes with Lucid, an ORM that uses the Active Record pattern. https://docs.adonisjs.com/guides/database/lucid https://docs.adonisjs.com/guides/database/lucid
- ForTheKidz 2y agoIt looks pretty similar in interface, but does it come with all the wonderful tooling for generating routes, views, tests, etc?
- Kerrick 2y agoScaffolding: https://docs.adonisjs.com/guides/concepts/scaffolding https://docs.adonisjs.com/guides/concepts/scaffolding Routes: https://docs.adonisjs.com/guides/basics/routing https://docs.adonisjs.com/guides/basics/routing Views: https://docs.adonisjs.com/guides/views-and-templates/edgejs https://docs.adonisjs.com/guides/views-and-templates/edgejs Tests: https://docs.adonisjs.com/guides/testing/introduction https://docs.adonisjs.com/guides/testing/introduction Etc: https://docs.adonisjs.com/guides/digging-deeper/ https://docs.adonisjs.com/guides/digging-deeper/
- jitl 2y agoJavaScript has plenty of stand alone ORMs like Drizzle, TypeORM, sql builders like Knex, there’s tons with a bit of googling. I think that ActiveRecord is actually the weakest part of Rails, and the scariest and most difficult to manage code in a large rails app is models and stuff that is doing lots of active record stuff. Rails can’t be reduced the goodness is that it’s more than the sum of its parts to get everything together, as DHH says, omakase. It’s not needing to build a framework before you can build your idea. It’s having such a solid and complete base that add-on packages can extend knowing they have a solid foundation. It’s being dominant enough in the language that most things try hard to work well with you. Outside of React, I don’t think there’s any package in JS that comes close to have the gravitational pull that Rails has in Ruby.
- ForTheKidz 2y agoI'm not actually a fan of ActiveRecord, i kind of detest it actually. But it's the beating heart of rails. The ORM aspect is almost a distraction from its primary benefit, defining a globally referencable model with lifecycle hooks and monkey-patching. Basically everything else falls apart without the model to leverage to rapidly produce code. The add-on packages you reference work so well because there are so many ways to hook into activerecord (and to a lesser extent, routing etc). Like, the typical path is: 1) add gem, 2) code gen, 3) run migration, 4) you now have third party code managing a subset of your model. Crazy powerful pattern. applies to everything from auth to sending emails to async task workers to writing audit logs.