Enable live-reloading with Spark

Hotwire Spark is a live-reloading system for Hotwire applications. It enhances your development feedback loop by detecting source code changes and updating the page smoothly without requiring a manual reload.

Jorge Manrubia

Install and configure Hotwire Spark

Gemfile
...

group :development do
  ...

  gem "hotwire-spark"
end
bundle
config/environments/development.rb
...

Rails.application.configure do
  ...

  config.hotwire.spark.html_paths += %w[ content ]
  config.hotwire.spark.html_extensions += %w[ md ]
end

Configure Action Cable

Uncomment action cable engine from Rails configuration:

config/application.rb
...
require "action_cable/engine"
...

Create the cable configuration file:

config/cable.yml
development:
  adapter: async

Restart the development server to apply the new configuration.


Commit: Hotwire Spark


What next?

Manage dependencies with Importmap