Live data from Hacker News

Rails 6: B-Sides and Rarities

evilmartians.com

31–40 of 49 posts

Re: Rails 6: B-Sides and Rarities

#32
post #6
post #4

Earlier quoted context omitted.

Any Reason why Rails still does not include an any decent Auth by default? Edit: I remembering keep asking this question but obviously no answer was satisfactory enough that stick to my brain.

I think the defacto standard is devise but they want you to be flexible enough to roll your own or whatever serves you. I would like to have it built in though.

I'm not familiar with recent versions of Rails or its authentication situation, but whenever I hear this said about some mandatory functionality of a system, it sounds to me exactly like "We haven't yet figured out how to do ___ well".

It reminds me of the old days when I'd get a library which would say "We want to be flexible, so just pass in any memory allocation function here!", or Linux distros that said "We want to be flexible, so just write any boot script here!" Then a year later, some competitor ships with a default, and everybody switches over to that because it's obviously better (and you can always customize it if you need to).

Especially so with Rails, whose entire existence seems to be picking good-enough defaults.

Re: Rails 6: B-Sides and Rarities

#33

I wish Rails had a way to use less features. API mode is great, but when I'm writing a GraphQL API for instance, I don't use controllers, I don't use views, I don't really use routing. I do use the excellently integrated ORM, database migrations, auth libraries (mostly devise), config environments, deployment options and CLI interface. I could just delete the folders, but that's not the point. Rails is sitting on an…

You can opt out of loading the library code for views/mailers/etc. Not sure if there's a way to skip the routing layer though. I'm sure you're aware of that already but just in case, you can skip loading the entire framework.

Use a Sinatra app and include ActiveRecord. There are a few gotchas like making sure to clear connections at the end of requests.

https://stackoverflow.com/questions/41400202/replacing-activ...

I’d love to see more examples of picking pieces of rails and combining with other libraries.

Re: Rails 6: B-Sides and Rarities

#34
post #31

Interesting site. At first I thought my browser was somehow set to 250% zoom. So then I zoomed out to 50% but the font sizes are still as big as they were at 100%.

Weird. Apparently they decided to (ab)use CSS viewport units everywhere just to jump on the cool kids bandwagon, completely breaking browser zoom functionality. This is not what viewport units are for. The site is also nearly illegible at 610px browser width because of it.

Re: Rails 6: B-Sides and Rarities

#35
post #12

I still see Rails as perhaps one of the best frameworks to start a new generic web project in. The out-of-the-box functionality is just so perfectly tuned, and the fact that they're focusing on features that appeal to larger applications just shows how Rails has helped companies grow.

Eh. Rails is fine, and lots of other things are fine too. Rails is amazing on day 1, even week 1 of a new project, vs piecing together your favorite separate smaller libraries into a web framework. That can be just what you need for a side project that you want to get up and running fast. But if you’re planning to build a business around it and work on this codebase for years, it’s crazy to optimize for day 1. (Not s…

There is an argument that you should absolutely be optimising for day 1. One of your biggest advantages as a startup is agility. Until you've hit upon product/market fit, you want to choose tools that enable you to iterate fast.

Re: Rails 6: B-Sides and Rarities

#36
post #6

Earlier quoted context omitted.

I think the defacto standard is devise but they want you to be flexible enough to roll your own or whatever serves you. I would like to have it built in though.

This sounds about right. And if you want something in between without rolling your own, Sorcery is excellent. https://github.com/Sorcery/sorcery

Looks interesting, thanks

Re: Rails 6: B-Sides and Rarities

#37
post #4

Earlier quoted context omitted.

Any Reason why Rails still does not include an any decent Auth by default? Edit: I remembering keep asking this question but obviously no answer was satisfactory enough that stick to my brain.

has_secure_password is built in, and works as long as you include the bcrypt gem in your Gemfile. I've never found Devise or any other 'off the shelf' solution to be satisfying for me because authentication seems to vary just enough between projects to make it easier to use has_secure_password and rewrite auth from scratch. Personally, I think it would be cool if someone built an user account/authentication experienc…

That's been my experience with Devise and similar libraries for other frameworks and languages. If it fulfills all needs for a project, that's great, but I tend to find that it's simpler just to build authentication around authentication "primitives" like has_secure_password. The thing I do like about Devise is that it has views for everything including password reset out of the box. The abstractions it provides end up being more of a headache than they are worth.

To be honest, I'd rather see more gems for these sorts of purposes that are just a collection of off-the-shelf views that can be easily tied in to one's authentication solution of choice. By installing Devise, you bring all of the extra non-view baggage it comes with into the application's memory space even if you don't use it. Yuck. (no offense!)

Actually, I just reread your comment and I think your scaffold/generator approach is also a nice way to go. It's just too bad that there hasn't been as much development effort towards these sorts of things recently in the Ruby community. I'd build it, but have gotten away from Ruby because the community is obsessed with applying object-orientation to every problem, over-abstracting, metaprogramming, etc.

Re: Rails 6: B-Sides and Rarities

#38
post #31

Interesting site. At first I thought my browser was somehow set to 250% zoom. So then I zoomed out to 50% but the font sizes are still as big as they were at 100%.

Weird. Apparently they decided to (ab)use CSS viewport units everywhere just to jump on the cool kids bandwagon, completely breaking browser zoom functionality. This is not what viewport units are for. The site is also nearly illegible at 610px browser width because of it.

Yeah I couldn't read the article - fonts are giant on my 32" and I couldn't scale them down.

Re: Rails 6: B-Sides and Rarities

#39
post #5

How is helix these days? The idea of calling out to Rust was super compelling when I first read about helix. Is that problem still being tackled?

I use Rutie[0] to handle passing complex ruby objects to Rust and it works well. You can also use Rutie-Serde[1] which handles even more of the heavy lifting for parsing Ruby objects into Rust structs.

[0] https://github.com/danielpclark/rutie [1] https://github.com/deliveroo/rutie-serde

Re: Rails 6: B-Sides and Rarities

#40

I wish Rails had a way to use less features. API mode is great, but when I'm writing a GraphQL API for instance, I don't use controllers, I don't use views, I don't really use routing. I do use the excellently integrated ORM, database migrations, auth libraries (mostly devise), config environments, deployment options and CLI interface. I could just delete the folders, but that's not the point. Rails is sitting on an…

When you use `rails new`, there are a bunch of `--skip-*` flags to turn off various features of the framework: https://gist.github.com/aklap/ee4bb619a77b80bf0c934a9948dc49...

Those carry through to the boot process and never even get loaded into memory: https://github.com/rails/rails/blob/master/railties/lib/rail...

Post reply on HN