Is it possible to do something like this in Rails ecosystem?

I read this fantastic article, and it kind of opened my eyes to a problem with JS-based libraries and frameworks that no one has addressed until now. The first thought that came to mind was: How difficult would it be to implement something like this into stimulus? or create something similar in nature for the Rails Ecosystem?

I’d love to hear your thoughts on this