Any Cables Monthly #6
Welcome to 2023! And say “hello” to renovated Any Cables Monthly, now running on Substack. We hope this relationship lasts longer than the previous one 🤞.
Stimulus Reflex 2023 resolution 🗓
The Stimulus Reflex team announced plans and commitments for the year 2023:
A commitment to building libraries that work seamlessly with the Rails tooling you already know and love.
Thus, instead of building an alternative Reactive Rails universe, the team decided to work together with Rails and Hotwire to bring us all better tools:
We plan to enhance the Rails and Hotwire ecosystem by introducing world-class tooling and content that will help 10x your productivity.
Competition makes us faster; collaboration makes us better.
Turbo Boost is a collection of libraries by Nate Hopkins to supercharge web applications development with Turbo:
turbo_boost-commands (f.k.a. turbo_ready)—Turbo the RPC way (w/o controllers/routes boilerplate).
turbo_boost-streams (f.k.a. turbo_reflex)—Turbo Streams extensions
turbo_boost-elements—reusable Turbo behaviors and developer tools (check out the video demonstrating Turbo Boost DevTools).
This post provides the steps to deploy a Rails w/ AnyCable application to AWS Elastic Container Service.
Building the Ultimate Search for Rails, Ep. 1
Louis Sommer starts a series on building complex searching functionality with Rails and Stimulus Reflex. The article also provides an example of using a Filter object (built with the all_futures gem) to encapsulate filtering logic and demonstrates how to use PostgreSQL full-text search features via the pg_search gem.
This release brings better Shadow DOM support.
We’ve upgraded our demo application to Ruby 3.2. Good news—everything went well! Another feature worth mentioning is the automatic black-box testing for real-time functionality via wsdirector.
The frame of curiosity: gRPC in Ruby
gRPC is the technology that powers AnyCable. It’s a remote procedure call (RPC) implementation on top of HTTP2 and Protoсol Buffers.
The official grpc Ruby gem is maintained (or not really 🤔) as a part of a large monorepo containing code for multiple languages. What do they have in common? They all rely on the gRPC implementation written in C via native extensions. And it comes at a price of uncountable “F”-word reactions from Ruby developers on “
Failed to build gem native extension”, or “, or, if you’re lucky enough, very slow compilation times. The situation escalates every Christmas with a new Ruby release (that’s why I mention
anycable_rails_demo a successful upgrade to Ruby 3.2 in this issue).
Luckily, Ruby world is not without good people. Cookpad maintains a pure Ruby gRPC implementation called grpc_kit. No compilation and less dependency on Google Cloud engineers (we still need Protobufs). And even more: there is another project from Cookpad, griffin—a multi-process gRPC server!
We at AnyCable are currently working on grpc_kit support out-of-the-box. You can check the PR here: anycable/anycable#186. The benchmarks look promising:
Stay tuned for the updates!