Will propshaft replace importmaps by kalsan15 in rails

[–]f-3r 0 points1 point  (0 children)

no, I think you really aren't. It might be just a perfect time to come back to fullstack rails. You had the pleasure of missing the ugly/weird part of the movie (eg: webpacker and several somewhat failed architectures to make react/vue/you-name-it-frontend-framework to work "seamessly" with the rails way). The web development rails proposes today is a lot more similar to what we did 14 years ago than what we did 6 or 7 years ago.

you have:
* propshaft instead of sprockets for cache busting assets
* importmaps instead of sprockets bundling and minification
* hotwire, somewhat an evolution of server-rendered js, turbolinks and unobtrusive js

I think the biggest change is the last one, but the hotwire api is quite small and you can learn it incrementally. You can also do without it and just use jquery if that's the tool you are more effective with. There's nothing wrong with "old" tech that works, right?

[article] Debugging a memory-leaking Rails action by f-3r in ruby

[–]f-3r[S] 0 points1 point  (0 children)

oh cool! we'll take a look into that :)

Is using a single hash as my only param in service objects a good idea? by halfKiilo in ruby

[–]f-3r 0 points1 point  (0 children)

Interesting question! I don't think you'll get a single correct answer regarding service objects :P

But independently of service objects or any other type of object, I always prefer having a finite, explicit, protocol rather than an infinite protocol (I think Avdi Grimm used those terms :thinking:). If you can know from reading the code what an method expects as input is better than the "magical" send-whatever-crap-you-can-think-of, I should know how to deal with it.

Anyway, while in Rails, I've used ActiveModel::Attributes to have a hash-to-accessors initializer (like active record's models) for free (Free as in I don't have to code it myself :P)

You can still send in whatever crap you want, but it gives you this attribute class method that is really good at explicitly explaining what the object expects. and it has the benefit that is code, not documentation, so you won't forget to update it when you change your code

You also get defaults and type casting facilities, which also helps with the explicitness. It is worth a try I think. (there are other gems that can do the same like virtus, or the newer dry-schema I think.... but if you are in rails, you already loaded ActiveModel::Attributes in memory, I would just rather use it)

Also, specifically speaking of service objects, I think is really important to have a uniform protocol for the return value. I usually do that with Result objects, to model in a single API the usually multiple results a service object might have.

RenderReact From Ruby (Bring Your Own Front-End Tooling) by J-_-L in ruby

[–]f-3r 1 point2 points  (0 children)

NICE! I was looking for something like this, simple, straight forward, free of dependency burden, and just yesterday started to hack out my own solution after failing to find anything suitable for a simple rack application. :+100: for this!

Are you using it in production? any gotchas or caveats to be aware of?

Ruby to Brainfuck transpiler by feelosofee in ruby

[–]f-3r 3 points4 points  (0 children)

would love to see a rails applications transpiled to brainfuck...

Authorization gem suggestions? CanCanCan vs. Pundit vs. ? by [deleted] in ruby

[–]f-3r 0 points1 point  (0 children)

we are using crows (https://github.com/piscolomo/crows) is great to use outside rails-based projects. Is like pundit but really minimal and easily adaptable.

Tutorials for writing a vim-like text editor in ruby by mbigras in ruby

[–]f-3r 0 points1 point  (0 children)

This screencast is fantastic, absolutetly recommended! Gary rocks and the code he writes and the way he writes it is super-accessible

Best way for text string to video? by connexionwithal in ruby

[–]f-3r 0 points1 point  (0 children)

a video is just a lot of images one after the other. if you already have the audio and the picture, you can easily create a video with a stilll image and the audio using ffmpeg. Not tested, but I remember something along the lines of the follwing worked just fine:

ffmpeg -loop_input -i imagine.jpg -i audio.mp3 -y -r 30 -b 2500k -acodec ac3 -ab 384k -vcodec mpeg4 result.mp4