- Short Ruby Newsletter
- Posts
- ๐ Short Ruby News - Edition #34
๐ Short Ruby News - Edition #34
Briefly about everything happening in Ruby world - week 11 of 2023 (web version)
You can jump directly to a section:
๐ Our Community
More content: ๐ฅ ๐ง ๐ (articles, podcasts, videos, and newsletters)
๐ค Founding Members supporting this newsletter
โ I am part of the organizing team for Friendly.rb conference:
There are early-bird tickets available and the call for speakers is still open in case you are considering submitting a talk proposal.
๐ Our Community
๐ rubyandrails.info is part of ShortRuby's effort to aggregate resources about Ruby. You can find there a good collection of books, courses, screencasts, newsletters, podcasts, communities and Youtube channels
If there is a resource that is not yet on the website, you can request to add it on the Github repo
๐ Adrian Marin shared their gratitude for the work Xavier Noria is doing in the community:
Adrian also shared a link to a discussion where Xavier explained in depth how autoreload works in Ruby on Rails and how Zeitwerk comes into play: [Question] Are classes in nested directories not auto-reloaded with `push_dir`?
๐ Pragmatic Programmers asked what the biggest advantages of using Rails today are:
Here are two of the answers:
๐คRobby Russell invited us to be greateful and endorse our colleagues:
๐ค Blue Ridge Ruby shared their final agenda for June 2023 in Asheville, NC
๐ค Emmanuel Hayford announced a new podcast called The Rails Changelog
๐ค Nate Berkopec asked how we can make the Ruby on Rails API docs more SEO friendly:
๐ DHH shared they started a discord for MRSK Discord - A New Way to Chat with Friends & Communities
๐ค You can support the Short Ruby newsletter for just $1.5/week ($6.5/month) by becoming a paid subscriber. Your contribution aids growth and maintains the quality of ShortRuby for everybody:
If you consider upgrading and want more information, please read Why to subscribe to paid
๐ All about Code and Ruby
๐Benoit shared an image showing a performance made using Perfetto UI
๐ Joel Drapper shared a code sample showing how to stream a view in phlex-rails:
He also added a code sample about an async API request:
๐ Tim Riley announced a new ERB engine that will be used in Hanami 2 view layer (check the PR here):
๐Esparta shared a code showing how to use coerce (see class Integer#coerce):
๐ Josef Strzibny shared a thread about gems:
Here is the list of the gems:
There are a couple of replies to the last tweet that contains more gem recommendations.
๐Steve Polito shared a sample code showing how to click on links inside emails when doing integration tests in Rails:
๐Adrien Poly asked if in Rails 7, there is still a need to use database_cleaner gem:
The general response is no.
๐Rishi Pithadiya shared an explanation about two configuration options for Rails:
๐ Stanislav (Stas) Katkov asked what tricks people use to reduce memory consumption in Ruby:
๐ Scott Watermasysk shared a code sample showing Quick Ruby implementation of https://www.npmjs.com/package/clsx
๐Maxime Chevalier shared a performance comparison between latest CRuby with the interpreter only vs CRuby with YJIT enabled:
๐Omkar Joshi reminded us about link_to_if in Rails:
Talking about conditionally rendering things there exists:
๐ Andrea Rocca continues the series about Hotwire. Here is a screenshot from only one of the many tips shared this week:
Here is the full list of all threads Andrea shared this week:
Hotwire tip 24/30 Gmail-style bulk select (source)
Hotwire tip 25/30 Reddit-like lazy loaded nested comments (source)
Howire tip 26/30 Fancy scroll animations with Stimulus (source)
Hotwire tip 27/30 Full Calendar with stimulus target callbacks (source)
Hotwire tip 28/30 Custom turbo destroy dialogs (source)
๐Ryan Bates asked how we handle pagination in automated tests:
Here are some of the answers:
๐Brad Gessler shared a code sample about:
๐Simon Chiu shared a tip for debugging Turbo Streams:
๐Chris Oliver shared a code sample showing a Hotwire tip about using Element.scrollIntoView() - Web APIs | MDN
๐Prabin Poudel shared a code sample showing how to use thor to write an overcommit config file:
๐Andrew Culver shared a small snipped that uses Ruby gsub to replace the content inside a file bullet_train/portable-string-replace
๐Jess Brown shared how they use table_print ruby gem:
๐Sam Saffron shared a code sample about using ChatGPT as a writing assistant
Here is a snippet from the GitHub gist:
If you like this content and want to receive it every week by email
๐งฐ Gems, Libraries, and Updates
๐งฐ Ruby On Rails announced new versions to fix two vulnerabilities Rails 7.0.4.3 and 6.1.7.3 have been released!
You can read the discussions here:
๐งฐ Joel Drapper shared a PR for Phlex where they are showing how to implement Smart chunking:
๐งฐ The J Ruby Team shared they released a new version of PostgreSQL driver that passed 99.8% of AR tests:
๐งฐ Shibata Hiroshi shared a PR they merged where they combined the cops from Bundler and RubyGems. Merge rubocop configuration: 2nd PR. Check the commits - each one contains one cop
๐งฐ Jean Boussier shared a PR they are working on for Rails about PoC: Cache Extended Collection Proxies
You can check the conversation on Ruby.social here and the one on Twitter here
๐งฐ Camilo announced the release of standardrb v 1.25.0. Checkout the release notes
๐งฐAvo announced they reached 1000 stars on GitHub and announced a new release, read the changelog or the thread:
๐งฐMaciej Mensfeld shared an update about Kafka topics as code - declarative Kafka topics management in Ruby - Closer to Code
๐งฐPaweล ลwiฤ tkowski announced they open-sourced their Hanami 2 app at katafrakt/palaver: a toy forum software in Hanami 2
๐งฐ Greg Molnar shared that Active Support 7.1 will Implement `Object#with`
๐งฐ Carlos Antonio shared a PR they work on for Devise gem about Respect locale set by controller in the failure app
๐ค Related (but not Ruby-specific)
๐คPaul Mucur shared a tip on how always to run a step in GitHub Actions, even if a preceding step fails (see Expressions - GitHub Docs)
๐ค Nate Berkopec shared a tip about changing the ratio when doing benchmarking:
๐คPaul Cantrell shared what they think is hard or important in the job of a programmer:
๐ค Jhey Tompkins shared a future proposal for HTML to display a popover (check the codepen):
๐คJess Brown shared a short alias that helps with switching to another branch
๐คMike Coutermarsh shared an insight (funny but also mostly true) about code that initially was named a hack but remained in production years:
๐คMoncef Belyamani shared a thread about their consultancy business:
Here is the main part that Moncef shared, but you should read the entire thread
๐ค Eleftheria Batsou asked about tools used by developers to save time and speed up development:
She received a lot of replies, and she gathered them in an article From TDD to AI: Techniques & Tools for Devs, Save Time & Speed up Your Development Process
๐ค If you like this newsletter, consider upgrading to paid. You will help the larger community by supporting this newsletter and thus being part of the effort to keep it freely accessible to everyone.
More content: ๐ฅ ๐ง ๐
๐ Newsletters
๐ Emmanuel Hayford published a new edition of This Week in Rails about TestFixtures#fixture_path deprecation, FinderMethods#find support f...
๐ Ruby/Rails performance newsletter published a new edition about All performance metrics exist on a spectrum from low to high level
๐๏ธ Ruby Weekly published a new edition: Deep dives into Rails routing and WASI
๐ Ruby Radar published a new edition Ruby Radar #94 - Protips
๐๏ธ Ruby LibHunt published a new edition of the Awesome Ruby Newsletter
Podcasts
๐งThe Ruby On Rails Podcast published a new episode The Ruby on Rails Podcast Episode 461: ccyalater and Merge Conflict Hit the Track! (with Colleen Leonard)
๐งRuby For All published a new episode about From Bootcamp to Community Advocate and Mentor | Ruby for All | Episode 34
Videos
Talks
๐ฝ๏ธMoncef Belyamani published their video about Setting Up a Personal Mastodon Instance
๐ฝ๏ธ Jason Swett published a new episode of Code With Jason Meetup about Abstraction (2023-03-16)
๐ฝ๏ธ Drifting Ruby published the video version of This Week in Rails - March 17th, 2023
๐ฝ๏ธ The Rubber Duck Dev Show published a new episode about Things Your Editor Should Have with Amir Rajan
๐ฝ๏ธ Paweล Strzaลkowski published a Webinar about Domain Modeling in Ruby on Rails with introduction to Domain-Driven Design
Screencasts
๐ฅYaroslav Shmarov published new videos:
๐ฅ Justin Searls published a new episode of their series Searls After Dark #4 - Refactoring vs. Testing
๐ฅ Equivalent shared a video created about Build a View Component library in Rails with LookBook
๐ฅ The Rubber Duck Dev Show published a new video from the series Coding with Chris about Cave Lords Part 9: Test Fixing and Play Map - Coding with Chris
๐ฅPete Hawkins published new videos
๐ฅ Adam Pallozzi published a video on Twitter about Using ActiveStorage to upload large files in chunks
๐ฅ Amir Rajan published a video about DragonRuby Game Toolkit - Gameplay recording and replay capabilities in action.
Articles
Whatโs new
Joseph Izaguirre published an article about How I got my first Rails job โ โIโm saying that when it came time to choose which language and framework to learn, I looked where everyone else was going, and I went the other wayโ
Rafael Montรกs published a new article about Implementing Data Structures in Ruby: Arrays
How-Tos
Andy Croll published a new article about Assign a default value to an attribute in Active Record โ โIf you ever needed to set a default value in an instance of an Active Record model, you probably used a callback. Since Rails 5.0 thereโs been a better way.โ
Sulman Baig published a new article about Clean Code Tip: Create a Service Object and Improve Your GraphQL Mutations in Rails
Felipe Vogel published an article about Parsing text in Ruby, part 1
Aestimo Kirina published an article about Working With Markdown in Ruby
Kon Yu published a new article about How to debug Rails running on Ruby 3.1 using VSCode and Dev Containers
Carla Urrea Stabile published a new article about Add Authorization to a Sinatra API using Auth0 โ โLearn how to implement a Sinatra API and protect its endpoints using Auth0โ
Steve Polito published an article about How to click links in Rails Mailers when writing tests
Benito Serna published an article about how to Use after_touch to avoid to handle race conditions saving computed values โ โWhen saving computed values in the database in your rails app, you must be aware that is possible to find unexpected errors in the result thanks to race conditions.โ
Miriamfark published a new article about Using Action Mailer to Send Emails from a Rails App
Moses Gathuku published an article about Custom Rails form submit debounce โ โIn some cases, this isnโt necessary, but this technique can drastically improve network overhead if costly server requests are involved. The form submit event is only triggered when the user finishes typing"
Suraj Mishra published an article about Must-know hash initialization tricks in Ruby
Max Braga published an article about RSpec for Rails: Advanced Techniques #3 - Metadata
Deep Dives
Dhaval Singh published an article about Why Every User Without a Profile Picture on GitHub Was Yehuda Katz
Lucas Barret published a new article about Mastering PostgreSQL Views and CTEs for Rails Developers: A Comprehensive Guide
Faraaz Ahmad published a deep dive article into Ruby 3.2's WASI Integration: A Closer Look
Akshay Khot published a deep dive into Understanding the Rails Router: Why, What, and How
Related
Kent Beck published a new article about Fool Proof Design โ โWeโve talked frequently about the cost reduction aspect of design change, but always from the perspective of making the changes we want to make. Thereโs a lurking cost, however, that Iโm starting to realize deserves more attentionโ
Lauren Ellsworth published a new article about Uniqueness in PostgreSQL: Constraints versus Indexes โ โConstraints and indexes come at a cost: they add write overhead with each INSERT and UPDATE and they can take up significant amounts of space. Since a unique constraint and a unique index both enforce uniqueness, which one should we prefer? And are they different?โ
๐ค Founding Members supporting ShortRuby
Drew Bragg, host of Code and the Coding Coders who Code it
Avi Flombaum, the founder of Flatiron School, is a product engineer interested in full-time/contract work.
Adrian Marin, creator of Avo - a Ruby on Rails application building framework
Adam McCrea, creator of Judoscale (formerly Rails Autoscale)โthe dead-simple autoscaler for Rails, Sidekiq, etc.
Stephen Ierodiaconou from www.diaconou.com
Harry Lascelles
Jason Charnes from Remote Ruby
Andy Croll from One Ruby Thing and FirstRubyFriend
Read more about what is a Founding Member or about Why pay for ShortRuby newsletter
Reply