Readit News logoReadit News
rorylaitila · 8 months ago
I like the emphasis on forms and pages. That's the approach I take in my apps. Forms and Links drive all interaction. Any JavaScript enhancements merely click an existing form (even if it's hidden). You can always inspect the HTML and know exactly the route that will handle the interaction. I think controllers are overused. It's really forms, models (backend) and views (Pages). A lot of the validation and ceremony of controllers can be handled more elegantly by the framework.
MortyWaves · 8 months ago
Is there a reason you literally simulate a click event on the form instead of calling submit() on it?
rorylaitila · 8 months ago
Yeah, it's escaping me at the moment all of the reasons, but calling .submit() on a form element doesn't exactly have all of the behaviors as calling .click() on a button element in a form, particularly multiple buttons in a form.
sarchertech · 8 months ago
>What about monads or algebraic data types or currying or maybe having everything be a Proc because call?! You don’t have to understand any part of that question. But if you want your business logic to use functors, go for it. We won’t stop you.

I love this! It sounds exactly what I’d want to use for a side project or a project with a limited number of reasonable, senior coworkers.

freedomben · 8 months ago
Neat, this looks like it might be a good middle ground between Sinatra (which I adore) on the barebones/low-level end and Rails (which I also adore for apps that need it, but simple apps really don't).

Looking forward to trying it out!

duck · 8 months ago
Another option is https://roda.jeremyevans.net/, which I've found is the sweet spot in smaller projects, but can still scale up. The plugin system works really well to extend and the routing tree is really easy to work with.
djfobbz · 8 months ago
Roda is hands-down my favorite framework and my go-to no matter the size of the app. It's super lightweight, crazy fast, and a great alternative to Rails, without all the extra bloat. You still get everything you need to build solid apps, just in a much leaner package.

We recently moved a legacy Rails 2.3 app over to the latest Roda, and paired it with Vite, Stimulus, and Tailwind on the frontend...and honestly, we couldn't be happier with how it turned out!

entropie · 8 months ago
For me the middleground is hanami but ill watch bruts developement closely.
Lio · 8 months ago
I loved David's book Sustainable Rails[1], it's one of the books on Rails I always recommend.

This is a really interesting take. I'd love see one of these small alternative frameworks full embrace Sorbet and use it for things like form validation. I guess that might defeat the gradual typing approach but it would definitely be interesting.

1. https://sustainable-rails.com/

krowek · 8 months ago
Very talented person, and good speaker as well. I recommend some of his talks as well, perhaps this one closer to the content of the book https://www.youtube.com/watch?v=CRboMkFdZfg.
davetron5000 · 8 months ago
Thanks for the kind words!
FrancoisBosun · 8 months ago
Sorbet is nice, but for data structure enforcement and data validation, I much prefer the dry-rb ecosystem.
Lio · 8 months ago
I've used dry-rb a bit but had problems with breaking changes that put me off.

I love some of the ideas but they seem a bit too heavy for my taste.

e.g. I think (project) standardised results are a fantastic idea but I don't need the weight of Dry::Monad for that.

I think I can get enough benefit from built in features like .then and throw..catch with tags for signaling without an extra dependency and the risk of the API breaking on upgrade.

ilvez · 8 months ago
I understand they have this peculiar license, but does that means that we can't see the source code?
regularfry · 8 months ago
ilvez · 8 months ago
Thanks. Probably was blind, but wasn't too obvious either.
jacob_a_dev · 8 months ago
agree a bit strange
raggi · 8 months ago
This reminds me of Camping without the dynamic parent class constructor.
Alifatisk · 8 months ago
Bruts own website was also interesting https://brutrb.com/overview.html
heeton · 8 months ago
Tried to login to the example site, unfortunately hit an error immediately after auth'ing with github.
davetron5000 · 8 months ago
Author here - the example doesn't allow logins now to avoid abuse. I wasn't 100% sure I'd make it public and just decided today to do it, so it's not yet ready for just anyone to login.

You can run the site locally, or view pages on the site by going to https://brutrb.com/adrs.html and clicking those links.