Facundo Espinosa

March 20, 2024

Turbo Frames autoscroll feature

Turbo tries to solve many general use cases by default with the idea of reduce developers work. One of those features is the autoscrolling for turbo frames. How autoscroll works? Let's ready the documentation: “autoscroll is a boolean attribute that controls whether or not to scroll a <turbo-frame> element (and its descendant <turbo-fr...
Read more
January 19, 2024

importmaps-rails 2.0 dropped es-module-shim

importmap-rails was originally released with the es-module-shim package included, catering to browsers that offered basic ESM support but lacked native support for import maps. With the release of version 2.0, importmap-rails has discontinued the inclusion of the es-module-shim, a decision influenced by the fact that modern browsers no...
Read more
December 29, 2023

Process to Update Gems on a Rails project

Recently, while updating gem versions in a Rails project, I contemplated a process with reasonable steps. This approach ensures we don't update too many components at once, allowing us to effectively handle any errors and quickly identify what might have broken the system. Check project status First, I assess the project's status. This...
Read more
August 11, 2022

Reduce ViewComponents complexity using helpers

Yesterday I figured out how to avoid a pattern that we’ve been doing in a project for some time which is sending the current_user in components through parameters to validate things based on who is watching. Example: ```erb <%= render ProductsComponent.new(current_user: current_user, products: @products) %> ```ruby class ProductsCompon...
Read more