openfoodfoundation / openfoodnetwork

Connect suppliers, distributors and consumers to trade local produce.
https://www.openfoodnetwork.org
GNU Affero General Public License v3.0
1.12k stars 723 forks source link

Replace mrujs with turbo #12794

Open mkllnk opened 2 months ago

mkllnk commented 2 months ago

What we should change and why (this is tech debt)

We currently use mrujs and turbo-rails together. While they can co-exist, Turbo should be able to do everything that UJS used to do. We may need to adjust some files though.

Context

Impact and timeline

wandji20 commented 1 month ago

I will like to work on this one

wandji20 commented 1 month ago

Since mrujs is responsible for updating the UI, removing it will result in the UI not being updated. I am not so sure if this is the right approach, but I would like to confirm it's expected to refactor controller actions that call render cable_ready: to render with turbo_streams instead

mkllnk commented 1 month ago

Since mrujs is responsible for updating the UI, removing it will result in the UI not being updated.

Is Turbo not doing the same thing?

I would like to confirm it's expected to refactor controller actions that call render cable_ready: to render with turbo_streams instead

That's actually not mentioned in this issue, but yes, we want to move away from StimulusReflex and CableReady in favour of Turbo. We can't, however, remove CableReady completely because we have a couple of background process triggering rendering. We would need an ActionCable websocket or an AnyCable ServerSentEvents stream for this. I'm not sure how much time you have. :wink: