Do you tune out Ruby deprecation warnings?
Arkency Blog
by Arkency
1M ago
Do you tune out Ruby deprecation warnings? Looking into deprecation warnings is an essential habit to maintain an up-to-date tech stack. Thanks to the explicit configuration of ActiveSupport::Deprecation in the environment-specific configuration files, it’s quite common to handle deprecation warnings coming from Rails. However, I rarely see projects configured properly to handle deprecation warnings coming from Ruby itself. As we always want to keep both Rails and Ruby up-to-date, it’s crucial to handle both types of deprecation warnings. How does Rails handle its deprecation warnings? In the ..read more
Visit website
How to get burned by 16 years old hack in 2024
Arkency Blog
by Arkency
1M ago
There’s a project I’m consulting on where programmers develop predominantly in cloud environment. This setup simplifies a lot of moving parts and has the benefit of providing everyone homogenous containers to run code. If it runs on my box — it will run on everyone’s box. In that case, that box is Linux-based. It has the drawback of having greater latency and being more resource-constrained than a beefy local machine a developer is equipped with, i.e. MacBook Pro running on Apple Silicon. Recently we’ve upgraded this development environment from Ruby 3.2.2 to Ruby 3.0.0. The process was s ..read more
Visit website
How to add a loading animation to your turbo frame with TailwindCSS
Arkency Blog
by Arkency
1M ago
How to add a loading animation to your turbo frame with TailwindCSS Ever been working on a project and hit a snag? That’s what happened to me recently. I came across a turbo frame that was slow to load and didn’t show any signs of loading. Talk about confusing! Waiting a few eternities for the historic transactions tab to load. The busy attribute of the turbo frame The easiest way to add a loading state to the turbo frame is to insert the loader inside the frame tag. Problem is that it only works on the very first load, after that you’ll see the old content until the new one fully loads. I did ..read more
Visit website
Upcasting events in RailsEventStore
Arkency Blog
by Arkency
2M ago
Upcasting events in RailsEventStore Understanding the domain you are working with often leads to the need to redesign some of the models. Sometimes you’ll need to add or change a concept. Other times, you’ll need to remove a method or event produced by the aggregate. This was the case for us. Our goal was to remove an event from the system. To do this, we had to deal with the fact that this event was in the aggregate stream. It’s interesting how we got there. We started discussing how to implement a new business feature in the aforementioned model. After tossing around a few ideas it felt like ..read more
Visit website
Completely custom Zeitwerk inflector
Arkency Blog
by Arkency
2M ago
Completely custom Zeitwerk inflector In my previous post, I discussed the difference between how the classic autoloader and Zeitwerk autoloader match constant and file names. Short reminder: Classic autoloader maps missing constant name Raport::PL::X123 to a file name by calling Raport::PL::X123.to_s.underscore Zeitwerk autoloader finds lib/report/pl/x123/products.rb and maps it to Report::PL::X123::Products constant name with the help of defined inflectors rules. What is an inflector? In general, an inflector is a software component responsible for transforming words according to predefined ..read more
Visit website
The mysterious litany of require_dependecy calls
Arkency Blog
by Arkency
2M ago
The mysterious litany of require_dependecy calls One of the challenges we faced when working on a huge legacy app tech stack upgrade was switching from the obsolete classic autoloader to the modern one, Zeitwerk. It is optional starting from Rails 6 but gets mandatory in Rails 7. Once, we were on Rails 6 and managed to apply most of the new framework defaults, we decided it was high time to switch to Zeitwerk. …This is where the story begins… Spending a lot of time with this codebase we came across one very large initializer with above 300 of require_dependency calls. The first red flag was th ..read more
Visit website
Repository implementation on ActiveRecord
Arkency Blog
by Arkency
4M ago
Repository implementation on ActiveRecord In its essence, a Repository separates domain objects from how they’re persisted and provides a limited interface to access them. It’s a tactical pattern described with far more words by Fowler and Evans than I’d like to include in this introduction. It stands in complete opposition to what ActiveRecord pattern promotes. Why bother transforming one into another? The problem with ActiveRecord pattern comes from its greatest strength. It’s a double-edged sword. Immensely useful in rapid prototyping for a “solopreneur”. Flexible for a well-knit and discip ..read more
Visit website
A crucial detail in implementing an async read model builder
Arkency Blog
by Arkency
4M ago
A crucial detail in implementing an async read model builder Let’s start with claryfing few terms before we begin, just to make sure we’re on the same page. Make sure you also look at the end of this blog post, where I describe one of the most common mistakes. What is a read model In an event sourced system (or part of the system that is event sourced) the truth lays in the event store. However, event stores are not optimized for reading the data. Therefore, it is more convenient to use read models. A read model is a denormalized data model built using the data coming from the events. You can ..read more
Visit website
Temporary databases for development
Arkency Blog
by Arkency
5M ago
Temporary databases for development At RailsEventStore we have quite an extensive test suite to ensure that it runs smoothly on all supported database engines. That includes PostgreSQL, MySQL and Sqlite in several versions — not only newest but also the oldest-supported releases. Setting up this many one-time databases and versions is now a mostly solved problem on CI, where each test run gets its own isolated environment. In development, at least on MacOS things are a bit more ambiguous. Let’s scope this problem a bit — you need to run a test suite for the database adapter on PostgreSQL 11 as ..read more
Visit website
Who calls who? — a simple events heuristic
Arkency Blog
by Arkency
5M ago
Who calls who? — a simple events heuristic When integrating two components, you may wonder who should own the commands and events you want to use for communication. Today, I will show you a simple heuristic that may help you make this decision. The heuristic relies on the frequency of change in components. Before using it, we should visualize relationships between those components. Context Mapping is a perfect tool for that, as it shows how changes in one Bounded Context affect others (there is an excellent resource about the concept itself here). And now, without further ado, let’s jump into ..read more
Visit website

Follow Arkency Blog on FeedSpot

Continue with Google
Continue with Apple
OR