- Short Ruby Newsletter
- Posts
- Issue #7 - 22 - 28 August 2022
Issue #7 - 22 - 28 August 2022
The one with the end of an era
Hello,
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.
Amree Zaid shared an excellent summary for Xavier Noria talk “The Journey to Zeitwerk” from the RailsConf 2022. Each tweet has a link to the specific time in the presentation and they also link to issues and discussions from Ruby and Rails projects:
Some responses said they were ordering them alphabetically:
While Joel Drapper suggested:
And in the same line, Jared White suggested:
Thiago Massa shared a short tip about how to use the debugger in the Ruby 3.1.0 release:
Benito Serna shared how to use lateral joins to get the most recent N posts for each user:
Andrew Mason shared that they are trying to use turbo with tables and received replies with some workarounds or possible solutions for this:
If you are trying to do this here are some links or responses:
Creating a fake table (see examples here shared by Pedro Schmitt)
An open PR for Turbo to Mix in Turbo Frames to build-in elements shared by Marco Roth
An article was written by Ariel Scherman about “Updating HTML tables with turbo streams”
Janko Marohnić asked about how to organize deep nested ViewComponents:
Among the suggestions:
“nesting components under a Views module in Phlex.fun, so you’d have Views::Artists::Index, Views::Album” by Joel Drapper here
“Artist::Component | Artist::Album::Component | Artist::Album::Song::Component” by Konnor Rogers here
Not use Component in the nested objects by Benito Serna here:
ArtistComponent
ArtistComponent::Album
ArtistComponent::Album::Song
Xavier Noria shared a piece of code to namespace all classes in app/components with Components:
Kirill Shevchenko shared a piece of code showing Fibers and how they work with infinite loops:
Brandon Weaver asked a question about anonymizing all arguments of a Ruby method, and then he shared exploring various ways of achieving this:
Steve Polito shared about how to represent model attributes as value objects. Check the Rails documentation here:
Greg Molnar shared on how to implement security improvements while developing with Rails:
Rob Zolkos shared a small web app that helps to format strftime for Ruby.
Direct link: https://strftimer.com
Facundo Espinosa shared in a short thread how they did infinite scroll with Rails 7 and Hotwire:
And here he shared is the HTML part of implementing the infinite scroll:
Xavier Noria shared about autoloading reloadable code from initializers in Rails 7:
I feel the entire text is very important to understand reloadable code:
Rails 6 deprecated autoloading reloadable code from initializers, and in Rails 7 that is not longer possible. This change coincides in time with the transition to Zeitwerk, but it is unrelated. It is a common misconception to associate both things. (source)
Autoloading reloadable code in initializers doesn't make sense conceptually and this removal would have made sense even if the autoloader was not changed. (source)
Reason is, initializers only run once. If, say, you used model M in an initializer and reload, whatever M was used for is now stale, because the initializer does not run again. So, preventing this made sense regardless. (source)
Xavier recommends reading the Rails guide section: Autoloading When the Application Boots
Emmanuel Hayford shared what happens when a class is instantiated with a cool code example:
Chris Oliver shared the date for the Rails Hackathon: 17-18 September 2022:
Check the hackathon main website https://railshackathon.com
Nate Berkopec shared their view about moving logic from jobs to POROs and triggered a nice discussion with pros and cons for each approach:
It is worth reading the arguments of both sides, and there are points worth considering.
Postmodern shared a question about why Active Record returns strings instead of symbols for an enum attribute and triggered a nice discussion about how they work:
The discussion got interesting with Andreas Finger suggesting the use of activerecord-postgres_enum while Schneems, Jean Boussier and postmodern discussing if the return of string and not symbol is a historical artefact from when symbols where not GCed (pre ruby 2.2) or maybe because String methods were slowly backported to Symbols.
Jason Charnes shared launched a new project for creating jobs boards. Direct link to jobboardly.com
Heroku shared the end of the free tier, and this (rightly so) occupied the attention of many people in the community:
Here are some of the responses to this announcements:
David Colby shared more about why Heroku helped to learn: “Heroku discontinuing free dynos is a tremendous bummer. Free dynos were an incredible resource as a learning tool when I was getting started as a developer, and they're still a great tool to demo functionality when I'm writing tutorials now. Sad.”
Schneems shared in a thread a collection of tweets about Heroku's decision to remove the free tier. It is worth reading the entire thread and seeing how much good Heroku did in the past for the Ruby and Rails community and how much people valued this product.
Brad Gessler shared they wrote a guide to migrate from Heroku to Fly.
Petrik De Heus shared a new feature of Ruby language immutable value object:
Greg Molnar shared a new project about sharing password secretes securely via browser:
Direct link to the project: https://secrets.spektrhq.com
Marco Roth shared that they want to add outlets to Stimulus:
Read the PR here, and it might look like this:
Joe Masilotti launched a new project on RailsDevs: a celebration package when getting hired:
If you read so far and you like the content, maybe you take into consideration sharing this and subscribe:
Related (but not Ruby specific)
Rose W shared a change of perspective when thinking about what does it mean that someone works at a company for less than 2 years:
Erwin Kroon shared advice for juniors to think about code context:
Michael Bolton shared about how to think about what testing is and its relations with various contexts. Read the entire thread, as it has some good perspectives about how to think about testing.
Facundo Espinosa shared advice about how to level up and shared some recommendations for videos from graceful.dev:
Julian Rubisch shared an excellent idea about how to improve the review on large PRs/MRs:
Articles and Videos
Communities
Pedro Schmitt shared they are starting a new podcast with Brazillian devs building with Ruby on Rails: Bullet Rails
Courses or Books
Timnan shared a course they created about Learning Ruby on Rails 7
Paweł Dąbrowski shared that their course Mastering CSV in Ruby is now free for everybody.
Ruby Hunt shared a book written by Cezar Halmagean: Bulletproof Ruby on Rails applications
Pragmatic Programmers shared shared best sellers and at least two are for ruby on rails: Pragmatic Bookshelf: By Developers, For Developers
Something to read
Newsletters
Ruby Radar shared published a new issue with great content: Read it here → Ruby Radar #65 - Fly Away From Heroku
Joe Masilotti shared a new edition of Hotwire newsletter: Read it here → August 2022 edition
Petrik De Heus created a new issue of This Week in Rails Newsletter: Read it here → Finer-grained error pages and extended routes grepping
Articles
Fullstack Ruby shared a new article about How to Think Like a Framework Developer
Stephan Hagemann shared an older article about Laying the Cultural and Technical Foundation for Big Rails
Nate Hopkins shared an older article about choosing to implement pluralization from the start: Preemptive Pluralization is (Probably) Not Evil
Shino Kouda shared an article wrote by them about handling exceptions in Ruby: How to handle Ruby exceptions
Greg Navis shared an article written by them about error handling API integrations: API Integrations: Client Classes and Error Handling
Jon Yongfook shared an article comparing various PaaS solutions: Best PaaS backend hosting: Heroku vs Render.com vs Fly.io vs Railway.app
App Signal shared published an article with an introduction to Reactors: An Introduction to Ractors in Ruby
Paweł Dąbrowski shared an article they wrote about comparing objects: Identifying the objects in the Ruby way
Nathan Vaughn ⭐ shared an article they wrote about debugging ruby: Debugging Ruby in VSCode
🇺🇦 Deanin shared a new tutorial about Tailwind and CSS for Rails: Create A Tailwind CSS Project w/ Rails 7, Stimulus
Brandon Weaver shared an article they wrote about recursion in Ruby: Understanding Ruby – Recursion
Something to watch or listen
Videos
Drifting Ruby shared a new episode where they build a question and answer feature with Hotwire: Episode 363 - Hotwire Question and Answer Feature
Go Rails published a new episode about air quality monitor and reporting usage using MQTT. See it here → How to use the MQTT Protocol with Ruby (Example)
Konnor Rogers shared a short video showing a Venn Diagram with CSS frameworks/tools distributions. See it → here
Matt Swanson 😈 shared an old video (2012) by Ben Orenstein about refactoring ruby code: See it here → Aloha Ruby Conf 2012 Refactoring from Good to Great
Drifting Ruby shared a episode of a video log of This week in Rails: See it here → This Week in Rails Aug 26th, 2022
Audio & Podcasts
Stephan Hagemann hosted a second Twitter Space focused on gradual modularization: Listen to it here → Ruby@Scale. Packwerk. Gradual Modularization
Therubyonrailspodcast released a new episode with John Crepezzi, founder of All Aboard Bootcamp. Listen to it here → Episode 432: All Aboard Bootcamp with John Crepezzi
Joël Quenneville shared shared a new episode of The Bike Shed with Steve Polito. Listen to it here → 351: Learning in Public
Ruby For All shared shared a new episode about how to contribute to open source: Listen to it here → How to Contribute to Open Source
Gems, Libraries and Updates
Edouard Chin shared a new release of the ci_runnner gem that now has support for Circle CI.
Bozhidar Batsov (Bug) shared a new release of RuboCop 1.35.1 · rubocop/rubocop
Thomas Countz shared a new gem that is a reimplementation of the scalar-value backpropagation library in Ruby: Check the code here here on Github:
Guillaume shared that the library Stimulus Components hit 500 stars on Github and has 1.3 million downloads on npm.
Check SonicPI here: https://sonic-pi.net
Ruby Gems Status shared an update about Ruby Gems MFA → An Update to RubyGems MFA Levels - RubyGems Blog
Nate Berkopec shared a new Puma release v5.6.5 that includes bug fixing. Read release changelog here.
Mike Perham 🇺🇦 shared a new PR that will “allows different queues to be processed with different concurrencies” in Sidekiq.
Cj Avilla shared a new major SDK update for stripe-ruby.
Eric Berry 💜 🇺🇦 shared discovered a great library for adding PSQL specific features to Active Record: GeorgeKaraszi/ActiveRecordExtended. Here are some examples:
Bram Jetten shared annouced the release of Spina CMS v2.12.0. Read the changelog here
Kasper Timm Hansen shared he created a new gem conventional_extensions. Here is how it might looks like:
Eric Berry shared a gem TurboReady created by Nate Hopkins that extends Turbo Streams to allow control of the DOM:
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)
Reply