Issue #6 - 15-21 August 2022
The one with deep conversations
I’m Lucian (find me on Twitter @lucianghinda), and I am the curator of this newsletter. Thank you for subscribing to this newsletter.
This edition was created with support from @adrianthedev from Avo for Ruby on Rails (a friendly full-featured Rails admin panel) and from @jcsrb, who sent me recommendations to include in the newsletter.
Among other points that people shared in the conversation were:
“controllers, views, and forms do not need to reflect a single underlying model. - you could have two different controllers changing the same model based on usage - one controller / view form may update multiple models” (source) by Rose W
And there are many more concrete examples of things to learn for juniors in that thread.
Here is what that class looks like from the example on Github:
And received a lot of good suggestions (not only from Ruby):
ruby -run -e httpd . -p 8000were the most common answer and the simplest one in ruby
Also, Olle Jonsson shared a link to a piece of code defined in Ruby that allows running multiple interesting small utilities:
There are so many exciting replies that I don’t know what to pick. Here is one that I did not know so far https://discord.gg/stimulus-reflex Discord channel.
There were suggested a couple of solutions:
This commit from Shopify/identity-cache
This line from test.yml from yabeda-sidekiq
The main.yml from rubyapi
Some interesting suggestions:
We have a separate gem and yes there is a prefix with the design system name (oh so fancy it has a name) - Josef Strzibny
I’m liking the idea of putting them all in a module, e.g. Components::Button because then you can use relative references for other component constants. - Joel Drapper
We use UI module for generic things UI::Modal UI::Tab and then app specific modules for things like Tasks::ListItem - Matt Swanson
Based on the replies from both these conversations there seems to be a desire for more UI libraries/projects in the Ruby/Rails world.
Among the mentioned pain points:
Missing UI libraries compatible with Rails
Finding talented UI developers
Working with ERB and partials
It is worth reading the discussion this poll generated and also the following discussions from what Thiago shared after the poll closed: one discussion here about preference for debugging in REPL and one here where he asked how devs are using debuggers.
Read the replies as there are interesting code examples offered there
If you read so far and you like the content, maybe you take into consideration sharing this and subscribe:
Related (but not Ruby specific)
He received two interesting replies:
Articles and Videos
Jason Swett launched his The Complete Guide to Rails Testing - Code with Jason that can come together with Video Course: Ruby DSLs Demystified.
Something to read
Ruby On Rails shared that a new issue of This Week in Rails was published by Emmanuel Hayford → Logging, raising, and rescuing errors and a fix for a query method.
Yukihiro Matz shared a good technical article about how YJIT works written by yTo_9 Read it here: Ruby が YJIT でなんで速くなるのか？ Lazy Basic Block Versioning をサクッと理解してみた - estie inside blog (or click here for the english version link translated by Google)
Malibu It Labs shared an article written by Benito Serna about Fetching the top n per group with a lateral join with rails
Rails Links shared an excellent article about Ruby gem installations can expose you to lockfile injection attacks | Snyk
Andrew Culver shared an old article about implementing Rails Routing Examples for Every* Crazy Combination of Nested Resource Namespacing
Something to watch or listen
Timnan shared an episode about creating a chat in Rails 7: See it here → Episode 23 Turbo Powered Chat Application in Rails 7.
Ernesto shared that he was a quest on the @duckiedevshow. See the episode here → Code Quality, RubyCritic & Skunk with special guest Ernesto
Avo shared a video walkthrough of features they released in their latest release. See it here → Customizable controls on the show page, scoped search for has_many and more
Creston Jamison published a new episode of Rubber Duck Dev Show Episode 54 → Listen to it here: Open Source Experiences And The Pay Gem With Chris Oliver
Felipe Vogel shared an old podcast episode of Ruby Rogues where Sandi Metz talks about the four rules for developers: Listen to it here → Practical Object-Oriented Design in Ruby with Sandi Metz
Stephan Hagemann shared a recording from the Twitter Space about “discussion about packwerk, stimpack, code ownership, what apps we should use these tools on, and how teams can get started”. Listen to it here → Ruby@Scale. Packwerk. Gradual Modularization. How are things going?
The Ruby on Rails Podcast shared a new episode with Mina Slater. Listen to it here → Episode 431: For the Love of Consulting and the Cloud with Mina Slater
New libraries and updates
Stephan Hagemann shared Gusto’s attempt at collecting a set of tools to help scale Ruby (and Rails) engineering organizations. You can find them all in Github at rubyatscale. Among the gems here (there are many):
stimpack establishes and implements a set of conventions for splitting up large monoliths built on top of
CodeOwnership helps engineering teams declare ownership of code.
danger-packwerk integrates packwerk with danger to provide inline comments in PRs related to boundaries in a Rails application.
This release includes slice and action generators, middleware inspection, and conditional slice loading.
Chris Oliver shared they will be the new maintainer for sequenced gem sequenced - Generate scoped sequential IDs for ActiveRecord models:
The focus was to bring the awaits feature to the heart of the gem and ensure it was robust.
I can honestly say that asynchronous but blocking jobs have completely changed the way I think about and architect my apps. I lean on background jobs immensely, and I orchestrate quite complex workflows with ease. But the throughput remains high. It is truly awesome.
Gomez shared the release of a new gem FastPage. You should read the article about this gem: Introducing FastPage: Faster offset pagination for Rails apps
This was a long issue as there was a lot of great content that I discovered in Ruby community.
Please consider sharing this on social media or with your colleagues. I hope I added content for a wide range of developers (beginners to experts)
Thanks for reading Short Ruby Newsletter! Subscribe for free to receive new posts and support my work.