#651 — April 27, 2023 |
|
Ruby Weekly |
MRSK: Hot Deployment Tool to Watch—or Total Game Changer? — The Evil Martians team gives DHH’s new container-based MRSK deployment tool a ‘vibe check’. The conclusion is that it has potential but there are various things to weigh up before you switch boats. Evil Martians |
🚢 In related news, the official MRSK homepage at MRSK.dev has lost its original brutalist design and now looks slick and ready to sail. There's a 20-minute screencast introduction from DHH to enjoy as well. |
Some Advanced Active Record Concepts — Quick examples of concepts including locking records to avoid conflicts, using UUIDs as primary keys, fulltext search, using database views, and working with geospatial data. Paweł Dąbrowski |
Smooth and Powerful Sidekiq Monitoring — Track and debug Sidekiq performance metrics with ease. Get insights and alerts for Sidekiq queue lengths, Sidekiq throughput/performance per worker, and Sidekiq process/connection counts. AppSignal sponsor |
How Ruby's 'Switch' is More Flexible Than You Thought — It might be Akshay Khot |
Stop Ignoring Your Ruby and Rails Deprecations (and How) — No-one wants to see warnings and it’s tempting to skip over them, but they’re there for a reason. Ali explains how deprecation warnings can help you upgrade your app before you really upgrade your app (which can help a lot when upgrading Rails versions in particular), and shows off of a technique for formally making deprecations part of an app’s reality. Ali Ibrahim |
QUICK BITS
|
📕 Tutorials, Articles, and Videos |
Updating Millions of Records in Rails — Ideally you’d step down to the database layer and avoid the overhead of Active Record entirely when doing large numbers of updates, but if that’s not viable, this is a reasonable Ruby-based approach based around Sidekiq and updating records in batches. Tomas Valent |
Making Lazy Accessors Thread-Safe — Greg created a gem called Feature Envy that pulls in features from other languages. In this case, he creates thread-safe, lazy attributes in Ruby, which is more involved than you might expect. Greg Navis |
How to Use OmniAuth to Add Authentication to Your Ruby App — Check out this strategy that leverages the OmniAuth gem and OIDC to add log in to your application with FusionAuth. FusionAuth sponsor |
Build a Memory Game with Rails, Stimulus JS, and Tailwind CSS — This is a good old step-by-step tutorial, with much of the focus on Stimulus and how it can be used to incrementally add functionality to Rails apps. Marvin Kang |
The Hardest Question on a Ruby Array Quiz — Only 2.07% of participants in a recent quiz got this one right – mostly because of not knowing the default no-argument behavior of Domhnall Murphy |
Solving N+1 Postgres Queries for Rails Apps — Tips for working with ActiveRecord and using better SQL to improve performance and avoid N+1 queries. Christopher Winslett |
Rails 7, Bootstrap CSS, and JavaScript with esbuild — How to introduce Bootstrap into an existing Rails 7 with esbuild handling the bundling. Ryan Bigg |
▶ Writing 'Boring' Code with the Help of ChatGPT — Avdi is well known as a Ruby developer who runs the Graceful.dev screencast site, so it makes sense he might turn to ChatGPT when using a less.. engaging language like PHP. 😆 Avdi Grimm |
Why Duplication is More Acceptable in Tests — DRY isn't the only way. Jason Swett |
Containerize a Rails 7 App and Run it on Vultr with Cloud 66
|
Seven Common Mistakes in Rails Upgrades
|
🛠 Code & Tools |
ViewComponent 3.0: React-like View Components for Rails — A framework for building reusable, testable & encapsulated view components in Rails, inspired by React. v3.0, a pretty significant release featuring work from over 200 contributors, was unveiled at RailsConf earlier this week. ViewComponent Contributors |
Low Cost, Rails Code Audit by a Senior Dev — We rapidly review your app using a nine point audit including security, tech debt, performance, versions and code quality with full recommendations on each. reinteractive Pty Ltd sponsor |
FastCount: Quickly Get a Count Estimation for Large Tables — Requires Active Record 6+. Mostly benefits Postgres users (via this approach), but will transparently work with MySQL, MariaDB, and SQLite too. fatkodima |
Maxitest 4.4: Minitest, Plus All The Features You Always Wanted — Too many features to list here, to be fair. Michael Grosser |
|
|
|