Week 48: Super Solid Cable, Tailwind 4 beta, and more!
This week, we dive into Rails 8 updates, useful tutorials, and tools for Hotwire!
Welcome to Hotwire Weekly!
Welcome to another issue of Hotwire Weekly! Wishing you a joyful Thanksgiving weekend! Happy reading! 🚀✨
📚 Articles, Tutorials, and Videos
Super Solid Cable - Miles Woodroffe shares his experience integrating Solid Cable, the new default WebSocket adapter in Rails 8, into a simple demo application.
How to build a dropdown menu with just HTML - Kyrylo Silin demonstrates creating a dropdown menu using only HTML and minimal CSS, eliminating the need for JavaScript by utilizing the <details>
and <summary>
HTML tags.
Nobuild with Rails and Importmap - Mario Alberto Chávez explores how modern versions of Rails emphasize simplicity, enabling developers to manage JavaScript dependencies without traditional bundlers like Webpack.
Server-sent Events and WebSockets in Rack for Ruby - On the AppSignal blog Ayush Newatia explores implementing persistent connections in Rack applications using server-sent events (SSEs) and WebSockets. This article builds upon his previous article, "Rack for Ruby: Socket Hijacking" by applying theoretical concepts to practical scenarios.
Stimulus Features You (Didn’t) Know - Rails Designer highlights several lesser-known capabilities of Stimulus. It discusses existential properties that allow developers to verify the presence of attributes like targets, classes, values, and outlets using methods such as has[Action]Target
and has[Name]Value
.
Automating barcode scanner tests with Capybara - On the thoughtbot blog, Nick Charlton and Silumesii Maboshe discuss automating barcode scanner tests in Rails applications using Capybara and Stimulus. They note that many barcode scanners function as basic human interface devices, effectively acting as keyboards that input data rapidly.
Conditional templates and Viewport for mobile browsers and native apps - In this article, Yaroslav Shmarov discusses implementing conditional templates in Rails to render different views for desktop browsers, mobile browsers, and native apps.
SupeRails: Stimulus Keyboard Events. Bad, Good, Best Approach - Yaroslav Shmarov published a video version of his blog post about submitting a form using Stimulus and Cmd+Enter.
Upgrading Rails applications to Tailwind 4 - Rob Zolkos provides a guide for updating Rails applications to latest TailwindCSS 4 Beta. The process involves updating the tailwindcss-rails
gem, adding the tailwindcss-ruby
gem to specify the desired TailwindCSS version, and running the TailwindCSS upgrade tool to adjust configurations.
Rails 8 + Nice Partials: Better Than ViewComponent? - Kaleb Lape explores the nice_partials
gem, a lightweight alternative to ViewComponent for keeping Rails views clean and maintainable. Using real-world code from "Author Launch", the tutorial demonstrates how to refactor partials with features like named slots, required fields, and partial objects without extra classes.
🧰 Libraries and Tools
hotwire_native_rails - A Hotwire Native generator for Rails applications.
nice_partials - A little bit of magic to make partials perfect for components.
🎉 Releases
Jumpstart 2.0 (+ iOS / Android) - Now supports Hotwire Native - get it as part of their Black Friday Deal!
symfony/ux v2.22.0 - The JavaScript ecosystem for Symfony, based on Stimulus.
phlex v2.0.0rc1 - A framework for building object-oriented views in Ruby.
phlex-rails v2.0.0rc1 - An object-oriented alternative to ActionView for Ruby on Rails.
hot-glue v0.6.7 - Simple, plug & play Rails scaffold building companion for Turbo-Rails and Hotwire.
tailwindcss-ruby v4.0.0.beta.3 and beta.4 - A self-contained tailwindcss
executable, wrapped up in a ruby gem.
Feel free to follow us on Twitter/X, Bluesky, or on Mastodon!
See you next week!