#​669 — September 14, 2023

Read on the Web

Together with  Crunchydata

Ruby Weekly

Ruby 3.3 Preview 2 Released — With Christmas Day as the traditional day that new versions of Ruby land, things begin to pick up in the fall. Major performance improvements over 3.2 are already on offer thanks to ongoing improvements with YJIT, but there’s also an optional experimental pure-Ruby JIT compiler called RJIT to try.

Yui Naruse

'We Turned Lobste.rs into a Benchmark for YJIT' — Related to my comments (above) on how YJIT is continuing to get faster and faster, Noah Gibbs has some real world data on just how well YJIT, the default JIT in CRuby, optimizes Rails apps. The ‘real world’ scenario is formed by testing against the Ruby-based code that runs Lobste.rs, a Hacker News-esque social link aggregation site.

Noah Gibbs

Fully Managed Postgres + Great Support — "What a different support experience Crunchy is. Not only is it timely, it's informed, it's on topic. We’re encouraged to ask questions. We’re able to do so much more working with a partner who cares as much about data as we do." Rob Sullivan, CareRev.

Crunchy Bridge sponsor

Rails 7.1 Beta 1 Released — It looks like things are gearing up for lots of Rails 7.1 news (and perhaps even a release) at the forthcoming Rails World 2023. This beta puts you on the cutting edge with support for the Bun JavaScript runtime, a new perform_all_later Active Job method for scheduling jobs en masse, support for composite primary keys in AR, improved async query support, and Dockerfile generation for all new apps.

Rafael Franca

Rails Middleware: (Almost) Everything You Need to Know — Akshay continues his run of posts digging into various facets of Ruby and Rails with a look at the use of middleware, a concept introduced by Rack but for which Rails has added a lot of sugar and helpers.

Akshay Khot

Akshay is blogging faster than we can link to him, as he's also written The Complete Guide to Working with Cookies in Rails which also goes into a lot of depth.

🎙️ Off the back of some.. kerfuffle about DHH's recent decision to yank TypeScript out of Turbo, DHH has appeared on the Rework Podcast to talk about the incident and share his characteristically punchy take on his role.

🙈 Over on Twitter/X, DHH stood up for Rails by 🐦 pointing to all the companies that have grown large using it. This provoked a flurry of discussion, mixed between replies suggesting some of those companies have since migrated away from Rails and people supporting Rails' success. It's certainly been interesting..

🎙️ Shami Tomita and Eric Halverson went on the Ruby on Rails Podcast to ▶️ discuss the building of the Rails World web site.

📅 In other event news, don't forget RubyConf 2023 is this November in San Diego, CA – tickets are still available.

🤖 Meanwhile, next month I'm headed to the AI Engineer Summit in San Francisco. Say hi if you're going! You can still apply to attend or grab a free remote ticket if you want to see what's up.

📕 Articles and Tutorials

▶  Building Authentication from Scratch in Rails 7.1 — With a particular focus on features that Rails 7.1 introduces, like authenticate_by and generate_token_for.

Chris Oliver

When Counting Lines in Ruby Randomly Failed Deployments — Sometimes the obvious or idiomatic way to do something can be quite inefficient under the hood, as in this case of using str.lines.count to count lines in a string. Luckily, there was a much faster approach..

Illia Zub (SerpApi)

Need to Upgrade Rails on a Tight Budget? Try Bonsai 🌳 — Let the team behind the Rails Upgrade Workshop (RailsConf) gradually upgrade your app and pay off tech debt.

Fixed-cost Upgrade Services sponsor

▶  Go Passwordless with WebAuthn in Ruby — A ~40 minute talk on WebAuthn, an authentication method that uses public-key cryptography together with biometrics. Braulio explains how it works and how to add it to a Ruby app.

Braulio Martinez

Express Yourself Clearly with positive? and negative? — Two handy numeric methods that were added in Ruby 2.3 but which may have escaped your attention till now. They can help you clean up things like if num > 0 or if num < 0 though Andy touches on a couple of downsides too.

Andy Croll

How to Improve Rails Caching with Brotli Compression — Improving cache performance can be a game changer for larger apps, so better compression and a strategy that intelligently includes an in-memory cache is worth checking out (or you can just slip Rails Brotli Cache into your app).

Paweł Urbanek

We Used to Store Files as Base64 Strings in Postgres.. Not Anymore — Just because you can, doesn’t necessarily mean you should.

Paul Oms (MailPace)

Using the Cursor IDE to Make Changes in a Rails App — A quick look at the curious Cursor ‘AI-first code editor.’

Lucian Ghinda

Refactoring from Feature Specs to System Specs
Harrison Broadbent

Add a Favicon to Your Rails App in Two Minutes
Harrison Broadbent

Exploring Ruby Warnings
Ariel Juodziukynas

🛠 Code & Tools

re2 v2.0: Ruby Bindings to the RE2 Regular Expression LibraryRE2 is a fast, thread-safe regular expression engine built by Google (and used in products like Gmail) that, notably, avoids recursive backtracking by using finite automata-based techniques (Russ Cox has an article about this). Note that the regex syntax is slightly different to PCRE. As of v2.0, the Ruby gem includes vendored versions of RE2 so it can be installed more easily. Docs.

Paul Mucur

nats-pure: Pure Ruby Client the NATS Cloud Native Messaging SystemNATS is worth exploring if you’re unfamiliar with it. It provides a lot of supporting functionality for building distributed apps of any kind. (Trivia: It was originally built in Ruby itself, but was later ported to Go.)

NATS Project

Wasting Time and Budget Interviewing the Wrong Candidates? — Get better outcomes from recruiters who speak engineering. Find the right hire faster.

Test Double sponsor

JRuby 9.3.11.0 Released — The Ruby 2.6.x compatible branch of the JVM Ruby implementation get some bugfixes, as well as an update to strscan.

JRuby Core Team

Linguist: GitHub's Language Detection System — The library that GitHub itself uses to detect the languages used in git repos. It can also be used as a CLI tool.

GitHub

Jobs

Find Ruby Jobs with Hired — Hired makes job hunting easy-instead of chasing recruiters, companies approach you with salary details up front. Create a free profile now.
Hired