So… there’s a hot new way of building “reactive” frontends in Rails that seems to have emerged as an option in 2020 and could be an alternative to rebuilding in React.
Just to be clear; I’m not saying we should definitely do this, and I absolutely recognise the timing couldn’t be much worse, but I think we should at least assess it, because there’s a chance it might be a much better option than going down the big React-rewrite path.
It uses a Rails-based system called StimulusReflex (a Rails gem), which is a combination of a few other technologies and gems that have been around for a while in Rails (ActionCable, Turbolinks, Stimulus), which are hooked up together in a novel way and with a layer on top that makes it easy to write the code to make it all work.
It’s not totally clear yet (it needs investigating) but it looks like it might offer:
- 10 times less code, and higher dev productivity in general
- Incremental updates can be done on an existing Rails app, switching UI components one at a time
- It’s done with a couple of gems and some very simple Ruby on Rails code
There’s a lot to unpack in this and lots of pros and cons to be a) determined and b) argued over…
Anyway, the docs are here, there’s a very simple video example of what implementing this actually looks like here, an article talking about it here, and a live example of a searchable/filterable table using it here.