Hotwire and Rails Engines

Hi, all. I’ve been on rails 4.2 for the longest time, and as part of my modernization efforts started seeding Vue components in the application. I’ve pretty much have been on a single monlyth app for about 7 years now…

Then I came across Hotwire at the same time as starting some new projects in parallel. I promptly moved my old app to Rails 7 and as I’m working on a new one, I wanted to integrate 2 things simultaneously:

  1. Turbo Hotwire (done, but disabled globally by default)
  2. Rails engine for common components, mainly Contact management for now.

In the case of the engine, I’d like to make it reusable enough and optionally support Hotwire. But being new to both, engines and hotwire, I’m not sure what steps are necessary to enable it on the engine.

Should I do that on test/dummy app and build turbo_stream related responses in the engine views?

What’s the best practice for such approaches?

This :point_up_2: answer in stackoverflow might help you.